[mw_shl_code=c,true]#include "sys.h"
#include "delay.h"
#include "led.h"
#include "lcd5310.h"
#include "includes.h"
#include "GUI.h"
#include "GUIDEMO.h"
/////////////////////////UCOSII?????è??///////////////////////////////////
#define START_TASK_PRIO 10 //?????????????????è????×???
#define START_STK_SIZE 64
OS_STK START_TASK_STK[START_STK_SIZE];
void start_task(void *pdata);
#define LED_TASK_PRIO 6
#define LED_STK_SIZE 128
OS_STK LED_TASK_STK[LED_STK_SIZE];
void led_task(void *pdata);
#define DEMO_TASK_PRIO 7
#define DEMO_STK_SIZE 2048
OS_STK DEMO_TASK_STK[DEMO_STK_SIZE];
void demo_task(void *pdata);
//////////////////////////////////////////////////////////////////////////////
int main(void)
{
delay_init(); //???±??????????
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//?è????????????·?×é??×é2??2??????????????2???ì????????
LED_Init(); //????????LED??????????????
LCD_init(); //??????LCD
GUI_Init();
OSInit(); //??????UCOSII
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(led_task,(void*)0,(OS_STK *)&LED_TASK_STK[LED_STK_SIZE],LED_TASK_PRIO);
OSTaskCreate(demo_task,(void*)0,(OS_STK *)&DEMO_TASK_STK[DEMO_STK_SIZE],DEMO_TASK_PRIO);
OSTaskSuspend(START_TASK_PRIO); //????????????.
OS_EXIT_CRITICAL(); //??????????(????±??????ò??)
}
//LED????
void led_task(void *pdata)
{
while(1)
{
LED0=!LED0;
delay_ms(500);
}
}
void demo_task(void *pdata)
{
while(1)
{
GUIDEMO_ShowColorBar();
delay_ms(200);
}
}
[/mw_shl_code]
我怎么都查不出来。 |