#include"..\ucos-ii\includes.h" /* uC/OS interface */
#include
#include"uhal.h"
#include"myuart.h"
#include"LCD320.h"
#include "tchScr.h"
///*********************************///
OS_STK SYS_Task_Stack[STACKSIZE]= {0, };
#define SYS_Task_Prio 1
void SYS_Task(void *Id);
OS_STK Task1_Stack[STACKSIZE]={0, };
void Task1(void *Id);
#define Task1_Prio 12
OS_STK Task2_Stack[STACKSIZE]= {0, };
void Task2(void *Id);
#define Task2_Prio 13
OS_STK Task3_Stack[STACKSIZE]= {0, };
void Task3(void *Id);
#define Task3_Prio 14
int Main(int argc, char **argv)
{
ARMTargetInit(); // do target (uHAL based ARM system) initialisation //
OSInit();
OSTaskCreate(SYS_Task, (void *)0, (OS_STK *)&SYS_Task_Stack[STACKSIZE-1], SYS_Task_Prio);
OSTaskCreate(Task3, (void *)0, (OS_STK *)&Task3_Stack[STACKSIZE-1], Task3_Prio);
OSTaskCreate(Task2, (void *)0, (OS_STK *)&Task2_Stack[STACKSIZE-1], Task2_Prio );
OSTaskCreate(Task1, (void *)0, (OS_STK *)&Task1_Stack[STACKSIZE-1], Task1_Prio );
OSStart(); // start the game //
// never reached //
return 0;
}//main
void Task1(void *Id)
{
for(;;){
int DspTxtMode=0;
ARMTargetInit();
LCD_Init();
LCD_ChangeMode(DspTxtMode);
LCD_Cls();
LCD_printf("Hello world!\n");
Uart_Printf("\nHello world!\n");
while(1);
OSTimeDly(1000);
}
}
void Task2(void *Id)
{
for (;;)
{
char c1[1];
char err;
ARMTargetInit();
while(1)
{
Uart_SendByte(0,0xa);
Uart_SendByte(0,0xd);
err=Uart_Getch(c1,0,0);
Uart_SendByte(0,c1[0]);
}
return 0;
OSTimeDly(2000);
}
}
void Task3(void *Id)
{
for (;;)
{
ARMTargetInit();
TchScr_Test();
OSTimeDly(3000);
}
}
void SYS_Task(void *Id)
{
uHALr_InstallSystemTimer();
Uart_Printf("\nstart system task.\n");
for (;;)
{
OSTimeDly(10000);
}
}