detect the scheduler is running

williamjsell wrote on Wednesday, January 15, 2014:

A simple question. I have some pre-rtos initialization which needs to occur, but this function could be called after the scheduler is invoked. In this case, I need to detect the scheduler is running and shut down some tasks. Is there an api to indicate the scheduler is running?

woops_ wrote on Wednesday, January 15, 2014:

http://www.freertos.org/a00021.html#xTaskGetSchedulerState

tlafleur wrote on Wednesday, January 15, 2014:

Set a flag to false
Do some initialization
Set flag to true
Start FreeRTOS
Test flag…