📄 main.c
字号:
/*
* File: main.c
*
* uC/OS Real-time multitasking kernel for the ARM processor.
*
*
* Created by hgxxx
*
*/
#include "ucos_ii.h" /* uC/OS interface */
#include "target.h"
#include "option.h"
#include "def.h"
#include "GUI.h"
#include "GUIDEMO.h"
#include "target.h"
//#include <stdlib.h>
/* allocate memory for tasks' stacks */
#ifdef SEMIHOSTED
#define STACKSIZE (SEMIHOSTED_STACK_NEEDS+64)
#else
#define STACKSIZE_H 8192
#define STACKSIZE_L 512
#endif
//#define LED_3(x) (x ? (rPDATD |=(1<<4)) : (rPDATD &= ~(1<<4)))
OS_STK Stack0[STACKSIZE_L];
OS_STK Stack1[STACKSIZE_L];
//OS_STK Stack2[STACKSIZE_L];
static OS_STK GUI_ExecTaskStk[1024];
#define GUI_ExecTaskPrio (OS_LOWEST_PRIO-10)
OS_EVENT *UartSem;
OS_EVENT *KeySem;
void TaskStart(void *i);
void TaskLED(void *i);
void GUI_ExecTask(void *pdata);
#define LED_0(x) (x ? (rPDATD |=(1<<4)) : (rPDATD &= ~(1<<4))) // LCDRESET GPC7
#define LED_3(x) (x ? (rPDATD |=(1<<5)) : (rPDATD &= ~(1<<5))) // LCDRESET GPC7
static int LedStatus;
void TaskLED(void *i)
{
i=i;
GUI_Init();
_ExecCalibration();
for (;;)
{
GUIDEMO_Touch();
OSTimeDly(100);
//UIDEMO_main();
}
}
/*
void __irq Timer_Tick3(void)
{
rI_ISPC=BIT_TIMER3;
if(TimerCnt22++ == 20) {
TimerCnt22=0;
LED_3(LedStatus55);
LedStatus55=~LedStatus55;
}
}
*/
void GUI_ExecTask(void *pdata)
{
pdata = pdata;
while(1) {
GUI_Exec();
OSTimeDly(100);
}
}
void TaskStart(void *i)
{
unsigned char mled_on_off=0;
i=i;
ARMStartTimer();
//Timer3_TouchExe_Init();
OSStatInit();
for(;;)
{
//LED_3(~LedStatus);
//LedStatus=~LedStatus;
GUI_TOUCH_Exec();
//OSTimeDlyHMSM(0,0,0,1);
OSTimeDly(8);
}
}
void Main(void)
{
char Id0 = '1';
char Id1 = '2';
char Id2 = '3';
ARMTargetInit();
OSInit();
OSTimeSet(0);
OSTaskCreate(TaskStart, (void *)&Id0, (void *)&Stack0[STACKSIZE_L - 1], 1);
OSTaskCreate(TaskLED, (void *)&Id1, (void *)&Stack1[STACKSIZE_L - 1], 3);
OSTaskCreate(GUI_ExecTask,(void *)0, &GUI_ExecTaskStk[1023], GUI_ExecTaskPrio);
ARMTargetStart();
OSStart();
while(1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -