From dc5964f59f591bffdbe875cea33b419000cd3568 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 16 Feb 2016 10:32:43 +0000 Subject: RT4 and NIL2 merged. All demos and test applications to be updated. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8901 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/osal/nil/osal.c | 4 ++-- os/hal/osal/nil/osal.h | 24 +++++++++++++----------- 2 files changed, 15 insertions(+), 13 deletions(-) (limited to 'os/hal') diff --git a/os/hal/osal/nil/osal.c b/os/hal/osal/nil/osal.c index f1d8c5e2a..e33747149 100644 --- a/os/hal/osal/nil/osal.c +++ b/os/hal/osal/nil/osal.c @@ -73,7 +73,7 @@ void osalThreadDequeueNextI(threads_queue_t *tqp, msg_t msg) { } tp++; - chDbgAssert(tp < &nil.threads[NIL_CFG_NUM_THREADS], + chDbgAssert(tp < &nil.threads[CH_CFG_NUM_THREADS], "pointer out of range"); } } @@ -97,7 +97,7 @@ void osalThreadDequeueAllI(threads_queue_t *tqp, msg_t msg) { tp = nil.threads; while (cnt < (cnt_t)0) { - chDbgAssert(tp < &nil.threads[NIL_CFG_NUM_THREADS], + chDbgAssert(tp < &nil.threads[CH_CFG_NUM_THREADS], "pointer out of range"); /* Is this thread waiting on this semaphore?*/ diff --git a/os/hal/osal/nil/osal.h b/os/hal/osal/nil/osal.h index aac0d5e77..34249e74f 100644 --- a/os/hal/osal/nil/osal.h +++ b/os/hal/osal/nil/osal.h @@ -29,7 +29,7 @@ #include #include -#include "nil.h" +#include "ch.h" #if defined(__SPC5_HAL__) #include "platform.h" @@ -92,17 +92,17 @@ /** * @brief Size in bits of the @p systick_t type. */ -#define OSAL_ST_RESOLUTION NIL_CFG_ST_RESOLUTION +#define OSAL_ST_RESOLUTION CH_CFG_ST_RESOLUTION /** * @brief Required systick frequency or resolution. */ -#define OSAL_ST_FREQUENCY NIL_CFG_ST_FREQUENCY +#define OSAL_ST_FREQUENCY CH_CFG_ST_FREQUENCY /** * @brief Systick mode required by the underlying OS. */ -#if (NIL_CFG_ST_TIMEDELTA == 0) || defined(__DOXYGEN__) +#if (CH_CFG_ST_TIMEDELTA == 0) || defined(__DOXYGEN__) #define OSAL_ST_MODE OSAL_ST_MODE_PERIODIC #else #define OSAL_ST_MODE OSAL_ST_MODE_FREERUNNING @@ -117,8 +117,12 @@ /* Derived constants and error checks. */ /*===========================================================================*/ -#if NIL_CFG_USE_EVENTS == FALSE -#error "OSAL requires NIL_CFG_USE_EVENTS=TRUE" +#if CH_CFG_USE_SEMAPHORES == FALSE +#error "OSAL requires CH_CFG_USE_SEMAPHORES=TRUE" +#endif + +#if CH_CFG_USE_EVENTS == FALSE +#error "OSAL requires CH_CFG_USE_EVENTS=TRUE" #endif #if !(OSAL_ST_MODE == OSAL_ST_MODE_NONE) && \ @@ -258,19 +262,17 @@ typedef struct { * * @api */ -#define osalDbgCheck(c) chDbgAssert(c, "parameter check") +#define osalDbgCheck(c) chDbgCheck(c) /** * @brief I-Class state check. - * @note Not implemented in this simplified OSAL. */ -#define osalDbgCheckClassI() /*chDbgCheckClassI()*/ +#define osalDbgCheckClassI() chDbgCheckClassI() /** * @brief S-Class state check. - * @note Not implemented in this simplified OSAL. */ -#define osalDbgCheckClassS() /*chDbgCheckClassS()*/ +#define osalDbgCheckClassS() chDbgCheckClassS() /** @} */ /** -- cgit v1.2.3