IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide IAR PowerPac RTOS User Guide

ie.ksu.edu.tw
from ie.ksu.edu.tw More from this publisher
11.07.2015 Views

OS_SUPPORT_CLEANUP_ON_TERMINATEIf enabled, it allows termination of tasks which are claiming resource semaphores or are suspended on anysynchronization object.Note:By default, this switch is activated for 16- and 32-bit CPUs.For 8-bit CPUs it is disabled.Even though the overhead is minimal and execution time is not affected significantly, you may define this switch tozero when you do not terminate tasks in your application, or if your application ensures, that tasks are never suspendedon any synchronization object or claim any resource semaphores when they are terminated.Disabling this switch will save some RAM in the task control structure and will also speed up the wait functions forsynchronization objects.When using an 8-bit CPU, you have to enable this switch (define it to be unequal to 0) to enable termination of taskswhich are suspended on synchronization objects or claim resource semaphores.138IAR PowerPac RTOSfor ARM CoresPPRTOS-2

Additional modulesKeyboard manager: KEYMAN.CKeyboard driver module supplied in C. It serves both as an example and as a module that can actually be used in yourapplication. The module can be used in most applications with only little changes to the hardware-specific portion.It needs to be initialized on startup and creates a task that checks the keyboard 50 times per second.Changes required for your hardwarevoid ReadKeys(void);Example of how to implement into your programvoid main(void) {OS_InitKern(); /* Initialize OS (should be first !) */OS_InitHW();/* Initialize Hardware for OS (see RtosInit.c)*//* You need to create at least one task here ! */OS_CREATETASK(&TCB0, "HP Task", Task0, 100, Stack0); /* Create Task0*/OS_CREATETASK(&TCB1, "LP Task", Task1, 50, Stack1); / *Create Task1*/InitKeyMan(); /* Initialize keyboard manager */OS_Start();}PPRTOS-2 139

Additional modulesKeyboard manager: KEYMAN.CKeyboard driver module supplied in C. It serves both as an example and as a module that can actually be used in yourapplication. The module can be used in most applications with only little changes to the hardware-specific portion.It needs to be initialized on startup and creates a task that checks the keyboard 50 times per second.Changes required for your hardwarevoid ReadKeys(void);Example of how to implement into your programvoid main(void) {OS_InitKern(); /* Initialize OS (should be first !) */OS_InitHW();/* Initialize Hardware for OS (see RtosInit.c)*//* You need to create at least one task here ! */OS_CREATETASK(&TCB0, "HP Task", Task0, 100, Stack0); /* Create Task0*/OS_CREATETASK(&TCB1, "LP Task", Task1, 50, Stack1); / *Create Task1*/InitKeyMan(); /* Initialize keyboard manager */OS_Start();}PP<strong>RTOS</strong>-2 139

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!