完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
[C] 纯文本查看 复制代码
#include "delay.h"#include "sys.h"#include "lcd.h"#include "sys.h"#include "gt811.h"#include "GUI.h"#include "includes.h" #include "led.h"#include "bsp_sdio_sdcard.h"#include "ff.h"#include "diskio.h"#include "GUI_Font16.h"#include "MainTask.h"#include "rtc.h" #include "adc.h" #include "dht11.h"#include "UltrasonicWave.h"#include "tiM2.h"#include "fatapp.h"#include "music.h"#include "VS10XX.h" #include "spi.h" /////////////////////////UCOSII?????è??/////////////////////////////////////START ????//?è????????????#define START_TASK_PRIO 55 //?????????????????è????×???//?è???????????ó??#define START_STK_SIZE 64//????????OS_STK START_TASK_STK[START_STK_SIZE];//????????void start_task(void *pdata); //LED0????//?è????????????#define LED0_TASK_PRIO 10 //?è???????????ó??#define LED0_STK_SIZE 32//????????OS_STK LED0_TASK_STK[LED0_STK_SIZE];//????????void led0_task(void *pdata);//????????//?è????????????#define Touch_TASK_Prio 3 //?è???????????ó??#define Touch_STK_SIZE 128//????????OS_STK TASK_Touch_STK[Touch_STK_SIZE];//????????void Task_Touch(void *pdata);//???§????????//?è????????????#define Menu_TASK_Prio 7 //?è???????????ó??#define Menu_STK_SIZE 1024//????????OS_STK TASK_Menu_STK[Menu_STK_SIZE];//???§????????????void Task_Menu(void *pdata);//?÷????????????//?è????????????#define Collection_TASK_Prio 6 //?è???????????ó??#define Collection_STK_SIZE 512//????????OS_STK TASK_Collection_STK[Collection_STK_SIZE];//????????????void Task_Collection(void *pdata);//??????·?????//?è????????????//#define Playmusic_TASK_Prio 5 //?è???????????ó??#define Playmusic_STK_SIZE 768//????????OS_STK TASK_Playmusic_STK[Playmusic_STK_SIZE];//????????????void Task_Playmusic(void *pdata);int main(void){delay_init(); //???±??????????NVIC_Configuration(); LED_Init(); //????????LED??????????????RTC_Init();Adc_Init();SPIx_Init();VS_Init();while(DHT11_Init());//VS_Sine_Test();//DHT11_GPIO_Config();//Read_DHT11(&DHT11_Data);TIM2_Configuration();UltrasonicWave_Configuration();while(ctp_dev.init())delay_ms(200); disk_initialize(0);filecount=FileScan("0:mp3");// while(1)//{//MainTask();//}OSInit(); OSTaskCreate(start_task,(void *)0,(OS_STK *)&START_TASK_STK[START_STK_SIZE-1],START_TASK_PRIO );//???¨????????OSStart();} //????????void start_task(void *pdata){ OS_CPU_SR cpu_sr=0;pdata = pdata; OS_ENTER_CRITICAL();//??????????(??·¨±??????ò??) OSTaskCreate(led0_task,(void *)0,(OS_STK*)&LED0_TASK_STK[LED0_STK_SIZE-1],LED0_TASK_PRIO); OSTaskCreate(Task_Menu, (void * )0, (OS_STK *)&TASK_Menu_STK[Menu_STK_SIZE-1], Menu_TASK_Prio);OSTaskCreate(Task_Touch, (void * )0, (OS_STK *)&TASK_Touch_STK[Touch_STK_SIZE-1], Touch_TASK_Prio);OSTaskCreate(Task_Collection, (void * )0, (OS_STK *)&TASK_Collection_STK[Collection_STK_SIZE-1], Collection_TASK_Prio);OSTaskCreate(Task_Playmusic, (void * )0, (OS_STK *)&TASK_Playmusic_STK[Playmusic_STK_SIZE-1], Playmusic_TASK_Prio); //OSTaskSuspend(Playmusic_TASK_Prio); OSTaskSuspend(START_TASK_PRIO);//????????????.OS_EXIT_CRITICAL();//??????????(????±??????ò??)}//LED0????void led0_task(void *pdata){ while(1){LED1=0;delay_ms(80);LED1=1;delay_ms(920);};}//???§????????void Task_Menu(void *pdata){while(1){MainTask(); }}//??????·?????void Task_Playmusic(void *pdata){uint8_t filePath[20]; while(1){strcpy((char *)filePath, "0:mp3/"); // °????????·??????tempPath????strcat((char *)filePath, (char *)(FileN[file_num])); play_mp3((char *)filePath);delay_ms(6);};}//????????void Task_Touch(void *pdata){ while(1){GUI_TOUCH_Exec();delay_ms(10);};}//????????void Task_Collection(void *pdata){u16 adcx;u16 humi_int_temp;u16 temp_int_temp;u16 adc_t;while (1) {DHT11_Read_Data(&temperature,&humidity);//????????????if(humi_int_temp!=humidity)water_fRefresh=1;delay_ms(300);if(temp_int_temp!=temperature)temp_fRefresh=1;delay_ms(300);adcx=Get_Adc_Average(ADC_Channel_1,10);adc_temp=adcx*(3.3/4096)*100;if(adc_t!=adc_temp)co2_fRefresh=1;delay_ms(300);UltrasonicWave_StartMeasure();delay_ms(300);}} 为什么我一加入了音乐播放的任务,屏幕的任务就不运行了呢? |
|
相关推荐 |
|
只有小组成员才能发言,加入小组>>
771 浏览 0 评论
1146 浏览 1 评论
2527 浏览 5 评论
2858 浏览 9 评论
移植了freeRTOS到STMf103之后显示没有定义的原因?
2709 浏览 6 评论
keil5中manage run-time environment怎么是灰色,不可以操作吗?
1055浏览 3评论
189浏览 2评论
453浏览 2评论
364浏览 2评论
M0518 PWM的电压输出只有2V左右,没有3.3V是怎么回事?
449浏览 1评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-18 18:41 , Processed in 0.972401 second(s), Total 49, Slave 39 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号