optimisation: use more string from PROGMEM

Change in memory:
Flash: -10 bytes
SRAM: 0 bytes
This commit is contained in:
Guðni Már Gilbert 2023-02-18 11:20:13 +00:00 committed by DRracer
parent 9f4a7adb9a
commit e41b6d106d
1 changed files with 5 additions and 4 deletions

View File

@ -3804,18 +3804,19 @@ static void gcode_G92()
/// by extracting common code into one function /// by extracting common code into one function
static void gcode_M861_print_pinda_cal_eeprom() { static void gcode_M861_print_pinda_cal_eeprom() {
int16_t usteps; int16_t usteps;
static const char comma_sep[] PROGMEM = ", ";
for (uint8_t i = 0; i < 6; i++) { for (uint8_t i = 0; i < 6; i++) {
usteps = 0; usteps = 0;
if(i > 0) { if(i > 0) {
usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1));
} }
float mm = ((float)usteps) / cs.axis_steps_per_unit[Z_AXIS]; float mm = ((float)usteps) / cs.axis_steps_per_unit[Z_AXIS];
i == 0 ? SERIAL_PROTOCOLPGM("n/a") : SERIAL_PROTOCOL(i - 1); i == 0 ? SERIAL_PROTOCOLRPGM(MSG_NA) : SERIAL_PROTOCOL(i - 1);
SERIAL_PROTOCOLPGM(", "); SERIAL_PROTOCOLRPGM(comma_sep);
SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOL(35 + (i * 5));
SERIAL_PROTOCOLPGM(", "); SERIAL_PROTOCOLRPGM(comma_sep);
SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOL(usteps);
SERIAL_PROTOCOLPGM(", "); SERIAL_PROTOCOLRPGM(comma_sep);
SERIAL_PROTOCOLLN(mm * 1000); SERIAL_PROTOCOLLN(mm * 1000);
} }
} }