?? hello.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 + -