From e41b6d106df2b2e69a7aae1091008f93c484cb77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 18 Feb 2023 11:20:13 +0000 Subject: [PATCH] optimisation: use more string from PROGMEM Change in memory: Flash: -10 bytes SRAM: 0 bytes --- Firmware/Marlin_main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index a6787e02a..d7dd95b53 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3804,18 +3804,19 @@ static void gcode_G92() /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { int16_t usteps; + static const char comma_sep[] PROGMEM = ", "; for (uint8_t i = 0; i < 6; i++) { usteps = 0; if(i > 0) { usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); } float mm = ((float)usteps) / cs.axis_steps_per_unit[Z_AXIS]; - i == 0 ? SERIAL_PROTOCOLPGM("n/a") : SERIAL_PROTOCOL(i - 1); - SERIAL_PROTOCOLPGM(", "); + i == 0 ? SERIAL_PROTOCOLRPGM(MSG_NA) : SERIAL_PROTOCOL(i - 1); + SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(35 + (i * 5)); - SERIAL_PROTOCOLPGM(", "); + SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); - SERIAL_PROTOCOLPGM(", "); + SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } }