11.07.2015 Views

IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

OS_SetTimeSlice()DescriptionAssigns a specified timeslice value to a specified task.Prototypeunsigned char OS_SetTimeSlice (OS_TASK* pTask,unsigned char TimeSlice);ParameterDescriptionpTaskTimeSliceTable 12: OS_SetTimeSlice() parameter listReturn valuePrevious timeslice value of the task as unsigned char.Additional InformationCan be called at any time from any task or software timer. Setting the timeslice value only affects the tasks running inround-robin mode. This means another task with the same priority must exist.The new timeslice value is interpreted as reload value. It is used after the next activation of the task. It does not affectthe remaining timeslice of a running task.OS_Suspend()DescriptionSuspends the specified task.Prototypevoid OS_Suspend (OS_TASK* pTask);ParameterDescriptionAdditional InformationIf pTask is the NULL pointer, the current task suspends.If the function succeeds, execution of the specified task is suspended and the task's suspend count is incremented. Thespecified task will be suspended immediately. It can only be restarted by a call of OS_Resume().Every task has a suspend count with a maximum value of OS_MAX_SUSPEND_CNT. If the suspend count is greater thanzero, the task is suspended.In debug versions of <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>, calling OS_Suspend() more often than OS_MAX_SUSPEND_CNT timeswithout calling OS_Resume(), the task's internal suspend count is not incremented and OS_Error() is called witherror OS_ERR_SUSPEND_TOO_OFTEN.OS_Resume()DescriptionDecrements the suspend count of the specified task and resumes it, if the suspend count reaches zero.Prototypevoid OS_Resume (OS_TASK* pTask);ParameterDescriptionPointer to a data structure of type OS_TASK.New timeslice value for the task. Must be within the following range:1

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

Saved successfully!

Ooh no, something went wrong!