diff --git a/libraries/BLE/src/FreeRTOS.cpp b/libraries/BLE/src/FreeRTOS.cpp index 2f52b99d..7539e252 100644 --- a/libraries/BLE/src/FreeRTOS.cpp +++ b/libraries/BLE/src/FreeRTOS.cpp @@ -193,8 +193,8 @@ bool FreeRTOS::Semaphore::take(std::string owner) { } else { rc = ::xSemaphoreTake(m_semaphore, portMAX_DELAY) == pdTRUE; } - m_owner = owner; if (rc) { + m_owner = owner; log_v("Semaphore taken: %s", toString().c_str()); } else { log_e("Semaphore NOT taken: %s", toString().c_str()); @@ -218,8 +218,8 @@ bool FreeRTOS::Semaphore::take(uint32_t timeoutMs, std::string owner) { } else { rc = ::xSemaphoreTake(m_semaphore, timeoutMs / portTICK_PERIOD_MS) == pdTRUE; } - m_owner = owner; if (rc) { + m_owner = owner; log_v("Semaphore taken: %s", toString().c_str()); } else { log_e("Semaphore NOT taken: %s", toString().c_str());