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.

47 lines
753 B

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