Commit 2236e99e by Michael Schmid

mutex pointer

parent 5c422de0
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment