task_arm.c
来自「uCOS-II移植到ARM7上的C语言代码. 包含uCOS-II移植代码含标准」· C语言 代码 · 共 26 行
C
26 行
#include "config.h"
extern OS_EVENT *RandomSem;
/*
*********************************************************************************************************
* TASKS
*********************************************************************************************************
*/
void Task (void *pdata)
{
INT8U x;
INT8U y;
INT8U err;
for (;;) {
OSSemPend(RandomSem, 0, &err); /* Acquire semaphore to perform random numbers */
x = random(80); /* Find X position where task number will appear */
y = random(16); /* Find Y position where task number will appear */
OSSemPost(RandomSem); /* Release semaphore */
/* Display the task number on the screen */
PC_DispChar(x, y + 5, *(char *)pdata, DISP_FGND_BLACK + DISP_BGND_LIGHT_GRAY);
OSTimeDly(1); /* Delay 1 clock tick */
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?