Keil™, An ARM® Company

Technical Support

ARTX: WAIT FOR MESSAGE + SIGNAL


Information in this article applies to:

  • ARTX-166 Version 1

QUESTION

I am currently porting software from the RTX166 Real-Time OS to Advanced RTX166. In RTX166 it was possible to wait for a signal and a message in combination. In the new system this seems to be no longer possible. Is there a way to do it?

ANSWER

Yes, you are correct. In Advanced RTX166, we have changed several things. However AR166 offers up to 16 signals per task and therefore it is pretty easy to use a second signal as shown below:

Include in the Task that sends a Message the following call:

os_mbx_send (mbx, message, 0xFFFF);
os_evt_set (0x0002, task2); // use a bit in the event mask to
                            // indicate that you have messages

Include in the task that waits for Message the following:

/* Wait for two event signals in combination */
os_evt_wait_or (0x0003, timeout);

if (os_mbx_check (mbx) < MAX_MBX_COUNT) {

  /* the message is waiting in a mailbox, get it */
  os_mbx_wait (mbx, &recmsg, 0xFFFF);
}
else {
  /* process an event */
}

The combination of different event signals makes it possible to wait for mailbox and standard signals.

MORE INFORMATION

  • Advanced RTX166 User's Guide

Last Reviewed: Thursday, June 19, 2008


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