I'm using ChibiOS 2.6.4. I found something that looks like a bug in chEvtBroadcastFlagsI():
Code: Select all
void chEvtBroadcastFlagsI(EventSource *esp, flagsmask_t flags) {
EventListener *elp;
chDbgCheckClassI();
chDbgCheck(esp != NULL, "chEvtBroadcastMaskI");
elp = esp->es_next;
while (elp != (EventListener *)esp) {
elp->el_flags |= flags;
chEvtSignalI(elp->el_listener, elp->el_mask); // Why do we send event mask to listeners ?
elp = elp->el_next;
}
}
This will force all listeners on the event to wake up, regardless whether they are waiting the correct flag or not. Based on the docs, I believe the chEvtBroadcastFlagsI() should send the flag to each of the event listeners:
Code: Select all
while (elp != (EventListener *)esp) {
elp->el_flags |= flags;
chEvtSignalI(elp->el_listener, flags); // Send the flag(s) to listeners
elp = elp->el_next;
}
Cheers,
-Daniel