From 2bea1bda569ac7aecc87c0f79a7ceaa7a073a0b4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 23 Jan 2018 21:17:33 -0600 Subject: [PATCH] Move more strings to PROGMEM --- Marlin/src/HAL/HAL_LPC1768/include/Wire.h | 2 +- Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp | 8 ++++---- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 2 +- Marlin/src/feature/dac/stepper_dac.cpp | 2 +- Marlin/src/gcode/config/M301.cpp | 2 +- Marlin/src/gcode/feature/caselight/M355.cpp | 4 ++-- Marlin/src/gcode/feature/i2c/M260_M261.cpp | 2 +- Marlin/src/module/configuration_store.cpp | 4 ++-- Marlin/src/module/temperature.cpp | 4 ++-- Marlin/src/module/tool_change.cpp | 2 +- Marlin/src/sd/cardreader.cpp | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Marlin/src/HAL/HAL_LPC1768/include/Wire.h b/Marlin/src/HAL/HAL_LPC1768/include/Wire.h index 5c4b0b9518..b833d699e4 100644 --- a/Marlin/src/HAL/HAL_LPC1768/include/Wire.h +++ b/Marlin/src/HAL/HAL_LPC1768/include/Wire.h @@ -49,7 +49,7 @@ class TwoWire { uint8_t requestFrom(uint8_t, uint8_t); uint8_t requestFrom(int, int); - + virtual size_t write(uint8_t); virtual size_t write(const uint8_t *, size_t); virtual int available(void); diff --git a/Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp index f2f33ba9f1..ef8e1aa29f 100644 --- a/Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp @@ -107,7 +107,7 @@ bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { SERIAL_PROTOCOLPAIR(" write_data(", pos); // This extra chit-chat goes away soon. But it is helpful SERIAL_PROTOCOLPAIR(",", (int)value); // right now to see errors that are happening in the SERIAL_PROTOCOLPAIR(",", (int)size); // read_data() and write_data() functions - SERIAL_PROTOCOL("...)\n"); + SERIAL_PROTOCOLLNPGM("...)"); SERIAL_PROTOCOLLNPAIR(" f_lseek()=", (int)s); return s; } @@ -117,7 +117,7 @@ bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { SERIAL_PROTOCOLPAIR(" write_data(", pos); // This extra chit-chat goes away soon. But it is helpful SERIAL_PROTOCOLPAIR(",", (int)value); // right now to see errors that are happening in the SERIAL_PROTOCOLPAIR(",", size); // read_data() and write_data() functions - SERIAL_PROTOCOLLN("...)"); + SERIAL_PROTOCOLLNPGM("...)"); SERIAL_PROTOCOLLNPAIR(" f_write()=", (int)s); SERIAL_PROTOCOLPAIR(" size=", size); SERIAL_PROTOCOLLNPAIR("\n bytes_written=", bytes_written); @@ -136,7 +136,7 @@ bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const boo SERIAL_PROTOCOLPAIR(" read_data(", pos); // This extra chit-chat goes away soon. But it is helpful SERIAL_PROTOCOLPAIR(",", (int)value); // right now to see errors that are happening in the SERIAL_PROTOCOLPAIR(",", size); // read_data() and write_data() functions - SERIAL_PROTOCOLLN("...)"); + SERIAL_PROTOCOLLNPGM("...)"); SERIAL_PROTOCOLLNPAIR(" f_lseek()=", (int)s); return true; } @@ -153,7 +153,7 @@ bool read_data(int &pos, uint8_t* value, uint16_t size, uint16_t *crc, const boo SERIAL_PROTOCOLPAIR(" read_data(", pos); // This extra chit-chat goes away soon. But it is helpful SERIAL_PROTOCOLPAIR(",", (int)value); // right now to see errors that are happening in the SERIAL_PROTOCOLPAIR(",", size); // read_data() and write_data() functions - SERIAL_PROTOCOLLN("...)"); + SERIAL_PROTOCOLLNPGM("...)"); SERIAL_PROTOCOLLNPAIR(" f_write()=", (int)s); SERIAL_PROTOCOLPAIR(" size=", size); SERIAL_PROTOCOLLNPAIR("\n bytes_read=", bytes_read); diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index b951962e6e..531dcadbfd 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -1095,7 +1095,7 @@ SERIAL_PROTOCOLLNPAIR("UBL object count: ", (int)ubl_cnt); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - SERIAL_PROTOCOL("planner.z_fade_height : "); + SERIAL_PROTOCOLPGM("planner.z_fade_height : "); SERIAL_PROTOCOL_F(planner.z_fade_height, 4); SERIAL_EOL(); #endif diff --git a/Marlin/src/feature/dac/stepper_dac.cpp b/Marlin/src/feature/dac/stepper_dac.cpp index 33be396d2f..458eb61f1a 100644 --- a/Marlin/src/feature/dac/stepper_dac.cpp +++ b/Marlin/src/feature/dac/stepper_dac.cpp @@ -114,7 +114,7 @@ void dac_print_values() { SERIAL_ECHOPAIR(" (", dac_amps(Z_AXIS)); SERIAL_ECHOPAIR(") E:", dac_perc(E_AXIS)); SERIAL_ECHOPAIR(" (", dac_amps(E_AXIS)); - SERIAL_ECHOLN(")"); + SERIAL_ECHOLNPGM(")"); } void dac_commit_eeprom() { diff --git a/Marlin/src/gcode/config/M301.cpp b/Marlin/src/gcode/config/M301.cpp index 4df4a2c0e5..9d876224fc 100644 --- a/Marlin/src/gcode/config/M301.cpp +++ b/Marlin/src/gcode/config/M301.cpp @@ -71,7 +71,7 @@ void GcodeSuite::M301() { } else { SERIAL_ERROR_START(); - SERIAL_ERRORLN(MSG_INVALID_EXTRUDER); + SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER); } } diff --git a/Marlin/src/gcode/feature/caselight/M355.cpp b/Marlin/src/gcode/feature/caselight/M355.cpp index 0e61ff5e0d..f22936d13c 100644 --- a/Marlin/src/gcode/feature/caselight/M355.cpp +++ b/Marlin/src/gcode/feature/caselight/M355.cpp @@ -56,10 +56,10 @@ void GcodeSuite::M355() { // always report case light status SERIAL_ECHO_START(); if (!case_light_on) { - SERIAL_ECHOLN("Case light: off"); + SERIAL_ECHOLNPGM("Case light: off"); } else { - if (!USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) SERIAL_ECHOLN("Case light: on"); + if (!USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) SERIAL_ECHOLNPGM("Case light: on"); else SERIAL_ECHOLNPAIR("Case light: ", case_light_brightness); } #else diff --git a/Marlin/src/gcode/feature/i2c/M260_M261.cpp b/Marlin/src/gcode/feature/i2c/M260_M261.cpp index fdfa5804d6..918e764c40 100644 --- a/Marlin/src/gcode/feature/i2c/M260_M261.cpp +++ b/Marlin/src/gcode/feature/i2c/M260_M261.cpp @@ -73,7 +73,7 @@ void GcodeSuite::M261() { } else { SERIAL_ERROR_START(); - SERIAL_ERRORLN("Bad i2c request"); + SERIAL_ERRORLNPGM("Bad i2c request"); } } diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index a27cf80563..6208275f51 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -1502,7 +1502,7 @@ void MarlinSettings::postprocess() { HAL::PersistentStore::access_finish(); if (status) - SERIAL_PROTOCOL("?Unable to save mesh data.\n"); + SERIAL_PROTOCOLPGM("?Unable to save mesh data.\n"); // Write crc to MAT along with other data, or just tack on to the beginning or end @@ -1540,7 +1540,7 @@ void MarlinSettings::postprocess() { HAL::PersistentStore::access_finish(); if (status) - SERIAL_PROTOCOL("?Unable to load mesh data.\n"); + SERIAL_PROTOCOLPGM("?Unable to load mesh data.\n"); #if ENABLED(EEPROM_CHITCHAT) else diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index a80626764d..224fbcfced 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -266,11 +266,11 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS], #endif if (!WITHIN(hotend, _BOT_HOTEND, _TOP_HOTEND)) { - SERIAL_ECHOLN(MSG_PID_BAD_EXTRUDER_NUM); + SERIAL_ECHOLNPGM(MSG_PID_BAD_EXTRUDER_NUM); return; } - SERIAL_ECHOLN(MSG_PID_AUTOTUNE_START); + SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_START); disable_all_heaters(); // switch off all heaters. diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 0d1e00c2cb..83cff7a641 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -123,7 +123,7 @@ inline void invalid_extruder_error(const uint8_t e) { SERIAL_CHAR('T'); SERIAL_ECHO_F(e, DEC); SERIAL_CHAR(' '); - SERIAL_ECHOLN(MSG_INVALID_EXTRUDER); + SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER); } /** diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 0269ee15a4..b78ffead5b 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -364,7 +364,7 @@ void CardReader::openFile(char* name, const bool read, const bool subcall/*=fals if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) { SERIAL_ERROR_START(); SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:"); - SERIAL_ERRORLN(SD_PROCEDURE_DEPTH); + SERIAL_ERRORLN((int)SD_PROCEDURE_DEPTH); kill(PSTR(MSG_KILLED)); return; }