diff options
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;
}
/**
|