ARM Technical Support Knowledge Articles

USING OS_WAIT AND OS_SEND_SIGNAL

Applies to: RTX166 Tiny Real-time Kernel

Answer


Information in this article applies to:


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

Article last edited on: 2005-09-22 12:54:10

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential