From e78f607ef33044eecde744e77beea87532817c47 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 26 Feb 2020 03:02:03 -0600 Subject: [PATCH] Use a STR_ prefix for non-translated strings --- .../HAL/HAL_AVR/persistent_store_eeprom.cpp | 2 +- Marlin/src/HAL/HAL_AVR/watchdog.cpp | 2 +- .../HAL/HAL_DUE/persistent_store_eeprom.cpp | 2 +- .../HAL_SAMD51/persistent_store_eeprom.cpp | 2 +- .../HAL/HAL_STM32/persistent_store_impl.cpp | 2 +- .../HAL_STM32F1/persistent_store_eeprom.cpp | 2 +- .../persistent_store_eeprom.cpp | 2 +- .../HAL_TEENSY31_32/persistent_store_impl.cpp | 2 +- .../persistent_store_eeprom.cpp | 2 +- Marlin/src/MarlinCore.cpp | 28 +- Marlin/src/core/language.h | 408 +++++++++--------- Marlin/src/core/serial.cpp | 2 +- Marlin/src/feature/bltouch.cpp | 4 +- Marlin/src/feature/pause.cpp | 4 +- Marlin/src/feature/prusa_MMU2/mmu2.cpp | 2 +- Marlin/src/feature/solenoid.cpp | 2 +- Marlin/src/gcode/bedlevel/G42.cpp | 2 +- Marlin/src/gcode/bedlevel/M420.cpp | 4 +- Marlin/src/gcode/bedlevel/abl/M421.cpp | 4 +- Marlin/src/gcode/bedlevel/mbl/M421.cpp | 4 +- Marlin/src/gcode/bedlevel/ubl/M421.cpp | 4 +- Marlin/src/gcode/calibrate/G28.cpp | 6 +- Marlin/src/gcode/calibrate/M852.cpp | 2 +- Marlin/src/gcode/config/M218.cpp | 2 +- Marlin/src/gcode/config/M301.cpp | 2 +- Marlin/src/gcode/control/M111.cpp | 16 +- Marlin/src/gcode/control/M211.cpp | 6 +- Marlin/src/gcode/control/M605.cpp | 2 +- Marlin/src/gcode/control/M80_M81.cpp | 2 +- Marlin/src/gcode/feature/pause/G60.cpp | 4 +- Marlin/src/gcode/feature/pause/G61.cpp | 4 +- Marlin/src/gcode/gcode.cpp | 12 +- Marlin/src/gcode/geometry/M206_M428.cpp | 2 +- Marlin/src/gcode/host/M115.cpp | 2 +- Marlin/src/gcode/lcd/M145.cpp | 2 +- Marlin/src/gcode/motion/G0_G1.cpp | 2 +- Marlin/src/gcode/motion/G2_G3.cpp | 4 +- Marlin/src/gcode/motion/G4.cpp | 2 +- Marlin/src/gcode/motion/G5.cpp | 2 +- Marlin/src/gcode/motion/M290.cpp | 6 +- Marlin/src/gcode/parser.cpp | 2 +- Marlin/src/gcode/probe/M851.cpp | 4 +- Marlin/src/gcode/queue.cpp | 22 +- Marlin/src/gcode/sdcard/M20.cpp | 4 +- Marlin/src/gcode/temperature/M105.cpp | 2 +- Marlin/src/gcode/temperature/M303.cpp | 2 +- .../lib/ftdi_eve_touch_ui/marlin_events.cpp | 8 +- .../screens/advanced_settings_menu.cpp | 4 +- .../screens/bio_advanced_settings.cpp | 2 +- .../screens/endstop_state_screen.cpp | 28 +- .../screens/nozzle_offsets_screen.cpp | 2 +- .../screens/nudge_nozzle_screen.cpp | 2 +- Marlin/src/lcd/extui_dgus_lcd.cpp | 8 +- Marlin/src/lcd/menu/menu_advanced.cpp | 6 +- Marlin/src/lcd/menu/menu_configuration.cpp | 2 +- Marlin/src/lcd/menu/menu_tmc.cpp | 48 +-- Marlin/src/module/endstops.cpp | 12 +- Marlin/src/module/motion.cpp | 6 +- Marlin/src/module/planner.cpp | 4 +- Marlin/src/module/printcounter.cpp | 8 +- Marlin/src/module/probe.cpp | 4 +- Marlin/src/module/stepper.cpp | 4 +- Marlin/src/module/temperature.cpp | 75 ++-- Marlin/src/module/tool_change.cpp | 6 +- Marlin/src/sd/cardreader.cpp | 38 +- 65 files changed, 438 insertions(+), 431 deletions(-) diff --git a/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp index db63b088f..1ae37f892 100644 --- a/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp @@ -39,7 +39,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); + SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE); return true; } } diff --git a/Marlin/src/HAL/HAL_AVR/watchdog.cpp b/Marlin/src/HAL/HAL_AVR/watchdog.cpp index c74634619..e35a70f2c 100644 --- a/Marlin/src/HAL/HAL_AVR/watchdog.cpp +++ b/Marlin/src/HAL/HAL_AVR/watchdog.cpp @@ -62,7 +62,7 @@ void watchdog_init() { #if ENABLED(WATCHDOG_RESET_MANUAL) ISR(WDT_vect) { sei(); // With the interrupt driven serial we need to allow interrupts. - SERIAL_ERROR_MSG(MSG_WATCHDOG_FIRED); + SERIAL_ERROR_MSG(STR_WATCHDOG_FIRED); minkill(); // interrupt-safe final kill and infinite loop } #endif diff --git a/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp index 801719dcd..9fdcca785 100644 --- a/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp @@ -54,7 +54,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui eeprom_write_byte(p, v); delay(2); if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); + SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE); return true; } } diff --git a/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp index 7e7c25378..c450599d7 100644 --- a/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp @@ -72,7 +72,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui eeprom_write_byte(p, v); delay(2); if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); + SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE); return true; } } diff --git a/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp index 2a71c4594..b4e58a795 100644 --- a/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp @@ -48,7 +48,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); + SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE); return true; } } diff --git a/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp index 19fcc3952..f2a1cb031 100644 --- a/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp @@ -49,7 +49,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); + SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE); return true; } } diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp index 8ffb68955..2ffbc609e 100644 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp @@ -41,7 +41,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); + SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE); return true; } } diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp index 9781dc62e..6a179cd96 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp @@ -36,7 +36,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); + SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE); return true; } } diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp index 963f372f5..32b215ee6 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp @@ -42,7 +42,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); + SERIAL_ECHO_MSG(STR_ERR_EEPROM_WRITE); return true; } } diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 839b64e09..a07948e0c 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -278,7 +278,7 @@ bool pin_is_protected(const pin_t pin) { } void protected_pin_err() { - SERIAL_ERROR_MSG(MSG_ERR_PROTECTED_PIN); + SERIAL_ERROR_MSG(STR_ERR_PROTECTED_PIN); } void quickstop_stepper() { @@ -461,7 +461,7 @@ void startOrResumeJob() { ui.reselect_last_file(); #endif - SERIAL_ECHOLNPGM(MSG_FILE_PRINTED); + SERIAL_ECHOLNPGM(STR_FILE_PRINTED); default: did_state = false; @@ -498,7 +498,7 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) { if (max_inactive_time && ELAPSED(ms, gcode.previous_move_ms + max_inactive_time)) { SERIAL_ERROR_START(); - SERIAL_ECHOLNPAIR(MSG_KILL_INACTIVE_TIME, parser.command_ptr); + SERIAL_ECHOLNPAIR(STR_KILL_INACTIVE_TIME, parser.command_ptr); kill(); } @@ -563,7 +563,7 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) { // KILL the machine // ---------------------------------------------------------------- if (killCount >= KILL_DELAY) { - SERIAL_ERROR_MSG(MSG_KILL_BUTTON); + SERIAL_ERROR_MSG(STR_KILL_BUTTON); kill(); } #endif @@ -781,7 +781,7 @@ void idle( void kill(PGM_P const lcd_error/*=nullptr*/, PGM_P const lcd_component/*=nullptr*/, const bool steppers_off/*=false*/) { thermalManager.disable_all_heaters(); - SERIAL_ERROR_MSG(MSG_ERR_KILLED); + SERIAL_ERROR_MSG(STR_ERR_KILLED); #if HAS_DISPLAY ui.kill_screen(lcd_error ?: GET_TEXT(MSG_KILLED), lcd_component ?: NUL_STR); @@ -852,7 +852,7 @@ void stop() { #endif if (IsRunning()) { - SERIAL_ERROR_MSG(MSG_ERR_STOPPED); + SERIAL_ERROR_MSG(STR_ERR_STOPPED); LCD_MESSAGEPGM(MSG_STOPPED); safe_delay(350); // allow enough time for messages to get out before stopping Running = false; @@ -958,11 +958,11 @@ void setup() { // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = HAL_get_reset_source(); - if (mcu & 1) SERIAL_ECHOLNPGM(MSG_POWERUP); - if (mcu & 2) SERIAL_ECHOLNPGM(MSG_EXTERNAL_RESET); - if (mcu & 4) SERIAL_ECHOLNPGM(MSG_BROWNOUT_RESET); - if (mcu & 8) SERIAL_ECHOLNPGM(MSG_WATCHDOG_RESET); - if (mcu & 32) SERIAL_ECHOLNPGM(MSG_SOFTWARE_RESET); + if (mcu & 1) SERIAL_ECHOLNPGM(STR_POWERUP); + if (mcu & 2) SERIAL_ECHOLNPGM(STR_EXTERNAL_RESET); + if (mcu & 4) SERIAL_ECHOLNPGM(STR_BROWNOUT_RESET); + if (mcu & 8) SERIAL_ECHOLNPGM(STR_WATCHDOG_RESET); + if (mcu & 32) SERIAL_ECHOLNPGM(STR_SOFTWARE_RESET); HAL_clear_reset_source(); serialprintPGM(GET_TEXT(MSG_MARLIN)); @@ -972,15 +972,15 @@ void setup() { #if defined(STRING_DISTRIBUTION_DATE) && defined(STRING_CONFIG_H_AUTHOR) SERIAL_ECHO_MSG( - MSG_CONFIGURATION_VER + STR_CONFIGURATION_VER STRING_DISTRIBUTION_DATE - MSG_AUTHOR STRING_CONFIG_H_AUTHOR + STR_AUTHOR STRING_CONFIG_H_AUTHOR ); SERIAL_ECHO_MSG("Compiled: " __DATE__); #endif SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_FREE_MEMORY, freeMemory(), MSG_PLANNER_BUFFER_BYTES, (int)sizeof(block_t) * (BLOCK_BUFFER_SIZE)); + SERIAL_ECHOLNPAIR(STR_FREE_MEMORY, freeMemory(), STR_PLANNER_BUFFER_BYTES, (int)sizeof(block_t) * (BLOCK_BUFFER_SIZE)); // UI must be initialized before EEPROM // (because EEPROM code calls the UI). diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 47245fa89..f58ace770 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -97,6 +97,210 @@ // #define STRING_SPLASH_LINE3 WEBSITE_URL //#endif +// +// Common Serial Console Messages +// Don't change these strings because serial hosts look for them. +// + +#define STR_ENQUEUEING "enqueueing \"" +#define STR_POWERUP "PowerUp" +#define STR_EXTERNAL_RESET " External Reset" +#define STR_BROWNOUT_RESET " Brown out Reset" +#define STR_WATCHDOG_RESET " Watchdog Reset" +#define STR_SOFTWARE_RESET " Software Reset" +#define STR_AUTHOR " | Author: " +#define STR_CONFIGURATION_VER " Last Updated: " +#define STR_FREE_MEMORY " Free Memory: " +#define STR_PLANNER_BUFFER_BYTES " PlannerBufferBytes: " +#define STR_OK "ok" +#define STR_WAIT "wait" +#define STR_STATS "Stats: " +#define STR_FILE_SAVED "Done saving file." +#define STR_ERR_LINE_NO "Line Number is not Last Line Number+1, Last Line: " +#define STR_ERR_CHECKSUM_MISMATCH "checksum mismatch, Last Line: " +#define STR_ERR_NO_CHECKSUM "No Checksum with line number, Last Line: " +#define STR_FILE_PRINTED "Done printing file" +#define STR_BEGIN_FILE_LIST "Begin file list" +#define STR_END_FILE_LIST "End file list" +#define STR_INVALID_EXTRUDER "Invalid extruder" +#define STR_INVALID_E_STEPPER "Invalid E stepper" +#define STR_E_STEPPER_NOT_SPECIFIED "E stepper not specified" +#define STR_INVALID_SOLENOID "Invalid solenoid" +#define STR_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID +#define STR_COUNT_X " Count X:" +#define STR_COUNT_A " Count A:" +#define STR_WATCHDOG_FIRED "Watchdog timeout. Reset required." +#define STR_ERR_KILLED "Printer halted. kill() called!" +#define STR_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)" +#define STR_BUSY_PROCESSING "busy: processing" +#define STR_BUSY_PAUSED_FOR_USER "busy: paused for user" +#define STR_BUSY_PAUSED_FOR_INPUT "busy: paused for input" +#define STR_Z_MOVE_COMP "Z_move_comp" +#define STR_RESEND "Resend: " +#define STR_UNKNOWN_COMMAND "Unknown command: \"" +#define STR_ACTIVE_EXTRUDER "Active Extruder: " +#define STR_X_MIN "x_min" +#define STR_X_MAX "x_max" +#define STR_X2_MIN "x2_min" +#define STR_X2_MAX "x2_max" +#define STR_Y_MIN "y_min" +#define STR_Y_MAX "y_max" +#define STR_Y2_MIN "y2_min" +#define STR_Y2_MAX "y2_max" +#define STR_Z_MIN "z_min" +#define STR_Z_MAX "z_max" +#define STR_Z2_MIN "z2_min" +#define STR_Z2_MAX "z2_max" +#define STR_Z3_MIN "z3_min" +#define STR_Z3_MAX "z3_max" +#define STR_Z4_MIN "z4_min" +#define STR_Z4_MAX "z4_max" +#define STR_Z_PROBE "z_probe" +#define STR_FILAMENT_RUNOUT_SENSOR "filament" +#define STR_PROBE_OFFSET "Probe Offset" +#define STR_SKEW_MIN "min_skew_factor: " +#define STR_SKEW_MAX "max_skew_factor: " +#define STR_ERR_MATERIAL_INDEX "M145 S out of range (0-1)" +#define STR_ERR_M421_PARAMETERS "M421 incorrect parameter usage" +#define STR_ERR_BAD_PLANE_MODE "G5 requires XY plane mode" +#define STR_ERR_MESH_XY "Mesh point cannot be resolved" +#define STR_ERR_ARC_ARGS "G2/G3 bad parameters" +#define STR_ERR_PROTECTED_PIN "Protected Pin" +#define STR_ERR_M420_FAILED "Failed to enable Bed Leveling" +#define STR_ERR_M428_TOO_FAR "Too far from reference point" +#define STR_ERR_M303_DISABLED "PIDTEMP disabled" +#define STR_M119_REPORT "Reporting endstop status" +#define STR_ON "ON" +#define STR_OFF "OFF" +#define STR_ENDSTOP_HIT "TRIGGERED" +#define STR_ENDSTOP_OPEN "open" +#define STR_HOTEND_OFFSET "Hotend offsets:" +#define STR_DUPLICATION_MODE "Duplication mode: " +#define STR_SOFT_ENDSTOPS "Soft endstops: " +#define STR_SOFT_MIN " Min: " +#define STR_SOFT_MAX " Max: " + +#define STR_SAVED_POS "Position saved" +#define STR_RESTORING_POS "Restoring position" +#define STR_INVALID_POS_SLOT "Invalid slot. Total: " + +#define STR_SD_CANT_OPEN_SUBDIR "Cannot open subdir " +#define STR_SD_INIT_FAIL "SD init fail" +#define STR_SD_VOL_INIT_FAIL "volume.init failed" +#define STR_SD_OPENROOT_FAIL "openRoot failed" +#define STR_SD_CARD_OK "SD card ok" +#define STR_SD_WORKDIR_FAIL "workDir open failed" +#define STR_SD_OPEN_FILE_FAIL "open failed, File: " +#define STR_SD_FILE_OPENED "File opened: " +#define STR_SD_SIZE " Size: " +#define STR_SD_FILE_SELECTED "File selected" +#define STR_SD_WRITE_TO_FILE "Writing to file: " +#define STR_SD_PRINTING_BYTE "SD printing byte " +#define STR_SD_NOT_PRINTING "Not SD printing" +#define STR_SD_ERR_WRITE_TO_FILE "error writing to file" +#define STR_SD_ERR_READ "SD read error" +#define STR_SD_CANT_ENTER_SUBDIR "Cannot enter subdir: " + +#define STR_ENDSTOPS_HIT "endstops hit: " +#define STR_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented" +#define STR_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented" +#define STR_ERR_HOTEND_TOO_COLD "Hotend too cold" +#define STR_ERR_Z_HOMING_SER "Home XY first" +#define STR_ERR_EEPROM_WRITE "Error writing to EEPROM!" + +#define STR_FILAMENT_CHANGE_HEAT_LCD "Press button to heat nozzle" +#define STR_FILAMENT_CHANGE_INSERT_LCD "Insert filament and press button" +#define STR_FILAMENT_CHANGE_WAIT_LCD "Press button to resume" +#define STR_FILAMENT_CHANGE_HEAT_M108 "Send M108 to heat nozzle" +#define STR_FILAMENT_CHANGE_INSERT_M108 "Insert filament and send M108" +#define STR_FILAMENT_CHANGE_WAIT_M108 "Send M108 to resume" + +#define STR_STOP_BLTOUCH "!! STOP called because of BLTouch error - restart with M999" +#define STR_STOP_UNHOMED "!! STOP called because of unhomed error - restart with M999" +#define STR_KILL_INACTIVE_TIME "!! KILL caused by too much inactive time - current command: " +#define STR_KILL_BUTTON "!! KILL caused by KILL button/pin" + +// temperature.cpp strings +#define STR_PID_AUTOTUNE_PREFIX "PID Autotune" +#define STR_PID_AUTOTUNE_START STR_PID_AUTOTUNE_PREFIX " start" +#define STR_PID_AUTOTUNE_FAILED STR_PID_AUTOTUNE_PREFIX " failed!" +#define STR_PID_BAD_EXTRUDER_NUM STR_PID_AUTOTUNE_FAILED " Bad extruder number" +#define STR_PID_TEMP_TOO_HIGH STR_PID_AUTOTUNE_FAILED " Temperature too high" +#define STR_PID_TIMEOUT STR_PID_AUTOTUNE_FAILED " timeout" +#define STR_BIAS " bias: " +#define STR_D_COLON " d: " +#define STR_T_MIN " min: " +#define STR_T_MAX " max: " +#define STR_KU " Ku: " +#define STR_TU " Tu: " +#define STR_CLASSIC_PID " Classic PID " +#define STR_KP " Kp: " +#define STR_KI " Ki: " +#define STR_KD " Kd: " +#define STR_PID_AUTOTUNE_FINISHED STR_PID_AUTOTUNE_PREFIX " finished! Put the last Kp, Ki and Kd constants from below into Configuration.h" +#define STR_PID_DEBUG " PID_DEBUG " +#define STR_PID_DEBUG_INPUT ": Input " +#define STR_PID_DEBUG_OUTPUT " Output " +#define STR_PID_DEBUG_PTERM " pTerm " +#define STR_PID_DEBUG_ITERM " iTerm " +#define STR_PID_DEBUG_DTERM " dTerm " +#define STR_PID_DEBUG_CTERM " cTerm " +#define STR_INVALID_EXTRUDER_NUM " - Invalid extruder number !" + +#define STR_HEATER_BED "bed" +#define STR_HEATER_CHAMBER "chamber" + +#define STR_STOPPED_HEATER ", system stopped! Heater_ID: " +#define STR_REDUNDANCY "Heater switched off. Temperature difference between temp sensors is too high !" +#define STR_T_HEATING_FAILED "Heating failed" +#define STR_T_THERMAL_RUNAWAY "Thermal Runaway" +#define STR_T_MAXTEMP "MAXTEMP triggered" +#define STR_T_MINTEMP "MINTEMP triggered" +#define STR_ERR_PROBING_FAILED "Probing Failed" +#define STR_ZPROBE_OUT_SER "Z Probe Past Bed" + +// Debug +#define STR_DEBUG_PREFIX "DEBUG:" +#define STR_DEBUG_OFF "off" +#define STR_DEBUG_ECHO "ECHO" +#define STR_DEBUG_INFO "INFO" +#define STR_DEBUG_ERRORS "ERRORS" +#define STR_DEBUG_DRYRUN "DRYRUN" +#define STR_DEBUG_COMMUNICATION "COMMUNICATION" +#define STR_DEBUG_LEVELING "LEVELING" + +// LCD Menu Messages + +#define LANGUAGE_DATA_INCL_(M) STRINGIFY_(fontdata/langdata_##M.h) +#define LANGUAGE_DATA_INCL(M) LANGUAGE_DATA_INCL_(M) + +#define LANGUAGE_INCL_(M) STRINGIFY_(../lcd/language/language_##M.h) +#define LANGUAGE_INCL(M) LANGUAGE_INCL_(M) + +#define STR_X "X" +#define STR_Y "Y" +#define STR_Z "Z" +#define STR_E "E" +#if IS_KINEMATIC + #define STR_A "A" + #define STR_B "B" + #define STR_C "C" +#else + #define STR_A "X" + #define STR_B "Y" + #define STR_C "Z" +#endif +#define STR_X2 "X2" +#define STR_Y2 "Y2" +#define STR_Z2 "Z2" +#define STR_Z3 "Z3" +#define STR_Z4 "Z4" + +#define LCD_STR_A STR_A +#define LCD_STR_B STR_B +#define LCD_STR_C STR_C +#define LCD_STR_E STR_E + #if HAS_CHARACTER_LCD // Custom characters defined in the first 8 characters of the LCD @@ -135,210 +339,6 @@ #endif -// Common Serial Console Messages (do not translate those!) - -#define MSG_ENQUEUEING "enqueueing \"" -#define MSG_POWERUP "PowerUp" -#define MSG_EXTERNAL_RESET " External Reset" -#define MSG_BROWNOUT_RESET " Brown out Reset" -#define MSG_WATCHDOG_RESET " Watchdog Reset" -#define MSG_SOFTWARE_RESET " Software Reset" -#define MSG_AUTHOR " | Author: " -#define MSG_CONFIGURATION_VER " Last Updated: " -#define MSG_FREE_MEMORY " Free Memory: " -#define MSG_PLANNER_BUFFER_BYTES " PlannerBufferBytes: " -#define MSG_OK "ok" -#define MSG_WAIT "wait" -#define MSG_STATS "Stats: " -#define MSG_FILE_SAVED "Done saving file." -#define MSG_ERR_LINE_NO "Line Number is not Last Line Number+1, Last Line: " -#define MSG_ERR_CHECKSUM_MISMATCH "checksum mismatch, Last Line: " -#define MSG_ERR_NO_CHECKSUM "No Checksum with line number, Last Line: " -#define MSG_FILE_PRINTED "Done printing file" -#define MSG_BEGIN_FILE_LIST "Begin file list" -#define MSG_END_FILE_LIST "End file list" -#define MSG_INVALID_EXTRUDER "Invalid extruder" -#define MSG_INVALID_E_STEPPER "Invalid E stepper" -#define MSG_E_STEPPER_NOT_SPECIFIED "E stepper not specified" -#define MSG_INVALID_SOLENOID "Invalid solenoid" -#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID -#define MSG_COUNT_X " Count X:" -#define MSG_COUNT_A " Count A:" -#define MSG_WATCHDOG_FIRED "Watchdog timeout. Reset required." -#define MSG_ERR_KILLED "Printer halted. kill() called!" -#define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)" -#define MSG_BUSY_PROCESSING "busy: processing" -#define MSG_BUSY_PAUSED_FOR_USER "busy: paused for user" -#define MSG_BUSY_PAUSED_FOR_INPUT "busy: paused for input" -#define MSG_Z_MOVE_COMP "Z_move_comp" -#define MSG_RESEND "Resend: " -#define MSG_UNKNOWN_COMMAND "Unknown command: \"" -#define MSG_ACTIVE_EXTRUDER "Active Extruder: " -#define MSG_X_MIN "x_min" -#define MSG_X_MAX "x_max" -#define MSG_X2_MIN "x2_min" -#define MSG_X2_MAX "x2_max" -#define MSG_Y_MIN "y_min" -#define MSG_Y_MAX "y_max" -#define MSG_Y2_MIN "y2_min" -#define MSG_Y2_MAX "y2_max" -#define MSG_Z_MIN "z_min" -#define MSG_Z_MAX "z_max" -#define MSG_Z2_MIN "z2_min" -#define MSG_Z2_MAX "z2_max" -#define MSG_Z3_MIN "z3_min" -#define MSG_Z3_MAX "z3_max" -#define MSG_Z4_MIN "z4_min" -#define MSG_Z4_MAX "z4_max" -#define MSG_Z_PROBE "z_probe" -#define MSG_FILAMENT_RUNOUT_SENSOR "filament" -#define MSG_PROBE_OFFSET "Probe Offset" -#define MSG_SKEW_MIN "min_skew_factor: " -#define MSG_SKEW_MAX "max_skew_factor: " -#define MSG_ERR_MATERIAL_INDEX "M145 S out of range (0-1)" -#define MSG_ERR_M421_PARAMETERS "M421 incorrect parameter usage" -#define MSG_ERR_BAD_PLANE_MODE "G5 requires XY plane mode" -#define MSG_ERR_MESH_XY "Mesh point cannot be resolved" -#define MSG_ERR_ARC_ARGS "G2/G3 bad parameters" -#define MSG_ERR_PROTECTED_PIN "Protected Pin" -#define MSG_ERR_M420_FAILED "Failed to enable Bed Leveling" -#define MSG_ERR_M428_TOO_FAR "Too far from reference point" -#define MSG_ERR_M303_DISABLED "PIDTEMP disabled" -#define MSG_M119_REPORT "Reporting endstop status" -#define MSG_ON "ON" -#define MSG_OFF "OFF" -#define MSG_ENDSTOP_HIT "TRIGGERED" -#define MSG_ENDSTOP_OPEN "open" -#define MSG_HOTEND_OFFSET "Hotend offsets:" -#define MSG_DUPLICATION_MODE "Duplication mode: " -#define MSG_SOFT_ENDSTOPS "Soft endstops: " -#define MSG_SOFT_MIN " Min: " -#define MSG_SOFT_MAX " Max: " - -#define MSG_SAVED_POS "Position saved" -#define MSG_RESTORING_POS "Restoring position" -#define MSG_INVALID_POS_SLOT "Invalid slot. Total: " - -#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir " -#define MSG_SD_INIT_FAIL "SD init fail" -#define MSG_SD_VOL_INIT_FAIL "volume.init failed" -#define MSG_SD_OPENROOT_FAIL "openRoot failed" -#define MSG_SD_CARD_OK "SD card ok" -#define MSG_SD_WORKDIR_FAIL "workDir open failed" -#define MSG_SD_OPEN_FILE_FAIL "open failed, File: " -#define MSG_SD_FILE_OPENED "File opened: " -#define MSG_SD_SIZE " Size: " -#define MSG_SD_FILE_SELECTED "File selected" -#define MSG_SD_WRITE_TO_FILE "Writing to file: " -#define MSG_SD_PRINTING_BYTE "SD printing byte " -#define MSG_SD_NOT_PRINTING "Not SD printing" -#define MSG_SD_ERR_WRITE_TO_FILE "error writing to file" -#define MSG_SD_ERR_READ "SD read error" -#define MSG_SD_CANT_ENTER_SUBDIR "Cannot enter subdir: " - -#define MSG_STEPPER_TOO_HIGH "Steprate too high: " -#define MSG_ENDSTOPS_HIT "endstops hit: " -#define MSG_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented" -#define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented" -#define MSG_ERR_HOTEND_TOO_COLD "Hotend too cold" -#define MSG_ERR_Z_HOMING_SER "Home XY first" -#define MSG_ERR_EEPROM_WRITE "Error writing to EEPROM!" - -#define MSG_FILAMENT_CHANGE_HEAT_LCD "Press button to heat nozzle" -#define MSG_FILAMENT_CHANGE_INSERT_LCD "Insert filament and press button" -#define MSG_FILAMENT_CHANGE_WAIT_LCD "Press button to resume" -#define MSG_FILAMENT_CHANGE_HEAT_M108 "Send M108 to heat nozzle" -#define MSG_FILAMENT_CHANGE_INSERT_M108 "Insert filament and send M108" -#define MSG_FILAMENT_CHANGE_WAIT_M108 "Send M108 to resume" - -#define MSG_STOP_BLTOUCH "!! STOP called because of BLTouch error - restart with M999" -#define MSG_STOP_UNHOMED "!! STOP called because of unhomed error - restart with M999" -#define MSG_KILL_INACTIVE_TIME "!! KILL caused by too much inactive time - current command: " -#define MSG_KILL_BUTTON "!! KILL caused by KILL button/pin" - -// temperature.cpp strings -#define MSG_PID_AUTOTUNE_PREFIX "PID Autotune" -#define MSG_PID_AUTOTUNE_START MSG_PID_AUTOTUNE_PREFIX " start" -#define MSG_PID_AUTOTUNE_FAILED MSG_PID_AUTOTUNE_PREFIX " failed!" -#define MSG_PID_BAD_EXTRUDER_NUM MSG_PID_AUTOTUNE_FAILED " Bad extruder number" -#define MSG_PID_TEMP_TOO_HIGH MSG_PID_AUTOTUNE_FAILED " Temperature too high" -#define MSG_PID_TIMEOUT MSG_PID_AUTOTUNE_FAILED " timeout" -#define MSG_BIAS " bias: " -#define MSG_D " d: " -#define MSG_T_MIN " min: " -#define MSG_T_MAX " max: " -#define MSG_KU " Ku: " -#define MSG_TU " Tu: " -#define MSG_CLASSIC_PID " Classic PID " -#define MSG_KP " Kp: " -#define MSG_KI " Ki: " -#define MSG_KD " Kd: " -#define MSG_AT " @:" -#define MSG_PID_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE_PREFIX " finished! Put the last Kp, Ki and Kd constants from below into Configuration.h" -#define MSG_PID_DEBUG " PID_DEBUG " -#define MSG_PID_DEBUG_INPUT ": Input " -#define MSG_PID_DEBUG_OUTPUT " Output " -#define MSG_PID_DEBUG_PTERM " pTerm " -#define MSG_PID_DEBUG_ITERM " iTerm " -#define MSG_PID_DEBUG_DTERM " dTerm " -#define MSG_PID_DEBUG_CTERM " cTerm " -#define MSG_INVALID_EXTRUDER_NUM " - Invalid extruder number !" - -#define MSG_HEATER_BED "bed" -#define MSG_HEATER_CHAMBER "chamber" - -#define MSG_STOPPED_HEATER ", system stopped! Heater_ID: " -#define MSG_REDUNDANCY "Heater switched off. Temperature difference between temp sensors is too high !" -#define MSG_T_HEATING_FAILED "Heating failed" -#define MSG_T_THERMAL_RUNAWAY "Thermal Runaway" -#define MSG_T_MAXTEMP "MAXTEMP triggered" -#define MSG_T_MINTEMP "MINTEMP triggered" -#define MSG_ERR_PROBING_FAILED "Probing Failed" -#define MSG_ZPROBE_OUT_SER "Z Probe Past Bed" - -// Debug -#define MSG_DEBUG_PREFIX "DEBUG:" -#define MSG_DEBUG_OFF "off" -#define MSG_DEBUG_ECHO "ECHO" -#define MSG_DEBUG_INFO "INFO" -#define MSG_DEBUG_ERRORS "ERRORS" -#define MSG_DEBUG_DRYRUN "DRYRUN" -#define MSG_DEBUG_COMMUNICATION "COMMUNICATION" -#define MSG_DEBUG_LEVELING "LEVELING" - -// LCD Menu Messages - -#define LANGUAGE_DATA_INCL_(M) STRINGIFY_(fontdata/langdata_##M.h) -#define LANGUAGE_DATA_INCL(M) LANGUAGE_DATA_INCL_(M) - -#define LANGUAGE_INCL_(M) STRINGIFY_(../lcd/language/language_##M.h) -#define LANGUAGE_INCL(M) LANGUAGE_INCL_(M) - -// Never translate these strings -#define MSG_X "X" -#define MSG_Y "Y" -#define MSG_Z "Z" -#define MSG_E "E" -#if IS_KINEMATIC - #define MSG_A "A" - #define MSG_B "B" - #define MSG_C "C" -#else - #define MSG_A "X" - #define MSG_B "Y" - #define MSG_C "Z" -#endif -#define MSG_X2 "X2" -#define MSG_Y2 "Y2" -#define MSG_Z2 "Z2" -#define MSG_Z3 "Z3" -#define MSG_Z4 "Z4" - -#define LCD_STR_A MSG_A -#define LCD_STR_B MSG_B -#define LCD_STR_C MSG_C -#define LCD_STR_E MSG_E - /** * Tool indexes for LCD display only * diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index 41c400ea6..304aa09a8 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -54,7 +54,7 @@ void serial_ternary(const bool onoff, PGM_P const pre, PGM_P const on, PGM_P con serialprintPGM(onoff ? on : off); if (post) serialprintPGM(post); } -void serialprint_onoff(const bool onoff) { serialprintPGM(onoff ? PSTR(MSG_ON) : PSTR(MSG_OFF)); } +void serialprint_onoff(const bool onoff) { serialprintPGM(onoff ? PSTR(STR_ON) : PSTR(STR_OFF)); } void serialprintln_onoff(const bool onoff) { serialprint_onoff(onoff); SERIAL_EOL(); } void serialprint_truefalse(const bool tf) { serialprintPGM(tf ? PSTR("true") : PSTR("false")); } diff --git a/Marlin/src/feature/bltouch.cpp b/Marlin/src/feature/bltouch.cpp index e5ccb42bf..77d85c419 100644 --- a/Marlin/src/feature/bltouch.cpp +++ b/Marlin/src/feature/bltouch.cpp @@ -124,7 +124,7 @@ bool BLTouch::deploy_proc() { // The deploy might have failed or the probe is actually triggered (nozzle too low?) again if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch Recovery Failed"); - SERIAL_ERROR_MSG(MSG_STOP_BLTOUCH); // Tell the user something is wrong, needs action + SERIAL_ERROR_MSG(STR_STOP_BLTOUCH); // Tell the user something is wrong, needs action stop(); // but it's not too bad, no need to kill, allow restart return true; // Tell our caller we goofed in case he cares to know @@ -169,7 +169,7 @@ bool BLTouch::stow_proc() { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("BLTouch Recovery Failed"); - SERIAL_ERROR_MSG(MSG_STOP_BLTOUCH); // Tell the user something is wrong, needs action + SERIAL_ERROR_MSG(STR_STOP_BLTOUCH); // Tell the user something is wrong, needs action stop(); // but it's not too bad, no need to kill, allow restart return true; // Tell our caller we goofed in case he cares to know diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 9fd279fe5..cfda05612 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -120,7 +120,7 @@ static bool ensure_safe_temperature(const PauseMode mode=PAUSE_MODE_SAME) { #if ENABLED(PREVENT_COLD_EXTRUSION) if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) { - SERIAL_ECHO_MSG(MSG_ERR_HOTEND_TOO_COLD); + SERIAL_ECHO_MSG(STR_ERR_HOTEND_TOO_COLD); return false; } #endif @@ -400,7 +400,7 @@ bool pause_print(const float &retract, const xyz_pos_t &park_point, const float #endif if (!DEBUGGING(DRYRUN) && unload_length && thermalManager.targetTooColdToExtrude(active_extruder)) { - SERIAL_ECHO_MSG(MSG_ERR_HOTEND_TOO_COLD); + SERIAL_ECHO_MSG(STR_ERR_HOTEND_TOO_COLD); #if HAS_LCD_MENU if (show_lcd) { // Show status screen diff --git a/Marlin/src/feature/prusa_MMU2/mmu2.cpp b/Marlin/src/feature/prusa_MMU2/mmu2.cpp index 2833735f3..d71edbac3 100644 --- a/Marlin/src/feature/prusa_MMU2/mmu2.cpp +++ b/Marlin/src/feature/prusa_MMU2/mmu2.cpp @@ -462,7 +462,7 @@ void MMU2::tool_change(uint8_t index) { ENABLE_AXIS_E0(); SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, int(extruder)); + SERIAL_ECHOLNPAIR(STR_ACTIVE_EXTRUDER, int(extruder)); ui.reset_status(); } diff --git a/Marlin/src/feature/solenoid.cpp b/Marlin/src/feature/solenoid.cpp index a6717b749..d53118fdd 100644 --- a/Marlin/src/feature/solenoid.cpp +++ b/Marlin/src/feature/solenoid.cpp @@ -67,7 +67,7 @@ static void set_solenoid(const uint8_t num, const bool active) { break; #endif default: - SERIAL_ECHO_MSG(MSG_INVALID_SOLENOID); + SERIAL_ECHO_MSG(STR_INVALID_SOLENOID); break; } } diff --git a/Marlin/src/gcode/bedlevel/G42.cpp b/Marlin/src/gcode/bedlevel/G42.cpp index ed6d66f00..139bd1bb6 100644 --- a/Marlin/src/gcode/bedlevel/G42.cpp +++ b/Marlin/src/gcode/bedlevel/G42.cpp @@ -41,7 +41,7 @@ void GcodeSuite::G42() { const int8_t iy = hasJ ? parser.value_int() : 0; if ((hasI && !WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) || (hasJ && !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1))) { - SERIAL_ECHOLNPGM(MSG_ERR_MESH_XY); + SERIAL_ECHOLNPGM(STR_ERR_MESH_XY); return; } diff --git a/Marlin/src/gcode/bedlevel/M420.cpp b/Marlin/src/gcode/bedlevel/M420.cpp index 1d78afaca..b84c60a6a 100644 --- a/Marlin/src/gcode/bedlevel/M420.cpp +++ b/Marlin/src/gcode/bedlevel/M420.cpp @@ -235,7 +235,7 @@ void GcodeSuite::M420() { // Error if leveling failed to enable or reenable if (to_enable && !planner.leveling_active) - SERIAL_ERROR_MSG(MSG_ERR_M420_FAILED); + SERIAL_ERROR_MSG(STR_ERR_M420_FAILED); SERIAL_ECHO_START(); SERIAL_ECHOPGM("Bed Leveling "); @@ -247,7 +247,7 @@ void GcodeSuite::M420() { if (planner.z_fade_height > 0.0) SERIAL_ECHOLN(planner.z_fade_height); else - SERIAL_ECHOLNPGM(MSG_OFF); + SERIAL_ECHOLNPGM(STR_OFF); #endif // Report change in position diff --git a/Marlin/src/gcode/bedlevel/abl/M421.cpp b/Marlin/src/gcode/bedlevel/abl/M421.cpp index bec751440..85ff70757 100644 --- a/Marlin/src/gcode/bedlevel/abl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/abl/M421.cpp @@ -50,9 +50,9 @@ void GcodeSuite::M421() { hasQ = !hasZ && parser.seen('Q'); if (!hasI || !hasJ || !(hasZ || hasQ)) - SERIAL_ERROR_MSG(MSG_ERR_M421_PARAMETERS); + SERIAL_ERROR_MSG(STR_ERR_M421_PARAMETERS); else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) - SERIAL_ERROR_MSG(MSG_ERR_MESH_XY); + SERIAL_ERROR_MSG(STR_ERR_MESH_XY); else { z_values[ix][iy] = parser.value_linear_units() + (hasQ ? z_values[ix][iy] : 0); #if ENABLED(ABL_BILINEAR_SUBDIVISION) diff --git a/Marlin/src/gcode/bedlevel/mbl/M421.cpp b/Marlin/src/gcode/bedlevel/mbl/M421.cpp index f0fbf3021..3997e5ad5 100644 --- a/Marlin/src/gcode/bedlevel/mbl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/M421.cpp @@ -49,9 +49,9 @@ void GcodeSuite::M421() { const bool hasZ = parser.seen('Z'), hasQ = !hasZ && parser.seen('Q'); if (int(hasI && hasJ) + int(hasX && hasY) != 1 || !(hasZ || hasQ)) - SERIAL_ERROR_MSG(MSG_ERR_M421_PARAMETERS); + SERIAL_ERROR_MSG(STR_ERR_M421_PARAMETERS); else if (ix < 0 || iy < 0) - SERIAL_ERROR_MSG(MSG_ERR_MESH_XY); + SERIAL_ERROR_MSG(STR_ERR_MESH_XY); else mbl.set_z(ix, iy, parser.value_linear_units() + (hasQ ? mbl.z_values[ix][iy] : 0)); } diff --git a/Marlin/src/gcode/bedlevel/ubl/M421.cpp b/Marlin/src/gcode/bedlevel/ubl/M421.cpp index 393eae03b..ca4af1e0c 100644 --- a/Marlin/src/gcode/bedlevel/ubl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/ubl/M421.cpp @@ -57,9 +57,9 @@ void GcodeSuite::M421() { if (hasC) ij = ubl.find_closest_mesh_point_of_type(REAL, current_position); if (int(hasC) + int(hasI && hasJ) != 1 || !(hasZ || hasQ || hasN)) - SERIAL_ERROR_MSG(MSG_ERR_M421_PARAMETERS); + SERIAL_ERROR_MSG(STR_ERR_M421_PARAMETERS); else if (!WITHIN(ij.x, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(ij.y, 0, GRID_MAX_POINTS_Y - 1)) - SERIAL_ERROR_MSG(MSG_ERR_MESH_XY); + SERIAL_ERROR_MSG(STR_ERR_MESH_XY); else { float &zval = ubl.z_values[ij.x][ij.y]; zval = hasN ? NAN : parser.value_linear_units() + (hasQ ? zval : 0); diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index b76d4da96..bee818240 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -118,7 +118,7 @@ // Disallow Z homing if X or Y are unknown if (!TEST(axis_known_position, X_AXIS) || !TEST(axis_known_position, Y_AXIS)) { LCD_MESSAGEPGM(MSG_ERR_Z_HOMING); - SERIAL_ECHO_MSG(MSG_ERR_Z_HOMING_SER); + SERIAL_ECHO_MSG(STR_ERR_Z_HOMING_SER); return; } @@ -154,7 +154,7 @@ } else { LCD_MESSAGEPGM(MSG_ZPROBE_OUT); - SERIAL_ECHO_MSG(MSG_ZPROBE_OUT_SER); + SERIAL_ECHO_MSG(STR_ZPROBE_OUT_SER); } if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< home_z_safely"); @@ -529,7 +529,7 @@ void GcodeSuite::G28(const bool always_home_all) { #define _HOME_SYNC doZ // Only for Z-axis #endif if (_HOME_SYNC) - SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP); + SERIAL_ECHOLNPGM(STR_Z_MOVE_COMP); #endif if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G28"); diff --git a/Marlin/src/gcode/calibrate/M852.cpp b/Marlin/src/gcode/calibrate/M852.cpp index f9fa84a3b..865b03def 100644 --- a/Marlin/src/gcode/calibrate/M852.cpp +++ b/Marlin/src/gcode/calibrate/M852.cpp @@ -82,7 +82,7 @@ void GcodeSuite::M852() { #endif if (badval) - SERIAL_ECHOLNPGM(MSG_SKEW_MIN " " STRINGIFY(SKEW_FACTOR_MIN) " " MSG_SKEW_MAX " " STRINGIFY(SKEW_FACTOR_MAX)); + SERIAL_ECHOLNPGM(STR_SKEW_MIN " " STRINGIFY(SKEW_FACTOR_MIN) " " STR_SKEW_MAX " " STRINGIFY(SKEW_FACTOR_MAX)); // When skew is changed the current position changes if (setval) { diff --git a/Marlin/src/gcode/config/M218.cpp b/Marlin/src/gcode/config/M218.cpp index 644a67eea..5c7d5eac7 100644 --- a/Marlin/src/gcode/config/M218.cpp +++ b/Marlin/src/gcode/config/M218.cpp @@ -50,7 +50,7 @@ void GcodeSuite::M218() { if (!parser.seen("XYZ")) { SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_HOTEND_OFFSET); + SERIAL_ECHOPGM(STR_HOTEND_OFFSET); HOTEND_LOOP() { SERIAL_CHAR(' '); SERIAL_ECHO(hotend_offset[e].x); diff --git a/Marlin/src/gcode/config/M301.cpp b/Marlin/src/gcode/config/M301.cpp index 31584d61e..54d32c865 100644 --- a/Marlin/src/gcode/config/M301.cpp +++ b/Marlin/src/gcode/config/M301.cpp @@ -82,7 +82,7 @@ void GcodeSuite::M301() { SERIAL_EOL(); } else - SERIAL_ERROR_MSG(MSG_INVALID_EXTRUDER); + SERIAL_ERROR_MSG(STR_INVALID_EXTRUDER); } #endif // PIDTEMP diff --git a/Marlin/src/gcode/control/M111.cpp b/Marlin/src/gcode/control/M111.cpp index fd7ca09c6..bb1a77836 100644 --- a/Marlin/src/gcode/control/M111.cpp +++ b/Marlin/src/gcode/control/M111.cpp @@ -28,13 +28,13 @@ void GcodeSuite::M111() { if (parser.seen('S')) marlin_debug_flags = parser.byteval('S'); - static const char str_debug_1[] PROGMEM = MSG_DEBUG_ECHO, - str_debug_2[] PROGMEM = MSG_DEBUG_INFO, - str_debug_4[] PROGMEM = MSG_DEBUG_ERRORS, - str_debug_8[] PROGMEM = MSG_DEBUG_DRYRUN, - str_debug_16[] PROGMEM = MSG_DEBUG_COMMUNICATION + static const char str_debug_1[] PROGMEM = STR_DEBUG_ECHO, + str_debug_2[] PROGMEM = STR_DEBUG_INFO, + str_debug_4[] PROGMEM = STR_DEBUG_ERRORS, + str_debug_8[] PROGMEM = STR_DEBUG_DRYRUN, + str_debug_16[] PROGMEM = STR_DEBUG_COMMUNICATION #if ENABLED(DEBUG_LEVELING_FEATURE) - , str_debug_lvl[] PROGMEM = MSG_DEBUG_LEVELING + , str_debug_lvl[] PROGMEM = STR_DEBUG_LEVELING #endif ; @@ -46,7 +46,7 @@ void GcodeSuite::M111() { }; SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_DEBUG_PREFIX); + SERIAL_ECHOPGM(STR_DEBUG_PREFIX); if (marlin_debug_flags) { uint8_t comma = 0; for (uint8_t i = 0; i < COUNT(debug_strings); i++) { @@ -57,7 +57,7 @@ void GcodeSuite::M111() { } } else { - SERIAL_ECHOPGM(MSG_DEBUG_OFF); + SERIAL_ECHOPGM(STR_DEBUG_OFF); #if !defined(__AVR__) || !defined(USBCON) #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) SERIAL_ECHOPAIR("\nBuffer Overruns: ", MYSERIAL0.buffer_overruns()); diff --git a/Marlin/src/gcode/control/M211.cpp b/Marlin/src/gcode/control/M211.cpp index 782084b71..3b0a928b8 100644 --- a/Marlin/src/gcode/control/M211.cpp +++ b/Marlin/src/gcode/control/M211.cpp @@ -36,11 +36,11 @@ void GcodeSuite::M211() { const xyz_pos_t l_soft_min = soft_endstop.min.asLogical(), l_soft_max = soft_endstop.max.asLogical(); SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SOFT_ENDSTOPS); + SERIAL_ECHOPGM(STR_SOFT_ENDSTOPS); if (parser.seen('S')) soft_endstops_enabled = parser.value_bool(); serialprint_onoff(soft_endstops_enabled); - print_xyz(l_soft_min, PSTR(MSG_SOFT_MIN), PSTR(" ")); - print_xyz(l_soft_max, PSTR(MSG_SOFT_MAX)); + print_xyz(l_soft_min, PSTR(STR_SOFT_MIN), PSTR(" ")); + print_xyz(l_soft_max, PSTR(STR_SOFT_MAX)); } #endif diff --git a/Marlin/src/gcode/control/M605.cpp b/Marlin/src/gcode/control/M605.cpp index e45dedf27..99bab4ddc 100644 --- a/Marlin/src/gcode/control/M605.cpp +++ b/Marlin/src/gcode/control/M605.cpp @@ -167,7 +167,7 @@ extruder_duplication_enabled = ena && (duplication_e_mask >= 3); } SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_DUPLICATION_MODE); + SERIAL_ECHOPGM(STR_DUPLICATION_MODE); serialprint_onoff(extruder_duplication_enabled); if (ena) { SERIAL_ECHOPGM(" ( "); diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index 76808e9c9..f9c40a20a 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -110,6 +110,6 @@ void GcodeSuite::M81() { #endif #if HAS_LCD_MENU - LCD_MESSAGEPGM_P(PSTR(MACHINE_NAME " " MSG_OFF ".")); + LCD_MESSAGEPGM_P(PSTR(MACHINE_NAME " " STR_OFF ".")); #endif } diff --git a/Marlin/src/gcode/feature/pause/G60.cpp b/Marlin/src/gcode/feature/pause/G60.cpp index 8d2e168af..45a8734ca 100644 --- a/Marlin/src/gcode/feature/pause/G60.cpp +++ b/Marlin/src/gcode/feature/pause/G60.cpp @@ -40,7 +40,7 @@ void GcodeSuite::G60() { const uint8_t slot = parser.byteval('S'); if (slot >= SAVED_POSITIONS) { - SERIAL_ERROR_MSG(MSG_INVALID_POS_SLOT STRINGIFY(SAVED_POSITIONS)); + SERIAL_ERROR_MSG(STR_INVALID_POS_SLOT STRINGIFY(SAVED_POSITIONS)); return; } @@ -49,7 +49,7 @@ void GcodeSuite::G60() { #if ENABLED(SAVED_POSITIONS_DEBUG) const xyze_pos_t &pos = stored_position[slot]; - DEBUG_ECHOPAIR_F(MSG_SAVED_POS " S", slot); + DEBUG_ECHOPAIR_F(STR_SAVED_POS " S", slot); DEBUG_ECHOPAIR_F(" : X", pos.x); DEBUG_ECHOPAIR_F_P(SP_Y_STR, pos.y); DEBUG_ECHOLNPAIR_F_P(SP_Z_STR, pos.z); diff --git a/Marlin/src/gcode/feature/pause/G61.cpp b/Marlin/src/gcode/feature/pause/G61.cpp index ed2cfca4f..e6e518019 100644 --- a/Marlin/src/gcode/feature/pause/G61.cpp +++ b/Marlin/src/gcode/feature/pause/G61.cpp @@ -42,7 +42,7 @@ void GcodeSuite::G61(void) { #if SAVED_POSITIONS < 256 if (slot >= SAVED_POSITIONS) { - SERIAL_ERROR_MSG(MSG_INVALID_POS_SLOT STRINGIFY(SAVED_POSITIONS)); + SERIAL_ERROR_MSG(STR_INVALID_POS_SLOT STRINGIFY(SAVED_POSITIONS)); return; } #endif @@ -54,7 +54,7 @@ void GcodeSuite::G61(void) { const float fr = parser.linearval('F'); if (fr > 0.0) feedrate_mm_s = MMM_TO_MMS(fr); - SERIAL_ECHOPAIR(MSG_RESTORING_POS " S", int(slot)); + SERIAL_ECHOPAIR(STR_RESTORING_POS " S", int(slot)); LOOP_XYZ(i) { destination[i] = parser.seen(axis_codes[i]) ? stored_position[slot][i] + parser.value_axis_units((AxisEnum)i) diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 4c9832dba..0d2b656dd 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -94,7 +94,7 @@ int8_t GcodeSuite::get_target_extruder_from_command() { if (e < EXTRUDERS) return e; SERIAL_ECHO_START(); SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum); - SERIAL_ECHOLNPAIR(" " MSG_INVALID_EXTRUDER " ", int(e)); + SERIAL_ECHOLNPAIR(" " STR_INVALID_EXTRUDER " ", int(e)); return -1; } return active_extruder; @@ -111,9 +111,9 @@ int8_t GcodeSuite::get_target_e_stepper_from_command() { SERIAL_ECHO_START(); SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum); if (e == -1) - SERIAL_ECHOLNPGM(" " MSG_E_STEPPER_NOT_SPECIFIED); + SERIAL_ECHOLNPGM(" " STR_E_STEPPER_NOT_SPECIFIED); else - SERIAL_ECHOLNPAIR(" " MSG_INVALID_E_STEPPER " ", int(e)); + SERIAL_ECHOLNPAIR(" " STR_INVALID_E_STEPPER " ", int(e)); return -1; } @@ -951,13 +951,13 @@ void GcodeSuite::process_subcommands_now(char * gcode) { switch (busy_state) { case IN_HANDLER: case IN_PROCESS: - SERIAL_ECHO_MSG(MSG_BUSY_PROCESSING); + SERIAL_ECHO_MSG(STR_BUSY_PROCESSING); break; case PAUSED_FOR_USER: - SERIAL_ECHO_MSG(MSG_BUSY_PAUSED_FOR_USER); + SERIAL_ECHO_MSG(STR_BUSY_PAUSED_FOR_USER); break; case PAUSED_FOR_INPUT: - SERIAL_ECHO_MSG(MSG_BUSY_PAUSED_FOR_INPUT); + SERIAL_ECHO_MSG(STR_BUSY_PAUSED_FOR_INPUT); break; default: break; diff --git a/Marlin/src/gcode/geometry/M206_M428.cpp b/Marlin/src/gcode/geometry/M206_M428.cpp index 8f0908595..e4cac5174 100644 --- a/Marlin/src/gcode/geometry/M206_M428.cpp +++ b/Marlin/src/gcode/geometry/M206_M428.cpp @@ -69,7 +69,7 @@ void GcodeSuite::M428() { if (!WITHIN(diff[i], -20, 20) && home_dir((AxisEnum)i) > 0) diff[i] = -current_position[i]; if (!WITHIN(diff[i], -20, 20)) { - SERIAL_ERROR_MSG(MSG_ERR_M428_TOO_FAR); + SERIAL_ERROR_MSG(STR_ERR_M428_TOO_FAR); LCD_ALERTMESSAGEPGM_P(PSTR("Err: Too far!")); BUZZ(200, 40); return; diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index bce0c8918..4d2c5d5d6 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -39,7 +39,7 @@ */ void GcodeSuite::M115() { - SERIAL_ECHOLNPGM(MSG_M115_REPORT); + SERIAL_ECHOLNPGM(STR_M115_REPORT); #if ENABLED(EXTENDED_CAPABILITIES_REPORT) diff --git a/Marlin/src/gcode/lcd/M145.cpp b/Marlin/src/gcode/lcd/M145.cpp index 3ba1c3fe7..311672753 100644 --- a/Marlin/src/gcode/lcd/M145.cpp +++ b/Marlin/src/gcode/lcd/M145.cpp @@ -38,7 +38,7 @@ void GcodeSuite::M145() { const uint8_t material = (uint8_t)parser.intval('S'); if (material >= COUNT(ui.preheat_hotend_temp)) - SERIAL_ERROR_MSG(MSG_ERR_MATERIAL_INDEX); + SERIAL_ERROR_MSG(STR_ERR_MATERIAL_INDEX); else { int v; if (parser.seenval('H')) { diff --git a/Marlin/src/gcode/motion/G0_G1.cpp b/Marlin/src/gcode/motion/G0_G1.cpp index 73329e7fc..8f0dfc71b 100644 --- a/Marlin/src/gcode/motion/G0_G1.cpp +++ b/Marlin/src/gcode/motion/G0_G1.cpp @@ -118,7 +118,7 @@ void GcodeSuite::G0_G1( #endif if (_MOVE_SYNC) { planner.synchronize(); - SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP); + SERIAL_ECHOLNPGM(STR_Z_MOVE_COMP); } #endif } diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index 70043f538..b11b1136b 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -327,7 +327,7 @@ void GcodeSuite::G2_G3(const bool clockwise) { // P indicates number of circles to do int8_t circles_to_do = parser.byteval('P'); if (!WITHIN(circles_to_do, 0, 100)) - SERIAL_ERROR_MSG(MSG_ERR_ARC_ARGS); + SERIAL_ERROR_MSG(STR_ERR_ARC_ARGS); while (circles_to_do--) plan_arc(current_position, arc_offset, clockwise); @@ -338,7 +338,7 @@ void GcodeSuite::G2_G3(const bool clockwise) { reset_stepper_timeout(); } else - SERIAL_ERROR_MSG(MSG_ERR_ARC_ARGS); + SERIAL_ERROR_MSG(STR_ERR_ARC_ARGS); } } diff --git a/Marlin/src/gcode/motion/G4.cpp b/Marlin/src/gcode/motion/G4.cpp index 2310c2c72..d157face9 100644 --- a/Marlin/src/gcode/motion/G4.cpp +++ b/Marlin/src/gcode/motion/G4.cpp @@ -35,7 +35,7 @@ void GcodeSuite::G4() { planner.synchronize(); #if ENABLED(NANODLP_Z_SYNC) - SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP); + SERIAL_ECHOLNPGM(STR_Z_MOVE_COMP); #endif if (!ui.has_status()) LCD_MESSAGEPGM(MSG_DWELL); diff --git a/Marlin/src/gcode/motion/G5.cpp b/Marlin/src/gcode/motion/G5.cpp index f34be7578..5d289e11d 100644 --- a/Marlin/src/gcode/motion/G5.cpp +++ b/Marlin/src/gcode/motion/G5.cpp @@ -45,7 +45,7 @@ void GcodeSuite::G5() { #if ENABLED(CNC_WORKSPACE_PLANES) if (workspace_plane != PLANE_XY) { - SERIAL_ERROR_MSG(MSG_ERR_BAD_PLANE_MODE); + SERIAL_ERROR_MSG(STR_ERR_BAD_PLANE_MODE); return; } #endif diff --git a/Marlin/src/gcode/motion/M290.cpp b/Marlin/src/gcode/motion/M290.cpp index d6535af82..4f6489d3b 100644 --- a/Marlin/src/gcode/motion/M290.cpp +++ b/Marlin/src/gcode/motion/M290.cpp @@ -48,13 +48,13 @@ ) { probe.offset.z += offs; SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET MSG_Z ": ", probe.offset.z); + SERIAL_ECHOLNPAIR(STR_PROBE_OFFSET STR_Z ": ", probe.offset.z); } else { #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) hotend_offset[active_extruder].z -= offs; SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET MSG_Z ": ", hotend_offset[active_extruder].z); + SERIAL_ECHOLNPAIR(STR_PROBE_OFFSET STR_Z ": ", hotend_offset[active_extruder].z); #endif } } @@ -98,7 +98,7 @@ void GcodeSuite::M290() { SERIAL_ECHO_START(); #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - SERIAL_ECHOLNPAIR(MSG_PROBE_OFFSET " " MSG_Z, probe.offset.z); + SERIAL_ECHOLNPAIR(STR_PROBE_OFFSET " " STR_Z, probe.offset.z); #endif #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) diff --git a/Marlin/src/gcode/parser.cpp b/Marlin/src/gcode/parser.cpp index a49b8b216..5a473403a 100644 --- a/Marlin/src/gcode/parser.cpp +++ b/Marlin/src/gcode/parser.cpp @@ -365,7 +365,7 @@ void GCodeParser::parse(char *p) { #endif // CNC_COORDINATE_SYSTEMS void GCodeParser::unknown_command_warning() { - SERIAL_ECHO_MSG(MSG_UNKNOWN_COMMAND, command_ptr, "\""); + SERIAL_ECHO_MSG(STR_UNKNOWN_COMMAND, command_ptr, "\""); } #if ENABLED(DEBUG_GCODE_PARSER) diff --git a/Marlin/src/gcode/probe/M851.cpp b/Marlin/src/gcode/probe/M851.cpp index 242ea170a..c2e746cf0 100644 --- a/Marlin/src/gcode/probe/M851.cpp +++ b/Marlin/src/gcode/probe/M851.cpp @@ -39,9 +39,9 @@ void GcodeSuite::M851() { if (!parser.seen("XYZ")) { SERIAL_ECHOLNPAIR_P( #if HAS_PROBE_XY_OFFSET - PSTR(MSG_PROBE_OFFSET " X"), probe.offset_xy.x, SP_Y_STR, probe.offset_xy.y, SP_Z_STR + PSTR(STR_PROBE_OFFSET " X"), probe.offset_xy.x, SP_Y_STR, probe.offset_xy.y, SP_Z_STR #else - PSTR(MSG_PROBE_OFFSET " X0 Y0 Z") + PSTR(STR_PROBE_OFFSET " X0 Y0 Z") #endif , probe.offset.z ); diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index ec1d3ebd3..7d17ca602 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -163,7 +163,7 @@ bool GCodeQueue::enqueue_one(const char* cmd) { if (*cmd == 0 || *cmd == '\n' || *cmd == '\r') return true; if (_enqueue(cmd)) { - SERIAL_ECHO_MSG(MSG_ENQUEUEING, cmd, "\""); + SERIAL_ECHO_MSG(STR_ENQUEUEING, cmd, "\""); return true; } return false; @@ -244,7 +244,7 @@ void GCodeQueue::ok_to_send() { PORT_REDIRECT(pn); // Reply to the serial port that sent the command #endif if (!send_ok[index_r]) return; - SERIAL_ECHOPGM(MSG_OK); + SERIAL_ECHOPGM(STR_OK); #if ENABLED(ADVANCED_OK) char* p = command_buffer[index_r]; if (*p == 'N') { @@ -270,7 +270,7 @@ void GCodeQueue::flush_and_request_resend() { PORT_REDIRECT(pn); // Reply to the serial port that sent the command #endif SERIAL_FLUSH(); - SERIAL_ECHOPGM(MSG_RESEND); + SERIAL_ECHOPGM(STR_RESEND); SERIAL_ECHOLN(last_N + 1); ok_to_send(); } @@ -397,7 +397,7 @@ void GCodeQueue::get_serial_commands() { static millis_t last_command_time = 0; const millis_t ms = millis(); if (length == 0 && !serial_data_available() && ELAPSED(ms, last_command_time + NO_TIMEOUTS)) { - SERIAL_ECHOLNPGM(MSG_WAIT); + SERIAL_ECHOLNPGM(STR_WAIT); last_command_time = ms; } #endif @@ -436,24 +436,24 @@ void GCodeQueue::get_serial_commands() { gcode_N = strtol(npos + 1, nullptr, 10); if (gcode_N != last_N + 1 && !M110) - return gcode_line_error(PSTR(MSG_ERR_LINE_NO), i); + return gcode_line_error(PSTR(STR_ERR_LINE_NO), i); char *apos = strrchr(command, '*'); if (apos) { uint8_t checksum = 0, count = uint8_t(apos - command); while (count) checksum ^= command[--count]; if (strtol(apos + 1, nullptr, 10) != checksum) - return gcode_line_error(PSTR(MSG_ERR_CHECKSUM_MISMATCH), i); + return gcode_line_error(PSTR(STR_ERR_CHECKSUM_MISMATCH), i); } else - return gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM), i); + return gcode_line_error(PSTR(STR_ERR_NO_CHECKSUM), i); last_N = gcode_N; } #if ENABLED(SDSUPPORT) // Pronterface "M29" and "M29 " has no line number else if (card.flag.saving && !is_M29(command)) - return gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM), i); + return gcode_line_error(PSTR(STR_ERR_NO_CHECKSUM), i); #endif // @@ -472,7 +472,7 @@ void GCodeQueue::get_serial_commands() { case 5: #endif PORT_REDIRECT(i); // Reply to the serial port that sent the command - SERIAL_ECHOLNPGM(MSG_ERR_STOPPED); + SERIAL_ECHOLNPGM(STR_ERR_STOPPED); LCD_MESSAGEPGM(MSG_STOPPED); break; } @@ -527,7 +527,7 @@ void GCodeQueue::get_serial_commands() { while (length < BUFSIZE && !card_eof) { const int16_t n = card.get(); card_eof = card.eof(); - if (n < 0 && !card_eof) { SERIAL_ERROR_MSG(MSG_SD_ERR_READ); continue; } + if (n < 0 && !card_eof) { SERIAL_ERROR_MSG(STR_SD_ERR_READ); continue; } const char sd_char = (char)n; const bool is_eol = sd_char == '\n' || sd_char == '\r'; @@ -585,7 +585,7 @@ void GCodeQueue::advance() { if (is_M29(command)) { // M29 closes the file card.closefile(); - SERIAL_ECHOLNPGM(MSG_FILE_SAVED); + SERIAL_ECHOLNPGM(STR_FILE_SAVED); #if !defined(__AVR__) || !defined(USBCON) #if ENABLED(SERIAL_STATS_DROPPED_RX) diff --git a/Marlin/src/gcode/sdcard/M20.cpp b/Marlin/src/gcode/sdcard/M20.cpp index 9307808b0..c45fcb038 100644 --- a/Marlin/src/gcode/sdcard/M20.cpp +++ b/Marlin/src/gcode/sdcard/M20.cpp @@ -31,9 +31,9 @@ * M20: List SD card to serial output */ void GcodeSuite::M20() { - SERIAL_ECHOLNPGM(MSG_BEGIN_FILE_LIST); + SERIAL_ECHOLNPGM(STR_BEGIN_FILE_LIST); card.ls(); - SERIAL_ECHOLNPGM(MSG_END_FILE_LIST); + SERIAL_ECHOLNPGM(STR_END_FILE_LIST); } #endif // SDSUPPORT diff --git a/Marlin/src/gcode/temperature/M105.cpp b/Marlin/src/gcode/temperature/M105.cpp index b45d6928a..7d68ccadc 100644 --- a/Marlin/src/gcode/temperature/M105.cpp +++ b/Marlin/src/gcode/temperature/M105.cpp @@ -31,7 +31,7 @@ void GcodeSuite::M105() { const int8_t target_extruder = get_target_extruder_from_command(); if (target_extruder < 0) return; - SERIAL_ECHOPGM(MSG_OK); + SERIAL_ECHOPGM(STR_OK); #if HAS_TEMP_SENSOR diff --git a/Marlin/src/gcode/temperature/M303.cpp b/Marlin/src/gcode/temperature/M303.cpp index 87bb84b10..31f7bf350 100644 --- a/Marlin/src/gcode/temperature/M303.cpp +++ b/Marlin/src/gcode/temperature/M303.cpp @@ -52,7 +52,7 @@ void GcodeSuite::M303() { #endif const heater_ind_t e = (heater_ind_t)parser.intval('E'); if (!WITHIN(e, SI, EI)) { - SERIAL_ECHOLNPGM(MSG_PID_BAD_EXTRUDER_NUM); + SERIAL_ECHOLNPGM(STR_PID_BAD_EXTRUDER_NUM); #if ENABLED(EXTENSIBLE_UI) ExtUI::OnPidTuning(ExtUI::result_t::PID_BAD_EXTRUDER_NUM); #endif diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/marlin_events.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/marlin_events.cpp index aabc5ef27..96845d406 100644 --- a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/marlin_events.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/marlin_events.cpp @@ -137,16 +137,16 @@ namespace ExtUI { SERIAL_ECHOLNPAIR("OnPidTuning:", rst); switch (rst) { case PID_BAD_EXTRUDER_NUM: - StatusScreen::setStatusMessage(MSG_PID_BAD_EXTRUDER_NUM); + StatusScreen::setStatusMessage(STR_PID_BAD_EXTRUDER_NUM); break; case PID_TEMP_TOO_HIGH: - StatusScreen::setStatusMessage(MSG_PID_TEMP_TOO_HIGH); + StatusScreen::setStatusMessage(STR_PID_TEMP_TOO_HIGH); break; case PID_TUNING_TIMEOUT: - StatusScreen::setStatusMessage(MSG_PID_TIMEOUT); + StatusScreen::setStatusMessage(STR_PID_TIMEOUT); break; case PID_DONE: - StatusScreen::setStatusMessage(MSG_PID_AUTOTUNE_FINISHED); + StatusScreen::setStatusMessage(STR_PID_AUTOTUNE_FINISHED); break; } GOTO_SCREEN(StatusScreen); diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp index 103dcc036..862b2cd53 100644 --- a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp @@ -74,7 +74,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { 1 #endif ) - .tag(4) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU)) + .tag(4) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(STR_OFFSETS_MENU)) .enabled( #if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) 1 @@ -142,7 +142,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { 1 #endif ) - .tag(4) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU)) + .tag(4) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(STR_OFFSETS_MENU)) .tag(12).button( BTN_POS(3,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS)) .tag(5) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY)) .tag(6) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION)) diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp index 0c53dca61..41ced01cf 100644 --- a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/bio_advanced_settings.cpp @@ -62,7 +62,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { 1 #endif ) - .tag(6) .button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU)) + .tag(6) .button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(STR_OFFSETS_MENU)) .tag(7) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM)) diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp index 9901bbf45..4510c9341 100644 --- a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp @@ -62,34 +62,34 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) { .text(BTN_POS(1,1), BTN_SIZE(6,1), GET_TEXT_F(MSG_LCD_ENDSTOPS)) .font(font_tiny); #if PIN_EXISTS(X_MAX) - PIN_ENABLED (1, 2, PSTR(MSG_X_MAX), X_MAX, X_MAX_ENDSTOP_INVERTING) + PIN_ENABLED (1, 2, PSTR(STR_X_MAX), X_MAX, X_MAX_ENDSTOP_INVERTING) #else - PIN_DISABLED(1, 2, PSTR(MSG_X_MAX), X_MAX) + PIN_DISABLED(1, 2, PSTR(STR_X_MAX), X_MAX) #endif #if PIN_EXISTS(Y_MAX) - PIN_ENABLED (3, 2, PSTR(MSG_Y_MAX), Y_MAX, Y_MAX_ENDSTOP_INVERTING) + PIN_ENABLED (3, 2, PSTR(STR_Y_MAX), Y_MAX, Y_MAX_ENDSTOP_INVERTING) #else - PIN_DISABLED(3, 2, PSTR(MSG_Y_MAX), Y_MAX) + PIN_DISABLED(3, 2, PSTR(STR_Y_MAX), Y_MAX) #endif #if PIN_EXISTS(Z_MAX) - PIN_ENABLED (5, 2, PSTR(MSG_Z_MAX), Z_MAX, Z_MAX_ENDSTOP_INVERTING) + PIN_ENABLED (5, 2, PSTR(STR_Z_MAX), Z_MAX, Z_MAX_ENDSTOP_INVERTING) #else - PIN_DISABLED(5, 2, PSTR(MSG_Z_MAX), Z_MAX) + PIN_DISABLED(5, 2, PSTR(STR_Z_MAX), Z_MAX) #endif #if PIN_EXISTS(X_MIN) - PIN_ENABLED (1, 3, PSTR(MSG_X_MIN), X_MIN, X_MIN_ENDSTOP_INVERTING) + PIN_ENABLED (1, 3, PSTR(STR_X_MIN), X_MIN, X_MIN_ENDSTOP_INVERTING) #else - PIN_DISABLED(1, 3, PSTR(MSG_X_MIN), X_MIN) + PIN_DISABLED(1, 3, PSTR(STR_X_MIN), X_MIN) #endif #if PIN_EXISTS(Y_MIN) - PIN_ENABLED (3, 3, PSTR(MSG_Y_MIN), Y_MIN, Y_MIN_ENDSTOP_INVERTING) + PIN_ENABLED (3, 3, PSTR(STR_Y_MIN), Y_MIN, Y_MIN_ENDSTOP_INVERTING) #else - PIN_DISABLED(3, 3, PSTR(MSG_Y_MIN), Y_MIN) + PIN_DISABLED(3, 3, PSTR(STR_Y_MIN), Y_MIN) #endif #if PIN_EXISTS(Z_MIN) - PIN_ENABLED (5, 3, PSTR(MSG_Z_MIN), Z_MIN, Z_MIN_ENDSTOP_INVERTING) + PIN_ENABLED (5, 3, PSTR(STR_Z_MIN), Z_MIN, Z_MIN_ENDSTOP_INVERTING) #else - PIN_DISABLED(5, 3, PSTR(MSG_Z_MIN), Z_MIN) + PIN_DISABLED(5, 3, PSTR(STR_Z_MIN), Z_MIN) #endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT) PIN_ENABLED (1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT, FIL_RUNOUT_INVERTING) @@ -102,9 +102,9 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) { PIN_DISABLED(3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2) #endif #if PIN_EXISTS(Z_MIN_PROBE) - PIN_ENABLED (5, 4, PSTR(MSG_Z_PROBE), Z_MIN_PROBE, Z_MIN_PROBE_ENDSTOP_INVERTING) + PIN_ENABLED (5, 4, PSTR(STR_Z_PROBE), Z_MIN_PROBE, Z_MIN_PROBE_ENDSTOP_INVERTING) #else - PIN_DISABLED(5, 4, PSTR(MSG_Z_PROBE), Z_MIN_PROBE) + PIN_DISABLED(5, 4, PSTR(STR_Z_PROBE), Z_MIN_PROBE) #endif #if HAS_SOFTWARE_ENDSTOPS diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp index ae224e9c1..406a01626 100644 --- a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nozzle_offsets_screen.cpp @@ -41,7 +41,7 @@ void NozzleOffsetScreen::onRedraw(draw_mode_t what) { widgets_t w(what); w.precision(2).units(GET_TEXT_F(MSG_UNITS_MM)); - w.heading( GET_TEXT_F(MSG_OFFSETS_MENU)); + w.heading( GET_TEXT_F(STR_OFFSETS_MENU)); w.color(Theme::x_axis).adjuster(2, GET_TEXT_F(MSG_AXIS_X), ExtUI::getNozzleOffset_mm(X, E1)); w.color(Theme::y_axis).adjuster(4, GET_TEXT_F(MSG_AXIS_Y), ExtUI::getNozzleOffset_mm(Y, E1)); w.color(Theme::z_axis).adjuster(6, GET_TEXT_F(MSG_AXIS_Z), ExtUI::getNozzleOffset_mm(Z, E1)); diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp index d9910ffa0..777c447cd 100644 --- a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp @@ -74,7 +74,7 @@ void NudgeNozzleScreen::onRedraw(draw_mode_t what) { #if HOTENDS > 1 format_position(str, getNozzleOffset_mm(X, E1), getNozzleOffset_mm(Y, E1), getNozzleOffset_mm(Z, E1)); - w.text_field(0, GET_TEXT_F(MSG_OFFSETS_MENU), str); + w.text_field(0, GET_TEXT_F(STR_OFFSETS_MENU), str); #endif } #endif diff --git a/Marlin/src/lcd/extui_dgus_lcd.cpp b/Marlin/src/lcd/extui_dgus_lcd.cpp index 7ec280122..5c6f11d7c 100644 --- a/Marlin/src/lcd/extui_dgus_lcd.cpp +++ b/Marlin/src/lcd/extui_dgus_lcd.cpp @@ -136,16 +136,16 @@ namespace ExtUI { SERIAL_ECHOLNPAIR("OnPidTuning:",rst); switch(rst) { case PID_BAD_EXTRUDER_NUM: - ScreenHandler.setstatusmessagePGM(PSTR(MSG_PID_BAD_EXTRUDER_NUM)); + ScreenHandler.setstatusmessagePGM(PSTR(STR_PID_BAD_EXTRUDER_NUM)); break; case PID_TEMP_TOO_HIGH: - ScreenHandler.setstatusmessagePGM(PSTR(MSG_PID_TEMP_TOO_HIGH)); + ScreenHandler.setstatusmessagePGM(PSTR(STR_PID_TEMP_TOO_HIGH)); break; case PID_TUNING_TIMEOUT: - ScreenHandler.setstatusmessagePGM(PSTR(MSG_PID_TIMEOUT)); + ScreenHandler.setstatusmessagePGM(PSTR(STR_PID_TIMEOUT)); break; case PID_DONE: - ScreenHandler.setstatusmessagePGM(PSTR(MSG_PID_AUTOTUNE_FINISHED)); + ScreenHandler.setstatusmessagePGM(PSTR(STR_PID_AUTOTUNE_FINISHED)); break; } ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN); diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 1ebd9374c..03bcedb73 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -85,13 +85,13 @@ void menu_cancelobject(); BACK_ITEM(MSG_ADVANCED_SETTINGS); #define EDIT_CURRENT_PWM(LABEL,I) EDIT_ITEM_P(long5, PSTR(LABEL), &stepper.motor_current_setting[I], 100, 2000, stepper.refresh_motor_power) #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - EDIT_CURRENT_PWM(MSG_X MSG_Y, 0); + EDIT_CURRENT_PWM(STR_X STR_Y, 0); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - EDIT_CURRENT_PWM(MSG_Z, 1); + EDIT_CURRENT_PWM(STR_Z, 1); #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - EDIT_CURRENT_PWM(MSG_E, 2); + EDIT_CURRENT_PWM(STR_E, 2); #endif END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index d2285e083..809c719ff 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -327,7 +327,7 @@ void menu_configuration() { #endif #if HAS_HOTEND_OFFSET - SUBMENU(MSG_OFFSETS_MENU, menu_tool_offsets); + SUBMENU(STR_OFFSETS_MENU, menu_tool_offsets); #endif #if ENABLED(DUAL_X_CARRIAGE) diff --git a/Marlin/src/lcd/menu/menu_tmc.cpp b/Marlin/src/lcd/menu/menu_tmc.cpp index ed70a3e7f..4d971e4e3 100644 --- a/Marlin/src/lcd/menu/menu_tmc.cpp +++ b/Marlin/src/lcd/menu/menu_tmc.cpp @@ -38,28 +38,28 @@ void menu_tmc_current() { START_MENU(); BACK_ITEM(MSG_TMC_DRIVERS); #if AXIS_IS_TMC(X) - TMC_EDIT_STORED_I_RMS(X, MSG_X); + TMC_EDIT_STORED_I_RMS(X, STR_X); #endif #if AXIS_IS_TMC(Y) - TMC_EDIT_STORED_I_RMS(Y, MSG_Y); + TMC_EDIT_STORED_I_RMS(Y, STR_Y); #endif #if AXIS_IS_TMC(Z) - TMC_EDIT_STORED_I_RMS(Z, MSG_Z); + TMC_EDIT_STORED_I_RMS(Z, STR_Z); #endif #if AXIS_IS_TMC(X2) - TMC_EDIT_STORED_I_RMS(X2, MSG_X2); + TMC_EDIT_STORED_I_RMS(X2, STR_X2); #endif #if AXIS_IS_TMC(Y2) - TMC_EDIT_STORED_I_RMS(Y2, MSG_Y2); + TMC_EDIT_STORED_I_RMS(Y2, STR_Y2); #endif #if AXIS_IS_TMC(Z2) - TMC_EDIT_STORED_I_RMS(Z2, MSG_Z2); + TMC_EDIT_STORED_I_RMS(Z2, STR_Z2); #endif #if AXIS_IS_TMC(Z3) - TMC_EDIT_STORED_I_RMS(Z3, MSG_Z3); + TMC_EDIT_STORED_I_RMS(Z3, STR_Z3); #endif #if AXIS_IS_TMC(Z4) - TMC_EDIT_STORED_I_RMS(Z4, MSG_Z4); + TMC_EDIT_STORED_I_RMS(Z4, STR_Z4); #endif #if AXIS_IS_TMC(E0) TMC_EDIT_STORED_I_RMS(E0, LCD_STR_E0); @@ -96,28 +96,28 @@ void menu_tmc_current() { START_MENU(); BACK_ITEM(MSG_TMC_DRIVERS); #if AXIS_HAS_STEALTHCHOP(X) - TMC_EDIT_STORED_HYBRID_THRS(X, MSG_X); + TMC_EDIT_STORED_HYBRID_THRS(X, STR_X); #endif #if AXIS_HAS_STEALTHCHOP(Y) - TMC_EDIT_STORED_HYBRID_THRS(Y, MSG_Y); + TMC_EDIT_STORED_HYBRID_THRS(Y, STR_Y); #endif #if AXIS_HAS_STEALTHCHOP(Z) - TMC_EDIT_STORED_HYBRID_THRS(Z, MSG_Z); + TMC_EDIT_STORED_HYBRID_THRS(Z, STR_Z); #endif #if AXIS_HAS_STEALTHCHOP(X2) - TMC_EDIT_STORED_HYBRID_THRS(X2, MSG_X2); + TMC_EDIT_STORED_HYBRID_THRS(X2, STR_X2); #endif #if AXIS_HAS_STEALTHCHOP(Y2) - TMC_EDIT_STORED_HYBRID_THRS(Y2, MSG_Y2); + TMC_EDIT_STORED_HYBRID_THRS(Y2, STR_Y2); #endif #if AXIS_HAS_STEALTHCHOP(Z2) - TMC_EDIT_STORED_HYBRID_THRS(Z2, MSG_Z2); + TMC_EDIT_STORED_HYBRID_THRS(Z2, STR_Z2); #endif #if AXIS_HAS_STEALTHCHOP(Z3) - TMC_EDIT_STORED_HYBRID_THRS(Z3, MSG_Z3); + TMC_EDIT_STORED_HYBRID_THRS(Z3, STR_Z3); #endif #if AXIS_HAS_STEALTHCHOP(Z4) - TMC_EDIT_STORED_HYBRID_THRS(Z4, MSG_Z4); + TMC_EDIT_STORED_HYBRID_THRS(Z4, STR_Z4); #endif #if AXIS_HAS_STEALTHCHOP(E0) TMC_EDIT_STORED_HYBRID_THRS(E0, LCD_STR_E0); @@ -181,28 +181,28 @@ void menu_tmc_current() { STATIC_ITEM(MSG_TMC_STEALTH_ENABLED); BACK_ITEM(MSG_TMC_DRIVERS); #if AXIS_HAS_STEALTHCHOP(X) - TMC_EDIT_STEP_MODE(X, MSG_X); + TMC_EDIT_STEP_MODE(X, STR_X); #endif #if AXIS_HAS_STEALTHCHOP(Y) - TMC_EDIT_STEP_MODE(Y, MSG_Y); + TMC_EDIT_STEP_MODE(Y, STR_Y); #endif #if AXIS_HAS_STEALTHCHOP(Z) - TMC_EDIT_STEP_MODE(Z, MSG_Z); + TMC_EDIT_STEP_MODE(Z, STR_Z); #endif #if AXIS_HAS_STEALTHCHOP(X2) - TMC_EDIT_STEP_MODE(X2, MSG_X2); + TMC_EDIT_STEP_MODE(X2, STR_X2); #endif #if AXIS_HAS_STEALTHCHOP(Y2) - TMC_EDIT_STEP_MODE(Y2, MSG_Y2); + TMC_EDIT_STEP_MODE(Y2, STR_Y2); #endif #if AXIS_HAS_STEALTHCHOP(Z2) - TMC_EDIT_STEP_MODE(Z2, MSG_Z2); + TMC_EDIT_STEP_MODE(Z2, STR_Z2); #endif #if AXIS_HAS_STEALTHCHOP(Z3) - TMC_EDIT_STEP_MODE(Z3, MSG_Z3); + TMC_EDIT_STEP_MODE(Z3, STR_Z3); #endif #if AXIS_HAS_STEALTHCHOP(Z4) - TMC_EDIT_STEP_MODE(Z4, MSG_Z4); + TMC_EDIT_STEP_MODE(Z4, STR_Z4); #endif #if AXIS_HAS_STEALTHCHOP(E0) TMC_EDIT_STEP_MODE(E0, LCD_STR_E0); diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index d291f972d..018f471c3 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -386,7 +386,7 @@ void Endstops::event_handler() { #define ENDSTOP_HIT_TEST_Z() _ENDSTOP_HIT_TEST(Z,'Z') SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT); + SERIAL_ECHOPGM(STR_ENDSTOPS_HIT); ENDSTOP_HIT_TEST_X(); ENDSTOP_HIT_TEST_Y(); ENDSTOP_HIT_TEST_Z(); @@ -415,7 +415,7 @@ void Endstops::event_handler() { static void print_es_state(const bool is_hit, PGM_P const label=nullptr) { if (label) serialprintPGM(label); SERIAL_ECHOPGM(": "); - serialprintPGM(is_hit ? PSTR(MSG_ENDSTOP_HIT) : PSTR(MSG_ENDSTOP_OPEN)); + serialprintPGM(is_hit ? PSTR(STR_ENDSTOP_HIT) : PSTR(STR_ENDSTOP_OPEN)); SERIAL_EOL(); } @@ -423,7 +423,7 @@ void _O2 Endstops::report_states() { #if ENABLED(BLTOUCH) bltouch._set_SW_mode(); #endif - SERIAL_ECHOLNPGM(MSG_M119_REPORT); + SERIAL_ECHOLNPGM(STR_M119_REPORT); #define ES_REPORT(S) print_es_state(READ(S##_PIN) != S##_ENDSTOP_INVERTING, PSTR(MSG_##S)) #if HAS_X_MIN ES_REPORT(X_MIN); @@ -474,11 +474,11 @@ void _O2 Endstops::report_states() { ES_REPORT(Z4_MAX); #endif #if HAS_CUSTOM_PROBE_PIN - print_es_state(READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING, PSTR(MSG_Z_PROBE)); + print_es_state(READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING, PSTR(STR_Z_PROBE)); #endif #if HAS_FILAMENT_SENSOR #if NUM_RUNOUT_SENSORS == 1 - print_es_state(READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_INVERTING, PSTR(MSG_FILAMENT_RUNOUT_SENSOR)); + print_es_state(READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_INVERTING, PSTR(STR_FILAMENT_RUNOUT_SENSOR)); #else #define _CASE_RUNOUT(N) case N: pin = FIL_RUNOUT##N##_PIN; break; for (uint8_t i = 1; i <= NUM_RUNOUT_SENSORS; i++) { @@ -487,7 +487,7 @@ void _O2 Endstops::report_states() { default: continue; REPEAT_S(1, INCREMENT(NUM_RUNOUT_SENSORS), _CASE_RUNOUT) } - SERIAL_ECHOPGM(MSG_FILAMENT_RUNOUT_SENSOR); + SERIAL_ECHOPGM(STR_FILAMENT_RUNOUT_SENSOR); if (i > 1) SERIAL_CHAR(' ', '0' + i); print_es_state(extDigitalRead(pin) != FIL_RUNOUT_INVERTING); } diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 84ab09b76..9f6cbf1b3 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1018,7 +1018,7 @@ void prepare_move_to_destination() { #if ENABLED(PREVENT_COLD_EXTRUSION) ignore_e = thermalManager.tooColdToExtrude(active_extruder); - if (ignore_e) SERIAL_ECHO_MSG(MSG_ERR_COLD_EXTRUDE_STOP); + if (ignore_e) SERIAL_ECHO_MSG(STR_ERR_COLD_EXTRUDE_STOP); #endif #if ENABLED(PREVENT_LENGTHY_EXTRUDE) @@ -1030,13 +1030,13 @@ void prepare_move_to_destination() { MIXER_STEPPER_LOOP(e) { if (e_delta * collector[e] > (EXTRUDE_MAXLENGTH)) { ignore_e = true; - SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP); + SERIAL_ECHO_MSG(STR_ERR_LONG_EXTRUDE_STOP); break; } } #else ignore_e = true; - SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP); + SERIAL_ECHO_MSG(STR_ERR_LONG_EXTRUDE_STOP); #endif } #endif diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index b39ac993b..bf01c771a 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1748,7 +1748,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, position_float.e = target_float.e; #endif de = 0; // no difference - SERIAL_ECHO_MSG(MSG_ERR_COLD_EXTRUDE_STOP); + SERIAL_ECHO_MSG(STR_ERR_COLD_EXTRUDE_STOP); } #endif // PREVENT_COLD_EXTRUSION #if ENABLED(PREVENT_LENGTHY_EXTRUDE) @@ -1770,7 +1770,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, position_float.e = target_float.e; #endif de = 0; // no difference - SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP); + SERIAL_ECHO_MSG(STR_ERR_LONG_EXTRUDE_STOP); } } #endif // PREVENT_LENGTHY_EXTRUDE diff --git a/Marlin/src/module/printcounter.cpp b/Marlin/src/module/printcounter.cpp index 43c4992ec..3fa09c883 100644 --- a/Marlin/src/module/printcounter.cpp +++ b/Marlin/src/module/printcounter.cpp @@ -183,7 +183,7 @@ void PrintCounter::saveStats() { #if HAS_SERVICE_INTERVALS inline void _service_when(char buffer[], const char * const msg, const uint32_t when) { - SERIAL_ECHOPGM(MSG_STATS); + SERIAL_ECHOPGM(STR_STATS); serialprintPGM(msg); SERIAL_ECHOLNPAIR(" in ", duration_t(when).toString(buffer)); } @@ -192,7 +192,7 @@ void PrintCounter::saveStats() { void PrintCounter::showStats() { char buffer[21]; - SERIAL_ECHOPGM(MSG_STATS); + SERIAL_ECHOPGM(STR_STATS); SERIAL_ECHOLNPAIR( "Prints: ", data.totalPrints, ", Finished: ", data.finishedPrints, @@ -200,7 +200,7 @@ void PrintCounter::showStats() { - ((isRunning() || isPaused()) ? 1 : 0) // Remove 1 from failures with an active counter ); - SERIAL_ECHOPGM(MSG_STATS); + SERIAL_ECHOPGM(STR_STATS); duration_t elapsed = data.printTime; elapsed.toString(buffer); SERIAL_ECHOPAIR("Total time: ", buffer); @@ -217,7 +217,7 @@ void PrintCounter::showStats() { SERIAL_CHAR(')'); #endif - SERIAL_ECHOPAIR("\n" MSG_STATS "Filament used: ", data.filamentUsed / 1000); + SERIAL_ECHOPAIR("\n" STR_STATS "Filament used: ", data.filamentUsed / 1000); SERIAL_CHAR('m'); SERIAL_EOL(); diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index cf74d464f..e22ee22d5 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -392,7 +392,7 @@ bool Probe::set_deployed(const bool deploy) { _BV(X_AXIS) #endif )) { - SERIAL_ERROR_MSG(MSG_STOP_UNHOMED); + SERIAL_ERROR_MSG(STR_STOP_UNHOMED); stop(); return true; } @@ -771,7 +771,7 @@ float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise if (isnan(measured_z)) { stow(); LCD_MESSAGEPGM(MSG_LCD_PROBING_FAILED); - SERIAL_ERROR_MSG(MSG_ERR_PROBING_FAILED); + SERIAL_ERROR_MSG(STR_ERR_PROBING_FAILED); } if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< Probe::probe_at_point"); diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 66fc39228..68639d40f 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -2462,9 +2462,9 @@ void Stepper::report_positions() { #endif #if CORE_IS_XY || CORE_IS_XZ || ENABLED(DELTA) || IS_SCARA - SERIAL_ECHOPAIR(MSG_COUNT_A, pos.x, " B:", pos.y); + SERIAL_ECHOPAIR(STR_COUNT_A, pos.x, " B:", pos.y); #else - SERIAL_ECHOPAIR(MSG_COUNT_X, pos.x, " Y:", pos.y); + SERIAL_ECHOPAIR(STR_COUNT_X, pos.x, " Y:", pos.y); #endif #if CORE_IS_XZ || CORE_IS_YZ || ENABLED(DELTA) SERIAL_ECHOLNPAIR(" C:", pos.z); diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index de64c28c8..7cee5fb1e 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -111,6 +111,9 @@ Temperature thermalManager; +const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY, + str_t_heating_failed[] PROGMEM = STR_T_HEATING_FAILED; + /** * Macros to include the heater id in temp errors. The compiler's dead-code * elimination should (hopefully) optimize out the unused strings. @@ -404,14 +407,14 @@ volatile bool Temperature::raw_temps_ready = false; #endif if (target > GHV(BED_MAXTEMP - 10, temp_range[heater].maxtemp - 15)) { - SERIAL_ECHOLNPGM(MSG_PID_TEMP_TOO_HIGH); + SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); #if ENABLED(EXTENSIBLE_UI) ExtUI::OnPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH); #endif return; } - SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_START); + SERIAL_ECHOLNPGM(STR_PID_AUTOTUNE_START); disable_all_heaters(); @@ -472,27 +475,27 @@ volatile bool Temperature::raw_temps_ready = false; LIMIT(bias, 20, max_pow - 20); d = (bias > max_pow >> 1) ? max_pow - 1 - bias : bias; - SERIAL_ECHOPAIR(MSG_BIAS, bias, MSG_D, d, MSG_T_MIN, minT, MSG_T_MAX, maxT); + SERIAL_ECHOPAIR(STR_BIAS, bias, STR_D_COLON, d, STR_T_MIN, minT, STR_T_MAX, maxT); if (cycles > 2) { const float Ku = (4.0f * d) / (float(M_PI) * (maxT - minT) * 0.5f), Tu = float(t_low + t_high) * 0.001f, pf = isbed ? 0.2f : 0.6f, df = isbed ? 1.0f / 3.0f : 1.0f / 8.0f; - SERIAL_ECHOPAIR(MSG_KU, Ku, MSG_TU, Tu); + SERIAL_ECHOPAIR(STR_KU, Ku, STR_TU, Tu); if (isbed) { // Do not remove this otherwise PID autotune won't work right for the bed! tune_pid.Kp = Ku * 0.2f; tune_pid.Ki = 2 * tune_pid.Kp / Tu; tune_pid.Kd = tune_pid.Kp * Tu / 3; SERIAL_ECHOLNPGM("\n" " No overshoot"); // Works far better for the bed. Classic and some have bad ringing. - SERIAL_ECHOLNPAIR(MSG_KP, tune_pid.Kp, MSG_KI, tune_pid.Ki, MSG_KD, tune_pid.Kd); + SERIAL_ECHOLNPAIR(STR_KP, tune_pid.Kp, STR_KI, tune_pid.Ki, STR_KD, tune_pid.Kd); } else { tune_pid.Kp = Ku * pf; tune_pid.Kd = tune_pid.Kp * Tu * df; tune_pid.Ki = 2 * tune_pid.Kp / Tu; - SERIAL_ECHOLNPGM("\n" MSG_CLASSIC_PID); - SERIAL_ECHOLNPAIR(MSG_KP, tune_pid.Kp, MSG_KI, tune_pid.Ki, MSG_KD, tune_pid.Kd); + SERIAL_ECHOLNPGM("\n" STR_CLASSIC_PID); + SERIAL_ECHOLNPAIR(STR_KP, tune_pid.Kp, STR_KI, tune_pid.Ki, STR_KD, tune_pid.Kd); } /** @@ -520,7 +523,7 @@ volatile bool Temperature::raw_temps_ready = false; #define MAX_OVERSHOOT_PID_AUTOTUNE 30 #endif if (current_temp > target + MAX_OVERSHOOT_PID_AUTOTUNE) { - SERIAL_ECHOLNPGM(MSG_PID_TEMP_TOO_HIGH); + SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); #if ENABLED(EXTENSIBLE_UI) ExtUI::OnPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH); #endif @@ -553,10 +556,10 @@ volatile bool Temperature::raw_temps_ready = false; if (current_temp > watch_temp_target) heated = true; // - Flag if target temperature reached } else if (ELAPSED(ms, temp_change_ms)) // Watch timer expired - _temp_error(heater, PSTR(MSG_T_HEATING_FAILED), GET_TEXT(MSG_HEATING_FAILED_LCD)); + _temp_error(heater, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD)); } else if (current_temp < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far? - _temp_error(heater, PSTR(MSG_T_THERMAL_RUNAWAY), GET_TEXT(MSG_THERMAL_RUNAWAY)); + _temp_error(heater, str_t_thermal_runaway, GET_TEXT(MSG_THERMAL_RUNAWAY)); } #endif } // every 2 seconds @@ -569,12 +572,12 @@ volatile bool Temperature::raw_temps_ready = false; #if ENABLED(EXTENSIBLE_UI) ExtUI::OnPidTuning(ExtUI::result_t::PID_TUNING_TIMEOUT); #endif - SERIAL_ECHOLNPGM(MSG_PID_TIMEOUT); + SERIAL_ECHOLNPGM(STR_PID_TIMEOUT); break; } if (cycles > ncycles && cycles > 2) { - SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_FINISHED); + SERIAL_ECHOLNPGM(STR_PID_AUTOTUNE_FINISHED); #if HAS_PID_FOR_BOTH const char * const estring = GHV(PSTR("bed"), NUL_STR); @@ -782,12 +785,12 @@ void Temperature::_temp_error(const heater_ind_t heater, PGM_P const serial_msg, ) { SERIAL_ERROR_START(); serialprintPGM(serial_msg); - SERIAL_ECHOPGM(MSG_STOPPED_HEATER); + SERIAL_ECHOPGM(STR_STOPPED_HEATER); if (heater >= 0) SERIAL_ECHO((int)heater); #if HAS_HEATED_CHAMBER - else if (heater == H_CHAMBER) SERIAL_ECHOPGM(MSG_HEATER_CHAMBER); + else if (heater == H_CHAMBER) SERIAL_ECHOPGM(STR_HEATER_CHAMBER); #endif - else SERIAL_ECHOPGM(MSG_HEATER_BED); + else SERIAL_ECHOPGM(STR_HEATER_BED); SERIAL_EOL(); } @@ -817,11 +820,11 @@ void Temperature::_temp_error(const heater_ind_t heater, PGM_P const serial_msg, } void Temperature::max_temp_error(const heater_ind_t heater) { - _temp_error(heater, PSTR(MSG_T_MAXTEMP), GET_TEXT(MSG_ERR_MAXTEMP)); + _temp_error(heater, PSTR(STR_T_MAXTEMP), GET_TEXT(MSG_ERR_MAXTEMP)); } void Temperature::min_temp_error(const heater_ind_t heater) { - _temp_error(heater, PSTR(MSG_T_MINTEMP), GET_TEXT(MSG_ERR_MINTEMP)); + _temp_error(heater, PSTR(STR_T_MINTEMP), GET_TEXT(MSG_ERR_MINTEMP)); } #if HOTENDS @@ -909,18 +912,18 @@ void Temperature::min_temp_error(const heater_ind_t heater) { if (ee == active_extruder) { SERIAL_ECHO_START(); SERIAL_ECHOPAIR( - MSG_PID_DEBUG, ee, - MSG_PID_DEBUG_INPUT, temp_hotend[ee].celsius, - MSG_PID_DEBUG_OUTPUT, pid_output + STR_PID_DEBUG, ee, + STR_PID_DEBUG_INPUT, temp_hotend[ee].celsius, + STR_PID_DEBUG_OUTPUT, pid_output ); #if DISABLED(PID_OPENLOOP) { SERIAL_ECHOPAIR( - MSG_PID_DEBUG_PTERM, work_pid[ee].Kp, - MSG_PID_DEBUG_ITERM, work_pid[ee].Ki, - MSG_PID_DEBUG_DTERM, work_pid[ee].Kd + STR_PID_DEBUG_PTERM, work_pid[ee].Kp, + STR_PID_DEBUG_ITERM, work_pid[ee].Ki, + STR_PID_DEBUG_DTERM, work_pid[ee].Kd #if ENABLED(PID_EXTRUSION_SCALING) - , MSG_PID_DEBUG_CTERM, work_pid[ee].Kc + , STR_PID_DEBUG_CTERM, work_pid[ee].Kc #endif ); } @@ -996,9 +999,9 @@ void Temperature::min_temp_error(const heater_ind_t heater) { SERIAL_ECHOLNPAIR( " PID_BED_DEBUG : Input ", temp_bed.celsius, " Output ", pid_output, #if DISABLED(PID_OPENLOOP) - MSG_PID_DEBUG_PTERM, work_pid.Kp, - MSG_PID_DEBUG_ITERM, work_pid.Ki, - MSG_PID_DEBUG_DTERM, work_pid.Kd, + STR_PID_DEBUG_PTERM, work_pid.Kp, + STR_PID_DEBUG_ITERM, work_pid.Ki, + STR_PID_DEBUG_DTERM, work_pid.Kd, #endif ); } @@ -1054,7 +1057,7 @@ void Temperature::manage_heater() { HOTEND_LOOP() { #if ENABLED(THERMAL_PROTECTION_HOTENDS) if (degHotend(e) > temp_range[e].maxtemp) - _temp_error((heater_ind_t)e, PSTR(MSG_T_THERMAL_RUNAWAY), GET_TEXT(MSG_THERMAL_RUNAWAY)); + _temp_error((heater_ind_t)e, str_t_thermal_runaway, GET_TEXT(MSG_THERMAL_RUNAWAY)); #endif #if HEATER_IDLE_HANDLER @@ -1072,7 +1075,7 @@ void Temperature::manage_heater() { // Make sure temperature is increasing if (watch_hotend[e].next_ms && ELAPSED(ms, watch_hotend[e].next_ms)) { // Time to check this extruder? if (degHotend(e) < watch_hotend[e].target) // Failed to increase enough? - _temp_error((heater_ind_t)e, PSTR(MSG_T_HEATING_FAILED), GET_TEXT(MSG_HEATING_FAILED_LCD)); + _temp_error((heater_ind_t)e, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD)); else // Start again if the target is still far off start_watching_hotend(e); } @@ -1081,7 +1084,7 @@ void Temperature::manage_heater() { #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) // Make sure measured temperatures are close together if (ABS(temp_hotend[0].celsius - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) - _temp_error(H_E0, PSTR(MSG_REDUNDANCY), GET_TEXT(MSG_ERR_REDUNDANT_TEMP)); + _temp_error(H_E0, PSTR(STR_REDUNDANCY), GET_TEXT(MSG_ERR_REDUNDANT_TEMP)); #endif } // HOTEND_LOOP @@ -1107,14 +1110,14 @@ void Temperature::manage_heater() { #if ENABLED(THERMAL_PROTECTION_BED) if (degBed() > BED_MAXTEMP) - _temp_error(H_BED, PSTR(MSG_T_THERMAL_RUNAWAY), GET_TEXT(MSG_THERMAL_RUNAWAY)); + _temp_error(H_BED, str_t_thermal_runaway, GET_TEXT(MSG_THERMAL_RUNAWAY)); #endif #if WATCH_BED // Make sure temperature is increasing if (watch_bed.elapsed(ms)) { // Time to check the bed? if (degBed() < watch_bed.target) // Failed to increase enough? - _temp_error(H_BED, PSTR(MSG_T_HEATING_FAILED), GET_TEXT(MSG_HEATING_FAILED_LCD)); + _temp_error(H_BED, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD)); else // Start again if the target is still far off start_watching_bed(); } @@ -1185,14 +1188,14 @@ void Temperature::manage_heater() { #if ENABLED(THERMAL_PROTECTION_CHAMBER) if (degChamber() > CHAMBER_MAXTEMP) - _temp_error(H_CHAMBER, PSTR(MSG_T_THERMAL_RUNAWAY), GET_TEXT(MSG_THERMAL_RUNAWAY)); + _temp_error(H_CHAMBER, str_t_thermal_runaway, GET_TEXT(MSG_THERMAL_RUNAWAY)); #endif #if WATCH_CHAMBER // Make sure temperature is increasing if (watch_chamber.elapsed(ms)) { // Time to check the chamber? if (degChamber() < watch_chamber.target) // Failed to increase enough? - _temp_error(H_CHAMBER, PSTR(MSG_T_HEATING_FAILED), GET_TEXT(MSG_HEATING_FAILED_LCD)); + _temp_error(H_CHAMBER, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD)); else start_watching_chamber(); // Start again if the target is still far off } @@ -1404,7 +1407,7 @@ void Temperature::manage_heater() { { SERIAL_ERROR_START(); SERIAL_ECHO((int)e); - SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER_NUM); + SERIAL_ECHOLNPGM(STR_INVALID_EXTRUDER_NUM); kill(); return 0; } @@ -2067,7 +2070,7 @@ void Temperature::init() { sm.state = TRRunaway; case TRRunaway: - _temp_error(heater_id, PSTR(MSG_T_THERMAL_RUNAWAY), GET_TEXT(MSG_THERMAL_RUNAWAY)); + _temp_error(heater_id, str_t_thermal_runaway, GET_TEXT(MSG_THERMAL_RUNAWAY)); } } diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index cf104e7b5..021878c1e 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -700,7 +700,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a inline void invalid_extruder_error(const uint8_t e) { SERIAL_ECHO_START(); SERIAL_CHAR('T'); SERIAL_ECHO(int(e)); - SERIAL_CHAR(' '); SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER); + SERIAL_CHAR(' '); SERIAL_ECHOLNPGM(STR_INVALID_EXTRUDER); } #endif @@ -843,7 +843,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { #endif if (should_swap) { if (too_cold) { - SERIAL_ECHO_MSG(MSG_ERR_HOTEND_TOO_COLD); + SERIAL_ECHO_MSG(STR_ERR_HOTEND_TOO_COLD); #if ENABLED(SINGLENOZZLE) active_extruder = new_tool; return; @@ -1073,7 +1073,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { #endif SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, int(active_extruder)); + SERIAL_ECHOLNPAIR(STR_ACTIVE_EXTRUDER, int(active_extruder)); #endif // EXTRUDERS > 1 } diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 426d540c7..2bde9501f 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -248,7 +248,7 @@ void CardReader::printListing(SdFile parent, const char * const prepend/*=nullpt SdFile child; if (!child.open(&parent, dosFilename, O_READ)) { SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_SD_CANT_OPEN_SUBDIR, dosFilename); + SERIAL_ECHOLNPAIR(STR_SD_CANT_OPEN_SUBDIR, dosFilename); } printListing(child, path); // close() is done automatically by destructor of SdFile @@ -318,7 +318,7 @@ void CardReader::ls() { if (!dir.open(&diveDir, segment, O_READ)) { SERIAL_EOL(); SERIAL_ECHO_START(); - SERIAL_ECHOPAIR(MSG_SD_CANT_OPEN_SUBDIR, segment); + SERIAL_ECHOPAIR(STR_SD_CANT_OPEN_SUBDIR, segment); break; } @@ -362,14 +362,14 @@ void CardReader::mount() { #if defined(LCD_SDSS) && (LCD_SDSS != SDSS) && !sd2card.init(SPI_SPEED, LCD_SDSS) #endif - ) SERIAL_ECHO_MSG(MSG_SD_INIT_FAIL); + ) SERIAL_ECHO_MSG(STR_SD_INIT_FAIL); else if (!volume.init(&sd2card)) - SERIAL_ERROR_MSG(MSG_SD_VOL_INIT_FAIL); + SERIAL_ERROR_MSG(STR_SD_VOL_INIT_FAIL); else if (!root.openRoot(&volume)) - SERIAL_ERROR_MSG(MSG_SD_OPENROOT_FAIL); + SERIAL_ERROR_MSG(STR_SD_OPENROOT_FAIL); else { flag.mounted = true; - SERIAL_ECHO_MSG(MSG_SD_CARD_OK); + SERIAL_ECHO_MSG(STR_SD_CARD_OK); #if ENABLED(EEPROM_SETTINGS) && NONE(FLASH_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM) settings.first_load(); #endif @@ -446,7 +446,7 @@ void CardReader::getAbsFilename(char *dst) { } void openFailed(const char * const fname) { - SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, fname, "."); + SERIAL_ECHOLNPAIR(STR_SD_OPEN_FILE_FAIL, fname, "."); } void announceOpen(const uint8_t doing, const char * const path) { @@ -511,8 +511,8 @@ void CardReader::openFileRead(char * const path, const uint8_t subcall_type/*=0* if (file.open(curDir, fname, O_READ)) { filesize = file.fileSize(); sdpos = 0; - SERIAL_ECHOLNPAIR(MSG_SD_FILE_OPENED, fname, MSG_SD_SIZE, filesize); - SERIAL_ECHOLNPGM(MSG_SD_FILE_SELECTED); + SERIAL_ECHOLNPAIR(STR_SD_FILE_OPENED, fname, STR_SD_SIZE, filesize); + SERIAL_ECHOLNPGM(STR_SD_FILE_SELECTED); selectFileByName(fname); ui.set_status(longFilename[0] ? longFilename : fname); @@ -521,6 +521,10 @@ void CardReader::openFileRead(char * const path, const uint8_t subcall_type/*=0* openFailed(fname); } +inline void echo_write_to_file(char * const fname) { + SERIAL_ECHOLNPAIR(STR_SD_WRITE_TO_FILE, fname); +} + // // Open a file by DOS path for write // @@ -542,7 +546,7 @@ void CardReader::openFileWrite(char * const path) { #if ENABLED(EMERGENCY_PARSER) emergency_parser.disable(); #endif - SERIAL_ECHOLNPAIR(MSG_SD_WRITE_TO_FILE, fname); + echo_write_to_file(fname); ui.set_status(fname); } else @@ -574,13 +578,13 @@ void CardReader::removeFile(const char * const name) { void CardReader::report_status() { if (isPrinting()) { - SERIAL_ECHOPGM(MSG_SD_PRINTING_BYTE); + SERIAL_ECHOPGM(STR_SD_PRINTING_BYTE); SERIAL_ECHO(sdpos); SERIAL_CHAR('/'); SERIAL_ECHOLN(filesize); } else - SERIAL_ECHOLNPGM(MSG_SD_NOT_PRINTING); + SERIAL_ECHOLNPGM(STR_SD_NOT_PRINTING); } void CardReader::write_command(char * const buf) { @@ -598,7 +602,7 @@ void CardReader::write_command(char * const buf) { end[3] = '\0'; file.write(begin); - if (file.writeError) SERIAL_ERROR_MSG(MSG_SD_ERR_WRITE_TO_FILE); + if (file.writeError) SERIAL_ERROR_MSG(STR_SD_ERR_WRITE_TO_FILE); } // @@ -739,7 +743,7 @@ const char* CardReader::diveToFile(const bool update_cwd, SdFile*& curDir, const // Open curDir if (!sub->open(curDir, dosSubdirname, O_READ)) { - SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, dosSubdirname, "."); + SERIAL_ECHOLNPAIR(STR_SD_OPEN_FILE_FAIL, dosSubdirname, "."); return nullptr; } @@ -779,7 +783,7 @@ void CardReader::cd(const char * relpath) { } else { SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_SD_CANT_ENTER_SUBDIR, relpath); + SERIAL_ECHOLNPAIR(STR_SD_CANT_ENTER_SUBDIR, relpath); } } @@ -1113,9 +1117,9 @@ void CardReader::fileHasFinished() { if (!isMounted()) return; if (recovery.file.isOpen()) return; if (!recovery.file.open(&root, recovery.filename, read ? O_READ : O_CREAT | O_WRITE | O_TRUNC | O_SYNC)) - SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, recovery.filename, "."); + SERIAL_ECHOLNPAIR(STR_SD_OPEN_FILE_FAIL, recovery.filename, "."); else if (!read) - SERIAL_ECHOLNPAIR(MSG_SD_WRITE_TO_FILE, recovery.filename); + echo_write_to_file(recovery.filename); } // Removing the job recovery file currently requires closing