diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-03-28 11:39:30 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-03-28 11:39:30 +0000 |
commit | 42a90cc8cebf186c64bbae50a16a90a9979b80f4 (patch) | |
tree | deebba85684cc14dbc44555de36ebcd950f9998a /src/lib/ch.hpp | |
parent | b83cd4a1dc8b3240f821a23c588c8d7d690f70ae (diff) | |
download | ChibiOS-42a90cc8cebf186c64bbae50a16a90a9979b80f4.tar.gz ChibiOS-42a90cc8cebf186c64bbae50a16a90a9979b80f4.tar.bz2 ChibiOS-42a90cc8cebf186c64bbae50a16a90a9979b80f4.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@251 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/lib/ch.hpp')
-rw-r--r-- | src/lib/ch.hpp | 24 |
1 files changed, 24 insertions, 0 deletions
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 @@ -149,6 +149,11 @@ namespace chibios_rt { /**
* 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.
+ */
msg_t SendMessage(msg_t msg);
/**
@@ -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 <int N>
+ 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.
|