MDK-ARM Keil, MDK-ARM Datasheet - Page 26

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
26
Chapter 2. Developing With an RTOS
Periodic Task Execution
We have seen that the scheduler runs tasks with a round-robin or pre-emptive
scheduling scheme. With the timing services, it is also possible to run a selected
task at specific time intervals. Within a task, we can define a periodic wake-up
interval.
void os_itv_set (unsigned short interval_time)
Then we can put the task to sleep and wait for the interval to expire. This places
the task into the WAIT_INT state.
void os_itv_wait (void)
When the interval expires, the task moves from the WAIT_INT to the READY
state and will be placed into the RUNNING state by the scheduler.
Exercise: Interval
This exercise modifies the two-task example to use interval service so that both
tasks run at a fixed period.
Virtual Timer
As well as running tasks on a defined periodic basis, we can define any number
of virtual timers, which act as countdown timers. When they expire, they run a
user call-back function to perform a specific action. A virtual timer is created
with the os_timer_create() function. This system call specifies the number of
RTOS system timer ticks before it expires and a value “info”, which is passed to
the callback function to identify the timer. Each virtual timer is also allocated an
OS_ID handle, so that it can be managed by other system calls.
OS_ID os_tmr_create (unsigned short tcnt, unsigned short info)
When the timer expires, it calls the function os_tmr_call(). The prototype for
this function is located in the
file.
RTX_Config.c

Related parts for MDK-ARM