Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
698 B

  1. /*
  2. DEBUG MODULE
  3. */
  4. #pragma once
  5. #include <pgmspace.h>
  6. extern "C" {
  7. void custom_crash_callback(struct rst_info*, uint32_t, uint32_t);
  8. }
  9. class PrintRaw;
  10. class PrintHex;
  11. enum class DebugLogMode : int {
  12. Disabled = 0,
  13. Enabled = 1,
  14. SkipBoot = 2
  15. };
  16. bool debugLogBuffer();
  17. void debugWebSetup();
  18. void debugConfigure();
  19. void debugConfigueBoot();
  20. void debugSetup();
  21. void debugSend(const char* format, ...);
  22. void debugSend_P(PGM_P format, ...); // PGM_P is `const char*`
  23. #if DEBUG_SUPPORT
  24. #define DEBUG_MSG(...) debugSend(__VA_ARGS__)
  25. #define DEBUG_MSG_P(...) debugSend_P(__VA_ARGS__)
  26. #endif
  27. #ifndef DEBUG_MSG
  28. #define DEBUG_MSG(...)
  29. #define DEBUG_MSG_P(...)
  30. #endif