Sync MK3<->MK4 MMU2 log

This commit is contained in:
D.R.racer 2023-09-11 10:58:42 +02:00 committed by DRracer
parent fd9f4ffb9e
commit eb7a73e748
1 changed files with 22 additions and 13 deletions

View File

@ -1,7 +1,7 @@
#pragma once
#ifndef UNITTEST
#include "Marlin.h"
#ifdef __AVR__
#include <avr/pgmspace.h>
#endif
// Beware - before changing this prefix, think twice
// you'd need to change appmain.cpp app_marlin_serial_output_write_hook
@ -14,16 +14,22 @@ namespace MMU2 {
/// @param msg pointer to a string in PROGMEM
/// On the AVR platform this variant reads the input string from PROGMEM.
/// On the ARM platform it calls LogErrorEvent directly (silently expecting the compiler to optimize it away)
void LogErrorEvent_P(const char *msg);
void LogErrorEvent_P(const char *msg_P);
/// Report the msg into the general logging subsystem (through Marlin's SERIAL_ECHO stuff)
/// @param msg pointer to a string in PROGMEM
/// On the AVR platform this variant reads the input string from PROGMEM.
/// On the ARM platform it calls LogErrorEvent directly (silently expecting the compiler to optimize it away)
void LogEchoEvent_P(const char *msg);
void LogEchoEvent_P(const char *msg_P);
} // namespace
} // namespace MMU2
#ifndef UNITTEST
#ifdef __AVR__
#include "Marlin.h"
#else
#include "../../core/serial.h"
#endif
#define SERIAL_MMU2() \
{ serialprintPGM(mmu2Magic); }
@ -50,10 +56,13 @@ void LogEchoEvent_P(const char *msg);
#define MMU2_ERROR_MSG(S) MMU2_ECHO_MSG(S) //!@todo Decide MMU errors on serial line
#else // #ifndef UNITTEST
#define MMU2_ECHO_MSGLN(S) /* */
#define MMU2_ERROR_MSGLN(S) /* */
#define MMU2_ECHO_MSGRPGM(S) /* */
#define MMU2_ERROR_MSGRPGM(S) /* */
#include "stubs/stub_interfaces.h"
#define MMU2_ECHO_MSGLN(S) marlinLogSim.AppendLine(S)
#define MMU2_ERROR_MSGLN(S) marlinLogSim.AppendLine(S)
#define MMU2_ECHO_MSGRPGM(S) /*marlinLogSim.AppendLine(S)*/
#define MMU2_ERROR_MSGRPGM(S) /*marlinLogSim.AppendLine(S)*/
#define SERIAL_ECHOLNPGM(S) /*marlinLogSim.AppendLine(S)*/
#define SERIAL_ECHOPGM(S) /* */
#define SERIAL_ECHOLN(S) /*marlinLogSim.AppendLine(S)*/
#endif // #ifndef UNITTEST