I’m still working on my first FreeRTOS project and I would like to have some advices on Interrupts management.
I have enable my interrupts at the beginning of my code, before calling vTaskStartScheduler(). I have some troubles and I think this happen when an interrupts is calling FreeRTOS API before my Scheduler is running. In order to avoid this, I find 2 ways:
1 - Check for each interrupts the State of Scheduler by using xTaskGetSchedulerState. I will call FreeRTOS API (FromISR) Only if Scheduler is running (taskSCHEDULER_RUNNING)
2 - Enable my interrupts in one Task, In order to be sure that Scheduler is running.
Do you think that one way is better? Or if you know a cleanest way to do this, don’t hesitate to explain it to me.
Thanks for your help,