void Start_Task(void* pdata)
{
OS_CPU_SR cpu_sr;
OSDelay_init();
OS_ENTER_CRI
tiCAL();
OSTaskCreate(LCD_Task,
(void *)0,
(OS_STK *)&LCD_TASK_STK[LCD_TASK_STK_SIZE - 1],
LCD_TASK_PRIO
);
OS_EXIT_CRITICAL();
OSTaskSuspend(OS_PRIO_SELF);
// OSTaskDel(OS_PRIO_SELF);
}
void LCD_Task(void* pdata)
{
while(1)
{
BACKLIGHT_OFF;
OSTimeDly(100);
BACKLIGHT_ON;
OSTimeDly(100);
}
}
int main(void)
{
OS_CPU_SR cpu_sr;
Blight_Init();
OSInit();
OS_ENTER_CRITICAL();
OSTaskCreate(Start_Task,
(void *)0,
(OS_STK *)&START_TASK_STK[START_TASK_STK_SIZE - 1],
START_TASK_PRIO
);
OS_EXIT_CRITICAL();
OSStart();
return 0;
}
一周热门 更多>