diff --git a/os/rt/src/chevents.c b/os/rt/src/chevents.c index 0f41699cf..3286c5f94 100644 --- a/os/rt/src/chevents.c +++ b/os/rt/src/chevents.c @@ -333,7 +333,7 @@ void chEvtBroadcastFlags(event_source_t *esp, eventflags_t flags) { } /** - * @brief Returns the flags associated to an @p event_listener_t. + * @brief Returns the unmasked flags associated to an @p event_listener_t. * @details The flags are returned and the @p event_listener_t flags mask is * cleared. * @@ -349,7 +349,7 @@ eventflags_t chEvtGetAndClearFlagsI(event_listener_t *elp) { flags = elp->flags; elp->flags = (eventflags_t)0; - return flags; + return flags & elp->wflags; } /** diff --git a/readme.txt b/readme.txt index e2cdcce56..031071bc4 100644 --- a/readme.txt +++ b/readme.txt @@ -141,6 +141,8 @@ - EX: Updated LIS302DL to 1.1.0 (backported to 18.2.1). - EX: Updated LPS25H to 1.1.0 (backported to 18.2.1). - EX: Updated LSM303DLHC to 1.1.0 (backported to 18.2.1). +- RT: Fixed chEvtGetAndClearFlags(...) does not mask events (bug #977) + (backported to 18.2.2 and 17.6.5). - HAL: Fixed HAL channels chnControl() macro broken (bug #976) (backported to 18.2.2). - OTH: Fixed wrong timeout handling in CMSIS OS layer (bug #975)