aboutsummaryrefslogtreecommitdiffstats
path: root/src/gos/gos_cmsis.c
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@seriouslyembedded.com>2015-10-25 22:10:00 +0100
committerJoel Bodenmann <joel@seriouslyembedded.com>2015-10-25 22:10:00 +0100
commitccd83187fa1d762550be55bd4e582573169f97b1 (patch)
treed9d360f8238f4b9ff1a404716104dd0d7aa76a42 /src/gos/gos_cmsis.c
parent96a912bbc0559924dfc89bfb3e57f4e109392c9d (diff)
downloaduGFX-ccd83187fa1d762550be55bd4e582573169f97b1.tar.gz
uGFX-ccd83187fa1d762550be55bd4e582573169f97b1.tar.bz2
uGFX-ccd83187fa1d762550be55bd4e582573169f97b1.zip
Fixing Mutex and Semaphores for CMSIS RTOS
Diffstat (limited to 'src/gos/gos_cmsis.c')
-rw-r--r--src/gos/gos_cmsis.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gos/gos_cmsis.c b/src/gos/gos_cmsis.c
index 26a3f7f0..ad32d16d 100644
--- a/src/gos/gos_cmsis.c
+++ b/src/gos/gos_cmsis.c
@@ -32,14 +32,20 @@ void _gosDeinit(void)
void gfxMutexInit(gfxMutex* pmutex)
{
- pmutex->id = osMutexCreate(&(pmutex->def));
+ osMutexDef_t def;
+ def.mutex = pmutex->mutex;
+
+ pmutex->id = osMutexCreate(&def);
}
void gfxSemInit(gfxSem* psem, semcount_t val, semcount_t limit)
{
- psem->id = osSemaphoreCreate(&(psem->def), limit);
- while(val--)
- osSemaphoreRelease(psem->id);
+ osSemaphoreDef_t def;
+ def.semaphore = psem->semaphore;
+
+ (void)limit;
+
+ psem->id = osSemaphoreCreate(&def, val);
}
void gfxSemDestroy(gfxSem* psem)