62 #if (CH_CFG_USE_EVENTS == TRUE) || defined(__DOXYGEN__) 106 eventflags_t wflags) {
115 elp->
flags = (eventflags_t)0;
145 if (p->
next == elp) {
165 m =
currp->epending & events;
166 currp->epending &= ~events;
238 if ((flags == (eventflags_t)0) ||
239 ((flags & elp->
wflags) != (eventflags_t)0)) {
262 elp->
flags = (eventflags_t)0;
265 return flags & elp->
wflags;
350 elp->
flags = (eventflags_t)0;
352 return flags & elp->
wflags;
370 while (events != (eventmask_t)0) {
371 if ((events &
EVENT_MASK(eid)) != (eventmask_t)0) {
372 chDbgAssert(handlers[eid] != NULL,
"null handler");
380 #if (CH_CFG_OPTIMIZE_SPEED == TRUE) || \ 381 (CH_CFG_USE_EVENTS_TIMEOUT == FALSE) || \ 405 if (m == (eventmask_t)0) {
410 m ^= m & (m - (eventmask_t)1);
435 if (m == (eventmask_t)0) {
461 if ((ctp->
epending & events) != events) {
472 #if (CH_CFG_USE_EVENTS_TIMEOUT == TRUE) || defined(__DOXYGEN__) 501 if (m == (eventmask_t)0) {
504 return (eventmask_t)0;
509 return (eventmask_t)0;
513 m ^= m & (m - (eventmask_t)1);
544 if (m == (eventmask_t)0) {
547 return (eventmask_t)0;
552 return (eventmask_t)0;
583 if ((ctp->
epending & events) != events) {
586 return (eventmask_t)0;
591 return (eventmask_t)0;
eventmask_t chEvtWaitOne(eventmask_t events)
Waits for exactly one of the specified events.
#define CH_STATE_WTANDEVT
Several events.
void chEvtRegisterMaskWithFlags(event_source_t *esp, event_listener_t *elp, eventmask_t events, eventflags_t wflags)
Registers an Event Listener on an Event Source.
eventmask_t chEvtAddEvents(eventmask_t events)
Adds (OR) a set of events to the current thread, this is much faster than using chEvtBroadcast() or c...
eventmask_t chEvtGetAndClearEventsI(eventmask_t events)
Clears the pending events specified in the events mask.
eventflags_t wflags
Flags that this listener interested in.
uint64_t sysinterval_t
Type of time interval.
eventmask_t epending
Pending events mask.
static void chSysLock(void)
Enters the kernel lock state.
eventmask_t events
Events to be set in the listening thread.
thread_t * chSchReadyI(thread_t *tp)
Inserts a thread in the Ready List placing it behind its peers.
eventflags_t chEvtGetAndClearFlags(event_listener_t *elp)
Returns the flags associated to an event_listener_t.
#define EVENT_MASK(eid)
Returns an event mask from an event identifier.
#define currp
Current thread pointer access macro.
msg_t rdymsg
Thread wakeup code.
static void chSysUnlock(void)
Leaves the kernel lock state.
void chEvtBroadcastFlags(event_source_t *esp, eventflags_t flags)
Signals all the Event Listeners registered on the specified Event Source.
void chEvtSignal(thread_t *tp, eventmask_t events)
Adds a set of event flags directly to the specified thread_t.
void chDbgCheckClassI(void)
I-class functions context check.
void chSchRescheduleS(void)
Performs a reschedule if a higher priority thread is runnable.
thread_t * listener
Thread interested in the event source.
void chEvtUnregister(event_source_t *esp, event_listener_t *elp)
Unregisters an Event Listener from its Event Source.
void chEvtBroadcastFlagsI(event_source_t *esp, eventflags_t flags)
Signals all the Event Listeners registered on the specified Event Source.
event_listener_t * next
First Event Listener registered on the Event Source.
eventmask_t ewmask
Enabled events mask.
void chSchGoSleepS(tstate_t newstate)
Puts the current thread to sleep into the specified state.
static eventmask_t chEvtAddEventsI(eventmask_t events)
Adds (OR) a set of events to the current thread, this is much faster than using chEvtBroadcast() or c...
void chEvtSignalI(thread_t *tp, eventmask_t events)
Adds a set of event flags directly to the specified thread_t.
#define chDbgCheck(c)
Function parameters check.
msg_t chSchGoSleepTimeoutS(tstate_t newstate, sysinterval_t timeout)
Puts the current thread to sleep into the specified state with timeout specification.
Event Listener structure.
#define MSG_OK
Normal wakeup message.
event_listener_t * next
Next Event Listener registered on the event source.
#define chDbgAssert(c, r)
Condition assertion.
eventmask_t chEvtWaitAny(eventmask_t events)
Waits for any of the specified events.
eventmask_t chEvtWaitAllTimeout(eventmask_t events, sysinterval_t timeout)
Waits for all the specified events.
void(* evhandler_t)(eventid_t id)
Event Handler callback function.
tstate_t state
Current thread state.
eventmask_t chEvtWaitAnyTimeout(eventmask_t events, sysinterval_t timeout)
Waits for any of the specified events.
union ch_thread::@0 u
State-specific fields.
eventmask_t chEvtGetAndClearEvents(eventmask_t events)
Clears the pending events specified in the events mask.
#define TIME_IMMEDIATE
Zero interval specification for some functions with a timeout specification.
eventmask_t chEvtWaitAll(eventmask_t events)
Waits for all the specified events.
#define CH_STATE_WTOREVT
One event.
eventflags_t flags
Flags added to the listener by the event source.
eventflags_t chEvtGetAndClearFlagsI(event_listener_t *elp)
Returns the unmasked flags associated to an event_listener_t.
ChibiOS/RT main include file.
void chEvtDispatch(const evhandler_t *handlers, eventmask_t events)
Invokes the event handlers associated to an event flags mask.
eventmask_t chEvtWaitOneTimeout(eventmask_t events, sysinterval_t timeout)
Waits for exactly one of the specified events.
Structure representing a thread.