From 8920d3403cf0fdde0e17a902ca5c137876e2fce1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 7 Oct 2014 12:53:22 +0000 Subject: Added messages to CMSIS RTOS, added demo for the STM32F407. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7383 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/ports/ARMCMx/cmsis_os/cmsis_os.c | 9 +++++---- os/rt/ports/ARMCMx/cmsis_os/cmsis_os.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'os') diff --git a/os/rt/ports/ARMCMx/cmsis_os/cmsis_os.c b/os/rt/ports/ARMCMx/cmsis_os/cmsis_os.c index 3bcb727b4..345312add 100644 --- a/os/rt/ports/ARMCMx/cmsis_os/cmsis_os.c +++ b/os/rt/ports/ARMCMx/cmsis_os/cmsis_os.c @@ -63,13 +63,14 @@ static struct os_timer_cb timers[CMSIS_CFG_NUM_TIMERS]; /** * @brief Virtual timers common callback. */ -static void timer_cb(void *arg) { +static void timer_cb(void const *arg) { osTimerId timer_id = (osTimerId)arg; timer_id->ptimer(timer_id->argument); if (timer_id->type == osTimerPeriodic) { chSysLockFromISR(); - chVTDoSetI(&timer_id->vt, timer_id->millisec, timer_cb, timer_id); + chVTDoSetI(&timer_id->vt, timer_id->millisec, + (vtfunc_t)timer_cb, timer_id); chSysUnlockFromISR(); } } @@ -112,7 +113,7 @@ osStatus osKernelStart(void) { /** * @brief Creates a thread. */ -osThreadId osThreadCreate(osThreadDef_t *thread_def, void *argument) { +osThreadId osThreadCreate(const osThreadDef_t *thread_def, void *argument) { size_t size; size = thread_def->stacksize == 0 ? CMSIS_CFG_DEFAULT_STACK : @@ -228,7 +229,7 @@ osStatus osTimerStart(osTimerId timer_id, uint32_t millisec) { return osErrorValue; timer_id->millisec = millisec; - chVTSet(&timer_id->vt, millisec, timer_cb, timer_id); + chVTSet(&timer_id->vt, millisec, (vtfunc_t)timer_cb, timer_id); 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 d248c3164..95114e7fb 100644 --- a/os/rt/ports/ARMCMx/cmsis_os/cmsis_os.h +++ b/os/rt/ports/ARMCMx/cmsis_os/cmsis_os.h @@ -423,7 +423,7 @@ extern "C" { #endif osStatus osKernelInitialize(void); osStatus osKernelStart(void); - osThreadId osThreadCreate(osThreadDef_t *thread_def, void *argument); + osThreadId osThreadCreate(const osThreadDef_t *thread_def, void *argument); osStatus osThreadTerminate(osThreadId thread_id); osStatus osThreadSetPriority(osThreadId thread_id, osPriority newprio); /*osEvent osWait(uint32_t millisec);*/ -- cgit v1.2.3