22#if defined(ESP_PLATFORM)
23#include "esp_rom_sys.h"
24#include "freertos/FreeRTOS.h"
25#include "freertos/task.h"
45 const char* format, va_list args)
noexcept {
47 vsnprintf(buf,
sizeof(buf), format, args);
50 case 0: log.Error(tag,
"%s", buf);
break;
51 case 1: log.Warn(tag,
"%s", buf);
break;
52 case 2: log.Info(tag,
"%s", buf);
break;
53 default: log.Debug(tag,
"%s", buf);
break;
65inline void DelayMs(uint32_t ms)
noexcept {
66#if defined(ESP_PLATFORM)
67 vTaskDelay(pdMS_TO_TICKS(ms));
69 volatile uint32_t count = ms * 10000;
70 while (count--) { __asm__
volatile(
""); }
83inline void DelayUs(uint32_t us)
noexcept {
84#if defined(ESP_PLATFORM)
86 vTaskDelay(pdMS_TO_TICKS(us / 1000));
91 volatile uint32_t count = us * 10;
92 while (count--) { __asm__
volatile(
""); }
Advanced logging system with formatting capabilities.
static Logger & GetInstance() noexcept
Get singleton instance.
Definition Logger.cpp:61
Definition HandlerCommon.h:28
void RouteLogToLogger(int level, const char *tag, const char *format, va_list args) noexcept
Route a driver log message to the Logger singleton.
Definition HandlerCommon.h:44
void DelayUs(uint32_t us) noexcept
Microsecond delay with automatic fallback to RTOS delay for large values.
Definition HandlerCommon.h:83
void DelayMs(uint32_t ms) noexcept
RTOS-aware millisecond delay.
Definition HandlerCommon.h:65