void TaskB(void) { while (1) { led1=~led1; OSWait(K_TMO,10); printf("TaskB\r\n"); } }
void TaskC(void) { while (1) { led2=~led2; OSWait(K_TMO,15); printf("TaskC\r\n"); } }
void TaskA(void) { while (1) { led0=~led0; OSWait(K_TMO,5); printf("TaskA\r\n"); } }
void TaskE(void) { uint8 x,y; while (1) { OS_ENTER_CRITICAL(); x = random(80); y = random(20); PC_DispChar(x, y + 5, '5', DISP_FGND_LIGHT_GRAY); OS_EXIT_CRITICAL(); OSWait(K_TMO,1); } }
static int8 ds18b20_ioctl(uint8 id, uint8 cmd, uint16 args) { int16 *p_temp = (int16 *)args; if (GET_CMD_DIR(cmd) == CMD_GET) { switch (cmd) { case DS18B20_GET: ds1302_start(); OSWait(K_TMO, OS_TICKS_PER_SEC); // delay 1S *p_temp = ds1302_read_temp(); break; default: break; } } UNUSED(id); return 0; }