#include <GPIO_LPC17xx.h>
#include <app_cfg.h>
#include <os.h>
static OS_TCB AppTaskStartTCB;
static CPU_STK AppTaskStartStk[1000];
static void AppTaskStart(void *p_arg);
int main(void)
{
OS_ERR err;
GPIO_SetDir(0,20,GPIO_DIR_OUTPUT);
GPIO_PinWrite(0,20,1);
OSInit(&err);
if (err !=OS_ERR_NONE) {
GPIO_PinWrite(0,20,0);
}
OSTaskCreate((OS_TCB *)&AppTaskStartTCB,
(CPU_CHAR *)"App Task Start",
(OS_TASK_PTR)AppTaskStart,
(void *)0,
(OS_PRIO )5,
(CPU_STK *)&AppTaskStartStk[0],
(CPU_STK_SIZE)1000/10,
(CPU_STK_SIZE)1000,
(OS_MSG_QTY )0,
(OS_TICK )0,
(void *)0,
(OS_OPT )(OS_OPT_TASK_STK_CHK | OS_OPT_TASK_STK_CLR),
(OS_ERR *)&err);
if (err !=OS_ERR_NONE) {
GPIO_PinWrite(0,20,0);
}
OSStart(&err);
if(err !=OS_ERR_NONE){
GPIO_PinWrite(0,20,0);
}
}
static void AppTaskStart (void *p_arg)
{
OS_ERR err;
p_arg = p_arg;
CPU_Init();
GPIO_PinWrite(0,20,0);
while(1)
{
[B]OSTimeDly((CPU_INT16U ) 500,[/B]
(OS_OPT ) OS_OPT_TIME_DLY,
(OS_ERR *) &err);
GPIO_PinWrite(0,20,1);
OSTimeDly((CPU_INT16U ) 500,
(OS_OPT ) OS_OPT_TIME_DLY,
(OS_ERR *) &err);
GPIO_PinWrite(0,20,0);
}
}