From 466a6a8fc373d73db68b3c6ab6997e151fe3d19a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 18 Mar 2023 16:33:13 +0000 Subject: [PATCH] Add M600 into PROGMEM Change in memory: Flash: -10 bytes SRAM: 0 bytes --- Firmware/Filament_sensor.cpp | 4 ++-- Firmware/messages.cpp | 5 +++-- Firmware/messages.h | 5 +++-- Firmware/mmu2.cpp | 2 +- Firmware/ultralcd.cpp | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Firmware/Filament_sensor.cpp b/Firmware/Filament_sensor.cpp index dbccf2760..e99ab928c 100644 --- a/Firmware/Filament_sensor.cpp +++ b/Firmware/Filament_sensor.cpp @@ -163,7 +163,7 @@ void Filament_sensor::filRunout() { restore_print_from_ram_and_continue(0); eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); - enquecommand_front_P((PSTR("M600"))); + enquecommand_front_P(MSG_M600); } void Filament_sensor::triggerError() { @@ -483,7 +483,7 @@ void PAT9125_sensor::filJam() { restore_print_from_ram_and_continue(0); eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); - enquecommand_front_P((PSTR("M600"))); + enquecommand_front_P(MSG_M600); } bool PAT9125_sensor::updatePAT9125() { diff --git a/Firmware/messages.cpp b/Firmware/messages.cpp index 83e1cc766..66d35a09c 100644 --- a/Firmware/messages.cpp +++ b/Firmware/messages.cpp @@ -230,9 +230,10 @@ const char MSG_LCD_STATUS_CHANGED[] PROGMEM_N1 = "LCD status changed"; const char MSG_UNKNOWN_CODE[] PROGMEM_N1 = "Unknown %c code: %s\n"; // Common G-gcodes -const char MSG_M701_NO_LIFT[] PROGMEM_N1 = "M701 Z0"; -const char MSG_M702_NO_LIFT[] PROGMEM_N1 = "M702 Z0"; const char MSG_M23[] PROGMEM_N1 = "M23 %s"; const char MSG_M24[] PROGMEM_N1 = "M24"; const char MSG_M83[] PROGMEM_N1 = "M83"; const char MSG_M84[] PROGMEM_N1 = "M84"; +const char MSG_M600[] PROGMEM_N1 = "M600"; +const char MSG_M701_NO_LIFT[] PROGMEM_N1 = "M701 Z0"; +const char MSG_M702_NO_LIFT[] PROGMEM_N1 = "M702 Z0"; diff --git a/Firmware/messages.h b/Firmware/messages.h index 1881315d8..c50f9baab 100644 --- a/Firmware/messages.h +++ b/Firmware/messages.h @@ -236,12 +236,13 @@ extern const char MSG_LCD_STATUS_CHANGED[]; extern const char MSG_UNKNOWN_CODE[]; // Common G-gcodes -extern const char MSG_M701_NO_LIFT[]; -extern const char MSG_M702_NO_LIFT[]; extern const char MSG_M23[]; extern const char MSG_M24[]; extern const char MSG_M83[]; extern const char MSG_M84[]; +extern const char MSG_M600[]; +extern const char MSG_M701_NO_LIFT[]; +extern const char MSG_M702_NO_LIFT[]; #if defined(__cplusplus) } diff --git a/Firmware/mmu2.cpp b/Firmware/mmu2.cpp index 46ed0d664..62b46375e 100644 --- a/Firmware/mmu2.cpp +++ b/Firmware/mmu2.cpp @@ -188,7 +188,7 @@ void MMU2::CheckFINDARunout() { if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { - enquecommand_front_P(PSTR("M600")); // save print and run M600 command + enquecommand_front_P(MSG_M600); // save print and run M600 command } } } diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 79e4a0f41..2df85e00f 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5490,7 +5490,7 @@ void stepper_timer_overflow() { static void lcd_colorprint_change() { - enquecommand_P(PSTR("M600")); + enquecommand_P(MSG_M600); custom_message_type = CustomMsg::FilamentLoading; //just print status message lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS));