From 814b642a0ced73a71ceb3b548c2c570e8631dd58 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 18 Apr 2012 16:40:15 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4112 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/ch.h | 34 ++++++++++++++++++++++++++-------- os/kernel/src/chmtx.c | 2 +- 2 files changed, 27 insertions(+), 9 deletions(-) (limited to 'os/kernel') diff --git a/os/kernel/include/ch.h b/os/kernel/include/ch.h index 7386b622b..3696f78b3 100644 --- a/os/kernel/include/ch.h +++ b/os/kernel/include/ch.h @@ -62,25 +62,43 @@ #define CH_KERNEL_PATCH 0 /** @} */ -/* - * Common values. +/** + * @name Common constants + */ +/** + * @brief Generic 'false' boolean constant. */ -#ifndef FALSE +#if !defined(FALSE) || defined(__DOXYGEN__) #define FALSE 0 #endif -#ifndef TRUE + +/** + * @brief Generic 'true' boolean constant. + */ +#if !defined(TRUE) || defined(__DOXYGEN__) #define TRUE (!FALSE) #endif -/* - * Human readable boolean error conditions. +/** + * @brief Generic success constant. + * @details This constant is functionally equivalent to @p FALSE but more + * readable, it can be used as return value of all those functions + * returning a @p bool_t as a status indicator. */ -#ifndef CH_SUCCESS +#if !defined(CH_SUCCESS) || defined(__DOXYGEN__) #define CH_SUCCESS FALSE #endif -#ifndef CH_FAILED + +/** + * @brief Generic failure constant. + * @details This constant is functionally equivalent to @p TRUE but more + * readable, it can be used as return value of all those functions + * returning a @p bool_t as a status indicator. + */ +#if !defined(CH_FAILED) || defined(__DOXYGEN__) #define CH_FAILED TRUE #endif +/** @} */ #include "chconf.h" #include "chtypes.h" diff --git a/os/kernel/src/chmtx.c b/os/kernel/src/chmtx.c index 20a4700fe..6e32ca439 100644 --- a/os/kernel/src/chmtx.c +++ b/os/kernel/src/chmtx.c @@ -258,7 +258,7 @@ Mutex *chMtxUnlock(void) { chDbgAssert(ctp->p_mtxlist->m_owner == ctp, "chMtxUnlock(), #2", "ownership failure"); - /* Removes the top Mutex from the Thread's owned mutexes list and matk it + /* Removes the top Mutex from the Thread's owned mutexes list and marks it as not owned.*/ ump = ctp->p_mtxlist; ctp->p_mtxlist = ump->m_next; -- cgit v1.2.3