diff --git a/FreeRTOS-Cpp/include/FreeRTOS/Kernel.hpp b/FreeRTOS-Cpp/include/FreeRTOS/Kernel.hpp index 67db8db..4aa8200 100644 --- a/FreeRTOS-Cpp/include/FreeRTOS/Kernel.hpp +++ b/FreeRTOS-Cpp/include/FreeRTOS/Kernel.hpp @@ -160,6 +160,25 @@ inline void yield() { taskYIELD(); } +/** + * Kernel.hpp + * + * @brief Function that calls portYIELD_FROM_ISR() to request a context + * switch from an ISR. + * + * @see + * + * This function is intended to be used at the end of an interrupt service + * routine (ISR). It requests a context switch if calling an ISR-safe FreeRTOS + * API function caused a higher-priority task to unblock. + * + * @param higherPriorityTaskWoken Set to true by the ISR-safe API wrapper if a + * higher-priority task was woken and a context switch should be performed. + */ +inline void yieldFromISR(bool higherPriorityTaskWoken) { + portYIELD_FROM_ISR(higherPriorityTaskWoken ? pdTRUE : pdFALSE); +} + /** * Kernel.hpp *