From 5494f2394286a9b177a09da02e5957e3efdf8b8a Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Thu, 6 Jun 2019 14:25:06 +0200 Subject: [PATCH] M0/M1/M117 fix: Add new CUSTOM_MSG states. When the printer prints from a SD card, the display of progress messages and filename takes precedence over CUSTOM_MSG_TYPE_STATUS messages used by M0/M1/M117. Let's introduce two new CUSTOM_MSG states, one that overrides the SD status while waiting in M0/M1 (M0WAIT) and one that ensures the message will be displayed in at least one screen update (MSGUPD). --- Firmware/ultralcd.cpp | 3 +++ Firmware/ultralcd.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 3b2be088a..5d23acf64 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -794,7 +794,10 @@ void lcdui_print_status_line(void) { // Otherwise check for other special events switch (custom_message_type) { + case CUSTOM_MSG_TYPE_MSGUPD: + custom_message_type = CUSTOM_MSG_TYPE_STATUS; case CUSTOM_MSG_TYPE_STATUS: // Nothing special, print status message normally + case CUSTOM_MSG_TYPE_M0WAIT: lcd_print(lcd_status_message); break; case CUSTOM_MSG_TYPE_MESHBL: // If mesh bed leveling in progress, show the status diff --git a/Firmware/ultralcd.h b/Firmware/ultralcd.h index 665c1233f..27b1c23ae 100644 --- a/Firmware/ultralcd.h +++ b/Firmware/ultralcd.h @@ -106,6 +106,8 @@ extern int8_t FSensorStateMenu; #define CUSTOM_MSG_TYPE_PIDCAL 3 // PID tuning in progress #define CUSTOM_MSG_TYPE_TEMCAL 4 // PINDA temp calibration #define CUSTOM_MSG_TYPE_TEMPRE 5 // Temp compensation preheat +#define CUSTOM_MSG_TYPE_M0WAIT 6 // M0/M1 Wait command working even from SD +#define CUSTOM_MSG_TYPE_MSGUPD 7 // Short message even while printing from SD extern unsigned int custom_message_type; extern unsigned int custom_message_state;