IAR PowerPac RTOS User Guide
IAR PowerPac RTOS User Guide IAR PowerPac RTOS User Guide
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
- Page 87 and 88: Event objectsExampleOS_EVENT_Reset(
- Page 89 and 90: Heap type memory managementANSI C o
- Page 91 and 92: Fixed block size memory poolsIntrod
- Page 93 and 94: Fixed block size memory poolsProtot
- Page 95 and 96: Fixed block size memory poolsProtot
- Page 97 and 98: StacksIntroductionThe stack is the
- Page 99 and 100: InterruptsIntroductionIn this chapt
- Page 101 and 102: InterruptsRules for interrupt handl
- Page 103 and 104: InterruptsOS_LeaveInterruptNoSwitch
- Page 105 and 106: InterruptsNesting interrupt routine
- Page 107 and 108: Critical RegionsIntroductionCritica
- Page 109 and 110: System variablesIntroductionThe sys
- Page 111 and 112: Configuration for your targetsystem
- Page 113 and 114: Time measurementIntroductionIAR Pow
- Page 115 and 116: Time measurementPrototypeU32 OS_Get
- Page 117 and 118: Time measurementPrototypeOS_U32 OS_
- Page 119 and 120: RTOS-aware debuggingThis chapter de
- Page 121 and 122: RTOS-aware debuggingTimersA softwar
- Page 123 and 124: DebuggingRuntime errorsSome error c
- Page 125 and 126: DebuggingValue Define Description17
- Page 127 and 128: Performance and resource usageThis
- Page 129 and 130: Performance and resource usageThe c
- Page 131 and 132: Performance and resource usage*/sta
- Page 133 and 134: ReentranceAll routines that can be
- Page 135 and 136: LimitationsThe following limitation
- Page 137: Source code of kernel and libraryIn
- Page 141 and 142: FAQ (frequently asked questions)Q:
- Page 143 and 144: GlossaryActive TaskCooperativemulti
- Page 145 and 146: IndexIndexAAdditional modules . . .
- Page 147: IndexOS_WaitSingleEventTimed(). . .
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