The Blinky RTC FreeRTOS example shows how to properly use hardware interrupts with FreeRTOS.
When the application starts, two GPIO pins are configured using the BSP module as outputs to drive the LEDs. Then, a new thread is started.
From the created thread, RTC is configured to generate an interrupt. Task negates the LED 1 state and starts waiting for the semaphore that will be set from an RTC interrupt.
The example presents the correct interrupt runtime construction that should be used with FreeRTOS:
pdFALSE
.portYIELD_FROM_ISR
must be called.Because of the Cortex-M functionality of PendSV, this function can be also called in the event handler that is not the real last instruction in the current ISR. It can be also called multiple times - the task scheduler will be processed only once, when all the interrupts have been processed.
You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\peripheral\blinky_rtc_freertos
LED assignments:
Test the Blinky RTC FreeRTOS Example application by performing the following steps: