diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2015-07-11 15:58:50 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2015-07-11 15:58:50 +0000 |
commit | 7cdde62864b4b1360129a096f9fcb61c27155184 (patch) | |
tree | 4f87cebcb26b1ac4316abd1c036e365d04d9b744 /os/rt | |
parent | 47d047ed996b0ab430076a72288dd991f08ae06c (diff) | |
download | ChibiOS-7cdde62864b4b1360129a096f9fcb61c27155184.tar.gz ChibiOS-7cdde62864b4b1360129a096f9fcb61c27155184.tar.bz2 ChibiOS-7cdde62864b4b1360129a096f9fcb61c27155184.zip |
Fixed bug #614.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8081 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt')
-rw-r--r-- | os/rt/include/chregistry.h | 48 | ||||
-rw-r--r-- | os/rt/src/chsys.c | 4 |
2 files changed, 26 insertions, 26 deletions
diff --git a/os/rt/include/chregistry.h b/os/rt/include/chregistry.h index cfec32eeb..a5d13b798 100644 --- a/os/rt/include/chregistry.h +++ b/os/rt/include/chregistry.h @@ -77,26 +77,6 @@ typedef struct { /*===========================================================================*/
/**
- * @name Macro Functions
- * @{
- */
-/**
- * @brief Sets the current thread name.
- * @pre This function only stores the pointer to the name if the option
- * @p CH_CFG_USE_REGISTRY is enabled else no action is performed.
- *
- * @param[in] p thread name as a zero terminated string
- *
- * @api
- */
-#define chRegSetThreadName(p) (ch.rlist.r_current->p_name = (p))
-/** @} */
-#else /* !CH_CFG_USE_REGISTRY */
-#define chRegSetThreadName(p)
-#endif /* !CH_CFG_USE_REGISTRY */
-
-#if (CH_CFG_USE_REGISTRY == TRUE) || defined(__DOXYGEN__)
-/**
* @brief Removes a thread from the registry list.
* @note This macro is not meant for use in application code.
*
@@ -134,11 +114,31 @@ extern "C" { }
#endif
+#endif /* CH_CFG_USE_REGISTRY == TRUE */
+
/*===========================================================================*/
/* Module inline functions. */
/*===========================================================================*/
/**
+ * @brief Sets the current thread name.
+ * @pre This function only stores the pointer to the name if the option
+ * @p CH_CFG_USE_REGISTRY is enabled else no action is performed.
+ *
+ * @param[in] name thread name as a zero terminated string
+ *
+ * @api
+ */
+static inline void chRegSetThreadName(const char *name) {
+
+#if CH_CFG_USE_REGISTRY == TRUE
+ ch.rlist.r_current->p_name = name;
+#else
+ (void)name;
+#endif
+}
+
+/**
* @brief Returns the name of the specified thread.
* @pre This function only returns the pointer to the name if the option
* @p CH_CFG_USE_REGISTRY is enabled else @p NULL is returned.
@@ -161,12 +161,11 @@ static inline const char *chRegGetThreadNameX(thread_t *tp) { /**
* @brief Changes the name of the specified thread.
- * @pre This function only sets the name if the option
- * @p CH_CFG_USE_REGISTRY is enabled else it does
- * nothing.
+ * @pre This function only stores the pointer to the name if the option
+ * @p CH_CFG_USE_REGISTRY is enabled else no action is performed.
*
* @param[in] tp pointer to the thread
- * @param[in] name name to be set
+ * @param[in] name thread name as a zero terminated string
*
* @xclass
*/
@@ -179,7 +178,6 @@ static inline void chRegSetThreadNameX(thread_t *tp, const char *name) { (void)name;
#endif
}
-#endif /* CH_CFG_USE_REGISTRY == TRUE */
#endif /* _CHREGISTRY_H_ */
diff --git a/os/rt/src/chsys.c b/os/rt/src/chsys.c index a76fb7c65..7e0a6c806 100644 --- a/os/rt/src/chsys.c +++ b/os/rt/src/chsys.c @@ -130,9 +130,11 @@ void chSysInit(void) { #endif
chSysEnable();
+#if CH_CFG_USE_REGISTRY == TRUE
/* Note, &ch_debug points to the string "main" if the registry is
- active, else the parameter is ignored.*/
+ active.*/
chRegSetThreadName((const char *)&ch_debug);
+#endif
#if CH_CFG_NO_IDLE_THREAD == FALSE
{
|