ex4.c

来自「c51学习的好书!」· C语言 代码 · 共 18 行

C
18
字号
#include <rtx51tny.h>
int counter0;
int counter1;
void job0 (void) _task_ 0 {
  os_create (1);                              /* mark task 1 as ready */
  while (1) {                                 /* loop forever */
    counter0++;                               /* update the counter */
    os_wait (K_TMO, 3);                       /* pause for 3 clock ticks */
  }
}

void job1 (void) _task_ 1 {
  while (1) {                                 /* loop forever */
    counter1++;                               /* update the counter */
    os_wait (K_TMO, 5);                       /* pause for 5 clock ticks */
  }
}

⌨️ 快捷键说明

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