Anything necessary to setup the real-time environment on the current RTOS may be done here. This is the first function that the RTT will call in the FOSI layer, when the MainThread object is constructed. Typically, the main thread is assigned a priority, put in a scheduler and memory is locked into RAM.

the new period. As a special exception, if this is equal to zero, it is to inform the RTOS that we'll block this periodic thread for an unspecified amount of time and that this should not trigger a watchdog, or lead to 'catching up' or signalling overruns.

In some RTOS's the scheduler can't be changed or the change can only be done for the calling thread.

Parameters:

t

The RTOS task to change.

sched_type

A scheduler typed known by your RTOS.

Return values:

0

when the scheduler of t was changed successfully

-1

if scheduler for t could not be changed or sched_type is invalid

-2

if sched_type is valid but can only be changed for the current thread which is not t. In this case, the calling code should find a way to let the thread associated with t make the call to rtos_task_set_scheduler().