From 42a90cc8cebf186c64bbae50a16a90a9979b80f4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 28 Mar 2008 11:39:30 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@251 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/lib/ch.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/lib/ch.hpp') diff --git a/src/lib/ch.hpp b/src/lib/ch.hpp index d9fffc229..177e9bb46 100644 --- a/src/lib/ch.hpp +++ b/src/lib/ch.hpp @@ -146,6 +146,11 @@ namespace chibios_rt { #endif /* CH_USE_SLEEP */ #ifdef CH_USE_MESSAGES + /** + * Sends a message to the thread and returns the answer. + */ + static msg_t SendMessage(::Thread *tp, msg_t msg); + /** * Sends a message to the thread and returns the answer. */ @@ -178,6 +183,25 @@ namespace chibios_rt { virtual msg_t Main(void); }; + /** + * Enhanced threads template class. This class introduces thread names + * and static working area allocation. + */ + template + class EnhancedThread : public BaseThread { + protected: + WorkingArea(wa, N); // Thread working area. + + public: + const char *name; + + EnhancedThread(const char *tname, tprio_t prio, tmode_t mode) : + BaseThread(prio, mode, wa, sizeof wa) { + + name = tname; + } + }; + #ifdef CH_USE_SEMAPHORES /** * Class encapsulating a /p Semaphore. -- cgit v1.2.3