Keil™, An ARM® Company

Technical Support

RTX166 TINY: USING OS_WAIT AND OS_SEND_SIGNAL


Information in this article applies to:

  • C166 Version 3.12
  • C166 Version 4.06
  • µVision2 Version 2.06

QUESTION

How do I use the os_wait and os_send_signal functions in RTX166 Tiny?

ANSWER

The 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

  • Refer to os_wait in the RTX166 Tiny User's Guide.
  • Refer to os_send_signal in the RTX166 Tiny User's Guide.

Last Reviewed: Thursday, September 22, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure