mmu2_log.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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) MMU2_ECHO_MSG(S) //!@todo Decide MMU2 errors on serial line
  19. #define MMU2_ECHO_MSGRPGM(S) do{ SERIAL_ECHO_START; SERIAL_MMU2(); SERIAL_ECHORPGM(S); }while(0)
  20. #define MMU2_ERROR_MSGRPGM(S) MMU2_ECHO_MSGRPGM(S) //!@todo Decide MMU2 errors on serial line
  21. #else // #ifndef UNITTEST
  22. #define MMU2_ECHO_MSG(S) /* */
  23. #define MMU2_ERROR_MSG(S) /* */
  24. #define SERIAL_ECHO(S) /* */
  25. #define SERIAL_ECHOLN(S) /* */
  26. #define MMU2_ECHO_MSGRPGM(S) /* */
  27. #define MMU2_ERROR_MSGRPGM(S) /* */
  28. #endif // #ifndef UNITTEST