21#ifndef LSH_CORE_UTIL_DEBUG_DEBUG_HPP
22#define LSH_CORE_UTIL_DEBUG_DEBUG_HPP
29#include <ArduinoJson.h>
39inline auto FPSTR(
const char *
const progmemString) ->
const __FlashStringHelper *
41 return reinterpret_cast<const __FlashStringHelper *
>(progmemString);
50#define DP VaPrint::print
56#define DPL VaPrint::println
64 CONFIG_DEBUG_SERIAL->begin(constants::debugConfigs::DEBUG_SERIAL_BAUD);
77template <
typename T>
__attribute__((always_inline))
constexpr inline void DPJ(
const T &json)
79 serializeJson(json, *CONFIG_DEBUG_SERIAL);
87[[maybe_unused]]
static void DFM()
97#define DP_CONTEXT() DPL(__PRETTY_FUNCTION__)
Defines build-time configurable parameters for the controller-to-bridge serial link.
Defines constants, strings, and configuration parameters used for debugging.
auto FPSTR(const char *const progmemString) -> const __FlashStringHelper *
Helper to cast a PROGMEM string to const __FlashStringHelper *, needed to print PROGMEM strings.
Definition debug.hpp:39
void NDSB()
Lazily initialize the debug serial port in non-debug builds.
Definition debug.cpp:33
bool serialIsActive
Tracks whether the fallback debug serial port was already initialized in non-debug builds.
Definition debug.cpp:25
auto freeMemory() -> size_t
Estimate the amount of free SRAM currently available on the MCU.
Definition memory.cpp:71
Declares functions to check for free memory on AVR devices.
__attribute__((noinline)) inline void deviceReset()
Performs a hardware reset using the watchdog timer.
Definition reset.hpp:36
Internal bridge that imports static profile resources into the library's scope.
Declares a variadic print utility for streamlined debugging output.