mmu2_log.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #ifndef UNITTEST
  3. #include "Marlin.h"
  4. // Beware - before changing this prefix, think twice
  5. // you'd need to change appmain.cpp app_marlin_serial_output_write_hook
  6. // and MMU2::ReportError + MMU2::ReportProgress
  7. static constexpr char mmu2Magic[] PROGMEM = "MMU2:";
  8. namespace MMU2 {
  9. /// Report the msg into the general logging subsystem (through Marlin's SERIAL_ECHO stuff)
  10. /// @param msg pointer to a string in PROGMEM
  11. void LogErrorEvent_P(const char *msg);
  12. /// Report the msg into the general logging subsystem (through Marlin's SERIAL_ECHO stuff)
  13. /// @param msg pointer to a string in PROGMEM
  14. void LogEchoEvent_P(const char *msg);
  15. } // namespace
  16. #define SERIAL_MMU2() { serialprintPGM(mmu2Magic); }
  17. #define MMU2_ECHO_MSG(S) do{ SERIAL_ECHO_START; SERIAL_MMU2(); SERIAL_ECHO(S); }while(0)
  18. #define MMU2_ERROR_MSG(S) do{ SERIAL_ERROR_START; SERIAL_MMU2(); SERIAL_ECHO(S); }while(0)
  19. #else // #ifndef UNITTEST
  20. #define MMU2_ECHO_MSG(S) /* */
  21. #define MMU2_ERROR_MSG(S) /* */
  22. #define SERIAL_ECHO(S) /* */
  23. #define SERIAL_ECHOLN(S) /* */
  24. #endif // #ifndef UNITTEST