HF-Core Platform 0.1.0-dev
Hardware-Agnostic Handler Layer & RTOS Utilities for HardFOC
Loading...
Searching...
No Matches
handler_utils Namespace Reference

Functions

void RouteLogToLogger (int level, const char *tag, const char *format, va_list args) noexcept
 Route a driver log message to the Logger singleton.
 
void DelayMs (uint32_t ms) noexcept
 RTOS-aware millisecond delay.
 
void DelayUs (uint32_t us) noexcept
 Microsecond delay with automatic fallback to RTOS delay for large values.
 

Function Documentation

◆ DelayMs()

void handler_utils::DelayMs ( uint32_t ms)
inlinenoexcept

RTOS-aware millisecond delay.

On ESP-IDF, yields to the RTOS scheduler via vTaskDelay. On other platforms, falls back to a busy-wait loop.

Parameters
msDelay duration in milliseconds.
Here is the caller graph for this function:

◆ DelayUs()

void handler_utils::DelayUs ( uint32_t us)
inlinenoexcept

Microsecond delay with automatic fallback to RTOS delay for large values.

For delays >= 1 ms, delegates to an RTOS task delay to avoid blocking the CPU. For shorter delays, uses a hardware microsecond delay on ESP-IDF or a busy-wait loop on other platforms.

Parameters
usDelay duration in microseconds.
Here is the caller graph for this function:

◆ RouteLogToLogger()

void handler_utils::RouteLogToLogger ( int level,
const char * tag,
const char * format,
va_list args )
inlinenoexcept

Route a driver log message to the Logger singleton.

Maps integer log levels to Logger methods:

  • 0 → Error
  • 1 → Warn
  • 2 → Info
  • 3+ → Debug
Parameters
levelInteger log level from the driver callback.
tagLogging tag (null-terminated string).
formatprintf-style format string.
argsVariadic argument list matching format.
Here is the call graph for this function:
Here is the caller graph for this function: