From 077d372e2ffc959be1f13d23ee14d00a53589b4a Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 23 Jul 2008 10:38:16 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@349 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/chevents.c | 6 +++--- src/chmsg.c | 2 +- src/chserial.c | 12 ++++++------ src/chthreads.c | 2 +- src/include/events.h | 10 ++++++++-- src/lib/evtimer.c | 2 +- 6 files changed, 20 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/chevents.c b/src/chevents.c index 93f28f0ec..87ba7ca95 100644 --- a/src/chevents.c +++ b/src/chevents.c @@ -90,11 +90,11 @@ void chEvtClear(eventmask_t mask) { * Signals all the Event Listeners registered on the specified Event Source. * @param esp pointer to the \p EventSource structure */ -void chEvtSend(EventSource *esp) { +void chEvtBroadcast(EventSource *esp) { chSysLock(); - chEvtSendI(esp); + chEvtBroadcastI(esp); chSchRescheduleS(); chSysUnlock(); @@ -105,7 +105,7 @@ void chEvtSend(EventSource *esp) { * @param esp pointer to the \p EventSource structure * @note This function does not reschedule. */ -void chEvtSendI(EventSource *esp) { +void chEvtBroadcastI(EventSource *esp) { EventListener *elp; elp = esp->es_next; diff --git a/src/chmsg.c b/src/chmsg.c index 8c6fa779f..bcc7117e2 100644 --- a/src/chmsg.c +++ b/src/chmsg.c @@ -83,7 +83,7 @@ msg_t chMsgSendWithEvent(Thread *tp, msg_t msg, EventSource *esp) { #else fifo_insert(currp, &tp->p_msgqueue); #endif - chEvtSendI(esp); + chEvtBroadcastI(esp); currp->p_wtthdp = tp; currp->p_msg = msg; chSchGoSleepS(PRSNDMSG); diff --git a/src/chserial.c b/src/chserial.c index b57dc96a4..f185c91fc 100644 --- a/src/chserial.c +++ b/src/chserial.c @@ -62,7 +62,7 @@ void chFDDIncomingDataI(FullDuplexDriver *sd, uint8_t b) { if (chIQPutI(&sd->sd_iqueue, b) < Q_OK) chFDDAddFlagsI(sd, SD_OVERRUN_ERROR); else - chEvtSendI(&sd->sd_ievent); + chEvtBroadcastI(&sd->sd_ievent); } /** @@ -78,7 +78,7 @@ msg_t chFDDRequestDataI(FullDuplexDriver *sd) { msg_t b = chOQGetI(&sd->sd_oqueue); if (b < Q_OK) - chEvtSendI(&sd->sd_oevent); + chEvtBroadcastI(&sd->sd_oevent); return b; } @@ -91,7 +91,7 @@ msg_t chFDDRequestDataI(FullDuplexDriver *sd) { void chFDDAddFlagsI(FullDuplexDriver *sd, dflags_t mask) { sd->sd_flags |= mask; - chEvtSendI(&sd->sd_sevent); + chEvtBroadcastI(&sd->sd_sevent); } /** @@ -143,7 +143,7 @@ void chHDDIncomingDataI(HalfDuplexDriver *sd, uint8_t b) { if (chHDQPutReceiveI(&sd->sd_queue, b) < Q_OK) chHDDAddFlagsI(sd, SD_OVERRUN_ERROR); else - chEvtSendI(&sd->sd_ievent); + chEvtBroadcastI(&sd->sd_ievent); } /** @@ -159,7 +159,7 @@ msg_t chHDDRequestDataI(HalfDuplexDriver *sd) { msg_t b = chHDQGetTransmitI(&sd->sd_queue); if (b < Q_OK) - chEvtSendI(&sd->sd_oevent); + chEvtBroadcastI(&sd->sd_oevent); return b; } @@ -172,7 +172,7 @@ msg_t chHDDRequestDataI(HalfDuplexDriver *sd) { void chHDDAddFlagsI(HalfDuplexDriver *sd, dflags_t mask) { sd->sd_flags |= mask; - chEvtSendI(&sd->sd_sevent); + chEvtBroadcastI(&sd->sd_sevent); } /** diff --git a/src/chthreads.c b/src/chthreads.c index 990b9bdba..02c2a7044 100644 --- a/src/chthreads.c +++ b/src/chthreads.c @@ -253,7 +253,7 @@ void chThdExit(msg_t msg) { chSchReadyI(list_remove(&currp->p_waiting)); #endif #ifdef CH_USE_EXIT_EVENT - chEvtSendI(&currp->p_exitesource); + chEvtBroadcastI(&currp->p_exitesource); #endif chSchGoSleepS(PREXIT); } diff --git a/src/include/events.h b/src/include/events.h index 30fa50ccb..28134d483 100644 --- a/src/include/events.h +++ b/src/include/events.h @@ -82,8 +82,8 @@ extern "C" { void chEvtRegister(EventSource *esp, EventListener *elp, eventid_t eid); void chEvtUnregister(EventSource *esp, EventListener *elp); void chEvtClear(eventmask_t mask); - void chEvtSend(EventSource *esp); - void chEvtSendI(EventSource *esp); + void chEvtBroadcast(EventSource *esp); + void chEvtBroadcastI(EventSource *esp); eventid_t chEvtWait(eventmask_t ewmask, const evhandler_t handlers[]); #ifdef CH_USE_EVENTS_TIMEOUT @@ -95,6 +95,12 @@ extern "C" { } #endif +/* + * Old function names, deprecated, will be removed in some next release. + */ +#define chEvtSend chEvtBroadcast +#define chEvtSendI chEvtBroadcastI + #endif /* CH_USE_EVENTS */ #endif /* _EVENTS_H_ */ diff --git a/src/lib/evtimer.c b/src/lib/evtimer.c index b273e1fd3..f9bd7449b 100644 --- a/src/lib/evtimer.c +++ b/src/lib/evtimer.c @@ -32,7 +32,7 @@ static void tmrcb(void *p) { EvTimer *etp = p; - chEvtSendI(&etp->et_es); + chEvtBroadcastI(&etp->et_es); chVTSetI(&etp->et_vt, etp->et_interval, tmrcb, etp); } -- cgit v1.2.3