Download COMPLETE EMBEDDED SOLUTIONS

Transcript
THE CMX MULTI-TASKING EXECUTIVE
EVENT MANAGER FUNCTIONS
for (ctr = 0; ctr < 16; ctr++)
{
switch (events & MASK)
{
case 0x0001:
.....
break;
case 0x0002:
.....
break;
case 0x0004:
.....
break;
case 0x0008:
.....
break;
etc....
case 0x8000:
.....
break;
default:
break;
}
MASK = MASK << 1;
}
}
Returned
EVENTS will either contain a zero indicating the time period specified expired before
any of the events the task is waiting on became set, or the specific events that were set
only according to the MATCH parameter.
☞ Remember only events that are selected by the MATCH parameter are worked within this
function. The MODE parameter allows powerful synchronization as to when the task's
events are cleared.
The K_Event_Signal function
The K_Event_Signal function sets a specific event. This can be done in a variety of
modes. This function may be called by tasks, cyclic timers, mailboxes or interrupts.
The caller will select which event, the mode of event set it wants, and the task slot
number or priority, depending upon the mode selected. Some cyclic timer and mailbox
functions use K_Event_Signal to signal that time expired or mail has arrived at the
mailbox, respectively.
34