aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/src/chevents.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/kernel/src/chevents.c')
-rw-r--r--os/kernel/src/chevents.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/os/kernel/src/chevents.c b/os/kernel/src/chevents.c
index a0ef2d1bb..a64f59bdc 100644
--- a/os/kernel/src/chevents.c
+++ b/os/kernel/src/chevents.c
@@ -160,12 +160,12 @@ eventmask_t chEvtAddFlags(eventmask_t mask) {
*
* @api
*/
-void chEvtSignal(Thread *tp, eventmask_t mask) {
+void chEvtSignalFlags(Thread *tp, eventmask_t mask) {
chDbgCheck(tp != NULL, "chEvtSignal");
chSysLock();
- chEvtSignalI(tp, mask);
+ chEvtSignalFlagsI(tp, mask);
chSchRescheduleS();
chSysUnlock();
}
@@ -182,7 +182,7 @@ void chEvtSignal(Thread *tp, eventmask_t mask) {
*
* @iclass
*/
-void chEvtSignalI(Thread *tp, eventmask_t mask) {
+void chEvtSignalFlagsI(Thread *tp, eventmask_t mask) {
chDbgCheck(tp != NULL, "chEvtSignalI");
@@ -198,15 +198,20 @@ void chEvtSignalI(Thread *tp, eventmask_t mask) {
/**
* @brief Signals all the Event Listeners registered on the specified Event
* Source.
+ * @details This function variants ORs the specified event flags to all the
+ * threads registered on the @p EventSource in addition to the event
+ * flags specified by the threads themselves in the
+ * @p EventListener objects.
*
* @param[in] esp pointer to the @p EventSource structure
+ * @param[in] mask the event flags set to be ORed
*
* @api
*/
-void chEvtBroadcast(EventSource *esp) {
+void chEvtBroadcastFlags(EventSource *esp, eventmask_t mask) {
chSysLock();
- chEvtBroadcastI(esp);
+ chEvtBroadcastFlagsI(esp, mask);
chSchRescheduleS();
chSysUnlock();
}
@@ -214,23 +219,28 @@ void chEvtBroadcast(EventSource *esp) {
/**
* @brief Signals all the Event Listeners registered on the specified Event
* Source.
+ * @details This function variants ORs the specified event flags to all the
+ * threads registered on the @p EventSource in addition to the event
+ * flags specified by the threads themselves in the
+ * @p EventListener objects.
* @post This function does not reschedule so a call to a rescheduling
* function must be performed before unlocking the kernel. Note that
* interrupt handlers always reschedule on exit so an explicit
* reschedule must not be performed in ISRs.
*
* @param[in] esp pointer to the @p EventSource structure
+ * @param[in] mask the event flags set to be ORed
*
* @iclass
*/
-void chEvtBroadcastI(EventSource *esp) {
+void chEvtBroadcastFlagsI(EventSource *esp, eventmask_t mask) {
EventListener *elp;
- chDbgCheck(esp != NULL, "chEvtBroadcastI");
+ chDbgCheck(esp != NULL, "chEvtBroadcastMaskI");
elp = esp->es_next;
while (elp != (EventListener *)esp) {
- chEvtSignalI(elp->el_listener, elp->el_mask);
+ chEvtSignalFlagsI(elp->el_listener, elp->el_mask | mask);
elp = elp->el_next;
}
}