?? main.c
字號:
#include <includes.h>
#include "serial.h"
sbit led3=P1^0;
OS_STK TaskStartStk1[MaxStkSize],TaskStartStk2[MaxStkSize];
void Task1(void *nouse) reentrant;
void Task2(void *nouse) reentrant;
void main(void)
{
OSInit();
InitHardware();
OSTaskCreate(Task1, (void *)0, &TaskStartStk1[0],2);
OSTaskCreate(Task2, (void *)0, &TaskStartStk2[0],3);
OSStart();
}
void Task1(void *nouse) reentrant
{
nouse=nouse;
ET0=1; //開時鐘節(jié)拍中斷
SendStr("Welcome to Micro-C/OS-II on MCU51-63K!\r\n", 40);
for(;;)
{
led3 = 0;
SendStr("Task1 is running\r\n",18);
OSTimeDly(OS_TICKS_PER_SEC);
}
}
void Task2(void *nouse) reentrant
{
nouse=nouse;
for(;;)
{
led3 = 1;
SendStr("Task2 is running\r\n",18);
OSTimeDly(OS_TICKS_PER_SEC*2);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -