From 7dae784676f600f421e59211697977224165c466 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 1 Jan 2013 09:37:24 +0000 Subject: [PATCH] Fixes to the CPP wrapper. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5006 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/various/ch.cpp | 17 +++++++++++------ os/various/ch.hpp | 19 ++++++++++++++++--- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/os/various/ch.cpp b/os/various/ch.cpp index fb4624e95..8b1f66da9 100644 --- a/os/various/ch.cpp +++ b/os/various/ch.cpp @@ -280,19 +280,24 @@ namespace chibios_rt { chEvtUnregister(&event, elp); } - void Event::Broadcast(void) { + void Event::BroadcastFlags(flagsmask_t flags) { - chEvtBroadcast(&event); + chEvtBroadcastFlags(&event, flags); } - eventmask_t Event::ClearFlags(eventmask_t mask) { + flagsmask_t GetAndClearFlags(EventListener *elp) { - return chEvtClearFlags(mask); + return chEvtGetAndClearFlags(elp); } - eventmask_t Event::AddFlags(eventmask_t mask) { + eventmask_t Event::GetAndClearEvents(eventmask_t mask) { - return chEvtAddFlags(mask); + return chEvtGetAndClearEvents(mask); + } + + eventmask_t Event::AddEvents(eventmask_t mask) { + + return chEvtAddEvents(mask); } void Event::Dispatch(const evhandler_t handlers[], eventmask_t mask) { diff --git a/os/various/ch.hpp b/os/various/ch.hpp index a7e645407..f58bd4e8c 100644 --- a/os/various/ch.hpp +++ b/os/various/ch.hpp @@ -509,8 +509,21 @@ namespace chibios_rt { /** * @brief Broadcasts an event. * @details All the listeners registered on the event source are signaled. + * + * @param[in] flags the flags set to be added to the listener + * flags mask */ - void Broadcast(void); + void BroadcastFlags(flagsmask_t flags); + + /** + * @brief Clears specified events from the pending events mask. + * + * @param[in] elp pointer to the @p EventListener structure + * @param[in] flags the events to be cleared + * @return The flags added to the listener by the + * associated event source. + */ + static flagsmask_t GetAndClearFlags(EventListener *elp); /** * @brief Clears specified events from the pending events mask. @@ -518,7 +531,7 @@ namespace chibios_rt { * @param[in] mask the events to be cleared * @return The pending events that were cleared. */ - static eventmask_t ClearFlags(eventmask_t mask); + static eventmask_t GetAndClearEvents(eventmask_t mask); /** * @brief Makes an events mask pending in the current thread. @@ -527,7 +540,7 @@ namespace chibios_rt { * @param[in] mask the events to be pended * @return The current pending events mask. */ - static eventmask_t AddFlags(eventmask_t mask); + static eventmask_t AddEvents(eventmask_t mask); /** * @brief Invokes the event handlers associated with a mask.