| |||||
Technical Support Support Resources
Product Information | RTX166 TINY: USING OS_WAIT AND OS_SEND_SIGNALInformation in this article applies to:
QUESTIONHow do I use the os_wait and os_send_signal functions in RTX166 Tiny? ANSWERThe following example program demonstrates how to use these routines:
#include <rtx166t.h>
unsigned char timer0;
unsigned char timer1;
unsigned char timer2;
void TASK_0 (void) _task_ 0
{
os_create_task (1);
os_create_task (2);
while (1)
{
os_send_signal (1); //Send signal to task 1
os_wait (K_SIG, 0, 0);
timer0++;
}
}
void TASK_1 (void) _task_ 1
{
while (1)
{
os_send_signal (2); //Send signal to task 2
os_wait (K_SIG, 0, 0);
timer1++;
}
}
void TASK_2 (void) _task_ 2
{
while (1)
{
os_send_signal (0); //Send signal to task 0
os_wait (K_SIG, 0, 0);
timer2++;
}
}
An example program that demonstrates these functions may be downloaded from the Keil website. MORE INFORMATION
Last Reviewed: Thursday, September 22, 2005 | ||||
| |||||