git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14514 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
085d4faf43
commit
8982ef3028
|
@ -233,44 +233,6 @@ eventmask_t chEvtAddEvents(eventmask_t events) {
|
||||||
return newevt;
|
return newevt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @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 event_source_t in addition to the
|
|
||||||
* event flags specified by the threads themselves in the
|
|
||||||
* @p event_listener_t 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 event_source_t structure
|
|
||||||
* @param[in] flags the flags set to be added to the listener flags mask
|
|
||||||
*
|
|
||||||
* @iclass
|
|
||||||
*/
|
|
||||||
void chEvtBroadcastFlagsI(event_source_t *esp, eventflags_t flags) {
|
|
||||||
event_listener_t *elp;
|
|
||||||
|
|
||||||
chDbgCheckClassI();
|
|
||||||
chDbgCheck(esp != NULL);
|
|
||||||
|
|
||||||
elp = esp->next;
|
|
||||||
/*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
|
|
||||||
while (elp != (event_listener_t *)esp) {
|
|
||||||
/*lint -restore*/
|
|
||||||
elp->flags |= flags;
|
|
||||||
/* When flags == 0 the thread will always be signaled because the
|
|
||||||
source does not emit any flag.*/
|
|
||||||
if ((flags == (eventflags_t)0) ||
|
|
||||||
((flags & elp->wflags) != (eventflags_t)0)) {
|
|
||||||
chEvtSignalI(elp->listener, elp->events);
|
|
||||||
}
|
|
||||||
elp = elp->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the unmasked 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
|
* @details The flags are returned and the @p event_listener_t flags mask is
|
||||||
|
@ -318,24 +280,6 @@ eventflags_t chEvtGetAndClearFlags(event_listener_t *elp) {
|
||||||
return flags & elp->wflags;
|
return flags & elp->wflags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Adds a set of event flags directly to the specified @p thread_t.
|
|
||||||
*
|
|
||||||
* @param[in] tp the thread to be signaled
|
|
||||||
* @param[in] events the events set to be ORed
|
|
||||||
*
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
void chEvtSignal(thread_t *tp, eventmask_t events) {
|
|
||||||
|
|
||||||
chDbgCheck(tp != NULL);
|
|
||||||
|
|
||||||
chSysLock();
|
|
||||||
chEvtSignalI(tp, events);
|
|
||||||
chSchRescheduleS();
|
|
||||||
chSysUnlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Adds a set of event flags directly to the specified @p thread_t.
|
* @brief Adds a set of event flags directly to the specified @p thread_t.
|
||||||
* @post This function does not reschedule so a call to a rescheduling
|
* @post This function does not reschedule so a call to a rescheduling
|
||||||
|
@ -364,6 +308,62 @@ void chEvtSignalI(thread_t *tp, eventmask_t events) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a set of event flags directly to the specified @p thread_t.
|
||||||
|
*
|
||||||
|
* @param[in] tp the thread to be signaled
|
||||||
|
* @param[in] events the events set to be ORed
|
||||||
|
*
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
void chEvtSignal(thread_t *tp, eventmask_t events) {
|
||||||
|
|
||||||
|
chDbgCheck(tp != NULL);
|
||||||
|
|
||||||
|
chSysLock();
|
||||||
|
chEvtSignalI(tp, events);
|
||||||
|
chSchRescheduleS();
|
||||||
|
chSysUnlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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 event_source_t in addition to the
|
||||||
|
* event flags specified by the threads themselves in the
|
||||||
|
* @p event_listener_t 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 event_source_t structure
|
||||||
|
* @param[in] flags the flags set to be added to the listener flags mask
|
||||||
|
*
|
||||||
|
* @iclass
|
||||||
|
*/
|
||||||
|
void chEvtBroadcastFlagsI(event_source_t *esp, eventflags_t flags) {
|
||||||
|
event_listener_t *elp;
|
||||||
|
|
||||||
|
chDbgCheckClassI();
|
||||||
|
chDbgCheck(esp != NULL);
|
||||||
|
|
||||||
|
elp = esp->next;
|
||||||
|
/*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
|
||||||
|
while (elp != (event_listener_t *)esp) {
|
||||||
|
/*lint -restore*/
|
||||||
|
elp->flags |= flags;
|
||||||
|
/* When flags == 0 the thread will always be signaled because the
|
||||||
|
source does not emit any flag.*/
|
||||||
|
if ((flags == (eventflags_t)0) ||
|
||||||
|
((flags & elp->wflags) != (eventflags_t)0)) {
|
||||||
|
chEvtSignalI(elp->listener, elp->events);
|
||||||
|
}
|
||||||
|
elp = elp->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Signals all the Event Listeners registered on the specified Event
|
* @brief Signals all the Event Listeners registered on the specified Event
|
||||||
* Source.
|
* Source.
|
||||||
|
|
Loading…
Reference in New Issue