From 2236e99eed34b48ab9963b181d2b05cc16c9a98d Mon Sep 17 00:00:00 2001 From: Michael Schmid Date: Wed, 8 Feb 2017 10:46:46 +0100 Subject: [PATCH] mutex pointer --- base_c/src/mutex.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base_c/src/mutex.c b/base_c/src/mutex.c index a376590..3471d9c 100644 --- a/base_c/src/mutex.c +++ b/base_c/src/mutex.c @@ -167,7 +167,7 @@ int embb_mutex_init(embb_mutex_t* mutex, int type) { } else { assert(type == EMBB_MUTEX_RECURSIVE);*/ - mutex = xSemaphoreCreateRecursiveMutex(); + *mutex = xSemaphoreCreateRecursiveMutex(); /*}*/ EMBB_UNUSED(type); @@ -183,7 +183,7 @@ int embb_mutex_lock(embb_mutex_t* mutex) { if (NULL == mutex) { return EMBB_ERROR; } - int result = xSemaphoreTakeRecursive(mutex, portMAX_DELAY); + int result = xSemaphoreTakeRecursive(*mutex, portMAX_DELAY); if (result != 1) return EMBB_ERROR; return EMBB_SUCCESS; } @@ -193,7 +193,7 @@ int embb_mutex_try_lock(embb_mutex_t* mutex) { return EMBB_ERROR; } - int result = xSemaphoreTakeRecursive(mutex, 0); + int result = xSemaphoreTakeRecursive(*mutex, 0); if (result != 1) return EMBB_ERROR; return EMBB_SUCCESS; } @@ -202,7 +202,7 @@ int embb_mutex_unlock(embb_mutex_t* mutex) { if (NULL == mutex) { return EMBB_ERROR; } - int result = xSemaphoreGiveRecursive(mutex); + int result = xSemaphoreGiveRecursive(*mutex); if(result != 1) return EMBB_ERROR; return EMBB_SUCCESS; } -- libgit2 0.26.0