IAR PowerPac RTOS User Guide
IAR PowerPac RTOS User Guide IAR PowerPac RTOS User Guide
Prototypevoid OS_LeaveRegion (void);Additional InformationOS_LeaveRegion() is not actually a function but a macro. However, it behaves very much like a function but is muchmore efficient. Usage of the macro indicates to IAR PowerPac RTOS the end of a critical region. A critical regioncounter (OS_RegionCnt), which is 0 by default, is decremented. If this counter reaches 0 again, the critical regionends.ExampleRefer to the example for OS_EnterRegion().108IAR PowerPac RTOSfor ARM CoresPPRTOS-2
System variablesIntroductionThe system variables are described here for a deeper understanding of how the OS works and to make debugging easier.Note:Do not change the value of any system variables.These variables are accessible and are not declared constant, but they should only be altered by functions of IARPowerPac RTOS. However, some of these variables can be very useful, especially the time variables.Time variablesOS_TimeDescriptionThis is the time variable which contains the current system time in ticks (usually equivalent to ms).Prototypextern volatile OS_I32 OS_Time;Additional InformationThe time variable has a resolution of one time unit, which is normally 1/1000 sec (1 ms) and is normally the timebetween two successive calls to the IAR PowerPac RTOS interrupt handler. Instead of accessing this variable directly,use OS_GetTime() or OS_GetTime32() as explained in the Chapter Time measurement on page 113.OS_TimeDexBasically, for internal use only. Contains the time at which the next task switch or timer activation is due. If((int)(OS_Time - OS_TimeDex)) >= 0, the task list and timer list will be checked for a task or timer to activate.After activation, OS_TimeDex will be assigned the time stamp of the next task or timer to be activated.OS internal variables and data-structuresIAR PowerPac RTOS internal variables are not explained here as they are in no way required to use IAR PowerPacRTOS. Your application should not rely on any of the internal variables, as only the documented API functions areguaranteed to remain unchanged in future versions of IAR PowerPac RTOS.ImportantDo not alter any system variables.PPRTOS-2 109
- Page 57 and 58: Counting SemaphoresPrototypevoid OS
- Page 59 and 60: Counting SemaphoresReturn value0: I
- Page 61 and 62: MailboxesWhy mailboxes?In the prece
- Page 63 and 64: MailboxesMailboxes API function ove
- Page 65 and 66: MailboxesExampleSingle-byte mailbox
- Page 67 and 68: MailboxesPrototypevoid OS_GetMail (
- Page 69 and 70: MailboxesOS_WaitMail()DescriptionWa
- Page 71 and 72: QueuesWhy queues?In the preceding c
- Page 73 and 74: QueuesReturn valueThe size of the r
- Page 75 and 76: QueuesExamplestatic void MemoryTask
- Page 77 and 78: Task eventsIntroductionTask events
- Page 79 and 80: Task eventsExampleOS_WaitEventTimed
- Page 81 and 82: Task eventsPrototypechar OS_ClearEv
- Page 83 and 84: Event objectsIntroductionEvent obje
- Page 85 and 86: Event objectsExampleif (OS_EVENT_Wa
- 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: Critical RegionsIntroductionCritica
- 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 and 138: Source code of kernel and libraryIn
- Page 139 and 140: Additional modulesKeyboard manager:
- 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(). . .
Prototypevoid OS_LeaveRegion (void);Additional InformationOS_LeaveRegion() is not actually a function but a macro. However, it behaves very much like a function but is muchmore efficient. Usage of the macro indicates to <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> the end of a critical region. A critical regioncounter (OS_RegionCnt), which is 0 by default, is decremented. If this counter reaches 0 again, the critical regionends.ExampleRefer to the example for OS_EnterRegion().108<strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>for ARM CoresPP<strong>RTOS</strong>-2