| |||||
Technical Support Support Resources
Product Information | ARTX: WAIT FOR MESSAGE + SIGNALInformation in this article applies to:
QUESTIONI 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? ANSWERYes, 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 INFORMATIONLast Reviewed: Thursday, June 19, 2008 | ||||
| |||||