#include "rtx51tny.h" #include "REG935.H"
const unsigned char table[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80 ,0x40,0x20,0x10,0x08,0x04,0x02,0x01,0xFF,0x00};
int counter0; int counter1; int counter2; int counter3;
void LED0 (void) _task_ 0 { int i; os_create_task(1); os_create_task(2); while(1) {
for (i = 0; i < 15; i++) {
P1 = table[i]; os_wait(K_TMO,30,0);
} os_send_signal(1); os_wait(K_SIG,0,0); counter0++; } }
void LED1 (void) _task_ 1 { int i; while(1) { os_wait(K_SIG,0,0);
for (i = 0; i < 3; i++) { P1 = table[15];
os_wait(K_TMO,30,0);
P1 = table[16];
os_wait(K_TMO,30,0); } os_send_signal(2);
counter1++; } }
void LED2 (void) _task_ 2 { int i; while(1) { os_wait(K_SIG,0,0);
for (i = 0; i < 8; i++) { P1 = table[i] | table[i+7]; os_wait(K_TMO,30,0); }
os_send_signal(0); counter2++; } }
Here is my programe, you can emulate it by the KEIL. Opening the "peripheral"-->"I/O port"-->"P1".you will see the movement of the P1.
Now I want to use the os_wait(K_IVL,0,0) instead of the os_wait(K_TMO,0,0) to see the differnce between them.But I can not see the difference.So who can help me to modify the programe to show the difference clearly.
If you start new threads over and over you can be sure, that no one will reply...