新手上路
- 积分
- 28
- 金钱
- 28
- 注册时间
- 2016-7-7
- 在线时间
- 4 小时
|
1金钱
UCOSIII 移植完后,只在空闲任务中运行,不启动其他任务? //开始任务
OSTaskCreate((OS_TCB * )&StartTaskTCB, //èÎÎñ¿ØÖÆ¿é
(CPU_CHAR * )"start task", //èÎÎñÃû×Ö
(OS_TASK_PTR )start_task, //èÎÎñoˉêy
(void * )0, //′«μY¸øèÎÎñoˉêyμÄ2Îêy
(OS_PRIO )START_TASK_PRIO, //èÎÎñóÅÏ輶
(CPU_STK * )&START_TASK_STK[0], //èÎÎñ¶ÑÕ»»ùμØÖ·
(CPU_STK_SIZE)START_STK_SIZE/10, //èÎÎñ¶ÑÕ»éî¶èÏTλ
(CPU_STK_SIZE)START_STK_SIZE, //èÎÎñ¶ÑÕ»′óD¡
(OS_MSG_QTY )0, //èÎÎñÄú2¿ÏûÏ¢¶óáDÄü1»½óêÕμÄ×î′óÏûÏ¢êyÄ¿,Îa0ê±½ûÖ1½óêÕÏûÏ¢
(OS_TICK )0, //μ±ê1Äüê±¼äƬÂÖ×aê±μÄê±¼äƬ3¤¶è£¬Îa0ê±ÎaĬèÏ3¤¶è£¬
(void * )0, //óû§213äμÄ′æ′¢Çø
(OS_OPT )OS_OPT_TASK_STK_CHK|OS_OPT_TASK_STK_CLR, //èÎÎñÑ¡Ïî
(OS_ERR * )&err); //′æ·Å¸Ãoˉêy′íÎóê±μÄ·μ»ØÖμ
OS_CRITICAL_EXIT(); //íË3öáù½çÇø
OSStart(&err); //¿aÆôUCOSIII
while (1);
//蜂鸣器任务
OSTaskCreate((OS_TCB * )&BuzzerTaskTCB,
(CPU_CHAR * )"Buzzer task",
(OS_TASK_PTR )Buzzer_task,
(void * )0,
(OS_PRIO )BUZZER_TASK_PRIO,
(CPU_STK * )&BUZZER_TASK_STK[0],
(CPU_STK_SIZE)BUZZER_STK_SIZE/10,
(CPU_STK_SIZE)BUZZER_STK_SIZE,
(OS_MSG_QTY )0,
(OS_TICK )0,
(void * )0,
(OS_OPT )OS_OPT_TASK_STK_CHK|OS_OPT_TASK_STK_CLR,
(OS_ERR * )&err);
//LED任务
OSTaskCreate((OS_TCB * )&LedTaskTCB,
(CPU_CHAR * )"led task",
(OS_TASK_PTR )Led_task,
(void * )0,
(OS_PRIO )LED_TASK_PRIO,
(CPU_STK * )&LED_TASK_STK[0],
(CPU_STK_SIZE)LED_STK_SIZE/10,
(CPU_STK_SIZE)LED_STK_SIZE,
(OS_MSG_QTY )0,
(OS_TICK )0,
(void * )0,
(OS_OPT )OS_OPT_TASK_STK_CHK|OS_OPT_TASK_STK_CLR,
(OS_ERR * )&err);
请大侠指导,跪谢!
|
最佳答案
查看完整内容[请看2#楼]
加上这句问题解决了!
//Initialize the clock for uCOS
OS_CPU_SysTickInit(SystemCoreClock/OSCfg_TickRate_Hz);
|