From e9959d45a11e9905bb2b9c3a8ce53f566ecea319 Mon Sep 17 00:00:00 2001 From: John Polstra Date: Fri, 19 Feb 2021 10:42:38 -0800 Subject: [PATCH] Bring in a bugfix from https://github.com/ARM-software/CMSIS-FreeRTOS/commit/78de2a6322d2b0a00b0ea9ce827e98cbfb89e795: Fixed group flags comparison, when waiting on all flags (osFlagsWaitAll). Previous implementation invokes fail every time, when other flags (those we don't wait for) are set. This fix only compares flags specified to wait for, as API docs suggests. --- .../Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c b/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c index 91fca304..fb558145 100644 --- a/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c +++ b/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c @@ -1176,7 +1176,7 @@ uint32_t osEventFlagsWait (osEventFlagsId_t ef_id, uint32_t flags, uint32_t opti rflags = xEventGroupWaitBits (hEventGroup, (EventBits_t)flags, exit_clr, wait_all, (TickType_t)timeout); if (options & osFlagsWaitAll) { - if (flags != rflags) { + if ((flags & rflags) != flags) { if (timeout > 0U) { rflags = (uint32_t)osErrorTimeout; } else {