Skip to content

Commit 78de2a6

Browse files
authored
osEventFlagsWait: Fix flag comparison
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
1 parent 9f4f1fa commit 78de2a6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

CMSIS/RTOS2/FreeRTOS/Source/cmsis_os2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ uint32_t osEventFlagsWait (osEventFlagsId_t ef_id, uint32_t flags, uint32_t opti
11811181
rflags = xEventGroupWaitBits (hEventGroup, (EventBits_t)flags, exit_clr, wait_all, (TickType_t)timeout);
11821182

11831183
if (options & osFlagsWaitAll) {
1184-
if (flags != rflags) {
1184+
if ((flags & rflags) != flags) {
11851185
if (timeout > 0U) {
11861186
rflags = (uint32_t)osErrorTimeout;
11871187
} else {

0 commit comments

Comments
 (0)