os_taskstart.c

来自「ucos在EP9302上的移植,运行正常,欢迎使用.」· C语言 代码 · 共 60 行

C
60
字号
/**************************************************************************
;                                                                         *
;   PROJECT     : ARM9 port test                                          *
;                                                                         *
;   MODULE      : OS_taskstart.c                                          *
;                                                                         *
;   AUTHOR      : wlp             		                                  *
;                 URL  :                                                  *
;                 EMAIL: samping1982@yahoo.com.cn                         *
;                                                                         *
;   PROCESSOR   : EP9302 (32 bit ARM920T RISC core from CIRRUS Logic)     *
;                                                                         *
;   IDE         : SDT 2.51 & ADS 1.2                                      *
;                                                                         *
;   DESCRIPTION : start up task in ucos                                   *
;                 												          *
;   DATE        : 2007.03.18                                              *
;                                                                         *
;*************************************************************************/
#include "includes.h"
#include "ucos_tasks.h"
#include "OS_EP9302.h"

void TaskStart(void *pdata)
{
	#if OS_CRITICAL_METHOD == 3			/* Allocate storage for CPU status register           */
    	OS_CPU_SR  cpu_sr;
	#endif
	
	pdata = pdata;	//just avoid warning
	
	
	//begin creating the application tasks
	//task1 set the beeb
	 OSTaskCreateExt(Task1,
    				(void*)0,
    				&Task1Stack[TASK1_STACKSIZE-1],
    				TASK1_PRIO,
    				TASK1_ID,
    				Task1Stack,
    				TASK1_STACKSIZE,
    				(void*)0,
    				OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
    
    //task2 clear the beeb
	OSTaskCreateExt(Task2,
    				(void*)0,
    				&Task2Stack[TASK2_STACKSIZE-1],
    				TASK2_PRIO,
    				TASK2_ID,
    				Task2Stack,
    				TASK2_STACKSIZE,
    				(void*)0,
    				OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
    
    
    OSTimeInit(OS_TICKS_PER_SEC);		//initialization and start the ticks
	
	OSTaskSuspend(OS_PRIO_SELF);		//suspend the TaskStart.
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?