From 6edd8b0719f7c99c6c25e9607356ffdf637ee957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 18 Mar 2023 17:09:43 +0000 Subject: [PATCH] Add M220 into PROGMEM Change in memory: Flash: -10 bytes SRAM: 0 bytes --- Firmware/Marlin_main.cpp | 4 ++-- Firmware/messages.cpp | 1 + Firmware/messages.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index ad4f75afc..80fbb0e7f 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3584,7 +3584,7 @@ static void gcode_M600(bool automatic, float x_position, float y_position, float // Recover feed rate feedmultiply = feedmultiplyBckp; char cmd[9]; - sprintf_P(cmd, PSTR("M220 S%i"), feedmultiplyBckp); + sprintf_P(cmd, MSG_M220, feedmultiplyBckp); enquecommand(cmd); } @@ -10957,7 +10957,7 @@ void restore_print_from_eeprom(bool mbl_was_active) { // Set the feedrates saved at the power panic. sprintf_P(cmd, PSTR("G1 F%d"), feedrate_rec); enquecommand(cmd); - sprintf_P(cmd, PSTR("M220 S%d"), feedmultiply_rec); + sprintf_P(cmd, MSG_M220, feedmultiply_rec); enquecommand(cmd); // Set the fan speed saved at the power panic. sprintf_P(cmd, PSTR("M106 S%u"), fan_speed_rec); diff --git a/Firmware/messages.cpp b/Firmware/messages.cpp index 3b88702d8..577570439 100644 --- a/Firmware/messages.cpp +++ b/Firmware/messages.cpp @@ -236,6 +236,7 @@ const char MSG_M24[] PROGMEM_N1 = "M24"; const char MSG_M83[] PROGMEM_N1 = "M83"; const char MSG_M84[] PROGMEM_N1 = "M84"; const char MSG_M107[] PROGMEM_N1 = "M107"; +const char MSG_M220[] PROGMEM_N1 = "M220 S%d"; const char MSG_M500[] PROGMEM_N1 = "M500"; const char MSG_M600[] PROGMEM_N1 = "M600"; const char MSG_M701_NO_LIFT[] PROGMEM_N1 = "M701 Z0"; diff --git a/Firmware/messages.h b/Firmware/messages.h index 6d6fa63e9..d6b67e05e 100644 --- a/Firmware/messages.h +++ b/Firmware/messages.h @@ -242,6 +242,7 @@ extern const char MSG_M24[]; extern const char MSG_M83[]; extern const char MSG_M84[]; extern const char MSG_M107[]; +extern const char MSG_M220[]; extern const char MSG_M500[]; extern const char MSG_M600[]; extern const char MSG_M701_NO_LIFT[];