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

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

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

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

Saved successfully!

Ooh no, something went wrong!