diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index fd3687a7f..5679aa309 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -784,6 +784,8 @@ #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + //#define TRAVEL_EXTRA_XYJERK 0.0 // Additional jerk allowance for all travel moves + //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 #if ENABLED(LIMITED_JERK_EDITING) #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index ca4f86a83..ede35a561 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1044,7 +1044,7 @@ #if ENABLED(POWER_LOSS_RECOVERY) //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module. //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume @@ -1172,18 +1172,16 @@ // Add an optimized binary file transfer mode, initiated with 'M28 B1' //#define BINARY_FILE_TRANSFER - #if HAS_SDCARD_CONNECTION - /** - * Set this option to one of the following (or the board's defaults apply): - * - * LCD - Use the SD drive in the external LCD controller. - * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) - * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). - * - * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] - */ - //#define SDCARD_CONNECTION LCD - #endif + /** + * Set this option to one of the following (or the board's defaults apply): + * + * LCD - Use the SD drive in the external LCD controller. + * ONBOARD - Use the SD drive on the control board. (No SD_DETECT_PIN. M21 to init.) + * CUSTOM_CABLE - Use a custom cable to access the SD (as defined in a pins file). + * + * :[ 'LCD', 'ONBOARD', 'CUSTOM_CABLE' ] + */ + //#define SDCARD_CONNECTION LCD #endif // SDSUPPORT @@ -1260,6 +1258,7 @@ #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating + //#define STATUS_CUTTER_ANIM // Use a second bitmap to indicate spindle / laser active //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames @@ -2791,6 +2790,8 @@ //#define GCODE_QUOTED_STRINGS // Support for quoted string parameters #endif +//#define GCODE_CASE_INSENSITIVE // Accept G-code sent to the firmware in lowercase + /** * CNC G-code options * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. 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_LPC1768/MarlinSerial.cpp b/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp index a486078db..1b80b211f 100644 --- a/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp @@ -32,21 +32,21 @@ } #endif -#if (defined(SERIAL_PORT) && SERIAL_PORT == 1) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 1) || (defined(DGUS_SERIAL_PORT) && DGUS_SERIAL_PORT == 1) +#if SERIAL_PORT == 1 || SERIAL_PORT_2 == 1 || DGUS_SERIAL_PORT == 1 MarlinSerial MSerial1((LPC_UART_TypeDef *) LPC_UART1); extern "C" void UART1_IRQHandler() { MSerial1.IRQHandler(); } #endif -#if (defined(SERIAL_PORT) && SERIAL_PORT == 2) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 2) || (defined(DGUS_SERIAL_PORT) && DGUS_SERIAL_PORT == 2) +#if SERIAL_PORT == 2 || SERIAL_PORT_2 == 2 || DGUS_SERIAL_PORT == 2 MarlinSerial MSerial2(LPC_UART2); extern "C" void UART2_IRQHandler() { MSerial2.IRQHandler(); } #endif -#if (defined(SERIAL_PORT) && SERIAL_PORT == 3) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 3) || (defined(DGUS_SERIAL_PORT) && DGUS_SERIAL_PORT == 3) +#if SERIAL_PORT == 3 || SERIAL_PORT_2 == 3 || DGUS_SERIAL_PORT == 3 MarlinSerial MSerial3(LPC_UART3); extern "C" void UART3_IRQHandler() { MSerial3.IRQHandler(); diff --git a/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h b/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h index 8dffb5624..a1fa34204 100644 --- a/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h +++ b/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h @@ -76,3 +76,52 @@ #if ENABLED(BAUD_RATE_GCODE) #error "BAUD_RATE_GCODE is not yet supported on LPC176x." #endif + +/** + * Flag any serial port conflicts + * + * Port | TX | RX | + * --- | --- | --- | + * Serial | P0_02 | P0_03 | + * Serial1 | P0_15 | P0_16 | + * Serial2 | P0_10 | P0_11 | + * Serial3 | P0_00 | P0_01 | + */ +#if (defined(SERIAL_PORT) && SERIAL_PORT == 0) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 0) || (defined(DGUS_SERIAL_PORT) && DGUS_SERIAL_PORT == 0) + #if X_CS_PIN == P0_02 || TMC_SW_MISO == P0_02 || (E_STEPPERS && E_MUX1_PIN == P0_02) \ + || Y_CS_PIN == P0_03 || TMC_SW_MOSI == P0_03 || (E_STEPPERS && E_MUX0_PIN == P0_03) + #error "Serial port assignment (0) conflicts with other pins!" + #endif +#endif + +#if SERIAL_PORT == 1 || SERIAL_PORT_2 == 1 || DGUS_SERIAL_PORT == 1 + #if TMC_SW_SCK == P0_15 + #error "Serial port assignment (1) conflicts with other pins!" + #elif HAS_SPI_LCD + #if BTN_EN2 == P0_15 || SCK_PIN == P0_15 || LCD_PINS_D4 == P0_15 || DOGLCD_SCK == P0_15 || LCD_RESET_PIN == P0_15 || LCD_PINS_RS == P0_15 || SHIFT_CLK == P0_15 \ + || BTN_EN1 == P0_16 || LCD_SDSS == P0_16 || LCD_PINS_RS == P0_16 || MISO_PIN == P0_16 || DOGLCD_A0 == P0_16 || SS_PIN == P0_16 || LCD_SDSS == P0_16 || DOGLCD_CS == P0_16 || LCD_RESET_PIN == P0_16 || LCD_BACKLIGHT_PIN == P0_16 + #error "Serial port assignment (1) conflicts with other pins!" + #endif + #endif +#endif + +#if SERIAL_PORT == 2 || SERIAL_PORT_2 == 2 || DGUS_SERIAL_PORT == 2 + #if Y_MIN_PIN == P0_10 || Z_MIN_PROBE_PIN == P0_10 \ + || X_ENABLE_PIN == P0_10 || Y_ENABLE_PIN == P0_10 || X2_ENABLE_PIN == P0_10 || Y2_ENABLE_PIN == P0_10 || Z2_ENABLE_PIN == P0_10 || Z3_ENABLE_PIN == P0_10 || Z4_ENABLE_PIN == P0_10 \ + || X2_CS_PIN == P0_10 || Y2_CS_PIN == P0_10 || Z2_CS_PIN == P0_10 || Z3_CS_PIN == P0_10 || Z4_CS_PIN == P0_10 \ + || X_DIR_PIN == P0_11 || Y_DIR_PIN == P0_11 || X2_DIR_PIN == P0_11 || Y2_DIR_PIN == P0_11 || Z2_DIR_PIN == P0_11 || Z3_DIR_PIN == P0_11 || Z4_DIR_PIN == P0_11 \ + || X2_STEP_PIN == P0_11 || Y2_STEP_PIN == P0_11 || Z2_STEP_PIN == P0_11 || Z3_STEP_PIN == P0_11 || Z4_STEP_PIN == P0_11 + #error "Serial port assignment (2) conflicts with other pins!" + #elif (E_STEPPERS > 1 && (E1_ENABLE_PIN == P0_10 || E1_CS_PIN == P0_10)) || (E_STEPPERS > 0 && (E0_DIR_PIN == P0_11 || E0_STEP_PIN == P0_11)) + #error "Serial port assignment (2) conflicts with other pins!" + #endif +#endif + +#if SERIAL_PORT == 3 || SERIAL_PORT_2 == 3 || DGUS_SERIAL_PORT == 3 + #if X_MIN_PIN == P0_00 || Y_SERIAL_TX_PIN == P0_00 || Y_SERIAL_RX_PIN == P0_00 \ + || X_MAX_PIN == P0_01 || X_SERIAL_TX_PIN == P0_01 || X_SERIAL_RX_PIN == P0_01 + #error "Serial port assignment (2) conflicts with other pins!" + #elif E_STEPPERS > 1 && (E1_DIR_PIN == P0_00 || E1_STEP_PIN == P0_01) + #error "Serial port assignment (2) conflicts with other pins!" + #endif +#endif 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 19fe1c062..5a527482c 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() { @@ -390,8 +390,8 @@ void startOrResumeJob() { #if ENABLED(SDSUPPORT) - void abortSDPrinting() { - card.stopSDPrint( + inline void abortSDPrinting() { + card.endFilePrint( #if SD_RESORT true #endif @@ -412,10 +412,58 @@ void startOrResumeJob() { #endif } -#endif + inline void finishSDPrinting() { + bool did_state = true; + switch (card.sdprinting_done_state) { + + #if HAS_RESUME_CONTINUE // Display "Click to Continue..." + case 1: + did_state = queue.enqueue_P(PSTR("M0Q1S" + #if HAS_LCD_MENU + "1800" // ...for 30 minutes with LCD + #else + "60" // ...for 1 minute with no LCD + #endif + )); + break; + #endif + + case 2: print_job_timer.stop(); break; + + case 3: + did_state = print_job_timer.duration() < 60 || queue.enqueue_P(PSTR("M31")); + break; + + case 4: + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.purge(); + #endif + + #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND) + planner.finish_and_disable(); + #endif + + #if ENABLED(LCD_SET_PROGRESS_MANUALLY) + ui.set_progress_done(); + #endif + + #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) + ui.reselect_last_file(); + #endif + + SERIAL_ECHOLNPGM(STR_FILE_PRINTED); + + default: + did_state = false; + card.sdprinting_done_state = 0; + } + if (did_state) ++card.sdprinting_done_state; + } + +#endif // SDSUPPORT /** - * Manage several activities: + * Minimal management of Marlin's core activities: * - Check for Filament Runout * - Keep the command buffer full * - Check for maximum inactive time between commands @@ -440,7 +488,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(); } @@ -505,7 +553,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 @@ -723,7 +771,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); @@ -794,7 +842,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; @@ -900,11 +948,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)); @@ -914,15 +962,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). @@ -937,32 +985,28 @@ void setup() { ui.show_bootscreen(); #endif - #if ENABLED(SDSUPPORT) - card.mount(); // Mount the SD card before settings.first_load - #endif + ui.reset_status(); // Load welcome message early. (Retained if no errors exist.) - // Load data from EEPROM if available (or use defaults) - // This also updates variables in the planner, elsewhere - settings.first_load(); + #if ENABLED(SDSUPPORT) + card.mount(); // Mount the SD card before settings.first_load + #endif + // Load data from EEPROM if available (or use defaults) + settings.first_load(); // This also updates variables in the planner, elsewhere #if ENABLED(TOUCH_BUTTONS) touch.init(); #endif - #if HAS_M206_COMMAND - // Initialize current position based on home_offset + #if HAS_M206_COMMAND // Initialize current position based on home_offset current_position += home_offset; #endif - // Vital to init stepper/planner equivalent for current_position - sync_plan_position(); + sync_plan_position(); // Vital to init stepper/planner equivalent for current_position thermalManager.init(); // Initialize temperature loop print_job_timer.init(); // Initial setup of print job timer - ui.reset_status(); // Print startup message after print statistics are loaded - endstops.init(); // Init endstops and pullups stepper.init(); // Init stepper. This enables interrupts! @@ -1117,15 +1161,24 @@ void setup() { #if ENABLED(PRUSA_MMU2) mmu2.init(); #endif + + #if HAS_SERVICE_INTERVALS + ui.reset_status(true); // Show service messages or keep current status + #endif } /** * The main Marlin program loop * - * - Save or log commands to SD - * - Process available commands (if not saving) - * - Call endstop manager - * - Call inactivity manager + * - Call idle() to handle all tasks between G-code commands + * Note that no G-codes from the queue can be executed during idle() + * but many G-codes can be called directly anytime like macros. + * - Check whether SD card auto-start is needed now. + * - Check whether SD print finishing is needed now. + * - Run one G-code command from the immediate or main command queue + * and open up one space. Commands in the main queue may come from sd + * card, host, or by direct injection. The queue will continue to fill + * as long as idle() or manage_inactivity() are being called. */ void loop() { do { @@ -1135,6 +1188,7 @@ void loop() { #if ENABLED(SDSUPPORT) card.checkautostart(); if (card.flag.abort_sd_printing) abortSDPrinting(); + if (card.sdprinting_done_state) finishSDPrinting(); #endif queue.advance(); 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/bltouch.h b/Marlin/src/feature/bltouch.h index 58c5b9ad3..af75fb8b2 100644 --- a/Marlin/src/feature/bltouch.h +++ b/Marlin/src/feature/bltouch.h @@ -105,7 +105,4 @@ private: static void mode_conv_proc(const bool M5V); }; -// Deploy/stow angles for use by servo.cpp / servo.h -#define BLTOUCH_ANGLES { BLTOUCH_DEPLOY, BLTOUCH_STOW } - extern BLTouch bltouch; diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 9fd279fe5..95b5cc953 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 @@ -175,7 +175,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l #if HAS_LCD_MENU if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_INSERT, mode); #endif - SERIAL_ECHO_MSG(_PMSG(MSG_FILAMENT_CHANGE_INSERT)); + SERIAL_ECHO_MSG(_PMSG(STR_FILAMENT_CHANGE_INSERT)); #if HAS_BUZZER filament_change_beep(max_beep_count, true); @@ -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 @@ -480,7 +480,7 @@ void show_continue_prompt(const bool is_reload) { lcd_pause_show_message(is_reload ? PAUSE_MESSAGE_INSERT : PAUSE_MESSAGE_WAITING); #endif SERIAL_ECHO_START(); - serialprintPGM(is_reload ? PSTR(_PMSG(MSG_FILAMENT_CHANGE_INSERT) "\n") : PSTR(_PMSG(MSG_FILAMENT_CHANGE_WAIT) "\n")); + serialprintPGM(is_reload ? PSTR(_PMSG(STR_FILAMENT_CHANGE_INSERT) "\n") : PSTR(_PMSG(STR_FILAMENT_CHANGE_WAIT) "\n")); } void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep_count/*=0*/ DXC_ARGS) { @@ -530,7 +530,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep #if HAS_LCD_MENU lcd_pause_show_message(PAUSE_MESSAGE_HEAT); #endif - SERIAL_ECHO_MSG(_PMSG(MSG_FILAMENT_CHANGE_HEAT)); + SERIAL_ECHO_MSG(_PMSG(STR_FILAMENT_CHANGE_HEAT)); #if ENABLED(HOST_PROMPT_SUPPORT) host_prompt_do(PROMPT_USER_CONTINUE, PSTR("HeaterTimeout"), PSTR("Reheat")); diff --git a/Marlin/src/feature/power_loss_recovery.cpp b/Marlin/src/feature/power_loss_recovery.cpp index aa7dff36e..f331a9f94 100644 --- a/Marlin/src/feature/power_loss_recovery.cpp +++ b/Marlin/src/feature/power_loss_recovery.cpp @@ -141,7 +141,7 @@ void PrintJobRecovery::prepare() { /** * Save the current machine state to the power-loss recovery file */ -void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*=true*/) { +void PrintJobRecovery::save(const bool force/*=false*/) { #if SAVE_INFO_INTERVAL_MS > 0 static millis_t next_save_ms; // = 0 diff --git a/Marlin/src/feature/power_loss_recovery.h b/Marlin/src/feature/power_loss_recovery.h index 84f0d9f69..6c4b5d5c3 100644 --- a/Marlin/src/feature/power_loss_recovery.h +++ b/Marlin/src/feature/power_loss_recovery.h @@ -159,13 +159,10 @@ class PrintJobRecovery { static inline void cancel() { purge(); card.autostart_index = 0; } static void load(); - static void save(const bool force= + static void save(const bool force=false #if ENABLED(SAVE_EACH_CMD_MODE) - true - #else - false + || true #endif - , const bool save_queue=true ); #if PIN_EXISTS(POWER_LOSS) diff --git a/Marlin/src/feature/probe_temp_compensation.h b/Marlin/src/feature/probe_temp_compensation.h index ddd178e45..c9ab93e4a 100644 --- a/Marlin/src/feature/probe_temp_compensation.h +++ b/Marlin/src/feature/probe_temp_compensation.h @@ -57,7 +57,7 @@ class ProbeTempComp { static const temp_calib_t cali_info[TSI_COUNT]; // Where to park nozzle to wait for probe cooldown - static constexpr xyz_pos_t park_point = { PTC_PARK_POS_X, PTC_PARK_POS_Y, PTC_PARK_POS_Z }; + static constexpr xyz_pos_t park_point = xyz_pos_t({ PTC_PARK_POS_X, PTC_PARK_POS_Y, PTC_PARK_POS_Z }); static constexpr int max_bed_temp = PTC_MAX_BED_TEMP, // Max temperature to avoid heating errors 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..6841636cf 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -106,6 +106,8 @@ #if AXIS_HAS_STALLGUARD(Y2) tmc_disable_stallguard(stepperY2, stealth_states.y2); #endif + do_blocking_move_to_xy(-0.5 * x_axis_home_dir, -0.5 * home_dir(Y_AXIS), fr_mm_s / 2); + safe_delay(100); #endif } @@ -118,7 +120,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 +156,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 +531,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/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index acf668f94..ac2cdf7d4 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -190,7 +190,7 @@ static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool */ static float calibration_probe(const xy_pos_t &xy, const bool stow) { #if HAS_BED_PROBE - return probe.probe_at_point(xy, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, true); + return probe.probe_at_point(xy, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, true, false); #else UNUSED(stow); return lcd_probe_pt(xy); 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/M281.cpp b/Marlin/src/gcode/config/M281.cpp index 3a07807f3..e925cd5b1 100644 --- a/Marlin/src/gcode/config/M281.cpp +++ b/Marlin/src/gcode/config/M281.cpp @@ -30,6 +30,12 @@ void GcodeSuite::M281() { if (!parser.seenval('P')) return; const int servo_index = parser.value_int(); if (WITHIN(servo_index, 0, NUM_SERVOS - 1)) { + #if ENABLED(BLTOUCH) + if (servo_index == Z_PROBE_SERVO_NR) { + SERIAL_ERROR_MSG("BLTouch angles can't be changed."); + return; + } + #endif bool angle_change = false; if (parser.seen('L')) { servo_angles[servo_index][0] = parser.value_int(); 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/feature/pause/M125.cpp b/Marlin/src/gcode/feature/pause/M125.cpp index c55032b11..6cf0847a9 100644 --- a/Marlin/src/gcode/feature/pause/M125.cpp +++ b/Marlin/src/gcode/feature/pause/M125.cpp @@ -35,6 +35,10 @@ #include "../../../lcd/ultralcd.h" #endif +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../../feature/power_loss_recovery.h" +#endif + /** * M125: Store current position and move to parking position. * Called on pause (by M25) to prevent material leaking onto the @@ -85,6 +89,9 @@ void GcodeSuite::M125() { #endif if (pause_print(retract, park_point, 0, show_lcd)) { + #if ENABLED(POWER_LOSS_RECOVERY) + if (recovery.enabled) recovery.save(true); + #endif if (!sd_printing || show_lcd) { wait_for_confirmation(false, 0); resume_print(0, 0, PAUSE_PARK_RETRACT_LENGTH, 0); 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/M0_M1.cpp b/Marlin/src/gcode/lcd/M0_M1.cpp index bf6a3d23d..2b35ddf3f 100644 --- a/Marlin/src/gcode/lcd/M0_M1.cpp +++ b/Marlin/src/gcode/lcd/M0_M1.cpp @@ -67,11 +67,16 @@ void GcodeSuite::M0_M1() { planner.synchronize(); + #if HAS_LEDS_OFF_FLAG + if (parser.seen('Q')) + printerEventLEDs.onPrintCompleted(); // Change LED color for Print Completed + #endif + #if HAS_LCD_MENU if (has_message) ui.set_status(args, true); - else if (!parser.seenval('Q')) { + else { LCD_MESSAGEPGM(MSG_USERWAIT); #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 ui.reset_progress_bar_timeout(); @@ -98,11 +103,11 @@ void GcodeSuite::M0_M1() { wait_for_user = true; #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M0/1 Break Called"), CONTINUE_STR); + host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? PSTR("M1 Stop") : PSTR("M0 Stop"), CONTINUE_STR); #endif if (ms > 0) ms += millis(); // wait until this time for a click - while (wait_for_user || (ms > 0 && PENDING(millis(), ms))) idle(); + while (wait_for_user && (ms == 0 || PENDING(millis(), ms))) idle(); #if HAS_LEDS_OFF_FLAG printerEventLEDs.onResumeAfterWait(); 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..0fac65300 100644 --- a/Marlin/src/gcode/parser.cpp +++ b/Marlin/src/gcode/parser.cpp @@ -118,11 +118,18 @@ void GCodeParser::parse(char *p) { reset(); // No codes to report + auto uppercase = [](char c) { + #if ENABLED(GCODE_CASE_INSENSITIVE) + if (WITHIN(c, 'a', 'z')) c += 'A' - 'a'; + #endif + return c; + }; + // Skip spaces while (*p == ' ') ++p; // Skip N[-0-9] if included in the command line - if (*p == 'N' && NUMERIC_SIGNED(p[1])) { + if (uppercase(*p) == 'N' && NUMERIC_SIGNED(p[1])) { #if ENABLED(FASTER_GCODE_PARSER) //set('N', p + 1); // (optional) Set the 'N' parameter value #endif @@ -135,7 +142,7 @@ void GCodeParser::parse(char *p) { command_ptr = p; // Get the command letter, which must be G, M, or T - const char letter = *p++; + const char letter = uppercase(*p++); // Nullify asterisk and trailing whitespace char *starpos = strchr(p, '*'); @@ -271,7 +278,7 @@ void GCodeParser::parse(char *p) { bool quoted_string_arg = false; #endif string_arg = nullptr; - while (const char param = *p++) { // Get the next parameter. A NUL ends the loop + while (const char param = uppercase(*p++)) { // Get the next parameter. A NUL ends the loop // Special handling for M32 [P] !/path/to/file.g# // The path must be the last parameter @@ -289,14 +296,14 @@ void GCodeParser::parse(char *p) { } #endif - // Arguments MUST be uppercase for fast GCode parsing #if ENABLED(FASTER_GCODE_PARSER) - #define PARAM_TEST WITHIN(param, 'A', 'Z') + // Arguments MUST be uppercase for fast GCode parsing + #define PARAM_OK(P) WITHIN((P), 'A', 'Z') #else - #define PARAM_TEST true + #define PARAM_OK(P) true #endif - if (PARAM_TEST) { + if (PARAM_OK(param)) { while (*p == ' ') p++; // Skip spaces between parameters & values @@ -365,7 +372,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/parser.h b/Marlin/src/gcode/parser.h index 70eb85e31..06e41ccf1 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -166,7 +166,6 @@ public: #ifdef CPU_32_BIT FORCE_INLINE static bool seen(const char * const str) { return !!(codebits & letter_bits(str)); } #else - // At least one of a list of code letters was seen FORCE_INLINE static bool seen(const char * const str) { const uint32_t letrbits = letter_bits(str); const uint8_t * const cb = (uint8_t*)&codebits; @@ -177,14 +176,27 @@ public: static inline bool seen_any() { return !!codebits; } - #define SEEN_TEST(L) TEST32(codebits, LETTER_BIT(L)) + FORCE_INLINE static bool seen_test(const char c) { return TEST32(codebits, LETTER_BIT(c)); } #else // !FASTER_GCODE_PARSER + #if ENABLED(GCODE_CASE_INSENSITIVE) + FORCE_INLINE static char* strgchr(char *p, char g) { + auto uppercase = [](char c) { + return c + (WITHIN(c, 'a', 'z') ? 'A' - 'a' : 0); + }; + const char d = uppercase(g); + for (char cc; (cc = uppercase(*p)); p++) if (cc == d) return p; + return nullptr; + } + #else + #define strgchr strchr + #endif + // Code is found in the string. If not found, value_ptr is unchanged. // This allows "if (seen('A')||seen('B'))" to use the last-found value. static inline bool seen(const char c) { - char *p = strchr(command_args, c); + char *p = strgchr(command_args, c); const bool b = !!p; if (b) value_ptr = valid_float(&p[1]) ? &p[1] : nullptr; return b; @@ -192,12 +204,12 @@ public: static inline bool seen_any() { return *command_args == '\0'; } - #define SEEN_TEST(L) !!strchr(command_args, L) + FORCE_INLINE static bool seen_test(const char c) { return (bool)strgchr(command_args, c); } // At least one of a list of code letters was seen static inline bool seen(const char * const str) { for (uint8_t i = 0; const char c = str[i]; i++) - if (SEEN_TEST(c)) return true; + if (seen_test(c)) return true; return false; } @@ -205,7 +217,7 @@ public: // Seen any axis parameter static inline bool seen_axis() { - return SEEN_TEST('X') || SEEN_TEST('Y') || SEEN_TEST('Z') || SEEN_TEST('E'); + return seen_test('X') || seen_test('Y') || seen_test('Z') || seen_test('E'); } #if ENABLED(GCODE_QUOTED_STRINGS) @@ -229,7 +241,7 @@ public: // Seen a parameter with a value static inline bool seenval(const char c) { return seen(c) && has_value(); } - // Float removes 'E' to prevent scientific notation interpretation + // The value as a string static inline char* value_string() { return value_ptr; } // Float removes 'E' to prevent scientific notation interpretation 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 edcb025bb..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; } @@ -512,9 +512,10 @@ void GCodeQueue::get_serial_commands() { #if ENABLED(SDSUPPORT) /** - * Get commands from the SD Card until the command buffer is full - * or until the end of the file is reached. The special character '#' - * can also interrupt buffering. + * Get lines from the SD Card until the command buffer is full + * or until the end of the file is reached. Because this method + * always receives complete command-lines, they can go directly + * into the main command queue. */ inline void GCodeQueue::get_sdcard_commands() { static uint8_t sd_input_state = PS_NORMAL; @@ -526,38 +527,22 @@ 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; - if (sd_char == '\n' || sd_char == '\r' || card_eof) { + const bool is_eol = sd_char == '\n' || sd_char == '\r'; + if (is_eol || card_eof) { // Reset stream state, terminate the buffer, and commit a non-empty command + if (!is_eol && sd_count) ++sd_count; // End of file with no newline if (!process_line_done(sd_input_state, command_buffer[index_w], sd_count)) { - _commit_command(false); // Can handle last line missing a newline terminator + _commit_command(false); #if ENABLED(POWER_LOSS_RECOVERY) - recovery.cmd_sdpos = card.getIndex(); // Prime for the next _commit_command + recovery.cmd_sdpos = card.getIndex(); // Prime for the NEXT _commit_command #endif } - if (card_eof) { - - card.fileHasFinished(); // Handle end of file reached - - if (!IS_SD_PRINTING()) { // Was it the main job file? - SERIAL_ECHOLNPGM(MSG_FILE_PRINTED); // Tell the host the file is printed. - #if ENABLED(PRINTER_EVENT_LEDS) - printerEventLEDs.onPrintCompleted(); // Change LED color for Print Completed - #if HAS_RESUME_CONTINUE - enqueue_now_P(PSTR("M0 S" // Display "Click to Continue..." - #if HAS_LCD_MENU - "1800" // ...for 30 minutes with LCD - #else - "60" // ...for 1 minute with no LCD - #endif - )); - #endif - #endif - } - } + if (card_eof) card.fileHasFinished(); // Handle end of file reached } else process_stream_char(sd_char, sd_input_state, command_buffer[index_w], sd_count); @@ -600,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) @@ -633,9 +618,7 @@ void GCodeQueue::advance() { #endif // SDSUPPORT // The queue may be reset by a command handler or by code invoked by idle() within a handler - if (length) { - --length; - if (++index_r >= BUFSIZE) index_r = 0; - } + --length; + if (++index_r >= BUFSIZE) index_r = 0; } diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h index 10b0ec764..1ce64590c 100644 --- a/Marlin/src/gcode/queue.h +++ b/Marlin/src/gcode/queue.h @@ -117,6 +117,12 @@ public: */ static void flush_and_request_resend(); + /** + * Attempt to enqueue a single G-code command + * and return 'true' if successful. + */ + FORCE_INLINE static bool enqueue_P(const char* cmd) { return _enqueue(cmd); } + private: static uint8_t index_w; // Ring buffer write position 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/sdcard/M24_M25.cpp b/Marlin/src/gcode/sdcard/M24_M25.cpp index 967b6dfdf..db1a671fe 100644 --- a/Marlin/src/gcode/sdcard/M24_M25.cpp +++ b/Marlin/src/gcode/sdcard/M24_M25.cpp @@ -86,10 +86,6 @@ void GcodeSuite::M24() { */ void GcodeSuite::M25() { - #if ENABLED(POWER_LOSS_RECOVERY) - if (recovery.enabled) recovery.save(true, false); - #endif - // Set initial pause flag to prevent more commands from landing in the queue while we try to pause #if ENABLED(SDSUPPORT) if (IS_SD_PRINTING()) card.pauseSDPrint(); @@ -101,6 +97,10 @@ void GcodeSuite::M25() { #else + #if ENABLED(POWER_LOSS_RECOVERY) + if (recovery.enabled) recovery.save(true); + #endif + print_job_timer.pause(); ui.reset_status(); 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/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 5cbdafd6e..9227f2c81 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -502,6 +502,10 @@ * Set a flag for a servo probe (or BLTouch) */ #define HAS_Z_SERVO_PROBE (defined(Z_PROBE_SERVO_NR) && Z_PROBE_SERVO_NR >= 0) +#define HAS_SERVO_ANGLES (HAS_Z_SERVO_PROBE || EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE)) +#if !HAS_SERVO_ANGLES + #undef EDITABLE_SERVO_ANGLES +#endif /** * Set flags for enabled probes @@ -571,8 +575,6 @@ #define IS_RE_ARM_BOARD MB(RAMPS_14_RE_ARM_EFB, RAMPS_14_RE_ARM_EEB, RAMPS_14_RE_ARM_EFF, RAMPS_14_RE_ARM_EEF, RAMPS_14_RE_ARM_SF) -#define HAS_SDCARD_CONNECTION EITHER(TARGET_LPC1768, ADAFRUIT_GRAND_CENTRAL_M4) - #define HAS_LINEAR_E_JERK (DISABLED(CLASSIC_JERK) && ENABLED(LIN_ADVANCE)) #ifndef SPI_SPEED diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 6785ea01e..159aefa5d 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -645,7 +645,7 @@ #define MINIMUM_STEPPER_PULSE 2 #elif HAS_DRIVER(A4988) || HAS_DRIVER(A5984) #define MINIMUM_STEPPER_PULSE 1 - #elif TRINAMICS + #elif HAS_TRINAMIC || HAS_TRINAMIC_STANDALONE #define MINIMUM_STEPPER_PULSE 0 #elif HAS_DRIVER(LV8729) #define MINIMUM_STEPPER_PULSE 0 @@ -665,7 +665,7 @@ #define MAXIMUM_STEPPER_RATE 500000 #elif HAS_DRIVER(LV8729) #define MAXIMUM_STEPPER_RATE 1000000 - #elif TRINAMICS + #elif HAS_TRINAMIC || HAS_TRINAMIC_STANDALONE #define MAXIMUM_STEPPER_RATE 5000000 #else #define MAXIMUM_STEPPER_RATE 250000 @@ -1546,16 +1546,6 @@ #define HAS_SERVO_3 (PIN_EXISTS(SERVO3) && NUM_SERVOS > 3) #define HAS_SERVOS (NUM_SERVOS > 0) -#if HAS_SERVOS && !defined(Z_PROBE_SERVO_NR) - #define Z_PROBE_SERVO_NR -1 -#endif - -#define HAS_SERVO_ANGLES (EITHER(SWITCHING_EXTRUDER, SWITCHING_NOZZLE) || (HAS_Z_SERVO_PROBE && defined(Z_PROBE_SERVO_NR))) - -#if !HAS_SERVO_ANGLES || ENABLED(BLTOUCH) - #undef EDITABLE_SERVO_ANGLES -#endif - // Sensors #define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH)) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 9bf403415..14d049dbd 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-02-24" + #define STRING_DISTRIBUTION_DATE "2020-02-27" #endif /** diff --git a/Marlin/src/lcd/dogm/dogm_Statusscreen.h b/Marlin/src/lcd/dogm/dogm_Statusscreen.h index 32a22b9f4..3656b02e0 100644 --- a/Marlin/src/lcd/dogm/dogm_Statusscreen.h +++ b/Marlin/src/lcd/dogm/dogm_Statusscreen.h @@ -785,7 +785,9 @@ #endif #endif -#else +#endif + +#ifndef STATUS_BED_WIDTH #define STATUS_BED_WIDTH 0 #endif @@ -1729,8 +1731,8 @@ #define DO_DRAW_LOGO (STATUS_LOGO_WIDTH && ENABLED(CUSTOM_STATUS_SCREEN_IMAGE)) #define DO_DRAW_HOTENDS (HOTENDS > 0) -#define DO_DRAW_CUTTER (HAS_CUTTER) -#define DO_DRAW_BED (HAS_HEATED_BED && STATUS_BED_WIDTH && HOTENDS <= 4) +#define DO_DRAW_BED (HAS_HEATED_BED && HOTENDS <= 4) +#define DO_DRAW_CUTTER (HAS_CUTTER && !DO_DRAW_BED) #define DO_DRAW_CHAMBER (HAS_TEMP_CHAMBER && STATUS_CHAMBER_WIDTH && HOTENDS <= 4) #define DO_DRAW_FAN (HAS_FAN0 && STATUS_FAN_WIDTH && HOTENDS <= 4 && defined(STATUS_FAN_FRAMES)) diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 75f1c8bdd..1ea1424d3 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -188,21 +188,6 @@ FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, cons u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, STATUS_HEATERS_HEIGHT, HOTEND_BITMAP(heater, isHeat)); #endif - // Draw a heating progress bar, if specified - #if DO_DRAW_BED && ENABLED(STATUS_HEAT_PERCENT) - - if (STATIC_HOTEND && isHeat) { - const uint8_t bx = STATUS_HOTEND_X(heater) + STATUS_HOTEND_WIDTH(heater) + 1; - u8g.drawFrame(bx, STATUS_HEATERS_Y, 3, STATUS_HEATERS_HEIGHT); - if (tall) { - const uint8_t ph = STATUS_HEATERS_HEIGHT - 1 - tall; - if (PAGE_OVER(STATUS_HEATERS_Y + ph)) - u8g.drawVLine(bx + 1, STATUS_HEATERS_Y + ph, tall); - } - } - - #endif - } // PAGE_CONTAINS if (PAGE_UNDER(7)) { @@ -240,11 +225,11 @@ FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, cons const float temp = thermalManager.degBed(), target = thermalManager.degTargetBed(); - #if ENABLED(STATUS_HEAT_PERCENT) || (DO_DRAW_BED && DISABLED(STATUS_BED_ANIM)) + #if ENABLED(STATUS_HEAT_PERCENT) || DISABLED(STATUS_BED_ANIM) const bool isHeat = BED_ALT(); #endif - #if DO_DRAW_BED && DISABLED(STATUS_BED_ANIM) + #if DISABLED(STATUS_BED_ANIM) #define STATIC_BED true #define BED_DOT isHeat #else @@ -513,7 +498,7 @@ void MarlinUI::draw_status_screen() { u8g.drawBitmapP(STATUS_HEATERS_X, STATUS_HEATERS_Y, STATUS_HEATERS_BYTEWIDTH, STATUS_HEATERS_HEIGHT, status_heaters_bmp); #endif - #if DO_DRAW_CUTTER + #if DO_DRAW_CUTTER && DISABLED(STATUS_COMBINE_HEATERS) #if ANIM_CUTTER #define CUTTER_BITMAP(S) ((S) ? status_cutter_on_bmp : status_cutter_bmp) #else @@ -537,7 +522,7 @@ void MarlinUI::draw_status_screen() { u8g.drawBitmapP(STATUS_BED_X, bedy, STATUS_BED_BYTEWIDTH, bedh, BED_BITMAP(BED_ALT())); #endif - #if DO_DRAW_CHAMBER + #if DO_DRAW_CHAMBER && DISABLED(STATUS_COMBINE_HEATERS) #if ANIM_CHAMBER #define CHAMBER_BITMAP(S) ((S) ? status_chamber_on_bmp : status_chamber_bmp) #else 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 b2fc2790a..103dcc036 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 @@ -84,7 +84,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { .tag(12).button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS)) .tag(15).button( BTN_POS(2,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU)) .tag(9) .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS)) - .tag(10).button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_FAILSAFE)) + .tag(10).button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS)) .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)) #if DISABLED(CLASSIC_JERK) @@ -154,7 +154,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { .tag(11).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENT)) .tag(15).button( BTN_POS(3,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU)) .tag(9) .button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS)) - .tag(10).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_FAILSAFE)) + .tag(10).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS)) .colors(action_btn) .tag(1) .button( BTN_POS(3,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK)); #endif 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 c2cbf70ae..0c53dca61 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 @@ -86,7 +86,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { ) .tag(12) .button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_LINEAR_ADVANCE)) .tag(13) .button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS)) - .tag(14) .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_FAILSAFE)) + .tag(14) .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_DEFAULTS)) .colors(action_btn) .tag(1). button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK)); #undef GRID_COLS 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/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/language/language_an.h b/Marlin/src/lcd/language/language_an.h index 9498d558e..8e7798d72 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -125,7 +125,7 @@ namespace Language_an { PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Alzar memoria"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Cargar memoria"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Restaurar memoria"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Restaurar memoria"); PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Tornar a cargar"); PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Informacion"); PROGMEM Language_Str MSG_PREPARE = _UxGT("Preparar"); diff --git a/Marlin/src/lcd/language/language_bg.h b/Marlin/src/lcd/language/language_bg.h index 18096b626..1987c2076 100644 --- a/Marlin/src/lcd/language/language_bg.h +++ b/Marlin/src/lcd/language/language_bg.h @@ -110,7 +110,7 @@ namespace Language_bg { PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD контраст"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Запази в EPROM"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Зареди от EPROM"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Фабрични настройки"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Фабрични настройки"); PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Обнови"); PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Преглед"); PROGMEM Language_Str MSG_PREPARE = _UxGT("Действия"); diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index 950a73d7f..ef5334f87 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -120,7 +120,7 @@ namespace Language_ca { PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contrast de LCD"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Desa memoria"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Carrega memoria"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Restaura valors"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Restaura valors"); PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Actualitza"); PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Pantalla Info."); PROGMEM Language_Str MSG_PREPARE = _UxGT("Prepara"); diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index 9b983dd94..77e25b733 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -310,7 +310,7 @@ namespace Language_cz { PROGMEM Language_Str MSG_CONTRAST = _UxGT("Kontrast LCD"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Uložit nastavení"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Načíst nastavení"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Obnovit výchozí"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Obnovit výchozí"); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Inic. EEPROM"); PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Aktualizace z SD"); PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Reset tiskárny"); diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index 09802adff..23d931c17 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -105,7 +105,7 @@ namespace Language_da { PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD kontrast"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Gem i EEPROM"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Hent fra EEPROM"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Gendan failsafe"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Gendan Defaults"); PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Genopfrisk"); PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Info skærm"); PROGMEM Language_Str MSG_PREPARE = _UxGT("Forbered"); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index cacef7b4d..ed2f779dd 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -290,7 +290,7 @@ namespace Language_de { PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD-Kontrast"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Konfig. speichern"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Konfig. laden"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Standardwerte laden"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Standardwerte laden"); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Werkseinstellungen"); PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("FW Update vom Medium"); PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Drucker neustarten"); diff --git a/Marlin/src/lcd/language/language_el.h b/Marlin/src/lcd/language/language_el.h index 2690e0b7f..6cb177d10 100644 --- a/Marlin/src/lcd/language/language_el.h +++ b/Marlin/src/lcd/language/language_el.h @@ -136,7 +136,7 @@ namespace Language_el { PROGMEM Language_Str MSG_CONTRAST = _UxGT("Κοντράστ LCD"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Αποθήκευση"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Φόρτωση"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Επαναφορά ασφαλούς αντιγράφου"); //SHORTEN + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Επαναφορά ασφαλούς αντιγράφου"); //SHORTEN PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Ανανέωση"); PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Οθόνη πληροφόρησης"); PROGMEM Language_Str MSG_PREPARE = _UxGT("Προετοιμασία"); diff --git a/Marlin/src/lcd/language/language_el_gr.h b/Marlin/src/lcd/language/language_el_gr.h index 859a8fa4f..5213dc7db 100644 --- a/Marlin/src/lcd/language/language_el_gr.h +++ b/Marlin/src/lcd/language/language_el_gr.h @@ -138,7 +138,7 @@ namespace Language_el_gr { PROGMEM Language_Str MSG_CONTRAST = _UxGT("Κοντράστ LCD"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Αποθήκευση"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Φόρτωση"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Επαναφορά ασφαλούς αντιγράφου"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Επαναφορά ασφαλούς αντιγράφου"); PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Ανανέωση"); PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Οθόνη πληροφόρησης"); PROGMEM Language_Str MSG_PREPARE = _UxGT("Προετοιμασία"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 4cbb2cc08..b5f508973 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -312,8 +312,11 @@ namespace Language_en { PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD Contrast"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Store Settings"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Load Settings"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Restore failsafe"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Restore Defaults"); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Initialize EEPROM"); + PROGMEM Language_Str MSG_ERR_EEPROM_CRC = _UxGT("Err: EEPROM CRC"); + PROGMEM Language_Str MSG_ERR_EEPROM_INDEX = _UxGT("Err: EEPROM Index"); + PROGMEM Language_Str MSG_ERR_EEPROM_VERSION = _UxGT("Err: EEPROM Version"); PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Media Update"); PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Reset Printer"); PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Refresh"); diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index fdab16a18..12d487b35 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -284,7 +284,7 @@ namespace Language_es { PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste LCD"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Guardar EEPROM"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Cargar EEPROM"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Rest. fábrica"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Rest. fábrica"); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Inicializar EEPROM"); PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Actualizar SD/USB"); PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Resetear Impresora"); diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index 210752e25..a6a0a5251 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -187,7 +187,7 @@ namespace Language_eu { PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD kontrastea"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Gorde memoria"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Kargatu memoria"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Larri. berriz."); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Larri. berriz."); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("EEPROM-a hasieratu"); PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Berriz kargatu"); PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Pantaila info"); diff --git a/Marlin/src/lcd/language/language_fi.h b/Marlin/src/lcd/language/language_fi.h index 2517a008f..79124c000 100644 --- a/Marlin/src/lcd/language/language_fi.h +++ b/Marlin/src/lcd/language/language_fi.h @@ -97,7 +97,7 @@ namespace Language_fi { PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD kontrasti"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Tallenna muistiin"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Lataa muistista"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Palauta oletus"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Palauta oletus"); PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Päivitä"); PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Seuraa"); PROGMEM Language_Str MSG_PREPARE = _UxGT("Valmistele"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index ec057399a..ffa12f39f 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -282,7 +282,7 @@ namespace Language_fr { PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste LCD"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Enregistrer config."); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Charger config."); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Restaurer défauts"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Restaurer défauts"); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Initialiser EEPROM"); PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("MaJ Firmware SD"); PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("RaZ imprimante"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index 1c78d4455..6a8f166ff 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -117,7 +117,7 @@ namespace Language_gl { PROGMEM Language_Str MSG_CONTRAST = _UxGT("Constraste LCD"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Gardar en memo."); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Cargar de memo."); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Cargar de firm."); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Cargar de firm."); PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Volver a cargar"); PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Monitorizacion"); PROGMEM Language_Str MSG_PREPARE = _UxGT("Preparar"); diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index e1caeb8ef..740d7e562 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -98,7 +98,7 @@ namespace Language_hr { PROGMEM Language_Str MSG_CONTRAST = _UxGT("Kontrast LCD-a"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Pohrani u memoriju"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Učitaj memoriju"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Učitaj failsafe"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Učitaj Defaults"); PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Osvježi"); PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Info screen"); PROGMEM Language_Str MSG_PREPARE = _UxGT("Pripremi"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 008f7735d..ae4dd813e 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -310,7 +310,7 @@ namespace Language_it { PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contrasto LCD"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Salva impostazioni"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Carica impostazioni"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Ripristina imp."); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Ripristina imp."); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Inizializza EEPROM"); PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Aggiorna media"); PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Resetta stampante"); @@ -368,7 +368,7 @@ namespace Language_it { PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Rimuovi filamento"); PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Rimuovi filamento *"); PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Rimuovi tutto"); - PROGMEM Language_Str MSG_ATTACH_MEDIA = _UxGT("Inizializ. media"); + PROGMEM Language_Str MSG_ATTACH_MEDIA = _UxGT("Collega media"); PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Cambia media"); PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Rilascia media"); PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Z probe fuori piatto"); diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h index ddff7f547..809ee83de 100644 --- a/Marlin/src/lcd/language/language_jp_kana.h +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -141,7 +141,7 @@ namespace Language_jp_kana { PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCDコントラスト"); // "LCD contrast" PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("EEPROMヘホゾン"); // "Store memory" PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("EEPROMカラヨミコミ"); // "Load memory" - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("セッテイリセット"); // "Restore failsafe" + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("セッテイリセット"); // "Restore Defaults" PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("リフレッシュ"); // "Refresh" PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("ジョウホウガメン"); // "Info screen" PROGMEM Language_Str MSG_PREPARE = _UxGT("ジュンビセッテイ"); // "Prepare" diff --git a/Marlin/src/lcd/language/language_ko_KR.h b/Marlin/src/lcd/language/language_ko_KR.h index f94a182fd..4d8142e38 100644 --- a/Marlin/src/lcd/language/language_ko_KR.h +++ b/Marlin/src/lcd/language/language_ko_KR.h @@ -84,7 +84,7 @@ namespace Language_ko_KR { PROGMEM Language_Str MSG_MOTION = _UxGT("동작"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("설정 저장하기"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("설정 읽어오기"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("설정 되돌리기"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("설정 되돌리기"); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("EEPROM 초기화"); PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("새로고침"); PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("처음으로"); diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index f657919bb..d5d46ecfe 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -123,7 +123,7 @@ namespace Language_nl { PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD contrast"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Geheugen opslaan"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Geheugen laden"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Noodstop reset"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Noodstop reset"); PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Ververs"); PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Info scherm"); PROGMEM Language_Str MSG_PREPARE = _UxGT("Voorbereiden"); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 8a8fe43ee..113c58629 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -298,7 +298,7 @@ namespace Language_pl { PROGMEM Language_Str MSG_CONTRAST = _UxGT("Kontrast LCD"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Zapisz w pamięci"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Wczytaj z pamięci"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Ustaw. fabryczne"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Ustaw. fabryczne"); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Initializuj EEPROM"); PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Uaktualnij kartę"); PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Resetuj drukarkę"); diff --git a/Marlin/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index 8a1e863b7..69c8be603 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -113,7 +113,7 @@ namespace Language_pt { PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Guardar na memoria"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Carregar da memoria"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Rest. de emergen."); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Rest. de emergen."); PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT(" Recarregar"); PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Monitorizar"); PROGMEM Language_Str MSG_PREPARE = _UxGT("Preparar"); diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index ab8e313b3..9ce6a7042 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -252,7 +252,7 @@ namespace Language_pt_br { PROGMEM Language_Str MSG_CONTRAST = _UxGT("Contraste"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Salvar Configuração"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Ler Configuração"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Restauro seguro"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Restauro seguro"); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Iniciar EEPROM"); PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Atualiz. SD"); PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Resetar Impressora"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 0cb25e057..82c91c650 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -276,7 +276,7 @@ namespace Language_ru { PROGMEM Language_Str MSG_CONTRAST = _UxGT("Контраст LCD"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Сохранить настройки"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Загрузить настройки"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Вернуть настройки"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Вернуть настройки"); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Изначальный EEPROM"); PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Обновление прошивки"); PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Сброс принтера"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index d652bb098..4205cd598 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -67,9 +67,9 @@ namespace Language_sk { PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Domov os Z"); PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto-zarovn. Z"); PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Parkovanie XYZ"); - PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Kliknutím spusťte"); + PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Kliknutím začnete"); PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Ďalší bod"); - PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Meranie hotové!"); + PROGMEM Language_Str MSG_LEVEL_BED_DONE = _UxGT("Vyrovnanie hotové!"); PROGMEM Language_Str MSG_Z_FADE_HEIGHT = _UxGT("Výška rovnania"); PROGMEM Language_Str MSG_SET_HOME_OFFSETS = _UxGT("Nastaviť ofsety"); PROGMEM Language_Str MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofsety nastavené"); @@ -173,10 +173,10 @@ namespace Language_sk { PROGMEM Language_Str MSG_UBL_SIDE_POINTS = _UxGT("Postranné body"); PROGMEM Language_Str MSG_UBL_MAP_TYPE = _UxGT("Typ siete bodov"); PROGMEM Language_Str MSG_UBL_OUTPUT_MAP = _UxGT("Exportovať sieť"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Exportovať do PC"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Exportovať do CSV"); - PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Záloha do PC"); - PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Info. o UBL do PC"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Export do hosta"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Export do CSV"); + PROGMEM Language_Str MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Externá záloha"); + PROGMEM Language_Str MSG_UBL_INFO_UBL = _UxGT("Info. o výst. UBL"); PROGMEM Language_Str MSG_UBL_FILLIN_AMOUNT = _UxGT("Hustota mriežky"); PROGMEM Language_Str MSG_UBL_MANUAL_FILLIN = _UxGT("Ručné vyplnenie"); PROGMEM Language_Str MSG_UBL_SMART_FILLIN = _UxGT("Chytré vyplnenie"); @@ -302,8 +302,11 @@ namespace Language_sk { PROGMEM Language_Str MSG_CONTRAST = _UxGT("Kontrast LCD"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Uložiť nastavenie"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Načítať nastavenie"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Obnoviť nastavenie"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Obnoviť nastavenie"); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Inicializ. EEPROM"); + PROGMEM Language_Str MSG_ERR_EEPROM_CRC = _UxGT("Chyba: EEPROM CRC"); + PROGMEM Language_Str MSG_ERR_EEPROM_INDEX = _UxGT("Chyba: EEPROM Index"); + PROGMEM Language_Str MSG_ERR_EEPROM_VERSION = _UxGT("Chyba: Verzia EEPROM"); PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Aktualizovať z SD"); PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Reštart. tlačiar."); PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Obnoviť"); diff --git a/Marlin/src/lcd/language/language_test.h b/Marlin/src/lcd/language/language_test.h index 1aa5cb4a0..465d3743f 100644 --- a/Marlin/src/lcd/language/language_test.h +++ b/Marlin/src/lcd/language/language_test.h @@ -149,7 +149,7 @@ namespace Language_test { PROGMEM Language_Str MSG_MOTION = STRG_OKTAL_4; PROGMEM Language_Str MSG_FILAMENT = STRG_OKTAL_5; PROGMEM Language_Str MSG_CONTRAST = STRG_OKTAL_6; - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = STRG_OKTAL_7; + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = STRG_OKTAL_7; PROGMEM Language_Str MSG_NOZZLE = STRG_OKTAL_8; PROGMEM Language_Str MSG_NOZZLE_N = STRG_OKTAL_8 " ~"; @@ -186,7 +186,7 @@ namespace Language_test { PROGMEM Language_Str MSG_MOTION = STRG_OKTAL_4; PROGMEM Language_Str MSG_FILAMENT = STRG_OKTAL_5; PROGMEM Language_Str MSG_CONTRAST = STRG_OKTAL_6; - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = STRG_OKTAL_7; + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = STRG_OKTAL_7; PROGMEM Language_Str MSG_NOZZLE = STRG_OKTAL_8; PROGMEM Language_Str MSG_NOZZLE_N = STRG_OKTAL_8 " ~"; @@ -222,7 +222,7 @@ namespace Language_test { PROGMEM Language_Str MSG_MOTION = STRG_OKTAL_4; PROGMEM Language_Str MSG_FILAMENT = STRG_OKTAL_5; PROGMEM Language_Str MSG_CONTRAST = STRG_OKTAL_6; - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = STRG_OKTAL_7; + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = STRG_OKTAL_7; PROGMEM Language_Str MSG_NOZZLE = STRG_OKTAL_8; PROGMEM Language_Str MSG_NOZZLE_N = STRG_OKTAL_8 " ~"; diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index b5ed64267..57d2911af 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -266,7 +266,7 @@ namespace Language_tr { PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD Kontrast"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Hafızaya Al"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Hafızadan Yükle"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Fabrika Ayarları"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Fabrika Ayarları"); PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("EEPROM'u başlat"); PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("SD Güncellemesi"); PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Yazıcıyı Resetle"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index bfc6e16dc..0d473bf0a 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -139,7 +139,7 @@ namespace Language_uk { PROGMEM Language_Str MSG_CONTRAST = _UxGT("контраст LCD"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Зберегти в ПЗП"); PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Зчитати з ПЗП"); - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Відновити базові"); + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Відновити базові"); PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("Поновити"); PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("Інформація"); PROGMEM Language_Str MSG_PREPARE = _UxGT("Підготувати"); diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index 76ce55284..330db4b69 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -266,7 +266,7 @@ namespace Language_vi { PROGMEM Language_Str MSG_CONTRAST = _UxGT("Độ tương phản LCD"); // LCD contrast PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("Lưu các thiết lập"); // Store settings PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("Tải các cài đặt"); // Load settings - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("Khôi phục phòng hư"); // Restore failsafe + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("Khôi phục phòng hư"); // Restore Defaults PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("Khởi Tạo EEPROM"); // Initialize EEPROM PROGMEM Language_Str MSG_MEDIA_UPDATE = _UxGT("Cập Nhật phương tiện"); // Update media PROGMEM Language_Str MSG_RESET_PRINTER = _UxGT("Bặt Lại Máy In"); @@ -309,7 +309,7 @@ namespace Language_vi { PROGMEM Language_Str MSG_FILAMENTUNLOAD = _UxGT("Dỡ dây nhựa"); // unload filament PROGMEM Language_Str MSG_FILAMENTUNLOAD_E = _UxGT("Dỡ dây nhựa *"); // unload filament PROGMEM Language_Str MSG_FILAMENTUNLOAD_ALL = _UxGT("Dỡ tất cả"); // Unload All - PROGMEM Language_Str MSG_ATTACH_MEDIA = _UxGT("Khởi tạo phương tiện"); // Init. media + PROGMEM Language_Str MSG_ATTACH_MEDIA = _UxGT("Khởi tạo phương tiện"); // Attach media PROGMEM Language_Str MSG_CHANGE_MEDIA = _UxGT("Thay phương tiện"); // Change midea PROGMEM Language_Str MSG_RELEASE_MEDIA = _UxGT("Phát hành phương tiện"); PROGMEM Language_Str MSG_ZPROBE_OUT = _UxGT("Đầu Dò Z qua bàn"); // Z Probe past bed diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 8e760f73b..742375c7d 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -240,7 +240,7 @@ namespace Language_zh_CN { PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD对比度"); //"LCD contrast" PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("保存设置"); //"Store memory" PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("装载设置"); //"Load memory" - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("恢复安全值"); //"Restore failsafe" + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("恢复安全值"); //"Restore Defaults" PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("初始化设置"); // "Initialize EEPROM" PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("刷新"); //"Refresh" PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("信息屏"); //"Info screen" diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 77a6c04d9..d0871f0e4 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -240,7 +240,7 @@ namespace Language_zh_TW { PROGMEM Language_Str MSG_CONTRAST = _UxGT("LCD對比度"); //"LCD contrast" PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("保存設置"); //"Store memory" PROGMEM Language_Str MSG_LOAD_EEPROM = _UxGT("載入設置"); //"Load memory" - PROGMEM Language_Str MSG_RESTORE_FAILSAFE = _UxGT("恢復安全值"); //"Restore failsafe" + PROGMEM Language_Str MSG_RESTORE_DEFAULTS = _UxGT("恢復安全值"); //"Restore Defaults" PROGMEM Language_Str MSG_INIT_EEPROM = _UxGT("初始化設置"); // "Initialize EEPROM" PROGMEM Language_Str MSG_REFRESH = LCD_STR_REFRESH _UxGT("刷新"); //"Refresh" PROGMEM Language_Str MSG_INFO_SCREEN = _UxGT("資訊界面"); //"Info screen" diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index f787e492e..f1bcb970d 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -324,9 +324,9 @@ void MarlinUI::_synchronize() { if (should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, sync_message); if (no_reentry) return; // Make this the current handler till all moves are done - no_reentry = true; const screenFunc_t old_screen = currentScreen; goto_screen(_synchronize); + no_reentry = true; planner.synchronize(); // idle() is called until moves complete no_reentry = false; goto_screen(old_screen); 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 eeae0e702..d2285e083 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -394,7 +394,7 @@ void menu_configuration() { #endif if (!busy) - ACTION_ITEM(MSG_RESTORE_FAILSAFE, []{ + ACTION_ITEM(MSG_RESTORE_DEFAULTS, []{ settings.reset(); #if HAS_BUZZER ui.completion_feedback(); diff --git a/Marlin/src/lcd/menu/menu_tmc.cpp b/Marlin/src/lcd/menu/menu_tmc.cpp index ed70a3e7f..0350d788e 100644 --- a/Marlin/src/lcd/menu/menu_tmc.cpp +++ b/Marlin/src/lcd/menu/menu_tmc.cpp @@ -32,34 +32,34 @@ #include "../../module/stepper/indirection.h" #include "../../feature/tmc_util.h" -#define TMC_EDIT_STORED_I_RMS(ST,MSG) EDIT_ITEM_P(uint16_4, PSTR(MSG), &stepper##ST.val_mA, 100, 3000, []{ stepper##ST.refresh_stepper_current(); }) +#define TMC_EDIT_STORED_I_RMS(ST,STR) EDIT_ITEM_P(uint16_4, PSTR(STR), &stepper##ST.val_mA, 100, 3000, []{ stepper##ST.refresh_stepper_current(); }) 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); @@ -90,34 +90,34 @@ void menu_tmc_current() { #if ENABLED(HYBRID_THRESHOLD) - #define TMC_EDIT_STORED_HYBRID_THRS(ST, MSG) EDIT_ITEM_P(uint8, PSTR(MSG), &stepper##ST.stored.hybrid_thrs, 0, 255, []{ stepper##ST.refresh_hybrid_thrs(); }); + #define TMC_EDIT_STORED_HYBRID_THRS(ST, STR) EDIT_ITEM_P(uint8, PSTR(STR), &stepper##ST.stored.hybrid_thrs, 0, 255, []{ stepper##ST.refresh_hybrid_thrs(); }); void menu_tmc_hybrid_thrs() { 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); @@ -150,7 +150,7 @@ void menu_tmc_current() { #if ENABLED(SENSORLESS_HOMING) - #define TMC_EDIT_STORED_SGT(ST) EDIT_ITEM_P(int4, PSTR(MSG_##ST), &stepper##ST.stored.homing_thrs, stepper##ST.sgt_min, stepper##ST.sgt_max, []{ stepper##ST.refresh_homing_thrs(); }); + #define TMC_EDIT_STORED_SGT(ST) EDIT_ITEM_P(int4, PSTR(STR_##ST), &stepper##ST.stored.homing_thrs, stepper##ST.sgt_min, stepper##ST.sgt_max, []{ stepper##ST.refresh_homing_thrs(); }); void menu_tmc_homing_thrs() { START_MENU(); @@ -174,35 +174,35 @@ void menu_tmc_current() { #if HAS_STEALTHCHOP - #define TMC_EDIT_STEP_MODE(ST, MSG) EDIT_ITEM_P(bool, PSTR(MSG), &stepper##ST.stored.stealthChop_enabled, []{ stepper##ST.refresh_stepping_mode(); }) + #define TMC_EDIT_STEP_MODE(ST, STR) EDIT_ITEM_P(bool, PSTR(STR), &stepper##ST.stored.stealthChop_enabled, []{ stepper##ST.refresh_stepping_mode(); }) void menu_tmc_step_mode() { START_MENU(); 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/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index 8ad02acfb..422c8b0b8 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -1453,7 +1453,7 @@ void MarlinUI::update() { /** * Reset the status message */ - void MarlinUI::reset_status() { + void MarlinUI::reset_status(const bool no_welcome) { PGM_P printing = GET_TEXT(MSG_PRINTING); PGM_P welcome = GET_TEXT(WELCOME_MSG); #if SERVICE_INTERVAL_1 > 0 @@ -1485,8 +1485,10 @@ void MarlinUI::update() { else if (print_job_timer.needsService(3)) msg = service3; #endif - else + else if (!no_welcome) msg = welcome; + else + return; set_status_P(msg, -1); } diff --git a/Marlin/src/lcd/ultralcd.h b/Marlin/src/lcd/ultralcd.h index 8a328c4b9..f614e2009 100644 --- a/Marlin/src/lcd/ultralcd.h +++ b/Marlin/src/lcd/ultralcd.h @@ -402,7 +402,7 @@ public: static void set_status(const char* const message, const bool persist=false); static void set_status_P(PGM_P const message, const int8_t level=0); static void status_printf_P(const uint8_t level, PGM_P const fmt, ...); - static void reset_status(); + static void reset_status(const bool no_welcome=false); #else // No LCD @@ -416,7 +416,7 @@ public: static inline void refresh() {} static inline void return_to_status() {} static inline void set_alert_status_P(PGM_P const) {} - static inline void reset_status() {} + static inline void reset_status(const bool=false) {} static inline void reset_alert_level() {} static constexpr bool has_status() { return false; } diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index efd9daded..3fe38d4ad 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -1397,6 +1397,9 @@ void MarlinSettings::postprocess() { } DEBUG_ECHO_START(); DEBUG_ECHOLNPAIR("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")"); + #if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT) + ui.set_status_P(GET_TEXT(MSG_ERR_EEPROM_VERSION)); + #endif eeprom_error = true; } else { @@ -2205,11 +2208,17 @@ void MarlinSettings::postprocess() { if (eeprom_error) { DEBUG_ECHO_START(); DEBUG_ECHOLNPAIR("Index: ", int(eeprom_index - (EEPROM_OFFSET)), " Size: ", datasize()); + #if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT) + ui.set_status_P(GET_TEXT(MSG_ERR_EEPROM_INDEX)); + #endif } else if (working_crc != stored_crc) { eeprom_error = true; DEBUG_ERROR_START(); DEBUG_ECHOLNPAIR("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!"); + #if HAS_LCD_MENU && DISABLED(EEPROM_AUTO_INIT) + ui.set_status_P(GET_TEXT(MSG_ERR_EEPROM_CRC)); + #endif } else if (!validating) { DEBUG_ECHO_START(); @@ -2532,7 +2541,7 @@ void MarlinSettings::reset() { // #if ENABLED(EDITABLE_SERVO_ANGLES) - COPY(servo_angles, base_servo_angles); + COPY(servo_angles, base_servo_angles); // When not editable only one copy of servo angles exists #endif // @@ -3082,7 +3091,7 @@ void MarlinSettings::reset() { #endif #elif ENABLED(SWITCHING_NOZZLE) case SWITCHING_NOZZLE_SERVO_NR: - #elif (ENABLED(BLTOUCH) && defined(BLTOUCH_ANGLES)) || (defined(Z_SERVO_ANGLES) && defined(Z_PROBE_SERVO_NR)) + #elif ENABLED(BLTOUCH) || (HAS_Z_SERVO_PROBE && defined(Z_SERVO_ANGLES)) case Z_PROBE_SERVO_NR: #endif CONFIG_ECHO_START(); diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 1491d881d..58de4a8d0 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(); @@ -403,7 +403,7 @@ void Endstops::event_handler() { #if BOTH(SD_ABORT_ON_ENDSTOP_HIT, SDSUPPORT) if (planner.abort_on_endstop_hit) { - card.stopSDPrint(); + card.endFilePrint(); quickstop_stepper(); thermalManager.disable_all_heaters(); print_job_timer.stop(); @@ -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,8 +423,8 @@ void _O2 Endstops::report_states() { #if ENABLED(BLTOUCH) bltouch._set_SW_mode(); #endif - SERIAL_ECHOLNPGM(MSG_M119_REPORT); - #define ES_REPORT(S) print_es_state(READ(S##_PIN) != S##_ENDSTOP_INVERTING, PSTR(MSG_##S)) + SERIAL_ECHOLNPGM(STR_M119_REPORT); + #define ES_REPORT(S) print_es_state(READ(S##_PIN) != S##_ENDSTOP_INVERTING, PSTR(STR_##S)) #if HAS_X_MIN ES_REPORT(X_MIN); #endif @@ -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..2067ecc23 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 @@ -2390,6 +2390,12 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // Start with a safe speed (from which the machine may halt to stop immediately). float safe_speed = nominal_speed; + #ifdef TRAVEL_EXTRA_XYJERK + const float extra_xyjerk = (de <= 0) ? TRAVEL_EXTRA_XYJERK : 0; + #else + constexpr float extra_xyjerk = 0; + #endif + uint8_t limited = 0; #if HAS_LINEAR_E_JERK LOOP_XYZ(i) @@ -2398,7 +2404,12 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif { const float jerk = ABS(current_speed[i]), // cs : Starting from zero, change in speed for this axis - maxj = max_jerk[i]; // mj : The max jerk setting for this axis + maxj = (max_jerk[i] // mj : The max jerk setting for this axis + #ifdef TRAVEL_EXTRA_XYJERK + + (i == X_AXIS || i == Y_AXIS ? extra_xyjerk : 0) + #endif + ); + if (jerk > maxj) { // cs > mj : New current speed too fast? if (limited) { // limited already? const float mjerk = nominal_speed * maxj; // ns*mj @@ -2450,8 +2461,14 @@ bool Planner::_populate_block(block_t * const block, bool split_move, : // v_exit <= v_entry coasting axis reversal ( (v_entry < 0 || v_exit > 0) ? (v_entry - v_exit) : _MAX(-v_exit, v_entry) ); - if (jerk > max_jerk[axis]) { - v_factor *= max_jerk[axis] / jerk; + const float maxj = (max_jerk[axis] + #ifdef TRAVEL_EXTRA_XYJERK + + (axis == X_AXIS || axis == Y_AXIS ? extra_xyjerk : 0) + #endif + ); + + if (jerk > maxj) { + v_factor *= maxj / jerk; ++limited; } } 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..858dcae74 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; } @@ -559,7 +559,7 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) { * * @return The Z position of the bed at the current XY or NAN on error. */ -float Probe::run_z_probe() { +float Probe::run_z_probe(const bool sanity_check/*=true*/) { if (DEBUGGING(LEVELING)) DEBUG_POS(">>> Probe::run_z_probe", current_position); @@ -572,7 +572,7 @@ float Probe::run_z_probe() { // Do a first probe at the fast speed if (probe_down_to_z(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_FAST)) // No probe trigger? - || current_position.z > -offset.z + _MAX(Z_CLEARANCE_BETWEEN_PROBES, 4) / 2 // Probe triggered too high? + || (sanity_check && current_position.z > -offset.z + _MAX(Z_CLEARANCE_BETWEEN_PROBES, 4) / 2) // Probe triggered too high? ) { if (DEBUGGING(LEVELING)) { DEBUG_ECHOLNPGM("FAST Probe fail!"); @@ -617,7 +617,7 @@ float Probe::run_z_probe() { { // Probe downward slowly to find the bed if (probe_down_to_z(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_SLOW)) // No probe trigger? - || current_position.z > -offset.z + _MAX(Z_CLEARANCE_MULTI_PROBE, 4) / 2 // Probe triggered too high? + || (sanity_check && current_position.z > -offset.z + _MAX(Z_CLEARANCE_MULTI_PROBE, 4) / 2) // Probe triggered too high? ) { if (DEBUGGING(LEVELING)) { DEBUG_ECHOLNPGM("SLOW Probe fail!"); @@ -709,7 +709,7 @@ float Probe::run_z_probe() { * - Raise to the BETWEEN height * - Return the probed Z position */ -float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/, const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/) { +float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/, const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/, const bool sanity_check/*=true*/) { if (DEBUGGING(LEVELING)) { DEBUG_ECHOLNPAIR( ">>> Probe::probe_at_point(", LOGICAL_X_POSITION(rx), ", ", LOGICAL_Y_POSITION(ry), @@ -751,7 +751,7 @@ float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise do_blocking_move_to(npos); float measured_z = NAN; - if (!deploy()) measured_z = run_z_probe() + offset.z; + if (!deploy()) measured_z = run_z_probe(sanity_check) + offset.z; if (!isnan(measured_z)) { const bool big_raise = raise_after == PROBE_PT_BIG_RAISE; if (big_raise || raise_after == PROBE_PT_RAISE) @@ -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/probe.h b/Marlin/src/module/probe.h index b70c01364..6f17090e6 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -48,8 +48,8 @@ public: #ifdef Z_AFTER_PROBING static void move_z_after_probing(); #endif - static float probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true); - static inline float probe_at_point(const xy_pos_t &pos, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true) { + static float probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true); + static inline float probe_at_point(const xy_pos_t &pos, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true) { return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative); } #if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER) @@ -164,7 +164,7 @@ public: private: static bool probe_down_to_z(const float z, const feedRate_t fr_mm_s); static void do_z_raise(const float z_raise); - static float run_z_probe(); + static float run_z_probe(const bool sanity_check=true); }; extern Probe probe; diff --git a/Marlin/src/module/servo.h b/Marlin/src/module/servo.h index 5f9291e97..335ce698e 100644 --- a/Marlin/src/module/servo.h +++ b/Marlin/src/module/servo.h @@ -31,46 +31,65 @@ #if HAS_SERVO_ANGLES #if ENABLED(SWITCHING_EXTRUDER) - #ifndef SWITCHING_EXTRUDER_E23_SERVO_NR - #define SWITCHING_EXTRUDER_E23_SERVO_NR -1 - #endif + // Switching extruder can have 2 or 4 angles #if EXTRUDERS > 3 #define REQ_ANGLES 4 #else #define REQ_ANGLES 2 #endif - #define SADATA SWITCHING_EXTRUDER_SERVO_ANGLES - #define ASRC(N,E) (SWITCHING_EXTRUDER_SERVO_NR == N ? asrc[E] : SWITCHING_EXTRUDER_E23_SERVO_NR == N ? asrc[E+2] : 0) - #elif ENABLED(SWITCHING_NOZZLE) - #define SADATA SWITCHING_NOZZLE_SERVO_ANGLES - #define ASRC(N,E) (SWITCHING_NOZZLE_SERVO_NR == N ? asrc[E] : 0) - #elif defined(Z_PROBE_SERVO_NR) - #define ASRC(N,E) (Z_PROBE_SERVO_NR == N ? asrc[E] : 0) + constexpr uint16_t sase[] = SWITCHING_EXTRUDER_SERVO_ANGLES; + static_assert(COUNT(sase) == REQ_ANGLES, "SWITCHING_EXTRUDER_SERVO_ANGLES needs " STRINGIFY(REQ_ANGLES) " angles."); + #else + constexpr uint16_t sase[4] = { 0 }; + #endif + + #if ENABLED(SWITCHING_NOZZLE) + constexpr uint16_t sasn[] = SWITCHING_NOZZLE_SERVO_ANGLES; + static_assert(COUNT(sasn) == 2, "SWITCHING_NOZZLE_SERVO_ANGLES needs 2 angles."); + #else + constexpr uint16_t sasn[2] = { 0 }; + #endif + + #ifdef Z_PROBE_SERVO_NR #if ENABLED(BLTOUCH) #include "../feature/bltouch.h" + #undef Z_SERVO_ANGLES + #define Z_SERVO_ANGLES { BLTOUCH_DEPLOY, BLTOUCH_STOW } #endif - #ifdef BLTOUCH_ANGLES - #define SADATA BLTOUCH_ANGLES - #elif defined(Z_SERVO_ANGLES) - #define SADATA Z_SERVO_ANGLES - #else - #error "Servo angles are needed!" - #endif + constexpr uint16_t sazp[] = Z_SERVO_ANGLES; + static_assert(COUNT(sazp) == 2, "Z_SERVO_ANGLES needs 2 angles."); + #else + constexpr uint16_t sazp[2] = { 0 }; #endif + #ifndef SWITCHING_EXTRUDER_SERVO_NR + #define SWITCHING_EXTRUDER_SERVO_NR -1 + #endif + #ifndef SWITCHING_EXTRUDER_E23_SERVO_NR + #define SWITCHING_EXTRUDER_E23_SERVO_NR -1 + #endif + #ifndef SWITCHING_NOZZLE_SERVO_NR + #define SWITCHING_NOZZLE_SERVO_NR -1 + #endif + #ifndef Z_PROBE_SERVO_NR + #define Z_PROBE_SERVO_NR -1 + #endif + + #define ASRC(N,I) ( \ + N == SWITCHING_EXTRUDER_SERVO_NR ? sase[I] \ + : N == SWITCHING_EXTRUDER_E23_SERVO_NR ? sase[I+2] \ + : N == SWITCHING_NOZZLE_SERVO_NR ? sasn[I] \ + : N == Z_PROBE_SERVO_NR ? sazp[I] \ + : 0 ) + #if ENABLED(EDITABLE_SERVO_ANGLES) extern uint16_t servo_angles[NUM_SERVOS][2]; - #define BASE_SERVO_ANGLES base_servo_angles + #define CONST_SERVO_ANGLES base_servo_angles #else - #define BASE_SERVO_ANGLES servo_angles + #define CONST_SERVO_ANGLES servo_angles #endif - constexpr uint16_t asrc[] = SADATA; - #if REQ_ANGLES - static_assert(COUNT(asrc) == REQ_ANGLES, "SWITCHING_EXTRUDER_SERVO_ANGLES needs " STRINGIFY(REQ_ANGLES) " angles."); - #endif - - constexpr uint16_t BASE_SERVO_ANGLES [NUM_SERVOS][2] = { + constexpr uint16_t CONST_SERVO_ANGLES [NUM_SERVOS][2] = { { ASRC(0,0), ASRC(0,1) } #if NUM_SERVOS > 1 , { ASRC(1,0), ASRC(1,1) } 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 28baa4047..021878c1e 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -45,8 +45,8 @@ #endif #endif -#if ENABLED(MAGNETIC_PARKING_EXTRUDER) || (ENABLED(PARKING_EXTRUDER) && PARKING_EXTRUDER_SOLENOIDS_DELAY > 0) - #include "../gcode/gcode.h" // for dwell() +#if ENABLED(MAGNETIC_PARKING_EXTRUDER) || defined(EVENT_GCODE_AFTER_TOOLCHANGE) || (ENABLED(PARKING_EXTRUDER) && PARKING_EXTRUDER_SOLENOIDS_DELAY > 0) + #include "../gcode/gcode.h" #endif #if ANY(SWITCHING_EXTRUDER, SWITCHING_NOZZLE, SWITCHING_TOOLHEAD) @@ -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; @@ -861,7 +861,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { } #endif // TOOLCHANGE_FILAMENT_SWAP - #if HAS_LEVELING + #if HAS_LEVELING && DISABLED(SINGLENOZZLE) // Set current position to the physical position TEMPORARY_BED_LEVELING_STATE(false); #endif @@ -1068,11 +1068,12 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { #endif #ifdef EVENT_GCODE_AFTER_TOOLCHANGE - gcode.process_subcommands_now_P(EVENT_GCODE_AFTER_TOOLCHANGE); + if (!no_move) + gcode.process_subcommands_now_P(PSTR(EVENT_GCODE_AFTER_TOOLCHANGE)); #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/pins/lpc1768/pins_BTT_SKR_V1_3.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h index d7af23242..bd0ad468d 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -187,32 +187,32 @@ /** * _____ _____ - * NC | · · | GND 5V | · · | GND - * RESET | · · | 1.31 (SD_DETECT) (LCD_D7) 1.23 | · · | 1.22 (LCD_D6) - * (MOSI) 0.18 | · · | 3.25 (BTN_EN2) (LCD_D5) 1.21 | · · | 1.20 (LCD_D4) - * (SD_SS) 0.16 | · · | 3.26 (BTN_EN1) (LCD_RS) 1.19 | · · | 1.18 (LCD_EN) - * (SCK) 0.15 | · · | 0.17 (MISO) (BTN_ENC) 0.28 | · · | 1.30 (BEEPER) + * NC | 1 2 | GND 5V | 1 2 | GND + * RESET | 3 4 | 1.31 (SD_DETECT) (LCD_D7) 1.23 | 3 4 | 1.22 (LCD_D6) + * (MOSI) 0.18 | 5 6 3.25 (BTN_EN2) (LCD_D5) 1.21 | 5 6 1.20 (LCD_D4) + * (SD_SS) 0.16 | 7 8 | 3.26 (BTN_EN1) (LCD_RS) 1.19 | 7 8 | 1.18 (LCD_EN) + * (SCK) 0.15 | 9 10| 0.17 (MISO) (BTN_ENC) 0.28 | 9 10| 1.30 (BEEPER) * ----- ----- * EXP2 EXP1 */ -#define EXP1_1_PIN P1_30 -#define EXP1_2_PIN P1_18 -#define EXP1_3_PIN P1_20 -#define EXP1_4_PIN P1_22 -#define EXP1_6_PIN P0_28 -#define EXP1_7_PIN P1_19 -#define EXP1_8_PIN P1_21 -#define EXP1_9_PIN P1_23 +#define EXPA1_03_PIN P1_23 +#define EXPA1_04_PIN P1_22 +#define EXPA1_05_PIN P1_21 +#define EXPA1_06_PIN P1_20 +#define EXPA1_07_PIN P1_19 +#define EXPA1_08_PIN P1_18 +#define EXPA1_09_PIN P0_28 +#define EXPA1_10_PIN P1_30 -#define EXP2_1_PIN P0_17 -#define EXP2_2_PIN P3_26 -#define EXP2_3_PIN P3_25 -#define EXP2_4_PIN P1_31 -#define EXP2_6_PIN P0_15 -#define EXP2_7_PIN P0_16 -#define EXP2_8_PIN P0_18 -#define EXP2_9_PIN -1 +#define EXPA2_03_PIN -1 +#define EXPA2_04_PIN P1_31 +#define EXPA2_05_PIN P0_18 +#define EXPA2_06_PIN P3_25 +#define EXPA2_07_PIN P0_16 +#define EXPA2_08_PIN P3_26 +#define EXPA2_09_PIN P0_15 +#define EXPA2_10_PIN P0_17 #if HAS_SPI_LCD @@ -232,114 +232,114 @@ * * BEFORE AFTER * _____ _____ - * GND 1 | · · | 2 5V 5V 1 | · · | 2 GND - * CS 3 | · · | 4 BTN_EN2 CS 3 | · · | 4 BTN_EN2 - * SID 5 | · · | 6 BTN_EN1 SID 5 | · · | 6 BTN_EN1 - * open 7 | · · | 8 BTN_ENC CLK 7 | · · | 8 BTN_ENC - * CLK 9 | · · | 10 Beeper open 9 | · · | 10 Beeper + * GND 1 | 1 2 | 2 5V 5V 1 | 1 2 | 2 GND + * CS 3 | 3 4 | 4 BTN_EN2 CS 3 | 3 4 | 4 BTN_EN2 + * SID 5 | 5 6 6 BTN_EN1 SID 5 | 5 6 6 BTN_EN1 + * open 7 | 7 8 | 8 BTN_ENC CLK 7 | 7 8 | 8 BTN_ENC + * CLK 9 | 9 10| 10 Beeper open 9 | 9 10| 10 Beeper * ----- ----- * LCD LCD */ - #define LCD_PINS_RS EXP1_9_PIN + #define LCD_PINS_RS EXPA1_03_PIN - #define BTN_EN1 EXP1_3_PIN - #define BTN_EN2 EXP1_4_PIN - #define BTN_ENC EXP1_2_PIN + #define BTN_EN1 EXPA1_06_PIN + #define BTN_EN2 EXPA1_04_PIN + #define BTN_ENC EXPA1_08_PIN - #define LCD_PINS_ENABLE EXP1_8_PIN - #define LCD_PINS_D4 EXP1_7_PIN + #define LCD_PINS_ENABLE EXPA1_05_PIN + #define LCD_PINS_D4 EXPA1_07_PIN #elif ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS EXP1_4_PIN + #define LCD_PINS_RS EXPA1_04_PIN - #define BTN_EN1 EXP1_2_PIN - #define BTN_EN2 EXP1_3_PIN - #define BTN_ENC EXP1_6_PIN // (58) open-drain + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN + #define BTN_ENC EXPA1_09_PIN // (58) open-drain - #define LCD_PINS_ENABLE EXP1_9_PIN - #define LCD_PINS_D4 EXP1_8_PIN + #define LCD_PINS_ENABLE EXPA1_03_PIN + #define LCD_PINS_D4 EXPA1_05_PIN #else // !CR10_STOCKDISPLAY - #define LCD_PINS_RS EXP1_7_PIN + #define LCD_PINS_RS EXPA1_07_PIN - #define BTN_EN1 EXP2_2_PIN // (31) J3-2 & AUX-4 - #define BTN_EN2 EXP2_3_PIN // (33) J3-4 & AUX-4 - #define BTN_ENC EXP1_6_PIN // (58) open-drain + #define BTN_EN1 EXPA2_08_PIN // (31) J3-2 & AUX-4 + #define BTN_EN2 EXPA2_06_PIN // (33) J3-4 & AUX-4 + #define BTN_ENC EXPA1_09_PIN // (58) open-drain - #define LCD_PINS_ENABLE EXP1_2_PIN - #define LCD_PINS_D4 EXP1_3_PIN + #define LCD_PINS_ENABLE EXPA1_08_PIN + #define LCD_PINS_D4 EXPA1_06_PIN - #define LCD_SDSS EXP2_7_PIN // (16) J3-7 & AUX-4 - #define SD_DETECT_PIN EXP2_4_PIN // (49) (NOT 5V tolerant) + #define LCD_SDSS EXPA2_07_PIN // (16) J3-7 & AUX-4 + #define SD_DETECT_PIN EXPA2_04_PIN // (49) (NOT 5V tolerant) #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS EXP1_2_PIN - #define DOGLCD_A0 EXP1_7_PIN - #define DOGLCD_SCK EXP2_6_PIN - #define DOGLCD_MOSI EXP2_8_PIN + #define DOGLCD_CS EXPA1_08_PIN + #define DOGLCD_A0 EXPA1_07_PIN + #define DOGLCD_SCK EXPA2_09_PIN + #define DOGLCD_MOSI EXPA2_05_PIN #define LCD_BACKLIGHT_PIN -1 #define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN EXP1_3_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXPA1_06_PIN // Must be high or open for LCD to operate normally. #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN EXP1_8_PIN + #define RGB_LED_R_PIN EXPA1_05_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_4_PIN + #define RGB_LED_G_PIN EXPA1_04_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_9_PIN + #define RGB_LED_B_PIN EXPA1_03_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_8_PIN + #define NEOPIXEL_PIN EXPA1_05_PIN #endif #else // !FYSETC_MINI_12864 #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS EXP1_8_PIN - #define DOGLCD_A0 EXP1_4_PIN - #define DOGLCD_SCK EXP2_6_PIN - #define DOGLCD_MOSI EXP2_8_PIN + #define DOGLCD_CS EXPA1_05_PIN + #define DOGLCD_A0 EXPA1_04_PIN + #define DOGLCD_SCK EXPA2_09_PIN + #define DOGLCD_MOSI EXPA2_05_PIN #elif ENABLED(ENDER2_STOCKDISPLAY) /** * Creality Ender-2 display pinout * _____ - * 5V | · · | GND - * (MOSI) P1_23 | · · | P1_22 (LCD_CS) - * (LCD_A0) P1_21 | · · | P1_20 (BTN_EN2) - * RESET P1_19 | · · | P1_18 (BTN_EN1) - * (BTN_ENC) P0_28 | · · | P1_30 (SCK) + * 5V | 1 2 | GND + * (MOSI) P1_23 | 3 4 | P1_22 (LCD_CS) + * (LCD_A0) P1_21 | 5 6 P1_20 (BTN_EN2) + * RESET P1_19 | 7 8 | P1_18 (BTN_EN1) + * (BTN_ENC) P0_28 | 9 10| P1_30 (SCK) * ----- * EXP1 */ - #define BTN_EN1 EXP1_2_PIN - #define BTN_EN2 EXP1_3_PIN - #define BTN_ENC EXP1_6_PIN - #define DOGLCD_CS EXP1_4_PIN - #define DOGLCD_A0 EXP1_8_PIN - #define DOGLCD_SCK EXP1_1_PIN - #define DOGLCD_MOSI EXP1_9_PIN + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN + #define BTN_ENC EXPA1_09_PIN + #define DOGLCD_CS EXPA1_04_PIN + #define DOGLCD_A0 EXPA1_05_PIN + #define DOGLCD_SCK EXPA1_10_PIN + #define DOGLCD_MOSI EXPA1_03_PIN #define FORCE_SOFT_SPI #define LCD_BACKLIGHT_PIN -1 #endif #if ENABLED(ULTIPANEL) - #define LCD_PINS_D5 EXP1_8_PIN - #define LCD_PINS_D6 EXP1_4_PIN - #define LCD_PINS_D7 EXP1_9_PIN + #define LCD_PINS_D5 EXPA1_05_PIN + #define LCD_PINS_D6 EXPA1_04_PIN + #define LCD_PINS_D7 EXPA1_03_PIN #endif #endif // !FYSETC_MINI_12864 @@ -357,7 +357,7 @@ #endif #if SD_CONNECTION_IS(LCD) - #define SS_PIN EXP2_7_PIN + #define SS_PIN EXPA2_07_PIN #endif /** diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h index b90ac07a7..316049d6b 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -150,11 +150,6 @@ #define TEMP_1_PIN P0_23_A0 // A2 (T2) - (69) - TEMP_1_PIN #define TEMP_BED_PIN P0_25_A2 // A0 (T0) - (67) - TEMP_BED_PIN -// -// Include common SKR pins -// -#include "pins_BTT_SKR_common.h" - // // Software SPI pins for TMC2130 stepper drivers // @@ -264,7 +259,10 @@ #define LCD_PINS_D4 P1_20 #define LCD_SDSS P0_16 // (16) J3-7 & AUX-4 - #define SD_DETECT_PIN P1_31 // (49) (NOT 5V tolerant) + + #if SD_CONNECTION_IS(LCD) + #define SD_DETECT_PIN P1_31 // (49) (NOT 5V tolerant) + #endif #if ENABLED(FYSETC_MINI_12864) #define DOGLCD_CS P1_18 @@ -329,3 +327,8 @@ * P0_27 (57) (Open collector) * P0_28 (58) (Open collector) */ + +// +// Include common SKR pins +// +#include "pins_BTT_SKR_common.h" diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index a7ff58f8d..58f9eb549 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -38,15 +38,53 @@ #define SERVO0_PIN P1_23 // SERVO P1.23 #define SERVO1_PIN P2_00 // SERVO P2.0 +// +// Trinamic Stallguard pins +// +#define X_DIAG_PIN P1_29 // X- +#define Y_DIAG_PIN P1_27 // Y- +#define Z_DIAG_PIN P1_25 // Z- +#define E0_DIAG_PIN P1_28 // X+ +#define E1_DIAG_PIN P1_26 // Y+ + // // Limit Switches // -#define X_MIN_PIN P1_29 -#define X_MAX_PIN P1_28 -#define Y_MIN_PIN P1_27 -#define Y_MAX_PIN P1_26 -#define Z_MIN_PIN P1_25 -#define Z_MAX_PIN P1_24 +#if X_STALL_SENSITIVITY + #define X_STOP_PIN X_DIAG_PIN + #if X_HOME_DIR < 0 + #define X_MAX_PIN P1_28 // X+ + #else + #define X_MIN_PIN P1_28 // X+ + #endif +#else + #define X_MIN_PIN P1_29 // X- + #define X_MAX_PIN P1_28 // X+ +#endif + +#if Y_STALL_SENSITIVITY + #define Y_STOP_PIN Y_DIAG_PIN + #if Y_HOME_DIR < 0 + #define Y_MAX_PIN P1_26 // Y+ + #else + #define Y_MIN_PIN P1_26 // Y+ + #endif +#else + #define Y_MIN_PIN P1_27 // Y- + #define Y_MAX_PIN P1_26 // Y+ +#endif + +#if Z_STALL_SENSITIVITY + #define Z_STOP_PIN Z_DIAG_PIN + #if Z_HOME_DIR < 0 + #define Z_MAX_PIN P1_24 // Z+ + #else + #define Z_MIN_PIN P1_24 // Z+ + #endif +#else + #define Z_MIN_PIN P1_25 // Z- + #define Z_MAX_PIN P1_24 // Z+ +#endif // // Z Probe (when not Z_MIN_PIN) diff --git a/Marlin/src/pins/pinsDebug.h b/Marlin/src/pins/pinsDebug.h index 2006bb8bc..f247c7cac 100644 --- a/Marlin/src/pins/pinsDebug.h +++ b/Marlin/src/pins/pinsDebug.h @@ -45,7 +45,7 @@ #line 46 // manually add pins that have names that are macros which don't play well with these macros -#if (AVR_ATmega2560_FAMILY || AVR_ATmega1284_FAMILY || defined(ARDUINO_ARCH_SAM)) +#if (AVR_ATmega2560_FAMILY || AVR_ATmega1284_FAMILY || defined(ARDUINO_ARCH_SAM) || defined(TARGET_LPC1768)) #if SERIAL_PORT == 0 static const char RXD_NAME_0[] PROGMEM = { "RXD0" }; static const char TXD_NAME_0[] PROGMEM = { "TXD0" }; @@ -116,6 +116,9 @@ const PinInfo pin_array[] PROGMEM = { #elif AVR_ATmega1284_FAMILY { RXD_NAME_0, 8, true }, { TXD_NAME_0, 9, true }, + #elif defined(TARGET_LPC1768) + { RXD_NAME_0, 3, true }, + { TXD_NAME_0, 2, true }, #endif #elif SERIAL_PORT == 1 #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) @@ -124,16 +127,25 @@ const PinInfo pin_array[] PROGMEM = { #elif AVR_ATmega1284_FAMILY { RXD_NAME_1, 10, true }, { TXD_NAME_1, 11, true }, + #elif defined(TARGET_LPC1768) + { RXD_NAME_1, 16, true }, + { TXD_NAME_1, 15, true }, #endif #elif SERIAL_PORT == 2 #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) { RXD_NAME_2, 17, true }, { TXD_NAME_2, 16, true }, + #elif defined(TARGET_LPC1768) + { RXD_NAME_2, 11, true }, + { TXD_NAME_2, 10, true }, #endif #elif SERIAL_PORT == 3 #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) { RXD_NAME_3, 15, true }, { TXD_NAME_3, 14, true }, + #elif defined(TARGET_LPC1768) + { RXD_NAME_3, 1, true }, + { TXD_NAME_3, 0, true }, #endif #endif @@ -145,6 +157,9 @@ const PinInfo pin_array[] PROGMEM = { #elif AVR_ATmega1284_FAMILY { RXD_NAME_0, 8, true }, { TXD_NAME_0, 9, true }, + #elif defined(TARGET_LPC1768) + { RXD_NAME_0, 3, true }, + { TXD_NAME_0, 2, true }, #endif #elif SERIAL_PORT_2 == 1 #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) @@ -153,16 +168,25 @@ const PinInfo pin_array[] PROGMEM = { #elif AVR_ATmega1284_FAMILY { RXD_NAME_1, 10, true }, { TXD_NAME_1, 11, true }, + #elif defined(TARGET_LPC1768) + { RXD_NAME_1, 16, true }, + { TXD_NAME_1, 15, true }, #endif #elif SERIAL_PORT_2 == 2 #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) { RXD_NAME_2, 17, true }, { TXD_NAME_2, 16, true }, + #elif defined(TARGET_LPC1768) + { RXD_NAME_2, 11, true }, + { TXD_NAME_2, 10, true }, #endif #elif SERIAL_PORT_2 == 3 #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) { RXD_NAME_3, 15, true }, { TXD_NAME_3, 14, true }, + #elif defined(TARGET_LPC1768) + { RXD_NAME_3, 1, true }, + { TXD_NAME_3, 0, true }, #endif #endif #endif diff --git a/Marlin/src/pins/stm32/pins_BTT_SKR_E3_DIP.h b/Marlin/src/pins/stm32/pins_BTT_SKR_E3_DIP.h index 33445f7d0..f5c35bbdc 100644 --- a/Marlin/src/pins/stm32/pins_BTT_SKR_E3_DIP.h +++ b/Marlin/src/pins/stm32/pins_BTT_SKR_E3_DIP.h @@ -163,53 +163,54 @@ /** * _____ - * 5V | · · | GND - * (LCD_EN) PB7 | · · | PB8 (LCD_RS) - * (LCD_D4) PB9 | · · | PA10 (BTN_EN2) - * RESET | · · | PA9 (BTN_EN1) - * (BTN_ENC) PB6 | · · | PA15 (BEEPER) + * 5V | 1 2 | GND + * (LCD_EN) PB7 | 3 4 | PB8 (LCD_RS) + * (LCD_D4) PB9 | 5 6 PA10 (BTN_EN2) + * RESET | 7 8 | PA9 (BTN_EN1) + * (BTN_ENC) PB6 | 9 10| PA15 (BEEPER) * ----- * EXP1 */ -#define EXP1_1_PIN PA15 -#define EXP1_2_PIN PA9 -#define EXP1_3_PIN PA10 -#define EXP1_4_PIN PB8 -#define EXP1_6_PIN PB6 -#define EXP1_7_PIN -1 -#define EXP1_8_PIN PB9 -#define EXP1_9_PIN PB7 + +#define EXPA1_03_PIN PB7 +#define EXPA1_04_PIN PB8 +#define EXPA1_05_PIN PB9 +#define EXPA1_06_PIN PA10 +#define EXPA1_07_PIN -1 +#define EXPA1_08_PIN PA9 +#define EXPA1_09_PIN PB6 +#define EXPA1_10_PIN PA15 #if HAS_SPI_LCD - #define BTN_ENC EXP1_6_PIN - #define BTN_EN1 EXP1_2_PIN - #define BTN_EN2 EXP1_3_PIN + #define BTN_ENC EXPA1_09_PIN + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define BEEPER_PIN EXP1_1_PIN + #define BEEPER_PIN EXPA1_10_PIN - #define LCD_PINS_RS EXP1_4_PIN - #define LCD_PINS_ENABLE EXP1_9_PIN - #define LCD_PINS_D4 EXP1_8_PIN + #define LCD_PINS_RS EXPA1_04_PIN + #define LCD_PINS_ENABLE EXPA1_03_PIN + #define LCD_PINS_D4 EXPA1_05_PIN #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) /** Creality Ender-2 display pinout * _____ - * 5V | · · | GND - * (MOSI) PB7 | · · | PB8 (LCD_RS) - * (LCD_A0) PB9 | · · | PA10 (BTN_EN2) - * RESET | · · | PA9 (BTN_EN1) - * (BTN_ENC) PB6 | · · | PA15 (SCK) + * 5V | 1 2 | GND + * (MOSI) PB7 | 3 4 | PB8 (LCD_RS) + * (LCD_A0) PB9 | 5 6 PA10 (BTN_EN2) + * RESET | 7 8 | PA9 (BTN_EN1) + * (BTN_ENC) PB6 | 9 10| PA15 (SCK) * ----- * EXP1 */ - #define DOGLCD_CS EXP1_4_PIN - #define DOGLCD_A0 EXP1_8_PIN - #define DOGLCD_SCK EXP1_1_PIN - #define DOGLCD_MOSI EXP1_9_PIN + #define DOGLCD_CS EXPA1_04_PIN + #define DOGLCD_A0 EXPA1_05_PIN + #define DOGLCD_SCK EXPA1_10_PIN + #define DOGLCD_MOSI EXPA1_03_PIN #define FORCE_SOFT_SPI #define LCD_BACKLIGHT_PIN -1 diff --git a/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3.h b/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3.h index 9785c7bd4..77a412ad6 100644 --- a/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3.h +++ b/Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3.h @@ -103,70 +103,70 @@ /** * _____ - * 5V | · · | GND - * (LCD_EN) PB7 | · · | PB8 (LCD_RS) - * (LCD_D4) PB9 | · · | PA10 (BTN_EN2) - * RESET | · · | PA9 (BTN_EN1) - * (BTN_ENC) PB6 | · · | PB5 (BEEPER) + * 5V | 1 2 | GND + * (LCD_EN) PB7 | 3 4 | PB8 (LCD_RS) + * (LCD_D4) PB9 | 5 6 PA10 (BTN_EN2) + * RESET | 7 8 | PA9 (BTN_EN1) + * (BTN_ENC) PB6 | 9 10| PB5 (BEEPER) * ----- * EXP1 */ -#define EXP1_1_PIN PB5 -#define EXP1_2_PIN PA9 -#define EXP1_3_PIN PA10 -#define EXP1_4_PIN PB8 -#define EXP1_6_PIN PB6 -#define EXP1_7_PIN -1 -#define EXP1_8_PIN PB9 -#define EXP1_9_PIN PB7 +#define EXPA1_03_PIN PB7 +#define EXPA1_04_PIN PB8 +#define EXPA1_05_PIN PB9 +#define EXPA1_06_PIN PA10 +#define EXPA1_07_PIN -1 +#define EXPA1_08_PIN PA9 +#define EXPA1_09_PIN PB6 +#define EXPA1_10_PIN PB5 #if HAS_SPI_LCD #if ENABLED(CR10_STOCKDISPLAY) - #define BEEPER_PIN EXP1_1_PIN + #define BEEPER_PIN EXPA1_10_PIN - #define BTN_EN1 EXP1_2_PIN - #define BTN_EN2 EXP1_3_PIN - #define BTN_ENC EXP1_6_PIN + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN + #define BTN_ENC EXPA1_09_PIN - #define LCD_PINS_RS EXP1_4_PIN - #define LCD_PINS_ENABLE EXP1_9_PIN - #define LCD_PINS_D4 EXP1_8_PIN + #define LCD_PINS_RS EXPA1_04_PIN + #define LCD_PINS_ENABLE EXPA1_03_PIN + #define LCD_PINS_D4 EXPA1_05_PIN #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3.h' for details. Comment out this line to continue." - #define LCD_PINS_RS EXP1_8_PIN - #define LCD_PINS_ENABLE EXP1_6_PIN - #define LCD_PINS_D4 EXP1_4_PIN - #define LCD_PINS_D5 EXP1_3_PIN - #define LCD_PINS_D6 EXP1_2_PIN - #define LCD_PINS_D7 EXP1_1_PIN + #define LCD_PINS_RS EXPA1_05_PIN + #define LCD_PINS_ENABLE EXPA1_09_PIN + #define LCD_PINS_D4 EXPA1_04_PIN + #define LCD_PINS_D5 EXPA1_06_PIN + #define LCD_PINS_D6 EXPA1_08_PIN + #define LCD_PINS_D7 EXPA1_10_PIN #define ADC_KEYPAD_PIN PA1 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD! #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) /** Creality Ender-2 display pinout * _____ - * 5V | · · | GND - * (MOSI) PB7 | · · | PB8 (LCD_RS) - * (LCD_A0) PB9 | · · | PA10 (BTN_EN2) - * RESET | · · | PA9 (BTN_EN1) - * (BTN_ENC) PB6 | · · | PB5 (SCK) + * 5V | 1 2 | GND + * (MOSI) PB7 | 3 4 | PB8 (LCD_RS) + * (LCD_A0) PB9 | 5 6 PA10 (BTN_EN2) + * RESET | 7 8 | PA9 (BTN_EN1) + * (BTN_ENC) PB6 | 9 10| PB5 (SCK) * ----- * EXP1 */ - #define BTN_EN1 EXP1_2_PIN - #define BTN_EN2 EXP1_3_PIN - #define BTN_ENC EXP1_6_PIN + #define BTN_EN1 EXPA1_08_PIN + #define BTN_EN2 EXPA1_06_PIN + #define BTN_ENC EXPA1_09_PIN - #define DOGLCD_CS EXP1_4_PIN - #define DOGLCD_A0 EXP1_8_PIN - #define DOGLCD_SCK EXP1_1_PIN - #define DOGLCD_MOSI EXP1_9_PIN + #define DOGLCD_CS EXPA1_04_PIN + #define DOGLCD_A0 EXPA1_05_PIN + #define DOGLCD_SCK EXPA1_10_PIN + #define DOGLCD_MOSI EXPA1_03_PIN #define FORCE_SOFT_SPI #define LCD_BACKLIGHT_PIN -1 diff --git a/Marlin/src/pins/stm32/pins_BTT_SKR_PRO_V1_1.h b/Marlin/src/pins/stm32/pins_BTT_SKR_PRO_V1_1.h index b523874cb..8222bbe14 100644 --- a/Marlin/src/pins/stm32/pins_BTT_SKR_PRO_V1_1.h +++ b/Marlin/src/pins/stm32/pins_BTT_SKR_PRO_V1_1.h @@ -182,6 +182,10 @@ // Misc. Functions // +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION LCD +#endif + // // Onboard SD card // NOT compatible with LCD diff --git a/Marlin/src/pins/stm32/pins_STEVAL_3DP001V1.h b/Marlin/src/pins/stm32/pins_STEVAL_3DP001V1.h index e65367971..2b6e6f6c3 100644 --- a/Marlin/src/pins/stm32/pins_STEVAL_3DP001V1.h +++ b/Marlin/src/pins/stm32/pins_STEVAL_3DP001V1.h @@ -236,7 +236,11 @@ #define SDIO_CK_PIN 28 // PC12 SDIO_CK #define SDIO_CMD_PIN 29 // PD2 SDIO_CMD -#if !defined(SDCARD_CONNECTION) || SDCARD_CONNECTION == ONBOARD +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#if SDCARD_CONNECTION == ONBOARD #define SDIO_SUPPORT // Use SDIO for onboard SD #ifndef SDIO_SUPPORT diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 3cc888fd9..b2b0d90e9 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -28,7 +28,7 @@ #include "../MarlinCore.h" #include "../lcd/ultralcd.h" -#include "../module/planner.h" +#include "../module/planner.h" // for synchronize #include "../module/printcounter.h" #include "../core/language.h" #include "../gcode/queue.h" @@ -49,6 +49,7 @@ // public: card_flags_t CardReader::flag; +uint8_t CardReader::sdprinting_done_state; char CardReader::filename[FILENAME_LENGTH], CardReader::longFilename[LONG_FILENAME_LENGTH]; int8_t CardReader::autostart_index; @@ -247,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 @@ -317,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; } @@ -361,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 @@ -379,7 +380,7 @@ void CardReader::mount() { } void CardReader::release() { - stopSDPrint(); + endFilePrint(); flag.mounted = false; } @@ -401,7 +402,7 @@ void CardReader::startFileprint() { } } -void CardReader::stopSDPrint( +void CardReader::endFilePrint( #if SD_RESORT const bool re_sort/*=false*/ #endif @@ -445,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) { @@ -501,7 +502,7 @@ void CardReader::openFileRead(char * const path, const uint8_t subcall_type/*=0* break; } - stopSDPrint(); + endFilePrint(); SdFile *curDir; const char * const fname = diveToFile(true, curDir, path); @@ -510,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); @@ -520,6 +521,10 @@ void CardReader::openFileRead(char * const path, const uint8_t subcall_type/*=0* openFailed(fname); } +inline void echo_write_to_file(const char * const fname) { + SERIAL_ECHOLNPAIR(STR_SD_WRITE_TO_FILE, fname); +} + // // Open a file by DOS path for write // @@ -529,7 +534,7 @@ void CardReader::openFileWrite(char * const path) { announceOpen(2, path); file_subcall_ctr = 0; - stopSDPrint(); + endFilePrint(); SdFile *curDir; const char * const fname = diveToFile(false, curDir, path); @@ -541,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 @@ -554,7 +559,7 @@ void CardReader::openFileWrite(char * const path) { void CardReader::removeFile(const char * const name) { if (!isMounted()) return; - //stopSDPrint(); + //endFilePrint(); SdFile *curDir; const char * const fname = diveToFile(false, curDir, name); @@ -573,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) { @@ -597,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); } // @@ -738,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; } @@ -778,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); } } @@ -937,7 +942,7 @@ void CardReader::cdroot() { bool didSwap = false; uint8_t o1 = sort_order[0]; #if DISABLED(SDSORT_USES_RAM) - selectFileByIndex(o1); // Pre-fetch the first entry and save it + selectFileByIndex(o1); // Pre-fetch the first entry and save it strcpy(name1, longest_filename()); // so the loop only needs one fetch #if HAS_FOLDER_SORTING bool dir1 = flag.filenameIsDir; @@ -1073,30 +1078,13 @@ void CardReader::fileHasFinished() { startFileprint(); } else { - stopSDPrint(); - - #if ENABLED(POWER_LOSS_RECOVERY) - recovery.purge(); - #endif - - #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND) - planner.finish_and_disable(); - #endif - - print_job_timer.stop(); - queue.enqueue_now_P(print_job_timer.duration() > 60 ? PSTR("M31") : PSTR("M117")); + endFilePrint(); #if ENABLED(SDCARD_SORT_ALPHA) presort(); #endif - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - ui.set_progress_done(); - #endif - - #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - ui.reselect_last_file(); - #endif + sdprinting_done_state = 1; } } @@ -1129,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 diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 8e09f4447..be700401e 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -49,6 +49,7 @@ typedef struct { class CardReader { public: + static uint8_t sdprinting_done_state; static card_flags_t flag; // Flags (above) static char filename[FILENAME_LENGTH], // DOS 8.3 filename of the selected item longFilename[LONG_FILENAME_LENGTH]; // Long name of the selected item @@ -108,9 +109,9 @@ public: static void openAndPrintFile(const char *name); // (working directory) static void fileHasFinished(); static void getAbsFilename(char *dst); - static void startFileprint(); static void printFilename(); - static void stopSDPrint( + static void startFileprint(); + static void endFilePrint( #if SD_RESORT const bool re_sort=false #endif diff --git a/platformio.ini b/platformio.ini index 9d4e70d26..c67f5c2b8 100644 --- a/platformio.ini +++ b/platformio.ini @@ -687,12 +687,6 @@ extra_scripts = pre:buildroot/share/PlatformIO/scripts/generic_create_varian build_flags = ${common.build_flags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSB_PRODUCT=\"STM32F407IG\" -DTARGET_STM32F4 -DSTM32F407IX -DVECT_TAB_OFFSET=0x8000 - -DHAVE_HWSERIAL3 - -DHAVE_HWSERIAL6 - -DPIN_SERIAL3_RX=PD_9 - -DPIN_SERIAL3_TX=PD_8 - -DPIN_SERIAL6_RX=PC_7 - -DPIN_SERIAL6_TX=PC_6 -IMarlin/src/HAL/HAL_STM32 lib_deps =