14#include "freertos/FreeRTOS.h"
15#include "freertos/semphr.h"
28 ESP_LOGE(
"Esp32TmcMutex",
"Failed to create mutex");
71 if (xSemaphoreTake(handle, portMAX_DELAY) == pdTRUE) {
88 xSemaphoreGive(handle);
ESP32 FreeRTOS mutex wrapper for TMC51x0 driver.
Definition esp32_tmc_mutex.hpp:24
~Esp32TmcMutex() noexcept
Definition esp32_tmc_mutex.hpp:32
Esp32TmcMutex(const Esp32TmcMutex &)=delete
SemaphoreHandle_t native_handle() const noexcept
Get native FreeRTOS semaphore handle.
Definition esp32_tmc_mutex.hpp:46
Esp32TmcMutex() noexcept
Definition esp32_tmc_mutex.hpp:26
bool is_valid() const noexcept
Check if mutex is valid.
Definition esp32_tmc_mutex.hpp:51
Esp32TmcMutex & operator=(const Esp32TmcMutex &)=delete
SemaphoreHandle_t handle_
Definition esp32_tmc_mutex.hpp:54
RAII mutex guard for automatic lock/unlock.
Definition esp32_tmc_mutex.hpp:63
TmcMutexGuard(Esp32TmcMutex &mutex) noexcept
Lock mutex (blocks until acquired)
Definition esp32_tmc_mutex.hpp:68
Esp32TmcMutex & mutex_
Definition esp32_tmc_mutex.hpp:99
bool locked_
Definition esp32_tmc_mutex.hpp:100
~TmcMutexGuard() noexcept
Unlock mutex (automatically called on destruction)
Definition esp32_tmc_mutex.hpp:80
bool is_locked() const noexcept
Check if mutex is currently locked by this guard.
Definition esp32_tmc_mutex.hpp:96
void unlock() noexcept
Manually unlock mutex.
Definition esp32_tmc_mutex.hpp:85