|
HardFOC Core
API 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. | |
|
inlinenoexcept |
RTOS-aware millisecond delay.
On ESP-IDF / FreeRTOS, yields via the scheduler so TLE/MAX reset settle times (datasheet ≥10 ms) are real wall time — not a short volatile busy-wait that was ~3×–10× too short at 200–240 MHz.
A non-zero ms always sleeps at least one tick, the rule os_convert_msec_to_delay_ticks() in hf-utils-rtos-wrap follows: below 1 kHz pdMS_TO_TICKS() rounds a short delay down to 0 ticks, which would only yield. HardFOC runs FreeRTOS at 1 kHz, where 1 ms is 1 tick.
| ms | Delay duration in milliseconds. |
|
inlinenoexcept |
Microsecond delay with automatic fallback to RTOS delay for large values.
For delays >= 1 ms, delegates to DelayMs (scheduler / HAL), rounded up to whole milliseconds so a datasheet minimum such as 2.5 ms is not cut to 2 ms. Shorter delays use esp_rom_delay_us on ESP-IDF or a denser busy-wait elsewhere so SPI CS setup / inter-frame gaps are not no-ops.
| us | Delay duration in microseconds. |
|
inlinenoexcept |
Route a driver log message to the Logger singleton.
Maps integer log levels to Logger methods:
| level | Integer log level from the driver callback. |
| tag | Logging tag (null-terminated string). |
| format | printf-style format string. |
| args | Variadic argument list matching format. |