How to find out if FreeRTOS scheduler running

znatok wrote on Friday, October 18, 2013:

Hi,
I have a task that should run before and after FreeRTOS scheduler is running. Before scheduler it just makes p[olling and after scheduler it uses Semaphore. What is the most simple way to query if scheduler is running? In other words if call to vTaskStartScheduler(); was made or not?
I can arrange global flag:

main()
{
FreeRTOS_running=0;



FreeRTOS_running=1;
vTaskStartScheduler();
}

But I wander if there is any internal flag or variable that can be used same way.

Thanks.

rtel wrote on Friday, October 18, 2013:

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

Regards.