diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-10-06 12:59:27 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-10-06 12:59:27 +0000 |
commit | e55acb6b0517fa4104bb69827366923ab099fabd (patch) | |
tree | 7eb1282d752f968f6d5652fea6933df7c172da5b /os/rt/ports | |
parent | db0b899f5f573e3f55185b96f713e3ecb84c1da5 (diff) | |
download | ChibiOS-e55acb6b0517fa4104bb69827366923ab099fabd.tar.gz ChibiOS-e55acb6b0517fa4104bb69827366923ab099fabd.tar.bz2 ChibiOS-e55acb6b0517fa4104bb69827366923ab099fabd.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7378 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/ports')
-rw-r--r-- | os/rt/ports/ARMCMx/cmsis_os/cmsis_os.c | 18 | ||||
-rw-r--r-- | os/rt/ports/ARMCMx/cmsis_os/cmsis_os.h | 7 |
2 files changed, 15 insertions, 10 deletions
diff --git a/os/rt/ports/ARMCMx/cmsis_os/cmsis_os.c b/os/rt/ports/ARMCMx/cmsis_os/cmsis_os.c index 454a77d1f..f8c8c3311 100644 --- a/os/rt/ports/ARMCMx/cmsis_os/cmsis_os.c +++ b/os/rt/ports/ARMCMx/cmsis_os/cmsis_os.c @@ -35,16 +35,12 @@ /* Module local definitions. */
/*===========================================================================*/
-static memory_pool_t sempool;
-static semaphore_t semaphores[CMSIS_CFG_NUM_SEMAPHORES];
-
-static memory_pool_t timpool;
-static struct os_timer_cb timers[CMSIS_CFG_NUM_TIMERS];
-
/*===========================================================================*/
/* Module exported variables. */
/*===========================================================================*/
+int32_t cmsis_os_started;
+
/*===========================================================================*/
/* Module local types. */
/*===========================================================================*/
@@ -53,6 +49,12 @@ static struct os_timer_cb timers[CMSIS_CFG_NUM_TIMERS]; /* Module local variables. */
/*===========================================================================*/
+static memory_pool_t sempool;
+static semaphore_t semaphores[CMSIS_CFG_NUM_SEMAPHORES];
+
+static memory_pool_t timpool;
+static struct os_timer_cb timers[CMSIS_CFG_NUM_TIMERS];
+
/*===========================================================================*/
/* Module local functions. */
/*===========================================================================*/
@@ -80,6 +82,8 @@ static void timer_cb(void *arg) { */
osStatus osKernelInitialize(void) {
+ cmsis_os_started = 0;
+
chSysInit();
chThdSetPriority(HIGHPRIO);
@@ -97,6 +101,8 @@ osStatus osKernelInitialize(void) { */
osStatus osKernelStart(void) {
+ cmsis_os_started = 1;
+
chThdSetPriority(NORMALPRIO);
return osOK;
diff --git a/os/rt/ports/ARMCMx/cmsis_os/cmsis_os.h b/os/rt/ports/ARMCMx/cmsis_os/cmsis_os.h index 784a04b97..5c15fc3be 100644 --- a/os/rt/ports/ARMCMx/cmsis_os/cmsis_os.h +++ b/os/rt/ports/ARMCMx/cmsis_os/cmsis_os.h @@ -309,6 +309,8 @@ const osTimerDef_t os_timer_def_##name = { \ /* External declarations. */
/*===========================================================================*/
+extern int32_t cmsis_os_started;
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -344,10 +346,7 @@ extern "C" { */
static inline int32_t osKernelRunning(void) {
- if (ch.rlist.r_queue.p_next != NULL)
- return 1;
-
- return 0;
+ return cmsis_os_started;
}
/**
|