This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

OsEventFlagsSet problem in CMSIS-RTOS2

The inside of the osEventFlagsSet

If (xEventGroupSetBitsFromISR (hEventGroup (EventBits_t) flags, & yield) != pdFAIL)

Should be changed to

If (xEventGroupSetBitsFromISR (hEventGroup (EventBits_t) flags, & yield) == pdFAIL)

uint32_t osEventFlagsSet (osEventFlagsId_t ef_id, uint32_t flags) {
EventGroupHandle_t hEventGroup = (EventGroupHandle_t)ef_id;
uint32_t rflags;
BaseType_t yield;

if ((hEventGroup == NULL) || ((flags & EVENT_FLAGS_INVALID_BITS) != 0U)) {
rflags = (uint32_t)osErrorParameter;
}
else if (IS_IRQ()) {
yield = pdFALSE;

if (xEventGroupSetBitsFromISR (hEventGroup, (EventBits_t)flags, &yield) != pdFAIL) {
rflags = (uint32_t)osErrorResource;
} else {
rflags = flags;
portYIELD_FROM_ISR (yield);
}
}
else {
rflags = xEventGroupSetBits (hEventGroup, (EventBits_t)flags);
}

return (rflags);
}

Parents Reply Children
No data