void (*ctl_task_switch_callout)(CTL_TASK_t *);

ctl_task_switch_callout contains a pointer to a function that is called (if it is set) when a task schedule occurs. The task that will be scheduled is supplied as a parameter to the function (ctl_task_executing will point to the currently scheduled task).

Note that the callout function is called from the CTL scheduler and as such any use of CTL services whilst executing the callout function has undefined behavior.


Because this function pointer is called in an interrupt service routine, you should assign it before interrupts are started or with interrupts turned off.