MDK-ARM Keil, MDK-ARM Datasheet - Page 35

KIT REALVIEW MCU DEVELOPMENT

MDK-ARM

Manufacturer Part Number
MDK-ARM
Description
KIT REALVIEW MCU DEVELOPMENT
Manufacturer
Keil
Type
Compiler and IDEr
Datasheets

Specifications of MDK-ARM

For Use With/related Products
ARM MCUs
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Getting Started: Building Applications with RL-ARM
Here, the multiplex semaphore has five tokens. Before a task can continue, it
must acquire a token. Once the function finished, the token is sent back. If more
than five tasks are calling ProcessBuffer(), the sixth task must wait until a
running task finishes and returns its token. Thus, the multiplex ensures that a
maximum of 5 instances of the ProcessBuffer() function may be called at any one
time.
Exercise: Multiplex
This exercise demonstrates the use of a multiplex to limit the number of
illuminated LEDs.
Rendezvous
A more generalized form of semaphore signaling is a rendezvous. A rendezvous
ensures that two tasks reach a certain point of execution. Neither may continue
until both have reached the rendezvous point.
In the example above, the two semaphores ensure that both tasks will rendezvous
and proceed then to execute FuncA2() and FuncB2().
Exercise: Rendezvous
This exercise uses rendezvous semaphores to synchronize the activity of two
tasks.
os_sem Arrived1, Arrived2;
__task void task1 (void)
}
os_sem_init (Arrived1, 0);
os_sem_init (Arrived2, 0);
while (1)
}
FuncA1 ();
os_sem_send (Arrived1);
os_sem_wait (Arrived2, 0xFFFF);
FuncA2 ();
{
{
__task void task2 (void)
}
while (1)
}
FuncB1 ();
os_sem_send (Arrived2);
os_sem_wait (Arrived1, 0xFFFF);
FuncB2 ();
{
{
35

Related parts for MDK-ARM