git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7378 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
db0b899f5f
commit
e55acb6b05
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue