MDK-ARM Keil, MDK-ARM Datasheet - Page 29

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
29
Any task can set the event flags of any other task in a system with the
os_evt_set() RTX function call. We use the task ID to select the task.
void os_evt_set (unsigned short event_flags, OS_TID task);
As well as setting a task’s event flags, it is also possible to clear selected flags.
void os_evt_clr (U16 clear_flags, OS_TID task);
When a task resumes execution after it has been waiting for an os_evt_wait_or()
function to complete, it may need to determine which event flag has been set.
The os_evt_get() function allows you to determine the event flag that was set.
You can then execute the correct code for this condition.
which_flag = os_evt_get ();
Exercise: Events
This exercise extends the simple two-task-example and uses event flags to
synchronize the activity between the active tasks.
RTOS Interrupt Handling
The use of event flags is a simple and efficient method of controlling actions
between tasks. Event flags are also an important method of triggering tasks to
respond to interrupt sources within the ARM processor-based microcontroller.
While it is possible to run C code in an interrupt service routine (ISR), this is not
desirable within an RTX-based application. This is because on an ARM7/9
based device you will disable further general-purpose interrupts until you quit the
ISR. This delays the timer tick and disrupts the RTX kernel. This is less of a
problem on Cortex-M profile-based devices, as the Cortex-M interrupt structure
supports nested interrupts. However, it is still good practice to keep the time
spent in interrupts to a minimum.
A traditional nested interrupt
scheme supports prioritized
interrupt handling, but has
unpredictable stack
requirements.

Related parts for MDK-ARM