📄 task_arm.c
字号:
#include "config.h"
#define TASK_START_PRIO 10 /* Application tasks priorities */
/*$PAGE*/
/*
*********************************************************************************************************
* TASK #1
*
* Description: This task executes every 100 mS and measures the time it task to perform stack checking
* for each of the 5 application tasks. Also, this task displays the statistics related to
* each task's stack usage.
*********************************************************************************************************
*/
void Task1 (void *pdata)
{
INT8U err;
OS_STK_DATA data; /* Storage for task stack data */
INT16U time; /* Execution time (in uS) */
INT8U i;
char s[80];
pdata = pdata;
for (;;) {
for (i = 0; i < 7; i++) {
PC_ElapsedStart();
err = OSTaskStkChk(TASK_START_PRIO + i, &data);
time = PC_ElapsedStop();
if (err == OS_NO_ERR) {
//change by cmj
// sprintf(s, "%4ld %4ld %4ld %6d",
sprintf(s, "%4d %4d %4d %6d", data.OSFree + data.OSUsed,
data.OSFree,
data.OSUsed,
time);
PC_DispStr(19, 12 + i, s, DISP_FGND_BLACK + DISP_BGND_LIGHT_GRAY);
}
}
OSTimeDlyHMSM(0, 0, 0, 100); /* Delay for 100 mS */
}
}
/*$PAGE*/
/*
*********************************************************************************************************
* TASK #2
*
* Description: This task displays a clockwise rotating wheel on the screen.
*********************************************************************************************************
*/
void Task2 (void *data)
{
data = data;
for (;;) {
PC_DispChar(70, 15, '|', DISP_FGND_YELLOW + DISP_BGND_BLUE);
OSTimeDly(10);
PC_DispChar(70, 15, '/', DISP_FGND_YELLOW + DISP_BGND_BLUE);
OSTimeDly(10);
PC_DispChar(70, 15, '-', DISP_FGND_YELLOW + DISP_BGND_BLUE);
OSTimeDly(10);
PC_DispChar(70, 15, '\\', DISP_FGND_YELLOW + DISP_BGND_BLUE);
OSTimeDly(10);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -