⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hello.c

📁 uCOS的ARM7移植,在LPC2200芯片上的具体实现
💻 C
字号:
#include "includes.h"#define	TASK_STK_SIZE	1024		// Stack size, in bytes#define	N_TASKS			2	// Number of tasksOS_STK	TaskStk[N_TASKS][TASK_STK_SIZE/sizeof(OS_STK)];	// Tasks stacksint  x = 0;int y = 10;// Prototypesvoid	Task1(void * pParam);void	Task2(void * pParam);void	Sleep(INT16U uSec);// Application entry point, invoked from Entry.objvoid start_kernel(void){	int	LineNo10 = 10;	int	LineNo11 = 11;       OSInit();	// Create two tasks.      OSTaskCreate(Task1, &LineNo10, &TaskStk[0][TASK_STK_SIZE], 0);      OSTaskCreate(Task2, &LineNo11, &TaskStk[1][TASK_STK_SIZE], 1);	// Start multitasking.      OSStart();	/* NEVER EXECUTED */}// Display a line of characters at the line specified by the parameter,// assuming a color 80x25 video adapter.//// This function never returns.void Task1(void * pParam){    at91_init_kernel();    x=y=0;    while (1)	{		x ++; 		//Sleep(1);	}}void Task2(void * pParam){    while (1) 	{			y --;		//OSSched();	}}// Sleeps for the specified delay (in seconds).// Since the 8254 is not set in this implementation,// sleeping one second means sleeping 18 clock ticks.void Sleep(INT16U uSec){	OSTimeDly((INT16U) (18 * uSec));}

⌨️ 快捷键说明

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