Keil Logo

RTX166 TINY: Using OS_WAIT and OS_SEND_SIGNAL


Information in this article applies to:

  • C166 Version 3.12 and later
  • µVision2 Version 2.06 and later

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

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, February 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.