From 462ab6bcaffc7ee98c418f17abab1178beb83db1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 2 Jan 2013 08:32:03 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5010 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/various/ch.cpp | 5 +++++ os/various/ch.hpp | 28 ++++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/os/various/ch.cpp b/os/various/ch.cpp index 3bd3d6234..84678349c 100644 --- a/os/various/ch.cpp +++ b/os/various/ch.cpp @@ -347,6 +347,11 @@ namespace chibios_rt { chEvtBroadcastFlags(&event, flags); } + void Event::broadcastFlagsI(flagsmask_t flags) { + + chEvtBroadcastFlagsI(&event, flags); + } + flagsmask_t Event::getAndClearFlags(EventListener *elp) { return chEvtGetAndClearFlags(elp); diff --git a/os/various/ch.hpp b/os/various/ch.hpp index 8ede5cac2..ad3dd18af 100644 --- a/os/various/ch.hpp +++ b/os/various/ch.hpp @@ -147,7 +147,9 @@ namespace chibios_rt { * * @api */ - ThreadReference(Thread * tp); + ThreadReference(Thread * tp) : thread_ref(tp) { + + }; /** * @brief Suspends the current thread on the reference. @@ -238,7 +240,7 @@ namespace chibios_rt { * @brief Abstract base class for a ChibiOS/RT thread. * @details The thread body is the virtual function @p Main(). */ - class BaseThread : ThreadReference{ + class BaseThread : public ThreadReference { public: /** @@ -255,7 +257,9 @@ namespace chibios_rt { * * @api */ - virtual msg_t Main(void); + virtual msg_t Main(void) { + return 0; + }; /** * @brief Creates and starts a system thread. @@ -268,7 +272,11 @@ namespace chibios_rt { * * @api */ - virtual bool start(const char *tname, tprio_t prio); + virtual bool start(const char *tname, tprio_t prio){ + (void) tname; + (void) prio; + return false; + }; /** * @brief Thread exit. @@ -409,6 +417,7 @@ namespace chibios_rt { * @api */ bool start(const char *tname, tprio_t prio) { + (void)tname; msg_t _thd_start(void *arg); thread_ref = chThdCreateStatic(wa, sizeof(wa), prio, _thd_start, this); @@ -689,6 +698,17 @@ namespace chibios_rt { */ void broadcastFlags(flagsmask_t flags); + /** + * @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 + * + * @api + */ + void broadcastFlagsI(flagsmask_t flags); + /** * @brief Clears specified events from the pending events mask. *