From 3d0b11a373746f8a08dc6d84d38e7c747990f143 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 12 Jan 2023 01:39:45 +0000 Subject: [PATCH 01/54] [cron] Bump distribution date (2023-01-12) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 91037353e8781..1b9d7c43c657d 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-11" +//#define STRING_DISTRIBUTION_DATE "2023-01-12" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index d3c0f4f717e48..817fcdc80bdec 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 "2023-01-11" + #define STRING_DISTRIBUTION_DATE "2023-01-12" #endif /** From 80dc7b290b38f042eb994b8c306b18c602f410aa Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 11 Jan 2023 20:31:46 -0600 Subject: [PATCH 02/54] =?UTF-8?q?=F0=9F=94=A7=20Input=20Shaping=20sanity?= =?UTF-8?q?=20checks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 60 +++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 485eb9011d2c0..0275c539b5086 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -4369,34 +4369,52 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #error "BINARY_FILE_TRANSFER and CUSTOM_FIRMWARE_UPLOAD are required for custom upload." #endif -// Check requirements for Input Shaping -#if HAS_SHAPING && defined(__AVR__) - #ifdef SHAPING_MIN_FREQ - static_assert((SHAPING_MIN_FREQ) > 0, "SHAPING_MIN_FREQ must be > 0."); - #else - TERN_(INPUT_SHAPING_X, static_assert((SHAPING_FREQ_X) > 0, "SHAPING_FREQ_X must be > 0 or SHAPING_MIN_FREQ must be set.")); - TERN_(INPUT_SHAPING_Y, static_assert((SHAPING_FREQ_Y) > 0, "SHAPING_FREQ_Y must be > 0 or SHAPING_MIN_FREQ must be set.")); +/** + * Input Shaping requirements + */ +#if HAS_SHAPING + #if ENABLED(DELTA) + #error "Input Shaping is not compatible with DELTA kinematics." + #elif ENABLED(SCARA) + #error "Input Shaping is not compatible with SCARA kinematics." + #elif ENABLED(TPARA) + #error "Input Shaping is not compatible with TPARA kinematics." + #elif ENABLED(POLAR) + #error "Input Shaping is not compatible with POLAR kinematics." + #elif ENABLED(POLARGRAPH) + #error "Input Shaping is not compatible with POLARGRAPH kinematics." + #elif ENABLED(DIRECT_STEPPING) + #error "Input Shaping is not compatible with DIRECT_STEPPING." + #elif ENABLED(INPUT_SHAPING_X) && ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_YX) + #error "INPUT_SHAPING_X is not supported with COREXY, COREYX, COREXZ, COREZX, or MARKFORGED_*." + #elif ENABLED(INPUT_SHAPING_Y) && ANY(CORE_IS_XY, CORE_IS_YZ, MARKFORGED_XY, MARKFORGED_YX) + #error "INPUT_SHAPING_Y is not supported with COREXY, COREYX, COREYZ, COREZY, or MARKFORGED_*." #endif - #if ENABLED(INPUT_SHAPING_X) - #if F_CPU > 16000000 - static_assert((SHAPING_FREQ_X) == 0 || (SHAPING_FREQ_X) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_X is below the minimum (20) for AVR 20MHz."); + + #ifdef __AVR__ + #ifdef SHAPING_MIN_FREQ + static_assert((SHAPING_MIN_FREQ) > 0, "SHAPING_MIN_FREQ must be > 0."); #else - static_assert((SHAPING_FREQ_X) == 0 || (SHAPING_FREQ_X) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_X is below the minimum (16) for AVR 16MHz."); + TERN_(INPUT_SHAPING_X, static_assert((SHAPING_FREQ_X) > 0, "SHAPING_FREQ_X must be > 0 or SHAPING_MIN_FREQ must be set.")); + TERN_(INPUT_SHAPING_Y, static_assert((SHAPING_FREQ_Y) > 0, "SHAPING_FREQ_Y must be > 0 or SHAPING_MIN_FREQ must be set.")); #endif - #endif - #if ENABLED(INPUT_SHAPING_Y) - #if F_CPU > 16000000 - static_assert((SHAPING_FREQ_Y) == 0 || (SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (20) for AVR 20MHz."); - #else - static_assert((SHAPING_FREQ_Y) == 0 || (SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (16) for AVR 16MHz."); + #if ENABLED(INPUT_SHAPING_X) + #if F_CPU > 16000000 + static_assert((SHAPING_FREQ_X) == 0 || (SHAPING_FREQ_X) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_X is below the minimum (20) for AVR 20MHz."); + #else + static_assert((SHAPING_FREQ_X) == 0 || (SHAPING_FREQ_X) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_X is below the minimum (16) for AVR 16MHz."); + #endif + #endif + #if ENABLED(INPUT_SHAPING_Y) + #if F_CPU > 16000000 + static_assert((SHAPING_FREQ_Y) == 0 || (SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (20) for AVR 20MHz."); + #else + static_assert((SHAPING_FREQ_Y) == 0 || (SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (16) for AVR 16MHz."); + #endif #endif #endif #endif -#if BOTH(HAS_SHAPING, DIRECT_STEPPING) - #error "INPUT_SHAPING_[XY] cannot currently be used with DIRECT_STEPPING." -#endif - // Misc. Cleanup #undef _TEST_PWM #undef _NUM_AXES_STR From 7503ac3c67b1521f8d2c822f51b46c97a884a21e Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 13 Jan 2023 00:22:51 +0000 Subject: [PATCH 03/54] [cron] Bump distribution date (2023-01-13) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 1b9d7c43c657d..8e8d09fdf619e 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-12" +//#define STRING_DISTRIBUTION_DATE "2023-01-13" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 817fcdc80bdec..b97be81521ca1 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 "2023-01-12" + #define STRING_DISTRIBUTION_DATE "2023-01-13" #endif /** From 5fd5cb02f6b26f32fd9b49fb37e53a93531da98c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 14 Jan 2023 07:44:57 -0600 Subject: [PATCH 04/54] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20=20ProUI=20followup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/proui/dwin.cpp | 16 ++++++++-------- Marlin/src/lcd/e3v2/proui/menus.cpp | 2 +- Marlin/src/lcd/e3v2/proui/menus.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 098db27b1b87e..ffb216f05fc34 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -874,7 +874,7 @@ void update_variable() { bool DWIN_lcd_sd_status = false; void SetMediaAutoMount() { - Toogle_Chkb_Line(HMI_data.MediaAutoMount); + Toggle_Chkb_Line(HMI_data.MediaAutoMount); } inline uint16_t nr_sd_menu_items() { @@ -2036,7 +2036,7 @@ void SetLanguage() { } bool EnableLiveMove = false; -void SetLiveMove() { Toogle_Chkb_Line(EnableLiveMove); } +void SetLiveMove() { Toggle_Chkb_Line(EnableLiveMove); } void LiveMove() { planner.synchronize(); if (!EnableLiveMove) return; @@ -2082,7 +2082,7 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS #if ENABLED(POWER_LOSS_RECOVERY) void SetPwrLossr() { - Toogle_Chkb_Line(recovery.enabled); + Toggle_Chkb_Line(recovery.enabled); recovery.changed(); } #endif @@ -2108,7 +2108,7 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS #if ENABLED(CASE_LIGHT_MENU) void SetCaseLight() { - Toogle_Chkb_Line(caselight.on); + Toggle_Chkb_Line(caselight.on); caselight.update_enabled(); } #if ENABLED(CASELIGHT_USES_BRIGHTNESS) @@ -2144,7 +2144,7 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS #if ENABLED(SOUND_MENU_ITEM) void SetEnableSound() { - Toogle_Chkb_Line(ui.sound_on); + Toggle_Chkb_Line(ui.sound_on); } #endif @@ -2168,7 +2168,7 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS #if ENABLED(BLTOUCH_HS_MODE) void SetHSMode() { - Toogle_Chkb_Line(bltouch.high_speed_mode); + Toggle_Chkb_Line(bltouch.high_speed_mode); } #endif @@ -2177,7 +2177,7 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS #if HAS_FILAMENT_SENSOR void SetRunoutEnable() { runout.reset(); - Toogle_Chkb_Line(runout.enabled); + Toggle_Chkb_Line(runout.enabled); } #if HAS_FILAMENT_RUNOUT_DISTANCE void ApplyRunoutDistance() { runout.set_runout_distance(MenuData.Value / MINUNITMULT); } @@ -2439,7 +2439,7 @@ void TramC () { Tram(4); } } void SetManualTramming() { - Toogle_Chkb_Line(HMI_data.FullManualTramming); + Toggle_Chkb_Line(HMI_data.FullManualTramming); } #endif // HAS_BED_PROBE && HAS_MESH diff --git a/Marlin/src/lcd/e3v2/proui/menus.cpp b/Marlin/src/lcd/e3v2/proui/menus.cpp index 3267eec60d33d..540f9e1f417b2 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.cpp +++ b/Marlin/src/lcd/e3v2/proui/menus.cpp @@ -115,7 +115,7 @@ void Show_Chkb_Line(const bool checked) { DWIN_UpdateLCD(); } -void Toogle_Chkb_Line(bool &checked) { +void Toggle_Chkb_Line(bool &checked) { checked = !checked; Show_Chkb_Line(checked); } diff --git a/Marlin/src/lcd/e3v2/proui/menus.h b/Marlin/src/lcd/e3v2/proui/menus.h index 9bc9d702bd300..33712f8959ef3 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.h +++ b/Marlin/src/lcd/e3v2/proui/menus.h @@ -145,7 +145,7 @@ void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, const char * const void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, FSTR_P label=nullptr, bool more=false, bool selected=false); void Draw_Chkb_Line(const uint8_t line, const bool checked); void Show_Chkb_Line(const bool checked); -void Toogle_Chkb_Line(bool &checked); +void Toggle_Chkb_Line(bool &checked); void Draw_Menu_IntValue(uint16_t bcolor, const uint8_t line, uint8_t iNum, const int32_t value=0); void onDrawMenuItem(MenuItemClass* menuitem, int8_t line); void onDrawSubMenu(MenuItemClass* menuitem, int8_t line); From 80a25550128b05a7761e4a3bd365b853891b48d4 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 14 Jan 2023 18:05:38 +0000 Subject: [PATCH 05/54] [cron] Bump distribution date (2023-01-14) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 8e8d09fdf619e..c3f5c624bc9ae 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-13" +//#define STRING_DISTRIBUTION_DATE "2023-01-14" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index b97be81521ca1..ea2509a83d25f 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 "2023-01-13" + #define STRING_DISTRIBUTION_DATE "2023-01-14" #endif /** From 5acf73868876da8baf823e7b95f49265935c249b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 15 Jan 2023 01:11:49 -0600 Subject: [PATCH 06/54] =?UTF-8?q?=F0=9F=94=A7=20Added=20MOTHERBOARD=20erro?= =?UTF-8?q?r=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 0275c539b5086..fbae1f5d8849e 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -88,7 +88,7 @@ * Warnings for old configurations */ #ifndef MOTHERBOARD - #error "MOTHERBOARD is required." + #error "MOTHERBOARD is required. You must '#define MOTHERBOARD BOARD_MYNAME' (not just '#define BOARD_MYNAME')." #elif !defined(X_BED_SIZE) || !defined(Y_BED_SIZE) #error "X_BED_SIZE and Y_BED_SIZE are now required!" #elif WATCH_TEMP_PERIOD > 500 From da87c203c1e70bf719b90f7bfdce6027861bef90 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 15 Jan 2023 01:19:45 -0600 Subject: [PATCH 07/54] =?UTF-8?q?=F0=9F=94=96=20=20Config=20version=200201?= =?UTF-8?q?0300?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 2 +- Marlin/Configuration_adv.h | 2 +- Marlin/src/inc/Version.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ec3ee87b9cd9d..32df08f853ecd 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -35,7 +35,7 @@ * * Advanced settings can be found in Configuration_adv.h */ -#define CONFIGURATION_H_VERSION 02010200 +#define CONFIGURATION_H_VERSION 02010300 //=========================================================================== //============================= Getting Started ============================= diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index bf4b439d85316..4735e34ededb1 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -30,7 +30,7 @@ * * Basic settings can be found in Configuration.h */ -#define CONFIGURATION_ADV_H_VERSION 02010200 +#define CONFIGURATION_ADV_H_VERSION 02010300 // @section develop diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index ea2509a83d25f..d33ad50877464 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -52,7 +52,7 @@ * to alert users to major changes. */ -#define MARLIN_HEX_VERSION 02010200 +#define MARLIN_HEX_VERSION 02010300 #ifndef REQUIRED_CONFIGURATION_H_VERSION #define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION #endif From d753781dc0c4853e8aac1cd997a5f105fbb8fa3a Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 15 Jan 2023 12:06:24 +0000 Subject: [PATCH 08/54] [cron] Bump distribution date (2023-01-15) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index c3f5c624bc9ae..b3dce84c47761 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-14" +//#define STRING_DISTRIBUTION_DATE "2023-01-15" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index d33ad50877464..52dd76d83412d 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 "2023-01-14" + #define STRING_DISTRIBUTION_DATE "2023-01-15" #endif /** From 212167b140f7a1b6f24ff69cf367860b78812c05 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sun, 15 Jan 2023 05:25:36 -0800 Subject: [PATCH 09/54] =?UTF-8?q?=F0=9F=93=9D=20No=20longer=20experimental?= =?UTF-8?q?=20(#25238)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 5 ++--- Marlin/Configuration_adv.h | 5 ++--- Marlin/src/inc/SanityCheck.h | 16 +++++----------- Marlin/src/inc/Warnings.cpp | 7 +++++++ buildroot/tests/SAMD21_minitronics20 | 2 +- buildroot/tests/SAMD51_grandcentral_m4 | 2 +- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 32df08f853ecd..f639b68787a8e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2019,7 +2019,7 @@ //#define EXTRAPOLATE_BEYOND_GRID // - // Experimental Subdivision of the grid by Catmull-Rom method. + // Subdivision of the grid by Catmull-Rom method. // Synthesizes intermediate points to produce a more detailed mesh. // //#define ABL_BILINEAR_SUBDIVISION @@ -2304,7 +2304,7 @@ #endif /** - * Clean Nozzle Feature -- EXPERIMENTAL + * Clean Nozzle Feature * * Adds the G12 command to perform a nozzle cleaning process. * @@ -2338,7 +2338,6 @@ * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. * * Caveats: The ending Z should be the same as starting Z. - * Attention: EXPERIMENTAL. G-code arguments may change. */ //#define NOZZLE_CLEAN_FEATURE diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 4735e34ededb1..ee53109142804 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -375,7 +375,7 @@ #endif #if ENABLED(PIDTEMP) - // Add an experimental additional term to the heater power, proportional to the extrusion speed. + // Add an additional term to the heater power, proportional to the extrusion speed. // A well-chosen Kc value should add just enough power to melt the increased material volume. //#define PID_EXTRUSION_SCALING #if ENABLED(PID_EXTRUSION_SCALING) @@ -384,7 +384,7 @@ #endif /** - * Add an experimental additional term to the heater power, proportional to the fan speed. + * Add an additional term to the heater power, proportional to the fan speed. * A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan. * You can either just add a constant compensation with the DEFAULT_Kf value * or follow the instruction below to get speed-dependent compensation. @@ -2121,7 +2121,6 @@ #endif //#define ADVANCE_K_EXTRA // Add a second linear advance constant, configurable with M900 L. //#define LA_DEBUG // Print debug information to serial during operation. Disable for production use. - //#define EXPERIMENTAL_SCURVE // Allow S-Curve Acceleration to be used with LA. //#define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends. //#define EXPERIMENTAL_I2S_LA // Allow I2S_STEPPER_STREAM to be used with LA. Performance degrades as the LA step rate reaches ~20kHz. #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index fbae1f5d8849e..b17bf2b7196f2 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -666,6 +666,8 @@ #error "SCARA_FEEDRATE_SCALING is now FEEDRATE_SCALING." #elif defined(MILLISECONDS_PREHEAT_TIME) #error "MILLISECONDS_PREHEAT_TIME is now PREHEAT_TIME_HOTEND_MS." +#elif defined(EXPERIMENTAL_SCURVE) + #error "EXPERIMENTAL_SCURVE is no longer needed and should be removed." #endif // L64xx stepper drivers have been removed @@ -1370,22 +1372,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #else static_assert(WITHIN(ADVANCE_K, 0, 10), "ADVANCE_K must be from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9)."); #endif - #if ENABLED(S_CURVE_ACCELERATION) && DISABLED(EXPERIMENTAL_SCURVE) - #error "LIN_ADVANCE and S_CURVE_ACCELERATION may not play well together! Enable EXPERIMENTAL_SCURVE to continue." - #elif ENABLED(DIRECT_STEPPING) - #error "DIRECT_STEPPING is incompatible with LIN_ADVANCE. Enable in external planner if possible." + + #if ENABLED(DIRECT_STEPPING) + #error "DIRECT_STEPPING is incompatible with LIN_ADVANCE. (Extrusion is controlled externally by the Step Daemon.)" #elif NONE(HAS_JUNCTION_DEVIATION, ALLOW_LOW_EJERK) && defined(DEFAULT_EJERK) static_assert(DEFAULT_EJERK >= 10, "It is strongly recommended to set DEFAULT_EJERK >= 10 when using LIN_ADVANCE. Enable ALLOW_LOW_EJERK to bypass this alert (e.g., for direct drive)."); #endif #endif -/** - * POLAR warnings - */ -#if BOTH(POLAR, S_CURVE_ACCELERATION) - #warning "POLAR Kinematics may not work well with S_CURVE_ACCELERATION." -#endif - /** * Special tool-changing options */ diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 24f4d7fbe9f39..561c8f43a34ed 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -783,3 +783,10 @@ #if ENABLED(BD_SENSOR) && DISABLED(BABYSTEPPING) #warning "BABYSTEPPING is recommended with BD_SENSOR." #endif + +/** + * POLAR warnings + */ +#if BOTH(POLAR, S_CURVE_ACCELERATION) + #warning "POLAR kinematics may not work well with S_CURVE_ACCELERATION." +#endif diff --git a/buildroot/tests/SAMD21_minitronics20 b/buildroot/tests/SAMD21_minitronics20 index 018d6a70fe00f..420495bb76598 100755 --- a/buildroot/tests/SAMD21_minitronics20 +++ b/buildroot/tests/SAMD21_minitronics20 @@ -26,7 +26,7 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE BLTOUCH Z_MIN_PROBE_REPEATABILITY_TEST \ SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \ MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS SENSORLESS_HOMING \ - SQUARE_WAVE_STEPPING EXPERIMENTAL_SCURVE + SQUARE_WAVE_STEPPING exec_test $1 $2 "Minitronics 2.0 with assorted features" "$3" # clean up diff --git a/buildroot/tests/SAMD51_grandcentral_m4 b/buildroot/tests/SAMD51_grandcentral_m4 index 3a5ac8e70cc98..ef67e061fe4b9 100755 --- a/buildroot/tests/SAMD51_grandcentral_m4 +++ b/buildroot/tests/SAMD51_grandcentral_m4 @@ -26,7 +26,7 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE S_CURVE_ACCELERATION BLTOUCH Z_MIN_PROBE_R SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \ MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS SENSORLESS_HOMING \ - SQUARE_WAVE_STEPPING TMC_DEBUG EXPERIMENTAL_SCURVE + SQUARE_WAVE_STEPPING TMC_DEBUG exec_test $1 $2 "Grand Central M4 with assorted features" "$3" # clean up From d94defc545ad477c82a8bc77e949aa91cdd3e0f2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 15 Jan 2023 06:48:17 -0600 Subject: [PATCH 10/54] =?UTF-8?q?=F0=9F=8E=A8=20Language=20/=20menu=20clea?= =?UTF-8?q?nup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/proui/dwin.cpp | 132 ++++++++++++--------- Marlin/src/lcd/e3v2/proui/dwin.h | 23 ++-- Marlin/src/lcd/e3v2/proui/dwinui.h | 6 +- Marlin/src/lcd/language/language_an.h | 1 - Marlin/src/lcd/language/language_cz.h | 1 - Marlin/src/lcd/language/language_da.h | 1 - Marlin/src/lcd/language/language_de.h | 1 - Marlin/src/lcd/language/language_en.h | 7 +- Marlin/src/lcd/language/language_es.h | 1 - Marlin/src/lcd/language/language_eu.h | 1 - Marlin/src/lcd/language/language_fr.h | 1 - Marlin/src/lcd/language/language_gl.h | 1 - Marlin/src/lcd/language/language_hr.h | 1 - Marlin/src/lcd/language/language_hu.h | 1 - Marlin/src/lcd/language/language_it.h | 1 - Marlin/src/lcd/language/language_jp_kana.h | 1 - Marlin/src/lcd/language/language_nl.h | 1 - Marlin/src/lcd/language/language_pl.h | 1 - Marlin/src/lcd/language/language_pt_br.h | 1 - Marlin/src/lcd/language/language_ro.h | 1 - Marlin/src/lcd/language/language_ru.h | 1 - Marlin/src/lcd/language/language_sk.h | 1 - Marlin/src/lcd/language/language_sv.h | 1 - Marlin/src/lcd/language/language_tr.h | 1 - Marlin/src/lcd/language/language_uk.h | 1 - Marlin/src/lcd/language/language_vi.h | 1 - Marlin/src/lcd/language/language_zh_CN.h | 1 - Marlin/src/lcd/language/language_zh_TW.h | 1 - Marlin/src/lcd/menu/menu_motion.cpp | 18 +-- Marlin/src/module/probe.h | 2 +- 30 files changed, 102 insertions(+), 110 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index ffb216f05fc34..621b3d0dd3938 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -550,10 +550,10 @@ void DWIN_DrawStatusMessage() { // If the string fits the status line do not scroll it if (slen <= LCD_WIDTH) { - if (hash_changed) { - DWIN_DrawStatusLine(ui.status_message); - hash_changed = false; - } + if (hash_changed) { + DWIN_DrawStatusLine(ui.status_message); + hash_changed = false; + } } else { // String is larger than the available line space @@ -676,14 +676,18 @@ void Draw_PrintDone() { Title.ShowCaption(GET_TEXT_F(MSG_PRINT_DONE)); DWINUI::ClearMainArea(); DWIN_Print_Header(nullptr); + #if HAS_GCODE_PREVIEW - if (Preview_Valid()) { + const bool isvalid = Preview_Valid(); + if (isvalid) { DWIN_ICON_Show(0, 0, 1, 21, 100, 0x00); DWINUI::Draw_Button(BTN_Continue, 86, 300); } - else + #else + constexpr bool isvalid = false; #endif - { + + if (!isvalid) { Draw_Print_ProgressBar(); Draw_Print_Labels(); DWINUI::Draw_Icon(ICON_PrintTime, 15, 173); @@ -731,11 +735,7 @@ void _update_axis_value(const AxisEnum axis, const uint16_t x, const uint16_t y, // Check for a position change static xyz_pos_t oldpos = { -1, -1, -1 }; - #if ENABLED(SHOW_REAL_POS) - const float p = stepper.position(axis) / planner.settings.axis_steps_per_mm[axis]; - #else - const float p = current_position[axis]; - #endif + const float p = TERN(SHOW_REAL_POS, stepper.position(axis) / planner.settings.axis_steps_per_mm[axis], current_position[axis]); const bool changed = oldpos[axis] != p; if (changed) oldpos[axis] = p; @@ -811,15 +811,9 @@ void update_variable() { if (IsMenu(TuneMenu) || IsMenu(TemperatureMenu)) { // Tune page temperature update - #if HAS_HOTEND - if (_new_hotend_target) HotendTargetItem->redraw(); - #endif - #if HAS_HEATED_BED - if (_new_bed_target) BedTargetItem->redraw(); - #endif - #if HAS_FAN - if (_new_fanspeed) FanSpeedItem->redraw(); - #endif + TERN_(HAS_HOTEND, if (_new_hotend_target) HotendTargetItem->redraw()); + TERN_(HAS_HEATED_BED, if (_new_bed_target) BedTargetItem->redraw()); + TERN_(HAS_FAN, if (_new_fanspeed) FanSpeedItem->redraw()); } // Bottom temperature update @@ -956,8 +950,7 @@ void onClickSDItem() { void FileMenuIdle(bool reset=false) { static bool hasUpDir = false; static uint8_t last_itemselected = 0; - static int8_t shift_amt = 0; - static int8_t shift_len = 0; + static int8_t shift_amt = 0, shift_len = 0; if (reset) { last_itemselected = 0; hasUpDir = !card.flag.workDirIsRoot; // is a SubDir @@ -1715,7 +1708,6 @@ void DWIN_CopySettingsFrom(const char * const buff) { ); leds.update(); #endif - } // Initialize or re-initialize the LCD @@ -1839,6 +1831,7 @@ void DWIN_RedrawScreen() { #endif // ADVANCED_PAUSE_FEATURE #if HAS_MESH + void DWIN_MeshViewer() { if (!leveling_is_valid()) DWIN_Popup_Continue(ICON_BLTouch, GET_TEXT_F(MSG_MESH_VIEWER), GET_TEXT_F(MSG_NO_VALID_MESH)); @@ -1847,8 +1840,8 @@ void DWIN_RedrawScreen() { MeshViewer.Draw(); } } -#endif // HAS_MESH +#endif // HAS_MESH #if HAS_LOCKSCREEN @@ -1874,7 +1867,7 @@ void DWIN_RedrawScreen() { if (lockScreen.isUnlocked()) DWIN_UnLockScreen(); } -#endif // HAS_LOCKSCREEN +#endif // HAS_LOCKSCREEN #if HAS_GCODE_PREVIEW @@ -1886,20 +1879,21 @@ void DWIN_RedrawScreen() { Goto_Main_Menu(); return card.openAndPrintFile(card.filename); } - else HMI_ReturnScreen(); + else + HMI_ReturnScreen(); } - void Goto_ConfirmToPrint() { - Goto_Popup(Preview_DrawFromSD, onClick_ConfirmToPrint); - } +#endif -#else - void Goto_ConfirmToPrint() { +void Goto_ConfirmToPrint() { + #if HAS_GCODE_PREVIEW + Goto_Popup(Preview_DrawFromSD, onClick_ConfirmToPrint); + #else // Print SD file HMI_flag.heat_flag = true; card.openAndPrintFile(card.filename); - } -#endif + #endif +} #if HAS_ESDIAG void Draw_EndStopDiag() { @@ -1915,6 +1909,7 @@ void DWIN_RedrawScreen() { // Tool functions #if ENABLED(EEPROM_SETTINGS) + void WriteEeprom() { DWIN_DrawStatusLine(GET_TEXT_F(MSG_STORE_EEPROM)); DWIN_UpdateLCD(); @@ -1934,8 +1929,9 @@ void DWIN_RedrawScreen() { } #if HAS_MESH - void SaveMesh() { TERN(AUTO_BED_LEVELING_UBL, UBLSaveMesh(), WriteEeprom()); } + void SaveMesh() { TERN(AUTO_BED_LEVELING_UBL, UBLMeshSave(), WriteEeprom()); } #endif + #endif // Reset Printer @@ -2404,9 +2400,9 @@ void TramC () { Tram(4); } MeshViewer.DrawMesh(zval, 2, 2); ui.reset_status(); - if (ABS(MeshViewer.max - MeshViewer.min) < 0.05) { - DWINUI::Draw_CenteredString(140,F("Corners leveled")); - DWINUI::Draw_CenteredString(160,F("Tolerance achieved!")); + if (ABS(MeshViewer.max - MeshViewer.min) < 0.05f) { + DWINUI::Draw_CenteredString(140, F("Corners leveled")); + DWINUI::Draw_CenteredString(160, F("Tolerance achieved!")); } else { uint8_t p = 0; @@ -2698,7 +2694,6 @@ void onDrawGetColorItem(MenuItemClass* menuitem, int8_t line) { DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(line + 1), 240); } - #if EITHER(PIDTEMP, PIDTEMPBED) void onDrawPIDi(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_i(*(float*)static_cast(menuitem)->value)); } void onDrawPIDd(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_d(*(float*)static_cast(menuitem)->value)); } @@ -2891,6 +2886,7 @@ void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { } #if HAS_HOTEND + void onDrawMaxJerkE(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 173, 133, 200, 147); @@ -2900,6 +2896,7 @@ void onDrawMaxAccelZ(MenuItemClass* menuitem, int8_t line) { } onDrawPFloatMenu(menuitem, line); } + #endif #endif // HAS_CLASSIC_JERK @@ -2929,6 +2926,7 @@ void onDrawStepsZ(MenuItemClass* menuitem, int8_t line) { } #if HAS_HOTEND + void onDrawStepsE(MenuItemClass* menuitem, int8_t line) { if (HMI_IsChinese()) { menuitem->SetFrame(1, 153, 148, 194, 161); @@ -2936,6 +2934,7 @@ void onDrawStepsZ(MenuItemClass* menuitem, int8_t line) { } onDrawPFloatMenu(menuitem, line); } + #endif #if HAS_ONESTEP_LEVELING @@ -3106,6 +3105,7 @@ void Draw_Move_Menu() { } #if HAS_HOME_OFFSET + void Draw_HomeOffset_Menu() { checkkey = Menu; if (SET_MENU(HomeOffMenu, MSG_SET_HOME_OFFSETS, 4)) { @@ -3116,9 +3116,11 @@ void Draw_Move_Menu() { } UpdateMenu(HomeOffMenu); } + #endif #if HAS_BED_PROBE + void Draw_ProbeSet_Menu() { checkkey = Menu; if (SET_MENU(ProbeSetMenu, MSG_ZPROBE_SETTINGS, 9)) { @@ -3138,6 +3140,7 @@ void Draw_Move_Menu() { } UpdateMenu(ProbeSetMenu); } + #endif void Draw_FilSet_Menu() { @@ -3205,6 +3208,7 @@ void Draw_GetColor_Menu() { } #if BOTH(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS) + void Draw_CaseLight_Menu() { checkkey = Menu; if (SET_MENU(CaseLightMenu, MSG_CASE_LIGHT, 3)) { @@ -3214,9 +3218,11 @@ void Draw_GetColor_Menu() { } UpdateMenu(CaseLightMenu); } + #endif #if ENABLED(LED_CONTROL_MENU) + void Draw_LedControl_Menu() { checkkey = Menu; if (SET_MENU(LedControlMenu, MSG_LED_CONTROL, 10)) { @@ -3246,7 +3252,8 @@ void Draw_GetColor_Menu() { } UpdateMenu(LedControlMenu); } -#endif + +#endif // LED_CONTROL_MENU void Draw_Tune_Menu() { checkkey = Menu; @@ -3309,6 +3316,7 @@ void Draw_Motion_Menu() { } #if ENABLED(ADVANCED_PAUSE_FEATURE) + void Draw_FilamentMan_Menu() { checkkey = Menu; if (SET_MENU(FilamentMenu, MSG_FILAMENT_MAN, 5)) { @@ -3324,9 +3332,11 @@ void Draw_Motion_Menu() { } UpdateMenu(FilamentMenu); } + #endif #if ENABLED(MESH_BED_LEVELING) + void Draw_ManualMesh_Menu() { checkkey = Menu; if (SET_MENU(ManualMesh, MSG_UBL_MANUAL_MESH, 6)) { @@ -3339,7 +3349,8 @@ void Draw_Motion_Menu() { } UpdateMenu(ManualMesh); } -#endif + +#endif // MESH_BED_LEVELING #if HAS_PREHEAT @@ -3422,6 +3433,7 @@ void Draw_MaxAccel_Menu() { } #if HAS_CLASSIC_JERK + void Draw_MaxJerk_Menu() { checkkey = Menu; if (SET_MENU_R(MaxJerkMenu, selrect({1, 16, 28, 13}), MSG_JERK, 5)) { @@ -3435,7 +3447,8 @@ void Draw_MaxAccel_Menu() { } UpdateMenu(MaxJerkMenu); } -#endif + +#endif // HAS_CLASSIC_JERK void Draw_Steps_Menu() { checkkey = Menu; @@ -3452,6 +3465,7 @@ void Draw_Steps_Menu() { } #if ENABLED(PIDTEMP) + void Draw_HotendPID_Menu() { checkkey = Menu; if (SET_MENU_F(HotendPIDMenu, STR_HOTEND_PID " Settings", 8)) { @@ -3468,9 +3482,11 @@ void Draw_Steps_Menu() { } UpdateMenu(HotendPIDMenu); } + #endif #if ENABLED(PIDTEMPBED) + void Draw_BedPID_Menu() { checkkey = Menu; if (SET_MENU_F(BedPIDMenu, STR_BED_PID " Settings", 8)) { @@ -3487,9 +3503,11 @@ void Draw_Steps_Menu() { } UpdateMenu(BedPIDMenu); } -#endif + +#endif // PIDTEMPBED #if HAS_BED_PROBE + void Draw_ZOffsetWiz_Menu() { checkkey = Menu; if (SET_MENU(ZOffsetWizMenu, MSG_PROBE_WIZARD, 4)) { @@ -3501,9 +3519,11 @@ void Draw_Steps_Menu() { UpdateMenu(ZOffsetWizMenu); if (!axis_is_trusted(Z_AXIS)) LCD_MESSAGE_F("WARNING: Z position unknown, move Z to home"); } + #endif #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) + void Draw_Homing_Menu() { checkkey = Menu; if (SET_MENU(HomingMenu, MSG_HOMING, 6)) { @@ -3518,9 +3538,11 @@ void Draw_Steps_Menu() { } UpdateMenu(HomingMenu); } + #endif #if ENABLED(FWRETRACT) + void Draw_FWRetract_Menu() { checkkey = Menu; if (SET_MENU(FWRetractMenu, MSG_FWRETRACT, 6)) { @@ -3533,6 +3555,7 @@ void Draw_Steps_Menu() { } UpdateMenu(FWRetractMenu); } + #endif //============================================================================= @@ -3565,22 +3588,23 @@ void Draw_Steps_Menu() { void SetEditMeshY() { HMI_value.Select = 1; SetIntOnClick(0, GRID_MAX_POINTS_Y - 1, bedLevelTools.mesh_y, ApplyEditMeshY, LiveEditMesh); } void SetEditZValue() { SetPFloatOnClick(Z_OFFSET_MIN, Z_OFFSET_MAX, 3); } #endif -#endif + +#endif // HAS_MESH #if ENABLED(AUTO_BED_LEVELING_UBL) void ApplyUBLSlot() { bedlevel.storage_slot = MenuData.Value; } void SetUBLSlot() { SetIntOnClick(0, settings.calc_num_meshes() - 1, bedlevel.storage_slot, ApplyUBLSlot); } void onDrawUBLSlot(MenuItemClass* menuitem, int8_t line) { - if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0; + NOLESS(bedlevel.storage_slot, 0); onDrawIntMenu(menuitem, line, bedlevel.storage_slot); } void ApplyUBLTiltGrid() { bedLevelTools.tilt_grid = MenuData.Value; } void SetUBLTiltGrid() { SetIntOnClick(1, 3, bedLevelTools.tilt_grid, ApplyUBLTiltGrid); } - void UBLTiltMesh() { - if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0; + void UBLMeshTilt() { + NOLESS(bedlevel.storage_slot, 0); char buf[15]; if (bedLevelTools.tilt_grid > 1) { sprintf_P(buf, PSTR("G28O\nG29 J%i"), bedLevelTools.tilt_grid); @@ -3596,15 +3620,15 @@ void Draw_Steps_Menu() { LCD_MESSAGE(MSG_UBL_MESH_FILLED); } - void UBLSaveMesh() { - if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0; + void UBLMeshSave() { + NOLESS(bedlevel.storage_slot, 0); settings.store_mesh(bedlevel.storage_slot); ui.status_printf(0, GET_TEXT_F(MSG_MESH_SAVED), bedlevel.storage_slot); DONE_BUZZ(true); } - void UBLLoadMesh() { - if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0; + void UBLMeshLoad() { + NOLESS(bedlevel.storage_slot, 0); settings.load_mesh(bedlevel.storage_slot); } @@ -3626,10 +3650,10 @@ void Draw_Steps_Menu() { #endif #if ENABLED(AUTO_BED_LEVELING_UBL) EDIT_ITEM(ICON_UBLSlot, MSG_UBL_STORAGE_SLOT, onDrawUBLSlot, SetUBLSlot, &bedlevel.storage_slot); - MENU_ITEM(ICON_UBLSaveMesh, MSG_UBL_SAVE_MESH, onDrawMenuItem, UBLSaveMesh); - MENU_ITEM(ICON_UBLLoadMesh, MSG_UBL_LOAD_MESH, onDrawMenuItem, UBLLoadMesh); + MENU_ITEM(ICON_UBLMeshSave, MSG_UBL_SAVE_MESH, onDrawMenuItem, UBLMeshSave); + MENU_ITEM(ICON_UBLMeshLoad, MSG_UBL_LOAD_MESH, onDrawMenuItem, UBLMeshLoad); EDIT_ITEM(ICON_UBLTiltGrid, MSG_UBL_TILTING_GRID, onDrawPInt8Menu, SetUBLTiltGrid, &bedLevelTools.tilt_grid); - MENU_ITEM(ICON_UBLTiltGrid, MSG_UBL_TILT_MESH, onDrawMenuItem, UBLTiltMesh); + MENU_ITEM(ICON_UBLTiltGrid, MSG_UBL_TILT_MESH, onDrawMenuItem, UBLMeshTilt); MENU_ITEM(ICON_UBLSmartFill, MSG_UBL_SMART_FILLIN, onDrawMenuItem, UBLSmartFillMesh); #endif #if ENABLED(MESH_EDIT_MENU) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index 27e1b4ebfacb2..cac64b8ce57d8 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -141,7 +141,9 @@ static constexpr size_t eeprom_data_size = sizeof(HMI_data_t); typedef struct { int8_t Color[3]; // Color components - TERN_(HAS_PID_HEATING, pidresult_t pidresult = PID_DONE); + #if HAS_PID_HEATING + tempcontrol_t pidresult = PID_DONE; + #endif uint8_t Select = 0; // Auxiliary selector variable AxisEnum axis = X_AXIS; // Axis Select } HMI_value_t; @@ -213,10 +215,10 @@ void ParkHead(); void ApplyLEDColor(); #endif #if ENABLED(AUTO_BED_LEVELING_UBL) - void UBLTiltMesh(); + void UBLMeshTilt(); bool UBLValidMesh(); - void UBLSaveMesh(); - void UBLLoadMesh(); + void UBLMeshSave(); + void UBLMeshLoad(); #endif #if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) void HostShutDown(); @@ -356,10 +358,13 @@ void Draw_Steps_Menu(); #endif // PID -void DWIN_PidTuning(pidresult_t result); -#if ENABLED(PIDTEMP) - void Draw_HotendPID_Menu(); +#if HAS_PID_HEATING + void DWIN_PidTuning(tempcontrol_t result); + #if ENABLED(PIDTEMP) + void Draw_HotendPID_Menu(); + #endif + #if ENABLED(PIDTEMPBED) + void Draw_BedPID_Menu(); + #endif #endif -#if ENABLED(PIDTEMPBED) - void Draw_BedPID_Menu(); #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.h b/Marlin/src/lcd/e3v2/proui/dwinui.h index 3dd37f30dfe6a..55345a789985c 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.h +++ b/Marlin/src/lcd/e3v2/proui/dwinui.h @@ -138,14 +138,12 @@ #define ICON_UBLActive ICON_HotendTemp #define ICON_UBLActive ICON_HotendTemp #define ICON_UBLSlot ICON_ResumeEEPROM -#define ICON_UBLSaveMesh ICON_WriteEEPROM -#define ICON_UBLLoadMesh ICON_ReadEEPROM +#define ICON_UBLMeshSave ICON_WriteEEPROM +#define ICON_UBLMeshLoad ICON_ReadEEPROM #define ICON_UBLTiltGrid ICON_PrintSize #define ICON_UBLSmartFill ICON_StockConfiguration #define ICON_ZAfterHome ICON_SetEndTemp - - #define ICON_CaseLight ICON_Motion #define ICON_LedControl ICON_Motion diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index 8e65f38012852..1d4801278ce2e 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -103,7 +103,6 @@ namespace Language_an { LSTR MSG_FLOW_N = _UxGT("Fluxo ~"); LSTR MSG_CONTROL = _UxGT("Control"); LSTR MSG_AUTOTEMP = _UxGT("Temperatura Auto."); - LSTR MSG_SELECT = _UxGT("Trigar"); LSTR MSG_SELECT_E = _UxGT("Trigar *"); LSTR MSG_ACC = _UxGT("Aceleracion"); LSTR MSG_VTRAV_MIN = _UxGT("Vel. viache min"); diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index 50d490a6c2eba..db50def2da879 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -264,7 +264,6 @@ namespace Language_cz { LSTR MSG_LCD_OFF = _UxGT("Vyp"); LSTR MSG_PID_AUTOTUNE = _UxGT("PID automatika"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID automatika *"); - LSTR MSG_SELECT = _UxGT("Vybrat"); LSTR MSG_SELECT_E = _UxGT("Vybrat *"); LSTR MSG_ACC = _UxGT("Zrychl"); LSTR MSG_JERK = _UxGT("Jerk"); diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index 4078c413d1107..7d3867c3584c8 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -98,7 +98,6 @@ namespace Language_da { LSTR MSG_AUTOTEMP = _UxGT("Autotemp"); LSTR MSG_LCD_ON = _UxGT("Til"); LSTR MSG_LCD_OFF = _UxGT("Fra"); - LSTR MSG_SELECT = _UxGT("Vælg"); LSTR MSG_SELECT_E = _UxGT("Vælg *"); LSTR MSG_A_RETRACT = _UxGT("A-retract"); LSTR MSG_A_TRAVEL = _UxGT("A-rejse"); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index c2af37fc77775..a60da34d5f136 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -357,7 +357,6 @@ namespace Language_de { LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Sensor res *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ambient h *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Amb. h fan *"); - LSTR MSG_SELECT = _UxGT("Auswählen"); LSTR MSG_SELECT_E = _UxGT("Auswählen *"); LSTR MSG_ACC = _UxGT("Beschleunigung"); LSTR MSG_JERK = _UxGT("Jerk"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 3ce7a5aa2b3a5..9e67042d37972 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -378,7 +378,6 @@ namespace Language_en { LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Sensor res *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ambient h *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Amb. h fan *"); - LSTR MSG_SELECT = _UxGT("Select"); LSTR MSG_SELECT_E = _UxGT("Select *"); LSTR MSG_ACC = _UxGT("Accel"); LSTR MSG_JERK = _UxGT("Jerk"); @@ -553,11 +552,11 @@ namespace Language_en { LSTR MSG_TOOL_MIGRATION_END = _UxGT("Last Extruder"); LSTR MSG_TOOL_MIGRATION_SWAP = _UxGT("Migrate to *"); LSTR MSG_FILAMENTCHANGE = _UxGT("Change Filament"); - LSTR MSG_FILAMENTCHANGE_E = _UxGT("Change Filament *"); + LSTR MSG_FILAMENTCHANGE_E = _UxGT("Change * Filament"); LSTR MSG_FILAMENTLOAD = _UxGT("Load Filament"); - LSTR MSG_FILAMENTLOAD_E = _UxGT("Load *"); + LSTR MSG_FILAMENTLOAD_E = _UxGT("Load * Filament"); LSTR MSG_FILAMENTUNLOAD = _UxGT("Unload Filament"); - LSTR MSG_FILAMENTUNLOAD_E = _UxGT("Unload *"); + LSTR MSG_FILAMENTUNLOAD_E = _UxGT("Unload * Filament"); LSTR MSG_FILAMENTUNLOAD_ALL = _UxGT("Unload All"); #if ENABLED(MULTI_VOLUME) LSTR MSG_ATTACH_MEDIA = _UxGT("Attach SD Card"); diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index 5422a8117ba12..92e469576536c 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -265,7 +265,6 @@ namespace Language_es { LSTR MSG_LCD_OFF = _UxGT("Apg"); LSTR MSG_PID_AUTOTUNE = _UxGT("PID Auto-ajuste"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Auto-ajuste *"); - LSTR MSG_SELECT = _UxGT("Seleccionar"); LSTR MSG_SELECT_E = _UxGT("Seleccionar *"); LSTR MSG_ACC = _UxGT("Aceleración"); LSTR MSG_JERK = _UxGT("Jerk"); diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index 77c8dbe2d870e..e5e1d898ab70f 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -161,7 +161,6 @@ namespace Language_eu { LSTR MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); LSTR MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fakt"); LSTR MSG_AUTOTEMP = _UxGT("Auto tenperatura"); - LSTR MSG_SELECT = _UxGT("Aukeratu"); LSTR MSG_SELECT_E = _UxGT("Aukeratu *"); LSTR MSG_ACC = _UxGT("Azelerazioa"); LSTR MSG_JERK = _UxGT("Astindua"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index ed4c7ca9af508..02576f802c1bb 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -272,7 +272,6 @@ namespace Language_fr { LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Echec Autotune! E incorrect"); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Echec Autotune! Temp. trop haute"); LSTR MSG_PID_TIMEOUT = _UxGT("Echec Autotune! Opér. expirée"); - LSTR MSG_SELECT = _UxGT("Sélectionner"); LSTR MSG_SELECT_E = _UxGT("Sélectionner *"); LSTR MSG_ACC = _UxGT("Accélération"); LSTR MSG_JERK = _UxGT("Jerk"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index 005c6cc5d0252..97b8b0831789e 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -266,7 +266,6 @@ namespace Language_gl { LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Auto-Sint. fallida! Extrusor danado."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-Sint. fallida! Temperatura moi alta."); LSTR MSG_PID_TIMEOUT = _UxGT("Auto-Sint. fallida! Tempo excedido."); - LSTR MSG_SELECT = _UxGT("Escolla"); LSTR MSG_SELECT_E = _UxGT("Escolla *"); LSTR MSG_ACC = _UxGT("Acel"); LSTR MSG_JERK = _UxGT("Jerk"); diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index 7ca0f5405af1d..36eaf78acb1ad 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -95,7 +95,6 @@ namespace Language_hr { LSTR MSG_BED = _UxGT("Bed"); LSTR MSG_FAN_SPEED = _UxGT("Brzina ventilatora"); LSTR MSG_FAN_SPEED_N = _UxGT("Brzina ventilatora ~"); - LSTR MSG_SELECT = _UxGT("Odaberi"); LSTR MSG_SELECT_E = _UxGT("Odaberi *"); LSTR MSG_TEMPERATURE = _UxGT("Temperature"); LSTR MSG_MOTION = _UxGT("Gibanje"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index 09fb71876f3fe..0d70148c624c4 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -309,7 +309,6 @@ namespace Language_hu { LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Hangolási hiba! Rossz adagoló."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Hangolási hiba! Magas hömérséklet."); LSTR MSG_PID_TIMEOUT = _UxGT("Hangolási hiba! Idötúllépés."); - LSTR MSG_SELECT = _UxGT("Kiválaszt"); LSTR MSG_SELECT_E = _UxGT("Kiválaszt *"); LSTR MSG_ACC = _UxGT("Gyorsítás"); LSTR MSG_JERK = _UxGT("Rántás"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index def1b98343174..b0adb7791fe23 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -370,7 +370,6 @@ namespace Language_it { LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Reattiv.Sens. *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("H ambiente *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("H Amb. vent. *"); - LSTR MSG_SELECT = _UxGT("Seleziona"); LSTR MSG_SELECT_E = _UxGT("Seleziona *"); LSTR MSG_ACC = _UxGT("Accel"); LSTR MSG_JERK = _UxGT("Jerk"); diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h index 2f75b887590e0..989d5844f6032 100644 --- a/Marlin/src/lcd/language/language_jp_kana.h +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -114,7 +114,6 @@ namespace Language_jp_kana { LSTR MSG_AUTOTEMP = _UxGT("ジドウオンドセイギョ"); // "Autotemp" LSTR MSG_LCD_ON = _UxGT("オン"); // "On" LSTR MSG_LCD_OFF = _UxGT("オフ"); // "Off" - LSTR MSG_SELECT = _UxGT("センタク"); // "Select" LSTR MSG_SELECT_E = _UxGT("センタク *"); LSTR MSG_ACC = _UxGT("カソクド mm/s") SUPERSCRIPT_TWO; // "Accel" LSTR MSG_JERK = _UxGT("ヤクドウ mm/s"); // "Jerk" diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index 8aa74d7e9fdc4..0636899c9523a 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -108,7 +108,6 @@ namespace Language_nl { LSTR MSG_AUTOTEMP = _UxGT("Autotemp"); LSTR MSG_LCD_ON = _UxGT("Aan"); LSTR MSG_LCD_OFF = _UxGT("Uit"); - LSTR MSG_SELECT = _UxGT("Selecteer"); LSTR MSG_SELECT_E = _UxGT("Selecteer *"); LSTR MSG_ACC = _UxGT("Versn"); LSTR MSG_TEMPERATURE = _UxGT("Temperatuur"); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 635866baf106e..7eb17e93f73b5 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -269,7 +269,6 @@ namespace Language_pl { LSTR MSG_PID_AUTOTUNE = _UxGT("PID Autostrojenie"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Autostrojenie *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Strojenie PID zakończone"); - LSTR MSG_SELECT = _UxGT("Wybierz"); LSTR MSG_SELECT_E = _UxGT("Wybierz *"); LSTR MSG_ACC = _UxGT("Przyspieszenie"); LSTR MSG_JERK = _UxGT("Zryw"); diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index 1d07b2b94f22c..d34cd0c0c1879 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -236,7 +236,6 @@ namespace Language_pt_br { LSTR MSG_AUTOTEMP = _UxGT("Temp. Automática"); LSTR MSG_LCD_ON = _UxGT("Ligado"); LSTR MSG_LCD_OFF = _UxGT("Desligado"); - LSTR MSG_SELECT = _UxGT("Selecionar"); LSTR MSG_SELECT_E = _UxGT("Selecionar *"); LSTR MSG_ACC = _UxGT("Acel."); LSTR MSG_JERK = _UxGT("Arrancada"); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index 2cf6fff263cc5..57af062023593 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -264,7 +264,6 @@ namespace Language_ro { LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed! Bad extruder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed! Temperature too high."); LSTR MSG_PID_TIMEOUT = _UxGT("Autotune failed! Timeout."); - LSTR MSG_SELECT = _UxGT("Select"); LSTR MSG_SELECT_E = _UxGT("Select *"); LSTR MSG_ACC = _UxGT("Accel"); LSTR MSG_JERK = _UxGT("Jerk"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index ec9ddfa7f63cd..0af84d120a6be 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -386,7 +386,6 @@ namespace Language_ru { LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Сбой автоподбора! Температура повышена."); LSTR MSG_PID_TIMEOUT = _UxGT("Сбой автоподбора! Завершение времени."); - LSTR MSG_SELECT = _UxGT("Выбор"); LSTR MSG_SELECT_E = _UxGT("Выбор *"); LSTR MSG_ACC = _UxGT("Ускорение"); LSTR MSG_JERK = _UxGT("Рывок"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index bb332f4b1ff2d..812e2a03c5305 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -368,7 +368,6 @@ namespace Language_sk { LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Rozliš. senz. *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("H okolia *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("H vent. okolia *"); - LSTR MSG_SELECT = _UxGT("Vybrať"); LSTR MSG_SELECT_E = _UxGT("Vybrať *"); LSTR MSG_ACC = _UxGT("Zrýchlenie"); LSTR MSG_JERK = _UxGT("Skok"); diff --git a/Marlin/src/lcd/language/language_sv.h b/Marlin/src/lcd/language/language_sv.h index 1342ccaad7643..7b3c2d56a66a0 100644 --- a/Marlin/src/lcd/language/language_sv.h +++ b/Marlin/src/lcd/language/language_sv.h @@ -294,7 +294,6 @@ namespace Language_sv { LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autojustera misslyckad! Dålig extruder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autojustera misslyckad! Temperatur för hög."); LSTR MSG_PID_TIMEOUT = _UxGT("Autojustera misslyckad! Tidsgräns."); - LSTR MSG_SELECT = _UxGT("Välj"); LSTR MSG_SELECT_E = _UxGT("Välj *"); LSTR MSG_ACC = _UxGT("Accel"); LSTR MSG_JERK = _UxGT("Ryck"); diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index cb2766306c8e3..84d33f764de06 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -256,7 +256,6 @@ namespace Language_tr { LSTR MSG_LCD_OFF = _UxGT("Kapalı"); LSTR MSG_PID_AUTOTUNE = _UxGT("PID Kalibrasyon"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Kalibrasyon *"); - LSTR MSG_SELECT = _UxGT("Seç"); LSTR MSG_SELECT_E = _UxGT("Seç *"); LSTR MSG_ACC = _UxGT("İvme"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 6b4ebc79cd1ef..59dd14812b7f0 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -391,7 +391,6 @@ namespace Language_uk { LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Збій автопідбору! Температура завищена."); LSTR MSG_PID_TIMEOUT = _UxGT("Збій автопідбору! Вичерпан час."); - LSTR MSG_SELECT = _UxGT("Вибрати"); LSTR MSG_SELECT_E = _UxGT("Вибрати *"); LSTR MSG_ACC = _UxGT("Прискорорення"); LSTR MSG_JERK = _UxGT("Ривок"); diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index 27c6ee11812f0..ed50cca6633bc 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -224,7 +224,6 @@ namespace Language_vi { LSTR MSG_AUTOTEMP = _UxGT("Nhiệt độ tự động"); // Autotemp LSTR MSG_LCD_ON = _UxGT("Bật"); // on LSTR MSG_LCD_OFF = _UxGT("Tắt"); // off - LSTR MSG_SELECT = _UxGT("Lựa"); // Select LSTR MSG_SELECT_E = _UxGT("Lựa *"); LSTR MSG_ACC = _UxGT("Tăng Tốc"); LSTR MSG_JERK = _UxGT("Giật"); diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 4c5a94edcdc83..26515b60940d2 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -264,7 +264,6 @@ namespace Language_zh_CN { LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("自动调失败! 坏的挤出机"); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("自动调失败! 温度太高"); LSTR MSG_PID_TIMEOUT = _UxGT("自动调失败! 超时"); - LSTR MSG_SELECT = _UxGT("选择"); // "Select" LSTR MSG_SELECT_E = _UxGT("选择 *"); LSTR MSG_ACC = _UxGT("加速度"); // "Accel" acceleration LSTR MSG_JERK = _UxGT("抖动速率"); // "Jerk" diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 2aa3554fe80f9..6bc00e712acaf 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -249,7 +249,6 @@ namespace Language_zh_TW { LSTR MSG_LCD_ON = _UxGT("開 "); // "On" LSTR MSG_LCD_OFF = _UxGT("關 "); // "Off" - LSTR MSG_SELECT = _UxGT("選擇"); // "Select" LSTR MSG_SELECT_E = _UxGT("選擇 *"); LSTR MSG_ACC = _UxGT("加速度"); // "Accel" acceleration LSTR MSG_JERK = _UxGT("抖動速率"); // "Jerk" diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index ffd60f77e8e41..1bd580aa2b343 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -246,25 +246,15 @@ void menu_move() { #endif } #elif EXTRUDERS == 3 - if (active_extruder < 2) { - if (active_extruder) - GCODES_ITEM_N(0, MSG_SELECT_E, F("T0")); - else - GCODES_ITEM_N(1, MSG_SELECT_E, F("T1")); - } + if (active_extruder < 2) + GCODES_ITEM_N(1 - active_extruder, MSG_SELECT_E, active_extruder ? F("T0") : F("T1")); #else - if (active_extruder) - GCODES_ITEM_N(0, MSG_SELECT_E, F("T0")); - else - GCODES_ITEM_N(1, MSG_SELECT_E, F("T1")); + GCODES_ITEM_N(1 - active_extruder, MSG_SELECT_E, active_extruder ? F("T0") : F("T1")); #endif #elif ENABLED(DUAL_X_CARRIAGE) - if (active_extruder) - GCODES_ITEM_N(0, MSG_SELECT_E, F("T0")); - else - GCODES_ITEM_N(1, MSG_SELECT_E, F("T1")); + GCODES_ITEM_N(1 - active_extruder, MSG_SELECT_E, active_extruder ? F("T0") : F("T1")); #endif diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h index 9b28551322499..961ba411440e1 100644 --- a/Marlin/src/module/probe.h +++ b/Marlin/src/module/probe.h @@ -50,7 +50,7 @@ #endif #if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) - #define Z_POST_CLEARANCE HMI_data.z_after_homing; + #define Z_POST_CLEARANCE HMI_data.z_after_homing #elif defined(Z_AFTER_HOMING) #define Z_POST_CLEARANCE Z_AFTER_HOMING #elif defined(Z_HOMING_HEIGHT) From 6fe387b6f0722033e6cca96fd5e8215ea7b162eb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 15 Jan 2023 06:48:17 -0600 Subject: [PATCH 11/54] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Adjus?= =?UTF-8?q?t=20PID=20/=20MPC=20/=20ProUI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes to simplify #25232 WIP --- Marlin/Configuration_adv.h | 6 +- Marlin/src/gcode/geometry/M206_M428.cpp | 2 +- Marlin/src/gcode/temp/M303.cpp | 19 +---- Marlin/src/gcode/temp/M306.cpp | 28 +++---- Marlin/src/inc/Conditionals_post.h | 3 + Marlin/src/lcd/e3v2/proui/dwin.cpp | 37 ++++++--- Marlin/src/lcd/e3v2/proui/dwin.h | 27 +++---- Marlin/src/lcd/e3v2/proui/plot.cpp | 2 +- Marlin/src/lcd/e3v2/proui/plot.h | 2 +- .../src/lcd/extui/dgus/DGUSScreenHandler.cpp | 4 +- .../lcd/extui/dgus/DGUSScreenHandlerBase.h | 1 + Marlin/src/lcd/extui/dgus/dgus_extui.cpp | 12 +-- .../extui/dgus_reloaded/DGUSScreenHandler.cpp | 4 +- .../extui/dgus_reloaded/DGUSScreenHandler.h | 8 +- Marlin/src/lcd/extui/example/example.cpp | 10 +-- .../ftdi_eve_touch_ui/ftdi_eve_extui.cpp | 4 +- Marlin/src/lcd/extui/malyan/malyan_extui.cpp | 4 +- Marlin/src/lcd/extui/ui_api.h | 2 +- Marlin/src/lcd/language/language_de.h | 4 +- Marlin/src/lcd/language/language_en.h | 15 ++-- Marlin/src/lcd/language/language_fr.h | 2 +- Marlin/src/lcd/language/language_gl.h | 2 +- Marlin/src/lcd/language/language_hu.h | 2 +- Marlin/src/lcd/language/language_it.h | 4 +- Marlin/src/lcd/language/language_ro.h | 2 +- Marlin/src/lcd/language/language_ru.h | 2 +- Marlin/src/lcd/language/language_sk.h | 4 +- Marlin/src/lcd/language/language_sv.h | 2 +- Marlin/src/lcd/language/language_uk.h | 2 +- Marlin/src/lcd/language/language_zh_CN.h | 2 +- Marlin/src/lcd/menu/menu_advanced.cpp | 22 +++--- Marlin/src/module/settings.cpp | 20 +++-- Marlin/src/module/temperature.cpp | 76 ++++++++++--------- Marlin/src/module/temperature.h | 10 ++- 34 files changed, 181 insertions(+), 165 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index ee53109142804..71f46bfe8a793 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1429,12 +1429,10 @@ #endif // HAS_MARLINUI_MENU -#if ANY(HAS_DISPLAY, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) +#if HAS_DISPLAY //#define SOUND_MENU_ITEM // Add a mute option to the LCD menu #define SOUND_ON_DEFAULT // Buzzer/speaker default enabled state -#endif -#if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI) // The timeout to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 // (ms) @@ -1483,7 +1481,7 @@ #endif #endif -#endif // HAS_DISPLAY || DWIN_LCD_PROUI +#endif // HAS_DISPLAY // Add 'M73' to set print job progress, overrides Marlin's built-in estimate //#define SET_PROGRESS_MANUALLY diff --git a/Marlin/src/gcode/geometry/M206_M428.cpp b/Marlin/src/gcode/geometry/M206_M428.cpp index 494b2115b826d..b12e68060537f 100644 --- a/Marlin/src/gcode/geometry/M206_M428.cpp +++ b/Marlin/src/gcode/geometry/M206_M428.cpp @@ -91,7 +91,7 @@ void GcodeSuite::M428() { diff[i] = -current_position[i]; if (!WITHIN(diff[i], -20, 20)) { SERIAL_ERROR_MSG(STR_ERR_M428_TOO_FAR); - LCD_ALERTMESSAGE_F("Err: Too far!"); + LCD_ALERTMESSAGE(MSG_ERR_M428_TOO_FAR); ERR_BUZZ(); return; } diff --git a/Marlin/src/gcode/temp/M303.cpp b/Marlin/src/gcode/temp/M303.cpp index 820b1556d6117..e0ad26027e60f 100644 --- a/Marlin/src/gcode/temp/M303.cpp +++ b/Marlin/src/gcode/temp/M303.cpp @@ -67,8 +67,8 @@ void GcodeSuite::M303() { default: SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_BAD_HEATER_ID); - TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_EXTRUDER_NUM)); - TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_BAD_EXTRUDER_NUM)); + TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_HEATER_ID)); + TERN_(DWIN_PID_TUNE, DWIN_PidTuning(PID_BAD_HEATER_ID)); return; } @@ -78,20 +78,9 @@ void GcodeSuite::M303() { const celsius_t temp = seenS ? parser.value_celsius() : default_temp; const bool u = parser.boolval('U'); - #if ENABLED(DWIN_LCD_PROUI) && EITHER(PIDTEMP, PIDTEMPBED) - if (seenC) HMI_data.PidCycles = c; - if (seenS) { - switch (hid) { - OPTCODE(PIDTEMP, case 0 ... HOTENDS - 1: HMI_data.HotendPidT = temp; break) - OPTCODE(PIDTEMPBED, case H_BED: HMI_data.BedPidT = temp; break) - default: break; - } - } - #endif + TERN_(DWIN_PID_TUNE, DWIN_StartM303(seenC, c, seenS, hid, temp)); - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(NOT_BUSY); - #endif + IF_DISABLED(BUSY_WHILE_HEATING, KEEPALIVE_STATE(NOT_BUSY)); LCD_MESSAGE(MSG_PID_AUTOTUNE); thermalManager.PID_autotune(temp, hid, c, u); diff --git a/Marlin/src/gcode/temp/M306.cpp b/Marlin/src/gcode/temp/M306.cpp index c6b700eac3b6b..582eb13f81f78 100644 --- a/Marlin/src/gcode/temp/M306.cpp +++ b/Marlin/src/gcode/temp/M306.cpp @@ -52,15 +52,15 @@ void GcodeSuite::M306() { if (parser.seen("ACFPRH")) { const heater_id_t hid = (heater_id_t)parser.intval('E', 0); - MPC_t &constants = thermalManager.temp_hotend[hid].constants; - if (parser.seenval('P')) constants.heater_power = parser.value_float(); - if (parser.seenval('C')) constants.block_heat_capacity = parser.value_float(); - if (parser.seenval('R')) constants.sensor_responsiveness = parser.value_float(); - if (parser.seenval('A')) constants.ambient_xfer_coeff_fan0 = parser.value_float(); + MPC_t &mpc = thermalManager.temp_hotend[hid].mpc; + if (parser.seenval('P')) mpc.heater_power = parser.value_float(); + if (parser.seenval('C')) mpc.block_heat_capacity = parser.value_float(); + if (parser.seenval('R')) mpc.sensor_responsiveness = parser.value_float(); + if (parser.seenval('A')) mpc.ambient_xfer_coeff_fan0 = parser.value_float(); #if ENABLED(MPC_INCLUDE_FAN) - if (parser.seenval('F')) constants.fan255_adjustment = parser.value_float() - constants.ambient_xfer_coeff_fan0; + if (parser.seenval('F')) mpc.applyFanAdjustment(parser.value_float()); #endif - if (parser.seenval('H')) constants.filament_heat_capacity_permm = parser.value_float(); + if (parser.seenval('H')) mpc.filament_heat_capacity_permm = parser.value_float(); return; } @@ -71,16 +71,16 @@ void GcodeSuite::M306_report(const bool forReplay/*=true*/) { report_heading(forReplay, F("Model predictive control")); HOTEND_LOOP() { report_echo_start(forReplay); - MPC_t& constants = thermalManager.temp_hotend[e].constants; + MPC_t &mpc = thermalManager.temp_hotend[e].mpc; SERIAL_ECHOPGM(" M306 E", e); - SERIAL_ECHOPAIR_F(" P", constants.heater_power, 2); - SERIAL_ECHOPAIR_F(" C", constants.block_heat_capacity, 2); - SERIAL_ECHOPAIR_F(" R", constants.sensor_responsiveness, 4); - SERIAL_ECHOPAIR_F(" A", constants.ambient_xfer_coeff_fan0, 4); + SERIAL_ECHOPAIR_F(" P", mpc.heater_power, 2); + SERIAL_ECHOPAIR_F(" C", mpc.block_heat_capacity, 2); + SERIAL_ECHOPAIR_F(" R", mpc.sensor_responsiveness, 4); + SERIAL_ECHOPAIR_F(" A", mpc.ambient_xfer_coeff_fan0, 4); #if ENABLED(MPC_INCLUDE_FAN) - SERIAL_ECHOPAIR_F(" F", constants.ambient_xfer_coeff_fan0 + constants.fan255_adjustment, 4); + SERIAL_ECHOPAIR_F(" F", mpc.fanCoefficient(), 4); #endif - SERIAL_ECHOPAIR_F(" H", constants.filament_heat_capacity_permm, 4); + SERIAL_ECHOPAIR_F(" H", mpc.filament_heat_capacity_permm, 4); SERIAL_EOL(); } } diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 8fe9a408f22dc..515d5f7984ace 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2504,6 +2504,9 @@ // PID heating #if ANY(PIDTEMP, PIDTEMPBED, PIDTEMPCHAMBER) #define HAS_PID_HEATING 1 + #if ENABLED(DWIN_LCD_PROUI) && EITHER(PIDTEMP, PIDTEMPBED) + #define DWIN_PID_TUNE 1 + #endif #endif // Thermal protection diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 621b3d0dd3938..4be0819441380 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1500,9 +1500,10 @@ void DWIN_LevelingDone() { // PID process -#if HAS_PIDPLOT +#if BOTH(HAS_PIDPLOT, DWIN_PID_TUNE) + void DWIN_Draw_PIDPopup() { - frame_rect_t gfrm = {40, 180, DWIN_WIDTH - 80, 120}; + frame_rect_t gfrm = { 40, 180, DWIN_WIDTH - 80, 120 }; DWINUI::ClearMainArea(); Draw_Popup_Bkgd(); DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_PID_AUTOTUNE)); @@ -1525,9 +1526,21 @@ void DWIN_LevelingDone() { default: break; } } + #endif -#if EITHER(PIDTEMP, PIDTEMPBED) +#if DWIN_PID_TUNE + + void DWIN_StartM303(const bool seenC, const int c, const bool seenS, const heater_id_t hid, const celsius_t temp) { + if (seenC) HMI_data.PidCycles = c; + if (seenS) { + switch (hid) { + OPTCODE(PIDTEMP, case 0 ... HOTENDS - 1: HMI_data.HotendPidT = temp; break) + OPTCODE(PIDTEMPBED, case H_BED: HMI_data.BedPidT = temp; break) + default: break; + } + } + } void DWIN_PidTuning(pidresult_t result) { HMI_value.pidresult = result; @@ -1541,9 +1554,9 @@ void DWIN_LevelingDone() { DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for Nozzle is running.")); #endif break; - case PID_BAD_EXTRUDER_NUM: + case PID_BAD_HEATER_ID: checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_BAD_EXTRUDER_NUM)); + DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_BAD_HEATER_ID)); break; #endif #if ENABLED(PIDTEMPBED) @@ -1568,11 +1581,13 @@ void DWIN_LevelingDone() { checkkey = last_checkkey; DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE), GET_TEXT_F(MSG_BUTTON_DONE)); break; - default: checkkey = last_checkkey; break; + default: + checkkey = last_checkkey; + break; } } -#endif // PIDTEMP || PIDTEMPBED +#endif // DWIN_PID_TUNE // Started a Print Job void DWIN_Print_Started() { @@ -1667,7 +1682,7 @@ void DWIN_SetDataDefaults() { DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color); TERN_(PIDTEMP, HMI_data.HotendPidT = DEF_HOTENDPIDT); TERN_(PIDTEMPBED, HMI_data.BedPidT = DEF_BEDPIDT); - TERN_(HAS_PID_HEATING, HMI_data.PidCycles = DEF_PIDCYCLES); + TERN_(DWIN_PID_TUNE, HMI_data.PidCycles = DEF_PIDCYCLES); #if ENABLED(PREVENT_COLD_EXTRUSION) HMI_data.ExtMinT = EXTRUDE_MINTEMP; ApplyExtMinT(); @@ -2057,7 +2072,7 @@ void SetMoveZ() { HMI_value.axis = Z_AXIS; SetPFloatOnClick(Z_MIN_POS, Z_MAX_POS } #endif -#if EITHER(PIDTEMP, PIDTEMPBED) +#if DWIN_PID_TUNE void SetPID(celsius_t t, heater_id_t h) { char cmd[53] = ""; char str_1[5] = "", str_2[5] = ""; @@ -2523,7 +2538,7 @@ void SetStepsZ() { HMI_value.axis = Z_AXIS, SetPFloatOnClick( MIN_STEP, MAX_STEP void SetBedPidT() { SetPIntOnClick(MIN_BEDTEMP, MAX_BEDTEMP); } #endif -#if EITHER(PIDTEMP, PIDTEMPBED) +#if DWIN_PID_TUNE void SetPidCycles() { SetPIntOnClick(3, 50); } void SetKp() { SetPFloatOnClick(0, 1000, 2); } void ApplyPIDi() { @@ -2694,7 +2709,7 @@ void onDrawGetColorItem(MenuItemClass* menuitem, int8_t line) { DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(line + 1), 240); } -#if EITHER(PIDTEMP, PIDTEMPBED) +#if DWIN_PID_TUNE void onDrawPIDi(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_i(*(float*)static_cast(menuitem)->value)); } void onDrawPIDd(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_d(*(float*)static_cast(menuitem)->value)); } #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index cac64b8ce57d8..bc050abd2e1ea 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -76,7 +76,7 @@ enum processID : uint8_t { enum pidresult_t : uint8_t { PIDTEMP_START = 0, PIDTEMPBED_START, - PID_BAD_EXTRUDER_NUM, + PID_BAD_HEATER_ID, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, PID_DONE, @@ -107,14 +107,14 @@ typedef struct { uint16_t Coordinate_Color; // Temperatures - #if ENABLED(PIDTEMP) - int16_t HotendPidT = DEF_HOTENDPIDT; - #endif - #if ENABLED(PIDTEMPBED) - int16_t BedPidT = DEF_BEDPIDT; - #endif - #if (HAS_HOTEND || HAS_HEATED_BED) && HAS_PID_HEATING + #if DWIN_PID_TUNE int16_t PidCycles = DEF_PIDCYCLES; + #if ENABLED(PIDTEMP) + int16_t HotendPidT = DEF_HOTENDPIDT; + #endif + #if ENABLED(PIDTEMPBED) + int16_t BedPidT = DEF_BEDPIDT; + #endif #endif #if ENABLED(PREVENT_COLD_EXTRUSION) int16_t ExtMinT = EXTRUDE_MINTEMP; @@ -141,8 +141,8 @@ static constexpr size_t eeprom_data_size = sizeof(HMI_data_t); typedef struct { int8_t Color[3]; // Color components - #if HAS_PID_HEATING - tempcontrol_t pidresult = PID_DONE; + #if DWIN_PID_TUNE + pidresult_t pidresult = PID_DONE; #endif uint8_t Select = 0; // Auxiliary selector variable AxisEnum axis = X_AXIS; // Axis Select @@ -358,8 +358,10 @@ void Draw_Steps_Menu(); #endif // PID -#if HAS_PID_HEATING - void DWIN_PidTuning(tempcontrol_t result); +#if DWIN_PID_TUNE + #include "../../../module/temperature.h" + void DWIN_StartM303(const bool seenC, const int c, const bool seenS, const heater_id_t hid, const celsius_t temp); + void DWIN_PidTuning(pidresult_t result); #if ENABLED(PIDTEMP) void Draw_HotendPID_Menu(); #endif @@ -367,4 +369,3 @@ void Draw_Steps_Menu(); void Draw_BedPID_Menu(); #endif #endif -#endif diff --git a/Marlin/src/lcd/e3v2/proui/plot.cpp b/Marlin/src/lcd/e3v2/proui/plot.cpp index 75917320a45f7..53178e3ea705f 100644 --- a/Marlin/src/lcd/e3v2/proui/plot.cpp +++ b/Marlin/src/lcd/e3v2/proui/plot.cpp @@ -74,7 +74,7 @@ void PlotClass::Draw(const frame_rect_t frame, const float max, const float ref) DWIN_Draw_HLine(Color_Red, frame.x, r, frame.w); } -void PlotClass::Update(const float value) { +void PlotClass::Update(const_float_t value) { if (!scale) return; uint16_t y = round((y2) - value * scale); if (grphpoints < grphframe.w) { diff --git a/Marlin/src/lcd/e3v2/proui/plot.h b/Marlin/src/lcd/e3v2/proui/plot.h index ea15255fe53a0..2663776dc4fc5 100644 --- a/Marlin/src/lcd/e3v2/proui/plot.h +++ b/Marlin/src/lcd/e3v2/proui/plot.h @@ -48,7 +48,7 @@ class PlotClass { public: void Draw(frame_rect_t frame, float max, float ref = 0); - void Update(float value); + void Update(const_float_t value); }; extern PlotClass Plot; diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp index 37543a237c0b5..82dbeee4112bc 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp @@ -295,11 +295,11 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var) // Don't let the user in the dark why there is no reaction. if (!ExtUI::isMediaInserted()) { - setstatusmessagePGM(GET_TEXT(MSG_NO_MEDIA)); + setstatusmessage(GET_TEXT_F(MSG_NO_MEDIA)); return; } if (card.flag.abort_sd_printing) { - setstatusmessagePGM(GET_TEXT(MSG_MEDIA_ABORTING)); + setstatusmessage(GET_TEXT_F(MSG_MEDIA_ABORTING)); return; } } diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h b/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h index 07a108e846638..340938c9790d5 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h @@ -51,6 +51,7 @@ class DGUSScreenHandler { static void setstatusmessage(const char *msg); // The same for messages from Flash static void setstatusmessagePGM(PGM_P const msg); + static void setstatusmessage(FSTR_P const fmsg) { setstatusmessagePGM(FTOP(fmsg)); } // Callback for VP "Display wants to change screen on idle printer" static void ScreenChangeHookIfIdle(DGUS_VP_Variable &var, void *val_ptr); // Callback for VP "Screen has been changed" diff --git a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp index b041687a14fa8..382c5eb1befa8 100644 --- a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp +++ b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp @@ -137,19 +137,19 @@ namespace ExtUI { // Called for temperature PID tuning result switch (rst) { case PID_STARTED: - ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_AUTOTUNE)); + ScreenHandler.setstatusmessage(GET_TEXT_F(MSG_PID_AUTOTUNE)); break; - case PID_BAD_EXTRUDER_NUM: - ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_BAD_EXTRUDER_NUM)); + case PID_BAD_HEATER_ID: + ScreenHandler.setstatusmessage(GET_TEXT_F(MSG_PID_BAD_HEATER_ID)); break; case PID_TEMP_TOO_HIGH: - ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_TEMP_TOO_HIGH)); + ScreenHandler.setstatusmessage(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH)); break; case PID_TUNING_TIMEOUT: - ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_TIMEOUT)); + ScreenHandler.setstatusmessage(GET_TEXT_F(MSG_PID_TIMEOUT)); break; case PID_DONE: - ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_AUTOTUNE_DONE)); + ScreenHandler.setstatusmessage(GET_TEXT_F(MSG_PID_AUTOTUNE_DONE)); break; } ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp index 4d758ae5ef741..3d0896a67cf6d 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp @@ -325,8 +325,8 @@ void DGUSScreenHandler::FilamentRunout(const ExtUI::extruder_t extruder) { case ExtUI::PID_STARTED: SetStatusMessage(GET_TEXT_F(MSG_PID_AUTOTUNE)); break; - case ExtUI::PID_BAD_EXTRUDER_NUM: - SetStatusMessage(GET_TEXT_F(MSG_PID_BAD_EXTRUDER_NUM)); + case ExtUI::PID_BAD_HEATER_ID: + SetStatusMessage(GET_TEXT_F(MSG_PID_BAD_HEATER_ID)); break; case ExtUI::PID_TEMP_TOO_HIGH: SetStatusMessage(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH)); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h index cc59bda6d7fab..6a00a4f72aff1 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h @@ -72,10 +72,10 @@ class DGUSScreenHandler { static void SetMessageLine(const char* msg, uint8_t line); static void SetMessageLinePGM(PGM_P msg, uint8_t line); - static void SetStatusMessage(const char* msg, const millis_t duration = DGUS_STATUS_EXPIRATION_MS); - static void SetStatusMessage(FSTR_P const msg, const millis_t duration = DGUS_STATUS_EXPIRATION_MS); + static void SetStatusMessage(const char* msg, const millis_t duration=DGUS_STATUS_EXPIRATION_MS); + static void SetStatusMessage(FSTR_P const msg, const millis_t duration=DGUS_STATUS_EXPIRATION_MS); - static void ShowWaitScreen(DGUS_Screen return_screen, bool has_continue = false); + static void ShowWaitScreen(DGUS_Screen return_screen, bool has_continue=false); static DGUS_Screen GetCurrentScreen(); static void TriggerScreenChange(DGUS_Screen screen); @@ -115,7 +115,7 @@ class DGUSScreenHandler { static const DGUS_Addr* FindScreenAddrList(DGUS_Screen screen); static bool CallScreenSetup(DGUS_Screen screen); - static void MoveToScreen(DGUS_Screen screen, bool abort_wait = false); + static void MoveToScreen(DGUS_Screen screen, bool abort_wait=false); static bool SendScreenVPData(DGUS_Screen screen, bool complete_update); static bool settings_ready; diff --git a/Marlin/src/lcd/extui/example/example.cpp b/Marlin/src/lcd/extui/example/example.cpp index 6ef20cf5f0f3a..27269a9bee7bc 100644 --- a/Marlin/src/lcd/extui/example/example.cpp +++ b/Marlin/src/lcd/extui/example/example.cpp @@ -121,11 +121,11 @@ namespace ExtUI { void onPidTuning(const result_t rst) { // Called for temperature PID tuning result switch (rst) { - case PID_STARTED: break; - case PID_BAD_EXTRUDER_NUM: break; - case PID_TEMP_TOO_HIGH: break; - case PID_TUNING_TIMEOUT: break; - case PID_DONE: break; + case PID_STARTED: break; + case PID_BAD_HEATER_ID: break; + case PID_TEMP_TOO_HIGH: break; + case PID_TUNING_TIMEOUT: break; + case PID_DONE: break; } } #endif diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp index 2ce9ed027e86c..84de2c587128b 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp @@ -136,8 +136,8 @@ namespace ExtUI { case PID_STARTED: StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PID_AUTOTUNE)); break; - case PID_BAD_EXTRUDER_NUM: - StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PID_BAD_EXTRUDER_NUM)); + case PID_BAD_HEATER_ID: + StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PID_BAD_HEATER_ID)); break; case PID_TEMP_TOO_HIGH: StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH)); diff --git a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp index 945ff472e1a1c..8ed319e35c8ac 100644 --- a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp +++ b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp @@ -111,8 +111,8 @@ namespace ExtUI { case PID_STARTED: set_lcd_error(GET_TEXT_F(MSG_PID_AUTOTUNE)); break; - case PID_BAD_EXTRUDER_NUM: - set_lcd_error(GET_TEXT_F(MSG_PID_BAD_EXTRUDER_NUM)); + case PID_BAD_HEATER_ID: + set_lcd_error(GET_TEXT_F(MSG_PID_BAD_HEATER_ID)); break; case PID_TEMP_TOO_HIGH: set_lcd_error(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH)); diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index c2ce52ba4c1e3..b48dc94f8fef2 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -61,7 +61,7 @@ namespace ExtUI { enum extruder_t : uint8_t { E0, E1, E2, E3, E4, E5, E6, E7 }; enum heater_t : uint8_t { H0, H1, H2, H3, H4, H5, BED, CHAMBER, COOLER }; enum fan_t : uint8_t { FAN0, FAN1, FAN2, FAN3, FAN4, FAN5, FAN6, FAN7 }; - enum result_t : uint8_t { PID_STARTED, PID_BAD_EXTRUDER_NUM, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, PID_DONE }; + enum result_t : uint8_t { PID_STARTED, PID_BAD_HEATER_ID, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, PID_DONE }; constexpr uint8_t extruderCount = EXTRUDERS; constexpr uint8_t hotendCount = HOTENDS; diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index a60da34d5f136..56f91e0ed23bb 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -343,10 +343,10 @@ namespace Language_de { LSTR MSG_PID_CYCLE = _UxGT("PID Zyklus"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID Tuning fertig"); LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("PID Autotune fehlge.!"); - LSTR MSG_BAD_EXTRUDER_NUM = _UxGT("ungültiger Extruder."); + LSTR MSG_BAD_HEATER_ID = _UxGT("ungültiger Extruder."); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Temperatur zu hoch."); LSTR MSG_TIMEOUT = _UxGT("Timeout."); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune fehlge.! Ungültiger Extruder"); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Autotune fehlge.! Ungültiger Extruder"); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune fehlge.! Temperatur zu hoch."); LSTR MSG_PID_TIMEOUT = _UxGT("Autotune fehlge.! Timeout."); LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("teste Wärmeverlust"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 9e67042d37972..8352ef8886221 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -107,6 +107,7 @@ namespace Language_en { LSTR MSG_HOME_OFFSET_Y = _UxGT("Home Offset Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Home Offset Z"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets Applied"); + LSTR MSG_ERR_M428_TOO_FAR = _UxGT("Err: Too far!"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Tramming Wizard"); LSTR MSG_SELECT_ORIGIN = _UxGT("Select Origin"); LSTR MSG_LAST_VALUE_SP = _UxGT("Last value "); @@ -364,20 +365,22 @@ namespace Language_en { LSTR MSG_PID_CYCLE = _UxGT("PID Cycles"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID tuning done"); LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("PID Autotune failed!"); - LSTR MSG_BAD_EXTRUDER_NUM = _UxGT("Bad extruder."); + LSTR MSG_BAD_HEATER_ID = _UxGT("Bad extruder."); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Temperature too high."); LSTR MSG_TIMEOUT = _UxGT("Timeout."); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed! Bad extruder."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Autotune failed! Bad extruder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed! Temperature too high."); LSTR MSG_PID_TIMEOUT = _UxGT("Autotune failed! Timeout."); LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Testing heat loss"); + LSTR MSG_MPC_HEATING_PAST_200 = _UxGT("Heating to >200C"); + LSTR MSG_MPC_COOLING_TO_AMBIENT = _UxGT("Cooling to ambient"); LSTR MSG_MPC_AUTOTUNE = _UxGT("MPC Autotune"); LSTR MSG_MPC_EDIT = _UxGT("Edit * MPC"); LSTR MSG_MPC_POWER_E = _UxGT("Power *"); - LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Block C *"); - LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Sensor res *"); - LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ambient h *"); - LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Amb. h fan *"); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Heat Cap. *"); + LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Sensor Resp. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ambient Co. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Fan coeff. *"); LSTR MSG_SELECT_E = _UxGT("Select *"); LSTR MSG_ACC = _UxGT("Accel"); LSTR MSG_JERK = _UxGT("Jerk"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 02576f802c1bb..35e8502b940c1 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -269,7 +269,7 @@ namespace Language_fr { LSTR MSG_PID_AUTOTUNE = _UxGT("PID Autotune"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Tuning PID terminé"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Echec Autotune! E incorrect"); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Echec Autotune! E incorrect"); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Echec Autotune! Temp. trop haute"); LSTR MSG_PID_TIMEOUT = _UxGT("Echec Autotune! Opér. expirée"); LSTR MSG_SELECT_E = _UxGT("Sélectionner *"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index 97b8b0831789e..abad80bbecb80 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -263,7 +263,7 @@ namespace Language_gl { LSTR MSG_PID_AUTOTUNE = _UxGT("Auto-Sint. PID"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("Auto-Sint. PID *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Fin Auto-Sint PID"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Auto-Sint. fallida! Extrusor danado."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Auto-Sint. fallida! Extrusor danado."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-Sint. fallida! Temperatura moi alta."); LSTR MSG_PID_TIMEOUT = _UxGT("Auto-Sint. fallida! Tempo excedido."); LSTR MSG_SELECT_E = _UxGT("Escolla *"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index 0d70148c624c4..598da662cc74a 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -306,7 +306,7 @@ namespace Language_hu { LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID hangolás *"); LSTR MSG_PID_CYCLE = _UxGT("PID ciklus"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID hangolás kész"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Hangolási hiba! Rossz adagoló."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Hangolási hiba! Rossz adagoló."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Hangolási hiba! Magas hömérséklet."); LSTR MSG_PID_TIMEOUT = _UxGT("Hangolási hiba! Idötúllépés."); LSTR MSG_SELECT_E = _UxGT("Kiválaszt *"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index b0adb7791fe23..12a9c572b5e94 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -356,10 +356,10 @@ namespace Language_it { LSTR MSG_PID_CYCLE = _UxGT("Ciclo PID"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Calibr.PID eseguita"); LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("Calibr.PID fallito!"); - LSTR MSG_BAD_EXTRUDER_NUM = _UxGT("Estrusore invalido."); + LSTR MSG_BAD_HEATER_ID = _UxGT("Estrusore invalido."); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Temp.troppo alta."); LSTR MSG_TIMEOUT = _UxGT("Tempo scaduto."); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Calibrazione fallita! Estrusore errato."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Calibrazione fallita! Estrusore errato."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Calibrazione fallita! Temperatura troppo alta."); LSTR MSG_PID_TIMEOUT = _UxGT("Calibrazione fallita! Tempo scaduto."); LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Testing heat loss"); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index 57af062023593..48751f8cd2a4f 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -261,7 +261,7 @@ namespace Language_ro { LSTR MSG_PID_AUTOTUNE = _UxGT("PID Autotune"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID tuning done"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autotune failed! Bad extruder."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Autotune failed! Bad extruder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed! Temperature too high."); LSTR MSG_PID_TIMEOUT = _UxGT("Autotune failed! Timeout."); LSTR MSG_SELECT_E = _UxGT("Select *"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 0af84d120a6be..1f3c77752e73f 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -382,7 +382,7 @@ namespace Language_ru { LSTR MSG_PID_AUTOTUNE = _UxGT("Автоподбор PID"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("Автоподбор PID *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Подбор PID выполнен"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Сбой автоподбора! Плохой экструдер."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Сбой автоподбора! Плохой экструдер."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Сбой автоподбора! Температура повышена."); LSTR MSG_PID_TIMEOUT = _UxGT("Сбой автоподбора! Завершение времени."); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 812e2a03c5305..323ae684d5ead 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -354,10 +354,10 @@ namespace Language_sk { LSTR MSG_PID_CYCLE = _UxGT("Cykly PID"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Kal. PID dokončená"); LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("Kal. PID zlyhala!"); - LSTR MSG_BAD_EXTRUDER_NUM = _UxGT("Zlý extrudér"); + LSTR MSG_BAD_HEATER_ID = _UxGT("Zlý extrudér"); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Príliš vysoká tepl."); LSTR MSG_TIMEOUT = _UxGT("Čas vypršal."); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Auto-kal. zlyhala! Zlý extrúder."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Auto-kal. zlyhala! Zlý extrúder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-kal. zlyhala! Príliš vysoká tepl."); LSTR MSG_PID_TIMEOUT = _UxGT("Auto-kal. zlyhala! Čas vypršal."); LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Test. tepl. straty"); diff --git a/Marlin/src/lcd/language/language_sv.h b/Marlin/src/lcd/language/language_sv.h index 7b3c2d56a66a0..a18691fe0e5e4 100644 --- a/Marlin/src/lcd/language/language_sv.h +++ b/Marlin/src/lcd/language/language_sv.h @@ -291,7 +291,7 @@ namespace Language_sv { LSTR MSG_PID_AUTOTUNE = _UxGT("PID Autojustera"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Autojustera *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID tuning done"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Autojustera misslyckad! Dålig extruder."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Autojustera misslyckad! Dålig extruder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autojustera misslyckad! Temperatur för hög."); LSTR MSG_PID_TIMEOUT = _UxGT("Autojustera misslyckad! Tidsgräns."); LSTR MSG_SELECT_E = _UxGT("Välj *"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 59dd14812b7f0..697445288dbb3 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -387,7 +387,7 @@ namespace Language_uk { LSTR MSG_PID_AUTOTUNE = _UxGT("Автопідбір PID"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("Автопідбір PID *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Підбір PID виконано"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Збій автопідбору! Поганий екструдер."); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Збій автопідбору! Поганий екструдер."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Збій автопідбору! Температура завищена."); LSTR MSG_PID_TIMEOUT = _UxGT("Збій автопідбору! Вичерпан час."); diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 26515b60940d2..79c59be44b073 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -261,7 +261,7 @@ namespace Language_zh_CN { LSTR MSG_PID_AUTOTUNE = _UxGT("自动PID"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("自动PID *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID调整完成"); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("自动调失败! 坏的挤出机"); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("自动调失败! 坏的挤出机"); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("自动调失败! 温度太高"); LSTR MSG_PID_TIMEOUT = _UxGT("自动调失败! 超时"); LSTR MSG_SELECT_E = _UxGT("选择 *"); diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 8e1963afe593b..6f404f20e11eb 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -41,7 +41,7 @@ #include "../../module/probe.h" #endif -#if ANY(PIDTEMP, PIDTEMPBED, PIDTEMPCHAMBER) +#if HAS_PID_HEATING #include "../../module/temperature.h" #endif @@ -277,10 +277,10 @@ void menu_backlash(); // #if SHOW_MENU_ADVANCED_TEMPERATURE - #if ENABLED(MPC_EDIT_MENU) - #define MPC_EDIT_DEFS(N) \ - MPC_t &c = thermalManager.temp_hotend[N].constants; \ - TERN_(MPC_INCLUDE_FAN, editable.decimal = c.ambient_xfer_coeff_fan0 + c.fan255_adjustment) + #if BOTH(MPC_EDIT_MENU, MPC_INCLUDE_FAN) + #define MPC_EDIT_DEFS(N) editable.decimal = thermalManager.temp_hotend[N].fanCoefficient() + #else + #define MPC_EDIT_DEFS(...) #endif void menu_advanced_temperature() { @@ -370,17 +370,17 @@ void menu_backlash(); #if ENABLED(MPC_EDIT_MENU) #define _MPC_EDIT_ITEMS(N) \ - EDIT_ITEM_FAST_N(float31sign, N, MSG_MPC_POWER_E, &c.heater_power, 1, 200); \ - EDIT_ITEM_FAST_N(float31sign, N, MSG_MPC_BLOCK_HEAT_CAPACITY_E, &c.block_heat_capacity, 0, 40); \ - EDIT_ITEM_FAST_N(float43, N, MSG_SENSOR_RESPONSIVENESS_E, &c.sensor_responsiveness, 0, 1); \ - EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_E, &c.ambient_xfer_coeff_fan0, 0, 1) + EDIT_ITEM_FAST_N(float31sign, N, MSG_MPC_POWER_E, &mpc.heater_power, 1, 200); \ + EDIT_ITEM_FAST_N(float31sign, N, MSG_MPC_BLOCK_HEAT_CAPACITY_E, &mpc.block_heat_capacity, 0, 40); \ + EDIT_ITEM_FAST_N(float43, N, MSG_SENSOR_RESPONSIVENESS_E, &mpc.sensor_responsiveness, 0, 1); \ + EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_E, &mpc.ambient_xfer_coeff_fan0, 0, 1) #if ENABLED(MPC_INCLUDE_FAN) #define MPC_EDIT_ITEMS(N) \ + MPC_t &mpc = thermalManager.temp_hotend[MenuItemBase::itemIndex].constants; \ _MPC_EDIT_ITEMS(N); \ EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_FAN_E, &editable.decimal, 0, 1, []{ \ - MPC_t &c = thermalManager.temp_hotend[MenuItemBase::itemIndex].constants; \ - c.fan255_adjustment = editable.decimal - c.ambient_xfer_coeff_fan0; \ + thermalManager.temp_hotend[MenuItemBase::itemIndex].applyFanAdjustment(editable.decimal); \ }) #else #define MPC_EDIT_ITEMS _MPC_EDIT_ITEMS diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index afdbf3d10342e..8b615f2faf149 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -1632,8 +1632,7 @@ void MarlinSettings::postprocess() { // Model predictive control // #if ENABLED(MPCTEMP) - HOTEND_LOOP() - EEPROM_WRITE(thermalManager.temp_hotend[e].constants); + HOTEND_LOOP() EEPROM_WRITE(thermalManager.temp_hotend[e].mpc); #endif // @@ -2627,8 +2626,7 @@ void MarlinSettings::postprocess() { // #if ENABLED(MPCTEMP) { - HOTEND_LOOP() - EEPROM_READ(thermalManager.temp_hotend[e].constants); + HOTEND_LOOP() EEPROM_READ(thermalManager.temp_hotend[e].mpc); } #endif @@ -3416,15 +3414,15 @@ void MarlinSettings::reset() { static_assert(COUNT(_filament_heat_capacity_permm) == HOTENDS, "FILAMENT_HEAT_CAPACITY_PERMM must have HOTENDS items."); HOTEND_LOOP() { - MPC_t &constants = thermalManager.temp_hotend[e].constants; - constants.heater_power = _mpc_heater_power[e]; - constants.block_heat_capacity = _mpc_block_heat_capacity[e]; - constants.sensor_responsiveness = _mpc_sensor_responsiveness[e]; - constants.ambient_xfer_coeff_fan0 = _mpc_ambient_xfer_coeff[e]; + MPC_t &mpc = thermalManager.temp_hotend[e].mpc; + mpc.heater_power = _mpc_heater_power[e]; + mpc.block_heat_capacity = _mpc_block_heat_capacity[e]; + mpc.sensor_responsiveness = _mpc_sensor_responsiveness[e]; + mpc.ambient_xfer_coeff_fan0 = _mpc_ambient_xfer_coeff[e]; #if ENABLED(MPC_INCLUDE_FAN) - constants.fan255_adjustment = _mpc_ambient_xfer_coeff_fan255[e] - _mpc_ambient_xfer_coeff[e]; + mpc.fan255_adjustment = _mpc_ambient_xfer_coeff_fan255[e] - _mpc_ambient_xfer_coeff[e]; #endif - constants.filament_heat_capacity_permm = _filament_heat_capacity_permm[e]; + mpc.filament_heat_capacity_permm = _filament_heat_capacity_permm[e]; } #endif diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index c53fa5df14ef0..a4f528a4c8196 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -660,13 +660,13 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(HAS_FAN_LOGIC, fan_update_ms = next_temp_ms + fan_update_interval_ms); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_STARTED)); - TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(isbed ? PIDTEMPBED_START : PIDTEMP_START)); + TERN_(DWIN_PID_TUNE, DWIN_PidTuning(isbed ? PIDTEMPBED_START : PIDTEMP_START)); if (target > GHV(CHAMBER_MAX_TARGET, BED_MAX_TARGET, temp_range[heater_id].maxtemp - (HOTEND_OVERSHOOT))) { SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH)); - TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_TEMP_TOO_HIGH)); + TERN_(DWIN_PID_TUNE, DWIN_PidTuning(PID_TEMP_TOO_HIGH)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH))); return; } @@ -760,7 +760,7 @@ volatile bool Temperature::raw_temps_ready = false; SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH)); - TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_TEMP_TOO_HIGH)); + TERN_(DWIN_PID_TUNE, DWIN_PidTuning(PID_TEMP_TOO_HIGH)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH))); break; } @@ -797,7 +797,7 @@ volatile bool Temperature::raw_temps_ready = false; #endif if ((ms - _MIN(t1, t2)) > (MAX_CYCLE_TIME_PID_AUTOTUNE * 60L * 1000L)) { TERN_(DWIN_CREALITY_LCD, DWIN_Popup_Temperature(0)); - TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_TUNING_TIMEOUT)); + TERN_(DWIN_PID_TUNE, DWIN_PidTuning(PID_TUNING_TIMEOUT)); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TUNING_TIMEOUT)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TIMEOUT))); SERIAL_ECHOPGM(STR_PID_AUTOTUNE); @@ -852,7 +852,7 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onPidTuningDone(color)); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_DONE)); - TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_DONE)); + TERN_(DWIN_PID_TUNE, DWIN_PidTuning(PID_DONE)); goto EXIT_M303; } @@ -870,7 +870,7 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onPidTuningDone(color)); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_DONE)); - TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_DONE)); + TERN_(DWIN_PID_TUNE, DWIN_PidTuning(PID_DONE)); EXIT_M303: TERN_(NO_FAN_SLOWING_IN_PID_TUNING, adaptive_fan_slowing = true); @@ -882,7 +882,7 @@ volatile bool Temperature::raw_temps_ready = false; #if ENABLED(MPCTEMP) void Temperature::MPC_autotune() { - auto housekeeping = [] (millis_t& ms, celsius_float_t& current_temp, millis_t& next_report_ms) { + auto housekeeping = [] (millis_t &ms, celsius_float_t ¤t_temp, millis_t &next_report_ms) { ms = millis(); if (updateTemperaturesIfReady()) { // temp sample ready @@ -929,7 +929,7 @@ volatile bool Temperature::raw_temps_ready = false; SERIAL_ECHOPGM(STR_MPC_AUTOTUNE); SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_START, active_extruder); MPCHeaterInfo &hotend = temp_hotend[active_extruder]; - MPC_t &constants = hotend.constants; + MPC_t &mpc = hotend.mpc; // Move to center of bed, just above bed height and cool with max fan gcode.home_all_axes(true); @@ -939,11 +939,11 @@ volatile bool Temperature::raw_temps_ready = false; set_fan_speed(EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); planner.sync_fan_speeds(fan_speed); #endif - const xyz_pos_t tuningpos = MPC_TUNING_POS; - do_blocking_move_to(tuningpos); + do_blocking_move_to(xyz_pos_t(MPC_TUNING_POS)); SERIAL_ECHOLNPGM(STR_MPC_COOLING_TO_AMBIENT); LCD_MESSAGE(MSG_COOLING); + millis_t ms = millis(), next_report_ms = ms, next_test_ms = ms + 10000UL; celsius_float_t current_temp = degHotend(active_extruder), ambient_temp = current_temp; @@ -961,6 +961,7 @@ volatile bool Temperature::raw_temps_ready = false; next_test_ms += 10000UL; } } + wait_for_heatup = false; #if HAS_FAN set_fan_speed(EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0); @@ -970,7 +971,7 @@ volatile bool Temperature::raw_temps_ready = false; hotend.modeled_ambient_temp = ambient_temp; SERIAL_ECHOLNPGM(STR_MPC_HEATING_PAST_200); - LCD_MESSAGE(MSG_HEATING); + TERN(DWIN_LCD_PROUI, LCD_ALERTMESSAGE(MSG_MPC_HEATING_PAST_200), LCD_MESSAGE(MSG_HEATING)); hotend.target = 200.0f; // So M105 looks nice hotend.soft_pwm_amount = MPC_MAX >> 1; const millis_t heat_start_time = next_test_ms = ms; @@ -1012,17 +1013,17 @@ volatile bool Temperature::raw_temps_ready = false; float asymp_temp = (t2 * t2 - t1 * t3) / (2 * t2 - t1 - t3), block_responsiveness = -log((t2 - asymp_temp) / (t1 - asymp_temp)) / (sample_distance * (sample_count >> 1)); - constants.ambient_xfer_coeff_fan0 = constants.heater_power * (MPC_MAX) / 255 / (asymp_temp - ambient_temp); - constants.fan255_adjustment = 0.0f; - constants.block_heat_capacity = constants.ambient_xfer_coeff_fan0 / block_responsiveness; - constants.sensor_responsiveness = block_responsiveness / (1.0f - (ambient_temp - asymp_temp) * exp(-block_responsiveness * t1_time) / (t1 - asymp_temp)); + mpc.ambient_xfer_coeff_fan0 = mpc.heater_power * (MPC_MAX) / 255 / (asymp_temp - ambient_temp); + mpc.fan255_adjustment = 0.0f; + mpc.block_heat_capacity = mpc.ambient_xfer_coeff_fan0 / block_responsiveness; + mpc.sensor_responsiveness = block_responsiveness / (1.0f - (ambient_temp - asymp_temp) * exp(-block_responsiveness * t1_time) / (t1 - asymp_temp)); hotend.modeled_block_temp = asymp_temp + (ambient_temp - asymp_temp) * exp(-block_responsiveness * (ms - heat_start_time) / 1000.0f); hotend.modeled_sensor_temp = current_temp; // Allow the system to stabilize under MPC, then get a better measure of ambient loss with and without fan SERIAL_ECHOLNPGM(STR_MPC_MEASURING_AMBIENT, hotend.modeled_block_temp); - LCD_MESSAGE(MSG_MPC_MEASURING_AMBIENT); + TERN(DWIN_LCD_PROUI, LCD_ALERTMESSAGE(MSG_MPC_MEASURING_AMBIENT), LCD_MESSAGE(MSG_MPC_MEASURING_AMBIENT)); hotend.target = hotend.modeled_block_temp; next_test_ms = ms + MPC_dT * 1000; constexpr millis_t settle_time = 20000UL, test_duration = 20000UL; @@ -1042,7 +1043,7 @@ volatile bool Temperature::raw_temps_ready = false; hotend.soft_pwm_amount = (int)get_pid_output_hotend(active_extruder) >> 1; if (ELAPSED(ms, settle_end_ms) && !ELAPSED(ms, test_end_ms) && TERN1(HAS_FAN, !fan0_done)) - total_energy_fan0 += constants.heater_power * hotend.soft_pwm_amount / 127 * MPC_dT + (last_temp - current_temp) * constants.block_heat_capacity; + total_energy_fan0 += mpc.heater_power * hotend.soft_pwm_amount / 127 * MPC_dT + (last_temp - current_temp) * mpc.block_heat_capacity; #if HAS_FAN else if (ELAPSED(ms, test_end_ms) && !fan0_done) { set_fan_speed(EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); @@ -1052,7 +1053,7 @@ volatile bool Temperature::raw_temps_ready = false; fan0_done = true; } else if (ELAPSED(ms, settle_end_ms) && !ELAPSED(ms, test_end_ms)) - total_energy_fan255 += constants.heater_power * hotend.soft_pwm_amount / 127 * MPC_dT + (last_temp - current_temp) * constants.block_heat_capacity; + total_energy_fan255 += mpc.heater_power * hotend.soft_pwm_amount / 127 * MPC_dT + (last_temp - current_temp) * mpc.block_heat_capacity; #endif else if (ELAPSED(ms, test_end_ms)) break; @@ -1067,24 +1068,24 @@ volatile bool Temperature::raw_temps_ready = false; } const float power_fan0 = total_energy_fan0 * 1000 / test_duration; - constants.ambient_xfer_coeff_fan0 = power_fan0 / (hotend.target - ambient_temp); + mpc.ambient_xfer_coeff_fan0 = power_fan0 / (hotend.target - ambient_temp); #if HAS_FAN const float power_fan255 = total_energy_fan255 * 1000 / test_duration, ambient_xfer_coeff_fan255 = power_fan255 / (hotend.target - ambient_temp); - constants.fan255_adjustment = ambient_xfer_coeff_fan255 - constants.ambient_xfer_coeff_fan0; + mpc.applyFanAdjustment(ambient_xfer_coeff_fan255); #endif // Calculate a new and better asymptotic temperature and re-evaluate the other constants - asymp_temp = ambient_temp + constants.heater_power * (MPC_MAX) / 255 / constants.ambient_xfer_coeff_fan0; + asymp_temp = ambient_temp + mpc.heater_power * (MPC_MAX) / 255 / mpc.ambient_xfer_coeff_fan0; block_responsiveness = -log((t2 - asymp_temp) / (t1 - asymp_temp)) / (sample_distance * (sample_count >> 1)); - constants.block_heat_capacity = constants.ambient_xfer_coeff_fan0 / block_responsiveness; - constants.sensor_responsiveness = block_responsiveness / (1.0f - (ambient_temp - asymp_temp) * exp(-block_responsiveness * t1_time) / (t1 - asymp_temp)); + mpc.block_heat_capacity = mpc.ambient_xfer_coeff_fan0 / block_responsiveness; + mpc.sensor_responsiveness = block_responsiveness / (1.0f - (ambient_temp - asymp_temp) * exp(-block_responsiveness * t1_time) / (t1 - asymp_temp)); SERIAL_ECHOPGM(STR_MPC_AUTOTUNE); SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_FINISHED); - /* <-- add a slash to enable + #if 0 SERIAL_ECHOLNPGM("t1_time ", t1_time); SERIAL_ECHOLNPGM("sample_count ", sample_count); SERIAL_ECHOLNPGM("sample_distance ", sample_distance); @@ -1093,10 +1094,11 @@ volatile bool Temperature::raw_temps_ready = false; SERIAL_ECHOLNPGM("t1 ", t1, " t2 ", t2, " t3 ", t3); SERIAL_ECHOLNPGM("asymp_temp ", asymp_temp); SERIAL_ECHOLNPAIR_F("block_responsiveness ", block_responsiveness, 4); - //*/ - SERIAL_ECHOLNPGM("MPC_BLOCK_HEAT_CAPACITY ", constants.block_heat_capacity); - SERIAL_ECHOLNPAIR_F("MPC_SENSOR_RESPONSIVENESS ", constants.sensor_responsiveness, 4); - SERIAL_ECHOLNPAIR_F("MPC_AMBIENT_XFER_COEFF ", constants.ambient_xfer_coeff_fan0, 4); + #endif + + SERIAL_ECHOLNPGM("MPC_BLOCK_HEAT_CAPACITY ", mpc.block_heat_capacity); + SERIAL_ECHOLNPAIR_F("MPC_SENSOR_RESPONSIVENESS ", mpc.sensor_responsiveness, 4); + SERIAL_ECHOLNPAIR_F("MPC_AMBIENT_XFER_COEFF ", mpc.ambient_xfer_coeff_fan0, 4); TERN_(HAS_FAN, SERIAL_ECHOLNPAIR_F("MPC_AMBIENT_XFER_COEFF_FAN255 ", ambient_xfer_coeff_fan255, 4)); } @@ -1413,7 +1415,7 @@ void Temperature::mintemp_error(const heater_id_t heater_id) { #elif ENABLED(MPCTEMP) MPCHeaterInfo &hotend = temp_hotend[ee]; - MPC_t &constants = hotend.constants; + MPC_t &mpc = hotend.mpc; // At startup, initialize modeled temperatures if (isnan(hotend.modeled_block_temp)) { @@ -1427,11 +1429,11 @@ void Temperature::mintemp_error(const heater_id_t heater_id) { const bool this_hotend = (ee == active_extruder); #endif - float ambient_xfer_coeff = constants.ambient_xfer_coeff_fan0; + float ambient_xfer_coeff = mpc.ambient_xfer_coeff_fan0; #if ENABLED(MPC_INCLUDE_FAN) const uint8_t fan_index = EITHER(MPC_FAN_0_ACTIVE_HOTEND, MPC_FAN_0_ALL_HOTENDS) ? 0 : ee; const float fan_fraction = TERN_(MPC_FAN_0_ACTIVE_HOTEND, !this_hotend ? 0.0f : ) fan_speed[fan_index] * RECIPROCAL(255); - ambient_xfer_coeff += fan_fraction * constants.fan255_adjustment; + ambient_xfer_coeff += fan_fraction * mpc.fan255_adjustment; #endif if (this_hotend) { @@ -1442,17 +1444,17 @@ void Temperature::mintemp_error(const heater_id_t heater_id) { if (fabs(e_speed) > planner.settings.max_feedrate_mm_s[E_AXIS]) mpc_e_position = e_position; else if (e_speed > 0.0f) { // Ignore retract/recover moves - ambient_xfer_coeff += e_speed * constants.filament_heat_capacity_permm; + ambient_xfer_coeff += e_speed * mpc.filament_heat_capacity_permm; mpc_e_position = e_position; } } // Update the modeled temperatures - float blocktempdelta = hotend.soft_pwm_amount * constants.heater_power * (MPC_dT / 127) / constants.block_heat_capacity; - blocktempdelta += (hotend.modeled_ambient_temp - hotend.modeled_block_temp) * ambient_xfer_coeff * MPC_dT / constants.block_heat_capacity; + float blocktempdelta = hotend.soft_pwm_amount * mpc.heater_power * (MPC_dT / 127) / mpc.block_heat_capacity; + blocktempdelta += (hotend.modeled_ambient_temp - hotend.modeled_block_temp) * ambient_xfer_coeff * MPC_dT / mpc.block_heat_capacity; hotend.modeled_block_temp += blocktempdelta; - const float sensortempdelta = (hotend.modeled_block_temp - hotend.modeled_sensor_temp) * (constants.sensor_responsiveness * MPC_dT); + const float sensortempdelta = (hotend.modeled_block_temp - hotend.modeled_sensor_temp) * (mpc.sensor_responsiveness * MPC_dT); hotend.modeled_sensor_temp += sensortempdelta; // Any delta between hotend.modeled_sensor_temp and hotend.celsius is either model @@ -1468,11 +1470,11 @@ void Temperature::mintemp_error(const heater_id_t heater_id) { float power = 0.0; if (hotend.target != 0 && !is_idling) { // Plan power level to get to target temperature in 2 seconds - power = (hotend.target - hotend.modeled_block_temp) * constants.block_heat_capacity / 2.0f; + power = (hotend.target - hotend.modeled_block_temp) * mpc.block_heat_capacity / 2.0f; power -= (hotend.modeled_ambient_temp - hotend.modeled_block_temp) * ambient_xfer_coeff; } - float pid_output = power * 254.0f / constants.heater_power + 1.0f; // Ensure correct quantization into a range of 0 to 127 + float pid_output = power * 254.0f / mpc.heater_power + 1.0f; // Ensure correct quantization into a range of 0 to 127 pid_output = constrain(pid_output, 0, MPC_MAX); /* <-- add a slash to enable diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index d099c3d73b361..0b5f8caf3facb 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -382,10 +382,14 @@ typedef struct { float p, i, d, c, f; } raw_pidcf_t; float block_heat_capacity; // M306 C float sensor_responsiveness; // M306 R float ambient_xfer_coeff_fan0; // M306 A + float filament_heat_capacity_permm; // M306 H #if ENABLED(MPC_INCLUDE_FAN) float fan255_adjustment; // M306 F + void applyFanAdjustment(const_float_t cf) { fan255_adjustment = cf - ambient_xfer_coeff_fan0; } + #else + void applyFanAdjustment(const_float_t) {} #endif - float filament_heat_capacity_permm; // M306 H + float fanCoefficient() { return SUM_TERN(MPC_INCLUDE_FAN, ambient_xfer_coeff_fan0, fan255_adjustment); } } MPC_t; #define MPC_dT ((OVERSAMPLENR * float(ACTUAL_ADC_SAMPLES)) / (TEMP_TIMER_FREQUENCY)) @@ -433,10 +437,12 @@ struct PIDHeaterInfo : public HeaterInfo { #if ENABLED(MPCTEMP) struct MPCHeaterInfo : public HeaterInfo { - MPC_t constants; + MPC_t mpc; float modeled_ambient_temp, modeled_block_temp, modeled_sensor_temp; + float fanCoefficient() { return mpc.fanCoefficient(); } + void applyFanAdjustment(const_float_t cf) { mpc.applyFanAdjustment(cf); } }; #endif From 938d7b5e14fadf7c0f63bfaf4726f7ce5045e27b Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 16 Jan 2023 00:22:07 +0000 Subject: [PATCH 12/54] [cron] Bump distribution date (2023-01-16) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index b3dce84c47761..9fea3cacaca78 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-15" +//#define STRING_DISTRIBUTION_DATE "2023-01-16" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 52dd76d83412d..b93139f87dd4c 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 "2023-01-15" + #define STRING_DISTRIBUTION_DATE "2023-01-16" #endif /** From c4482083ac901b1691662ed01ec89f8a2cba6874 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 16 Jan 2023 22:11:49 -0600 Subject: [PATCH 13/54] =?UTF-8?q?=F0=9F=8E=A8=20Heading=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/STM32F1/onboard_sd.h | 28 ++++++++++++++++--- .../stm32f4/pins_MKS_ROBIN_NANO_V3_common.h | 1 - 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Marlin/src/HAL/STM32F1/onboard_sd.h b/Marlin/src/HAL/STM32F1/onboard_sd.h index f228d068c9dbb..f8846e95bcaa1 100644 --- a/Marlin/src/HAL/STM32F1/onboard_sd.h +++ b/Marlin/src/HAL/STM32F1/onboard_sd.h @@ -1,11 +1,31 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + /*----------------------------------------------------------------------- -/ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] / * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech] -/ * Low level disk interface module include file (C)ChaN, 2015 +/ * Low level disk interface module include file (c) ChaN, 2015 /-----------------------------------------------------------------------*/ -#pragma once - #define _DISKIO_WRITE 1 /* 1: Enable disk_write function */ #define _DISKIO_IOCTL 1 /* 1: Enable disk_ioctl function */ #define _DISKIO_ISDIO 0 /* 1: Enable iSDIO control function */ diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h index 603da09d14ef7..d26811199bc8b 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -19,7 +19,6 @@ * along with this program. If not, see . * */ - #pragma once // From 58f64eaeba35107cff15ed225577c553b23a6627 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 17 Jan 2023 06:05:52 +0000 Subject: [PATCH 14/54] [cron] Bump distribution date (2023-01-17) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 9fea3cacaca78..a4c4a580c832c 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-16" +//#define STRING_DISTRIBUTION_DATE "2023-01-17" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index b93139f87dd4c..cd87b9255c46e 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 "2023-01-16" + #define STRING_DISTRIBUTION_DATE "2023-01-17" #endif /** From 99d1b04a1f1d66aef78994fd98189a9ba9acbcb1 Mon Sep 17 00:00:00 2001 From: alexgrach Date: Wed, 18 Jan 2023 02:37:19 +0300 Subject: [PATCH 15/54] =?UTF-8?q?=E2=9C=A8=20TFT=20320x240=20portrait=20(#?= =?UTF-8?q?25207)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/inc/Conditionals_LCD.h | 84 +++- Marlin/src/lcd/tft/tft.h | 16 - Marlin/src/lcd/tft/tft_font.h | 1 - Marlin/src/lcd/tft/ui_1024x600.cpp | 20 +- Marlin/src/lcd/tft/ui_1024x600.h | 6 +- Marlin/src/lcd/tft/ui_320x240.cpp | 456 +++++++++++++----- Marlin/src/lcd/tft/ui_320x240.h | 2 + Marlin/src/lcd/tft/ui_480x320.cpp | 8 +- Marlin/src/lcd/tft_io/tft_io.h | 17 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h | 27 +- buildroot/tests/mks_robin_nano_v1v2_maple | 9 +- 11 files changed, 430 insertions(+), 216 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 88d7c91c6ef34..af9dd22557997 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -324,7 +324,7 @@ #define IS_ULTIPANEL 1 #endif -// TFT Compatibility +// TFT Legacy Compatibility #if ANY(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT, TFT_320x240, TFT_480x320, TFT_320x240_SPI, TFT_480x320_SPI, TFT_LVGL_UI_FSMC, TFT_LVGL_UI_SPI) #define IS_LEGACY_TFT 1 #define TFT_GENERIC @@ -1525,30 +1525,6 @@ #endif #endif -#if ENABLED(TFT_RES_320x240) - #define TFT_WIDTH 320 - #define TFT_HEIGHT 240 - #define GRAPHICAL_TFT_UPSCALE 2 -#elif ENABLED(TFT_RES_480x272) - #define TFT_WIDTH 480 - #define TFT_HEIGHT 272 - #define GRAPHICAL_TFT_UPSCALE 2 -#elif ENABLED(TFT_RES_480x320) - #define TFT_WIDTH 480 - #define TFT_HEIGHT 320 - #define GRAPHICAL_TFT_UPSCALE 3 -#elif ENABLED(TFT_RES_1024x600) - #define TFT_WIDTH 1024 - #define TFT_HEIGHT 600 - #if ENABLED(TOUCH_SCREEN) - #define GRAPHICAL_TFT_UPSCALE 6 - #define TFT_PIXEL_OFFSET_X 120 - #else - #define GRAPHICAL_TFT_UPSCALE 8 - #define TFT_PIXEL_OFFSET_X 0 - #endif -#endif - // FSMC/SPI TFT Panels using standard HAL/tft/tft_(fsmc|spi|ltdc).h #if ENABLED(TFT_INTERFACE_FSMC) #define HAS_FSMC_TFT 1 @@ -1573,8 +1549,62 @@ #endif #endif +// Set TFT_COLOR_UI_PORTRAIT flag, if needed +#if defined(TFT_ROTATION) && (HAS_SPI_TFT || HAS_FSMC_TFT || HAS_LTDC_TFT) + #define _CMP_TFT_ROTATE_90 90 + #define _CMP_TFT_ROTATE_270 270 + #define _CMP_TFT_ROTATE_90_MIRROR_X 90 + #define _CMP_TFT_ROTATE_90_MIRROR_Y 90 + #define _CMP_TFT_ROTATE_270_MIRROR_X 270 + #define _CMP_TFT_ROTATE_270_MIRROR_Y 270 + #define _ISROT(N) || (_CAT(_CMP_, TFT_ROTATION) == N) + #define ISROT(V...) (0 MAP(_ISROT, V)) + + #if ISROT(90, 270) + #define TFT_COLOR_UI_PORTRAIT 1 + #endif + + #undef _CMP_TFT_ROTATE_90 + #undef _CMP_TFT_ROTATE_270 + #undef _CMP_TFT_ROTATE_90_MIRROR_X + #undef _CMP_TFT_ROTATE_90_MIRROR_Y + #undef _CMP_TFT_ROTATE_270_MIRROR_X + #undef _CMP_TFT_ROTATE_270_MIRROR_Y + #undef _ISROT + #undef ISROT +#endif + +#if ENABLED(TFT_RES_320x240) + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + #define TFT_WIDTH 240 + #define TFT_HEIGHT 320 + #else + #define TFT_WIDTH 320 + #define TFT_HEIGHT 240 + #endif + #define GRAPHICAL_TFT_UPSCALE 2 +#elif ENABLED(TFT_RES_480x272) + #define TFT_WIDTH 480 + #define TFT_HEIGHT 272 + #define GRAPHICAL_TFT_UPSCALE 2 +#elif ENABLED(TFT_RES_480x320) + #define TFT_WIDTH 480 + #define TFT_HEIGHT 320 + #define GRAPHICAL_TFT_UPSCALE 3 +#elif ENABLED(TFT_RES_1024x600) + #define TFT_WIDTH 1024 + #define TFT_HEIGHT 600 + #if ENABLED(TOUCH_SCREEN) + #define GRAPHICAL_TFT_UPSCALE 6 + #define TFT_PIXEL_OFFSET_X 120 + #else + #define GRAPHICAL_TFT_UPSCALE 8 + #define TFT_PIXEL_OFFSET_X 0 + #endif +#endif + #if ENABLED(TFT_COLOR_UI) - #if TFT_HEIGHT == 240 + #if (TFT_WIDTH == 320 && TFT_HEIGHT == 240) || (TFT_WIDTH == 240 && TFT_HEIGHT == 320) #if ENABLED(TFT_INTERFACE_SPI) #define TFT_320x240_SPI #elif ENABLED(TFT_INTERFACE_FSMC) @@ -1612,6 +1642,8 @@ #endif #if ANY(HAS_UI_320x240, HAS_UI_480x320, HAS_UI_480x272) #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen +#elif HAS_UI_240x320 + #define LCD_HEIGHT TERN(TOUCH_SCREEN, 8, 6) // Fewer lines with touch buttons onscreen #elif HAS_UI_1024x600 #define LCD_HEIGHT TERN(TOUCH_SCREEN, 12, 13) // Fewer lines with touch buttons onscreen #endif diff --git a/Marlin/src/lcd/tft/tft.h b/Marlin/src/lcd/tft/tft.h index 6df4c22d5191c..7dc3996148ab4 100644 --- a/Marlin/src/lcd/tft/tft.h +++ b/Marlin/src/lcd/tft/tft.h @@ -37,22 +37,6 @@ #define ENDIAN_COLOR(C) (C) #endif -#if HAS_UI_320x240 - #define TFT_WIDTH 320 - #define TFT_HEIGHT 240 -#elif HAS_UI_480x320 - #define TFT_WIDTH 480 - #define TFT_HEIGHT 320 -#elif HAS_UI_480x272 - #define TFT_WIDTH 480 - #define TFT_HEIGHT 272 -#elif HAS_UI_1024x600 - #define TFT_WIDTH 1024 - #define TFT_HEIGHT 600 -#else - #error "Unsupported display resolution!" -#endif - #ifndef TFT_BUFFER_SIZE #ifdef STM32F103xB #define TFT_BUFFER_SIZE 1024 diff --git a/Marlin/src/lcd/tft/tft_font.h b/Marlin/src/lcd/tft/tft_font.h index 5ed5f8380cc5a..6c8838ed7c481 100644 --- a/Marlin/src/lcd/tft/tft_font.h +++ b/Marlin/src/lcd/tft/tft_font.h @@ -37,5 +37,4 @@ extern const uint8_t SYMBOLS_FONT_NAME[]; extern const uint8_t EXTRA_FONT_NAME[]; #endif - #endif // HAS_GRAPHICAL_TFT diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index 6511757d7dfaa..f3eb83eb9f50e 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -700,12 +700,12 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { probe.offset.z = new_offs; else TERN(BABYSTEP_HOTEND_Z_OFFSET, hotend_offset[active_extruder].z = new_offs, NOOP); - drawMessage(""); // clear the error + drawMessage(F("")); // clear the error drawAxisValue(axis); } - else { + else drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); - } + #elif HAS_BED_PROBE // only change probe.offset.z probe.offset.z += diff; @@ -717,9 +717,9 @@ static void moveAxis(const AxisEnum axis, const int8_t direction) { current_position[axis] = Z_PROBE_OFFSET_RANGE_MAX; drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } - else { - drawMessage(""); // clear the error - } + else + drawMessage(F("")); // clear the error + drawAxisValue(axis); #endif return; @@ -765,10 +765,8 @@ static void z_minus() { moveAxis(Z_AXIS, -1); } #if ENABLED(TOUCH_SCREEN) static void e_select() { - motionAxisState.e_selection++; - if (motionAxisState.e_selection >= EXTRUDERS) { + if (++motionAxisState.e_selection >= EXTRUDERS) motionAxisState.e_selection = 0; - } quick_feedback(); drawCurESelection(); @@ -810,8 +808,8 @@ static void disable_steppers() { } static void drawBtn(int x, int y, const char *label, intptr_t data, MarlinImage img, uint16_t bgColor, bool enabled = true) { - uint16_t width = Images[imgBtn52Rounded].width; - uint16_t height = Images[imgBtn52Rounded].height; + uint16_t width = Images[imgBtn52Rounded].width, + height = Images[imgBtn52Rounded].height; if (!enabled) bgColor = COLOR_CONTROL_DISABLED; diff --git a/Marlin/src/lcd/tft/ui_1024x600.h b/Marlin/src/lcd/tft/ui_1024x600.h index 855b0db865f93..c6b5d9f85ec16 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.h +++ b/Marlin/src/lcd/tft/ui_1024x600.h @@ -35,15 +35,15 @@ #define MENU_ITEM_ICON_Y 5 #define MENU_ITEM_ICON_SPACE 42 +#define MENU_ITEM_HEIGHT 43 +#define MENU_LINE_HEIGHT (MENU_ITEM_HEIGHT + 2) + #if (TFT_FONT == NOTOSANS) || (TFT_FONT == HELVETICA) #define FONT_SIZE 19 #elif TFT_FONT == UNIFONT #define FONT_SIZE 20 #endif -#define MENU_ITEM_HEIGHT 43 #define FONT_LINE_HEIGHT 34 -#define MENU_LINE_HEIGHT (MENU_ITEM_HEIGHT + 2) - #include "tft_font.h" diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 85ed59b2cce99..07fa95732726f 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -49,9 +49,11 @@ void MarlinUI::tft_idle() { #if ENABLED(TOUCH_SCREEN) if (TERN0(HAS_TOUCH_SLEEP, lcd_sleep_task())) return; if (draw_menu_navigation) { - add_control(48, 206, PAGE_UP, imgPageUp, encoderTopLine > 0); - add_control(240, 206, PAGE_DOWN, imgPageDown, encoderTopLine + LCD_HEIGHT < screen_items); - add_control(144, 206, BACK, imgBack); + constexpr uint16_t cx = TERN(TFT_COLOR_UI_PORTRAIT, 16, 48), + cy = TERN(TFT_COLOR_UI_PORTRAIT, 286, 206); + add_control(cx, cy, PAGE_UP, imgPageUp, encoderTopLine > 0); + add_control(cx + 192, cy, PAGE_DOWN, imgPageDown, encoderTopLine + LCD_HEIGHT < screen_items); + add_control(cx + 96, cy, BACK, imgBack); draw_menu_navigation = false; } #endif @@ -97,19 +99,19 @@ void MarlinUI::draw_kill_screen() { tft.queue.reset(); tft.fill(0, 0, TFT_WIDTH, TFT_HEIGHT, COLOR_KILL_SCREEN_BG); - tft.canvas(0, 60, TFT_WIDTH, 24); + tft.canvas(0, 60, TFT_WIDTH, FONT_LINE_HEIGHT); tft.set_background(COLOR_KILL_SCREEN_BG); tft_string.set(status_message); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), 0, COLOR_KILL_SCREEN_TEXT, tft_string); - tft.canvas(0, 120, TFT_WIDTH, 24); + tft.canvas(0, 120, TFT_WIDTH, FONT_LINE_HEIGHT); tft.set_background(COLOR_KILL_SCREEN_BG); tft_string.set(GET_TEXT(MSG_HALTED)); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), 0, COLOR_KILL_SCREEN_TEXT, tft_string); - tft.canvas(0, 160, TFT_WIDTH, 24); + tft.canvas(0, 160, TFT_WIDTH, FONT_LINE_HEIGHT); tft.set_background(COLOR_KILL_SCREEN_BG); tft_string.set(GET_TEXT(MSG_PLEASE_RESET)); tft_string.trim(); @@ -185,13 +187,13 @@ void draw_heater_status(uint16_t x, uint16_t y, const int8_t Heater) { tft_string.set(i16tostr3rj(currentTemperature)); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); - tft.add_text(tft_string.center(64) + 2, 69 + tft_string.vcenter(24), Color, tft_string); + tft.add_text(tft_string.center(64) + 2, 69 + tft_string.vcenter(FONT_LINE_HEIGHT), Color, tft_string); if (targetTemperature >= 0) { tft_string.set(i16tostr3rj(targetTemperature)); tft_string.add(LCD_STR_DEGREE); tft_string.trim(); - tft.add_text(tft_string.center(64) + 2, 5 + tft_string.vcenter(24), Color, tft_string); + tft.add_text(tft_string.center(64) + 2, 5 + tft_string.vcenter(FONT_LINE_HEIGHT), Color, tft_string); } } @@ -214,7 +216,7 @@ void draw_fan_status(uint16_t x, uint16_t y, const bool blink) { tft_string.set(ui8tostr4pctrj(thermalManager.fan_speed[0])); tft_string.trim(); - tft.add_text(tft_string.center(64) + 6, 69 + tft_string.vcenter(24), COLOR_FAN, tft_string); + tft.add_text(tft_string.center(64) + 6, 69 + tft_string.vcenter(FONT_LINE_HEIGHT), COLOR_FAN, tft_string); } void MarlinUI::draw_status_screen() { @@ -226,7 +228,7 @@ void MarlinUI::draw_status_screen() { uint16_t i, x, y = TFT_STATUS_TOP_Y; for (i = 0 ; i < ITEMS_COUNT; i++) { - x = (320 / ITEMS_COUNT - 64) / 2 + (320 * i / ITEMS_COUNT); + x = (TFT_WIDTH / ITEMS_COUNT - 64) / 2 + (TFT_WIDTH * i / ITEMS_COUNT); switch (i) { #ifdef ITEM_E0 case ITEM_E0: draw_heater_status(x, y, H_E0); break; @@ -253,33 +255,60 @@ void MarlinUI::draw_status_screen() { } // coordinates - tft.canvas(4, 103, 312, 24); + tft.canvas(4, 103, + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 232, FONT_LINE_HEIGHT * 2 + #else + 312, FONT_LINE_HEIGHT + #endif + ); tft.set_background(COLOR_BACKGROUND); - tft.add_rectangle(0, 0, 312, 24, COLOR_AXIS_HOMED); + tft.add_rectangle(0, 0, + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 232, FONT_LINE_HEIGHT * 2 + #else + 312, FONT_LINE_HEIGHT + #endif + , COLOR_AXIS_HOMED + ); if (TERN0(LCD_SHOW_E_TOTAL, printingIsActive())) { #if ENABLED(LCD_SHOW_E_TOTAL) - tft.add_text( 10, tft_string.vcenter(24), COLOR_AXIS_HOMED , "E"); + tft.add_text( 10, tft_string.vcenter(FONT_LINE_HEIGHT), COLOR_AXIS_HOMED , "E"); const uint8_t escale = e_move_accumulator >= 100000.0f ? 10 : 1; // After 100m switch to cm tft_string.set(ftostr4sign(e_move_accumulator / escale)); tft_string.add(escale == 10 ? 'c' : 'm'); tft_string.add('m'); - tft.add_text(127 - tft_string.width(), tft_string.vcenter(24), COLOR_AXIS_HOMED, tft_string); + tft.add_text(127 - tft_string.width(), tft_string.vcenter(FONT_LINE_HEIGHT), COLOR_AXIS_HOMED, tft_string); #endif } else { - tft.add_text( 10, tft_string.vcenter(24), COLOR_AXIS_HOMED , "X"); + tft.add_text(TERN(TFT_COLOR_UI_PORTRAIT, 32, 10), tft_string.vcenter(FONT_LINE_HEIGHT), COLOR_AXIS_HOMED , "X"); const bool nhx = axis_should_home(X_AXIS); tft_string.set(blink && nhx ? "?" : ftostr4sign(LOGICAL_X_POSITION(current_position.x))); - tft.add_text( 68 - tft_string.width(), tft_string.vcenter(24), nhx ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); + tft.add_text( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 32 - tft_string.width() / 2, FONT_LINE_HEIGHT + tft_string.vcenter(FONT_LINE_HEIGHT), + #else + 68 - tft_string.width(), tft_string.vcenter(FONT_LINE_HEIGHT), + #endif + nhx ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string + ); - tft.add_text(127, tft_string.vcenter(24), COLOR_AXIS_HOMED , "Y"); + tft.add_text(TERN(TFT_COLOR_UI_PORTRAIT, 110, 127), tft_string.vcenter(FONT_LINE_HEIGHT), COLOR_AXIS_HOMED , "Y"); const bool nhy = axis_should_home(Y_AXIS); tft_string.set(blink && nhy ? "?" : ftostr4sign(LOGICAL_Y_POSITION(current_position.y))); - tft.add_text(185 - tft_string.width(), tft_string.vcenter(24), nhy ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); + tft.add_text( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 110 - tft_string.width() / 2, FONT_LINE_HEIGHT + tft_string.vcenter(FONT_LINE_HEIGHT), + #else + 185 - tft_string.width(), tft_string.vcenter(FONT_LINE_HEIGHT), + #endif + nhy ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string + ); } - tft.add_text(219, tft_string.vcenter(24), COLOR_AXIS_HOMED , "Z"); + tft.add_text(TERN(TFT_COLOR_UI_PORTRAIT, 192, 219), tft_string.vcenter(FONT_LINE_HEIGHT), COLOR_AXIS_HOMED , "Z"); const bool nhz = axis_should_home(Z_AXIS); uint16_t offset = 25; if (blink && nhz) @@ -293,61 +322,138 @@ void MarlinUI::draw_status_screen() { tft_string.set(ftostr52sp(z)); offset -= tft_string.width(); } - tft.add_text(301 - tft_string.width() - offset, tft_string.vcenter(24), nhz ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); - TERN_(TOUCH_SCREEN, touch.add_control(MOVE_AXIS, 0, 103, 312, 24)); + tft.add_text( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 192 - tft_string.width() / 2, FONT_LINE_HEIGHT + tft_string.vcenter(FONT_LINE_HEIGHT), + #else + 301 - tft_string.width() - offset, tft_string.vcenter(FONT_LINE_HEIGHT), + #endif + nhz ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); + TERN_(TOUCH_SCREEN, touch.add_control(MOVE_AXIS, 0, 103, + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 232, FONT_LINE_HEIGHT * 2 + #else + 312, FONT_LINE_HEIGHT + #endif + )); // feed rate - tft.canvas(70, 136, 84, 32); + tft.canvas( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 30, 172, 80 + #else + 70, 136, 84 + #endif + , 32 + ); tft.set_background(COLOR_BACKGROUND); uint16_t color = feedrate_percentage == 100 ? COLOR_RATE_100 : COLOR_RATE_ALTERED; tft.add_image(0, 0, imgFeedRate, color); tft_string.set(i16tostr3rj(feedrate_percentage)); tft_string.add('%'); tft.add_text(32, tft_string.vcenter(30), color , tft_string); - TERN_(TOUCH_SCREEN, touch.add_control(FEEDRATE, 70, 136, 84, 32)); + TERN_(TOUCH_SCREEN, touch.add_control(FEEDRATE, + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 30, 172, 80 + #else + 70, 136, 84 + #endif + , 32 + )); // flow rate - tft.canvas(170, 136, 84, 32); + tft.canvas( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 140, 172, 80 + #else + 170, 136, 84 + #endif + , 32 + ); tft.set_background(COLOR_BACKGROUND); color = planner.flow_percentage[0] == 100 ? COLOR_RATE_100 : COLOR_RATE_ALTERED; tft.add_image(0, 0, imgFlowRate, color); tft_string.set(i16tostr3rj(planner.flow_percentage[active_extruder])); tft_string.add('%'); tft.add_text(32, tft_string.vcenter(30), color , tft_string); - TERN_(TOUCH_SCREEN, touch.add_control(FLOWRATE, 170, 136, 84, 32, active_extruder)); + TERN_(TOUCH_SCREEN, touch.add_control(FLOWRATE, + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 140, 172, 80 + #else + 170, 136, 84 + #endif + , 32, active_extruder + )); // print duration char buffer[14]; duration_t elapsed = print_job_timer.duration(); elapsed.toDigital(buffer); - tft.canvas(96, 173, 128, 24); + tft.canvas( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 56, 256, 128 + #else + 96, 173, 128 + #endif + , FONT_LINE_HEIGHT + ); tft.set_background(COLOR_BACKGROUND); tft_string.set(buffer); - tft.add_text(tft_string.center(128), tft_string.vcenter(24), COLOR_PRINT_TIME, tft_string); + tft.add_text(tft_string.center(128), tft_string.vcenter(FONT_LINE_HEIGHT), COLOR_PRINT_TIME, tft_string); // progress bar const uint8_t progress = ui.get_progress_percent(); - tft.canvas(4, 198, 312, 9); + tft.canvas( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 4, 278, 232 + #else + 4, 198, 312 + #endif + , 9 + ); tft.set_background(COLOR_PROGRESS_BG); - tft.add_rectangle(0, 0, 312, 9, COLOR_PROGRESS_FRAME); + tft.add_rectangle(0, 0, + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 232, 9 + #else + 312, 9 + #endif + , COLOR_PROGRESS_FRAME + ); if (progress) - tft.add_bar(1, 1, (310 * progress) / 100, 7, COLOR_PROGRESS_BAR); + tft.add_bar(1, 1, ((TFT_WIDTH - 10) * progress) / 100, 7, COLOR_PROGRESS_BAR); // status message - tft.canvas(0, 212, 320, 24); + tft.canvas( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 0, 296, 240 + #else + 0, 212, 320 + #endif + , FONT_LINE_HEIGHT + ); tft.set_background(COLOR_BACKGROUND); tft_string.set(status_message); tft_string.trim(); - tft.add_text(tft_string.center(TFT_WIDTH), tft_string.vcenter(24), COLOR_STATUS_MESSAGE, tft_string); + tft.add_text(tft_string.center(TFT_WIDTH), tft_string.vcenter(FONT_LINE_HEIGHT), COLOR_STATUS_MESSAGE, tft_string); #if ENABLED(TOUCH_SCREEN) - add_control(256, 130, menu_main, imgSettings); + { + add_control( + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + 176, 210 + #else + 256, 130 + #endif + , menu_main, imgSettings + ); #if ENABLED(SDSUPPORT) const bool cm = card.isMounted(), pa = printingIsActive(); - add_control(0, 130, menu_media, imgSD, cm && !pa, COLOR_CONTROL_ENABLED, cm && pa ? COLOR_BUSY : COLOR_CONTROL_DISABLED); + add_control(0, TERN(TFT_COLOR_UI_PORTRAIT, 210, 130), menu_media, imgSD, cm && !pa, COLOR_CONTROL_ENABLED, cm && pa ? COLOR_BUSY : COLOR_CONTROL_DISABLED); #endif - #endif + } // (sublime) + #endif // TOUCH_SCREEN } // Low-level draw_edit_screen can be used to draw an edit screen from anyplace @@ -412,9 +518,9 @@ void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const va void TFT::draw_edit_screen_buttons() { #if ENABLED(TOUCH_SCREEN) - add_control(32, TFT_HEIGHT - 64, DECREASE, imgDecrease); - add_control(224, TFT_HEIGHT - 64, INCREASE, imgIncrease); - add_control(128, TFT_HEIGHT - 64, CLICK, imgConfirm); + add_control(TERN(TFT_COLOR_UI_PORTRAIT, 16, 32), TFT_HEIGHT - 64, DECREASE, imgDecrease); + add_control(TERN(TFT_COLOR_UI_PORTRAIT, 172, 224), TFT_HEIGHT - 64, INCREASE, imgIncrease); + add_control(TERN(TFT_COLOR_UI_PORTRAIT, 96, 128), TFT_HEIGHT - 64, CLICK, imgConfirm); #endif } @@ -443,8 +549,8 @@ void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, con tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string); } #if ENABLED(TOUCH_SCREEN) - if (no) add_control( 48, TFT_HEIGHT - 64, CANCEL, imgCancel, true, yesno ? HALF(COLOR_CONTROL_CANCEL) : COLOR_CONTROL_CANCEL); - if (yes) add_control(208, TFT_HEIGHT - 64, CONFIRM, imgConfirm, true, yesno ? COLOR_CONTROL_CONFIRM : HALF(COLOR_CONTROL_CONFIRM)); + if (no) add_control(TERN(TFT_COLOR_UI_PORTRAIT, 32, 48), TFT_HEIGHT - 64, CANCEL, imgCancel, true, yesno ? HALF(COLOR_CONTROL_CANCEL) : COLOR_CONTROL_CANCEL); + if (yes) add_control(TERN(TFT_COLOR_UI_PORTRAIT, 172, 208), TFT_HEIGHT - 64, CONFIRM, imgConfirm, true, yesno ? COLOR_CONTROL_CONFIRM : HALF(COLOR_CONTROL_CONFIRM)); #endif } @@ -625,9 +731,16 @@ static void drawCurESelection() { } static void drawMessage(PGM_P const msg) { - tft.canvas(X_MARGIN, TFT_HEIGHT - Y_MARGIN - 29, (TFT_WIDTH / 2) - (BTN_WIDTH / 2) - X_MARGIN, 20); + tft.canvas(X_MARGIN, + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + TFT_HEIGHT - 2 * BTN_HEIGHT, TFT_WIDTH - X_MARGIN + #else + TFT_HEIGHT - Y_MARGIN - 29, (TFT_WIDTH / 2) - (BTN_WIDTH / 2) - X_MARGIN + #endif + , FONT_LINE_HEIGHT + ); tft.set_background(COLOR_BACKGROUND); - tft.add_text(0, 0, COLOR_YELLOW, msg); + tft.add_text(0, 0, COLOR_STATUS_MESSAGE, msg); } static void drawMessage(FSTR_P const fmsg) { drawMessage(FTOP(fmsg)); } @@ -646,7 +759,7 @@ static void drawAxisValue(const AxisEnum axis) { case E_AXIS: pos = motionAxisState.eValuePos; color = E_BTN_COLOR; break; default: return; } - tft.canvas(pos.x, pos.y, BTN_WIDTH + X_MARGIN, 20); + tft.canvas(pos.x, pos.y, BTN_WIDTH + X_MARGIN, FONT_LINE_HEIGHT); tft.set_background(COLOR_BACKGROUND); tft_string.set(ftostr52sp(value)); tft.add_text(0, 0, color, tft_string); @@ -745,10 +858,8 @@ static void z_minus() { moveAxis(Z_AXIS, -1); } #if ENABLED(TOUCH_SCREEN) static void e_select() { - motionAxisState.e_selection++; - if (motionAxisState.e_selection >= EXTRUDERS) { + if (++motionAxisState.e_selection >= EXTRUDERS) motionAxisState.e_selection = 0; - } quick_feedback(); drawCurESelection(); @@ -773,16 +884,17 @@ static void z_minus() { moveAxis(Z_AXIS, -1); } quick_feedback(); drawCurStepValue(); } -#endif -#if BOTH(HAS_BED_PROBE, TOUCH_SCREEN) - static void z_select() { - motionAxisState.z_selection *= -1; - quick_feedback(); - drawCurZSelection(); - drawAxisValue(Z_AXIS); - } -#endif + #if HAS_BED_PROBE + static void z_select() { + motionAxisState.z_selection *= -1; + quick_feedback(); + drawCurZSelection(); + drawAxisValue(Z_AXIS); + } + #endif + +#endif // TOUCH_SCREEN static void disable_steppers() { quick_feedback(); @@ -805,12 +917,12 @@ static void drawBtn(int x, int y, const char *label, intptr_t data, MarlinImage tft_string.trim(); tft.add_text(tft_string.center(width), height / 2 - tft_string.font_height() / 2, bgColor, tft_string); } - else { + else tft.add_image(0, 0, img, bgColor, COLOR_BACKGROUND, COLOR_DARKGREY); - } TERN_(HAS_TFT_XPT2046, if (enabled) touch.add_control(BUTTON, x, y, width, height, data)); } + void MarlinUI::move_axis_screen() { // Reset defer_status_screen(true); @@ -827,93 +939,187 @@ void MarlinUI::move_axis_screen() { if (busy && ENABLED(BABYSTEP_ZPROBE_OFFSET)) motionAxisState.z_selection = Z_SELECTION_Z_PROBE; - // ROW 1 -> E- Y- CurY Z+ - int x = X_MARGIN, y = Y_MARGIN, spacing = 0; + #if ENABLED(TFT_COLOR_UI_PORTRAIT) - drawBtn(x, y, "E+", (intptr_t)e_plus, imgUp, E_BTN_COLOR, !busy); + // ROW 1 -> E+ Y+ Z+ + int x = X_MARGIN, y = Y_MARGIN, spacing = 0; - spacing = (TFT_WIDTH - X_MARGIN * 2 - 3 * BTN_WIDTH) / 2; - x += BTN_WIDTH + spacing; - uint16_t yplus_x = x; - drawBtn(x, y, "Y+", (intptr_t)y_plus, imgUp, Y_BTN_COLOR, !busy); + drawBtn(x, y, "E+", (intptr_t)e_plus, imgUp, E_BTN_COLOR, !busy); - // Cur Y - x += BTN_WIDTH; - motionAxisState.yValuePos.x = x + 2; - motionAxisState.yValuePos.y = y; - drawAxisValue(Y_AXIS); + spacing = (TFT_WIDTH - X_MARGIN * 2 - 3 * BTN_WIDTH) / 2; + x += BTN_WIDTH + spacing; + uint16_t yplus_x = x; + drawBtn(x, y, "Y+", (intptr_t)y_plus, imgUp, Y_BTN_COLOR, !busy); - x += spacing; - drawBtn(x, y, "Z+", (intptr_t)z_plus, imgUp, Z_BTN_COLOR, !busy || ENABLED(BABYSTEP_ZPROBE_OFFSET)); //only enabled when not busy or have baby step + x += BTN_WIDTH + spacing; + uint16_t zplus_x = x; + drawBtn(x, y, "Z+", (intptr_t)z_plus, imgUp, Z_BTN_COLOR, !busy || ENABLED(BABYSTEP_ZPROBE_OFFSET)); //only enabled when not busy or have baby step - // ROW 2 -> "Ex" X- HOME X+ "Z" - y += BTN_HEIGHT + (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3; - x = X_MARGIN; - spacing = (TFT_WIDTH - X_MARGIN * 2 - 5 * BTN_WIDTH) / 4; + // ROW 2 -> "Ex" CurY "Z" + x = X_MARGIN; + y += BTN_HEIGHT + 2; - motionAxisState.eNamePos.x = x; - motionAxisState.eNamePos.y = y; - drawCurESelection(); - TERN_(HAS_TFT_XPT2046, if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, BTN_HEIGHT, (intptr_t)e_select)); + motionAxisState.eNamePos.x = x; + motionAxisState.eNamePos.y = y; + drawCurESelection(); + TERN_(HAS_TFT_XPT2046, if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, BTN_HEIGHT, (intptr_t)e_select)); - x += BTN_WIDTH + spacing; - drawBtn(x, y, "X-", (intptr_t)x_minus, imgLeft, X_BTN_COLOR, !busy); + motionAxisState.yValuePos.x = yplus_x; + motionAxisState.yValuePos.y = y; + drawAxisValue(Y_AXIS); - x += BTN_WIDTH + spacing; //imgHome is 64x64 - TERN_(HAS_TFT_XPT2046, add_control(TFT_WIDTH / 2 - Images[imgHome].width / 2, y - (Images[imgHome].width - BTN_HEIGHT) / 2, BUTTON, (intptr_t)do_home, imgHome, !busy)); + motionAxisState.zTypePos.x = zplus_x; + motionAxisState.zTypePos.y = y; + drawCurZSelection(); - x += BTN_WIDTH + spacing; - uint16_t xplus_x = x; - drawBtn(x, y, "X+", (intptr_t)x_plus, imgRight, X_BTN_COLOR, !busy); + // ROW 3 -> X- HOME X+ + y += (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3 - 2; + x = X_MARGIN; - x += BTN_WIDTH + spacing; - motionAxisState.zTypePos.x = x; - motionAxisState.zTypePos.y = y; - drawCurZSelection(); - #if BOTH(HAS_BED_PROBE, TOUCH_SCREEN) - if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, 34 * 2, (intptr_t)z_select); - #endif + drawBtn(x, y, "X-", (intptr_t)x_minus, imgLeft, X_BTN_COLOR, !busy); - // ROW 3 -> E- CurX Y- Z- - y += BTN_HEIGHT + (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3; - x = X_MARGIN; - spacing = (TFT_WIDTH - X_MARGIN * 2 - 3 * BTN_WIDTH) / 2; + TERN_(HAS_TFT_XPT2046, add_control(TFT_WIDTH / 2 - Images[imgHome].width / 2, y - (Images[imgHome].width - BTN_HEIGHT) / 2, BUTTON, (intptr_t)do_home, imgHome, !busy)); - drawBtn(x, y, "E-", (intptr_t)e_minus, imgDown, E_BTN_COLOR, !busy); + drawBtn(zplus_x, y, "X+", (intptr_t)x_plus, imgRight, X_BTN_COLOR, !busy); - // Cur E - motionAxisState.eValuePos.x = x; - motionAxisState.eValuePos.y = y + BTN_HEIGHT + 2; - drawAxisValue(E_AXIS); + #if BOTH(HAS_BED_PROBE, TOUCH_SCREEN) + if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, 34 * 2, (intptr_t)z_select); + #endif - // Cur X - motionAxisState.xValuePos.x = BTN_WIDTH + (TFT_WIDTH - X_MARGIN * 2 - 5 * BTN_WIDTH) / 4; //X- pos - motionAxisState.xValuePos.y = y - 10; - drawAxisValue(X_AXIS); + // ROW 4 -> Cur X + y += BTN_HEIGHT + 2; - x += BTN_WIDTH + spacing; - drawBtn(x, y, "Y-", (intptr_t)y_minus, imgDown, Y_BTN_COLOR, !busy); + motionAxisState.xValuePos.x = x; + motionAxisState.xValuePos.y = y; + drawAxisValue(X_AXIS); - x += BTN_WIDTH + spacing; - drawBtn(x, y, "Z-", (intptr_t)z_minus, imgDown, Z_BTN_COLOR, !busy || ENABLED(BABYSTEP_ZPROBE_OFFSET)); //only enabled when not busy or have baby step + // ROW 5 -> E- CurX Y- Z- + y += (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3 - 2; + x = X_MARGIN; - // Cur Z - motionAxisState.zValuePos.x = x; - motionAxisState.zValuePos.y = y + BTN_HEIGHT + 2; - drawAxisValue(Z_AXIS); + drawBtn(x, y, "E-", (intptr_t)e_minus, imgDown, E_BTN_COLOR, !busy); - // ROW 4 -> step_size disable steppers back - y = TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT; // - x = xplus_x - CUR_STEP_VALUE_WIDTH - 10; - motionAxisState.stepValuePos.x = yplus_x + BTN_WIDTH - CUR_STEP_VALUE_WIDTH; - motionAxisState.stepValuePos.y = TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT; - if (!busy) { - drawCurStepValue(); - TERN_(HAS_TFT_XPT2046, touch.add_control(BUTTON, motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT, (intptr_t)step_size)); - } + // Cur E + motionAxisState.eValuePos.x = x; + motionAxisState.eValuePos.y = y + BTN_HEIGHT + 2; + drawAxisValue(E_AXIS); + + x += BTN_WIDTH + spacing; + drawBtn(x, y, "Y-", (intptr_t)y_minus, imgDown, Y_BTN_COLOR, !busy); + + x += BTN_WIDTH + spacing; + drawBtn(x, y, "Z-", (intptr_t)z_minus, imgDown, Z_BTN_COLOR, !busy || ENABLED(BABYSTEP_ZPROBE_OFFSET)); //only enabled when not busy or have baby step + + // Cur Z + motionAxisState.zValuePos.x = x; + motionAxisState.zValuePos.y = y + BTN_HEIGHT + 2; + drawAxisValue(Z_AXIS); + + // ROW 6 -> step_size disable steppers back + y = TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT; // + x = zplus_x - CUR_STEP_VALUE_WIDTH - 10; + motionAxisState.stepValuePos.x = X_MARGIN + BTN_WIDTH - CUR_STEP_VALUE_WIDTH; + motionAxisState.stepValuePos.y = TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT; + + if (!busy) { + drawCurStepValue(); + TERN_(HAS_TFT_XPT2046, touch.add_control(BUTTON, motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT, (intptr_t)step_size)); + } + + // aligned with x+ + drawBtn(yplus_x, y, "off", (intptr_t)disable_steppers, imgCancel, COLOR_WHITE, !busy); + + #else // !TFT_COLOR_UI_PORTRAIT + + // ROW 1 -> E+ Y+ CurY Z+ + int x = X_MARGIN, y = Y_MARGIN, spacing = 0; + + drawBtn(x, y, "E+", (intptr_t)e_plus, imgUp, E_BTN_COLOR, !busy); + + spacing = (TFT_WIDTH - X_MARGIN * 2 - 3 * BTN_WIDTH) / 2; + x += BTN_WIDTH + spacing; + uint16_t yplus_x = x; + drawBtn(x, y, "Y+", (intptr_t)y_plus, imgUp, Y_BTN_COLOR, !busy); + + // Cur Y + x += BTN_WIDTH; + motionAxisState.yValuePos.x = x + 2; + motionAxisState.yValuePos.y = y; + drawAxisValue(Y_AXIS); + + x += spacing; + drawBtn(x, y, "Z+", (intptr_t)z_plus, imgUp, Z_BTN_COLOR, !busy || ENABLED(BABYSTEP_ZPROBE_OFFSET)); //only enabled when not busy or have baby step + + // ROW 2 -> "Ex" X- HOME X+ "Z" + y += BTN_HEIGHT + (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3; + x = X_MARGIN; + spacing = (TFT_WIDTH - X_MARGIN * 2 - 5 * BTN_WIDTH) / 4; + + motionAxisState.eNamePos.x = x; + motionAxisState.eNamePos.y = y; + drawCurESelection(); + TERN_(HAS_TFT_XPT2046, if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, BTN_HEIGHT, (intptr_t)e_select)); + + x += BTN_WIDTH + spacing; + drawBtn(x, y, "X-", (intptr_t)x_minus, imgLeft, X_BTN_COLOR, !busy); + + x += BTN_WIDTH + spacing; //imgHome is 64x64 + TERN_(HAS_TFT_XPT2046, add_control(TFT_WIDTH / 2 - Images[imgHome].width / 2, y - (Images[imgHome].width - BTN_HEIGHT) / 2, BUTTON, (intptr_t)do_home, imgHome, !busy)); + + x += BTN_WIDTH + spacing; + uint16_t xplus_x = x; + drawBtn(x, y, "X+", (intptr_t)x_plus, imgRight, X_BTN_COLOR, !busy); + + x += BTN_WIDTH + spacing; + motionAxisState.zTypePos.x = x; + motionAxisState.zTypePos.y = y; + drawCurZSelection(); + #if BOTH(HAS_BED_PROBE, TOUCH_SCREEN) + if (!busy) touch.add_control(BUTTON, x, y, BTN_WIDTH, 34 * 2, (intptr_t)z_select); + #endif + + // ROW 3 -> E- CurX Y- Z- + y += BTN_HEIGHT + (TFT_HEIGHT - Y_MARGIN * 2 - 4 * BTN_HEIGHT) / 3; + x = X_MARGIN; + spacing = (TFT_WIDTH - X_MARGIN * 2 - 3 * BTN_WIDTH) / 2; + + drawBtn(x, y, "E-", (intptr_t)e_minus, imgDown, E_BTN_COLOR, !busy); + + // Cur E + motionAxisState.eValuePos.x = x; + motionAxisState.eValuePos.y = y + BTN_HEIGHT + 2; + drawAxisValue(E_AXIS); + + // Cur X + motionAxisState.xValuePos.x = BTN_WIDTH + (TFT_WIDTH - X_MARGIN * 2 - 5 * BTN_WIDTH) / 4; //X- pos + motionAxisState.xValuePos.y = y - 10; + drawAxisValue(X_AXIS); + + x += BTN_WIDTH + spacing; + drawBtn(x, y, "Y-", (intptr_t)y_minus, imgDown, Y_BTN_COLOR, !busy); + + x += BTN_WIDTH + spacing; + drawBtn(x, y, "Z-", (intptr_t)z_minus, imgDown, Z_BTN_COLOR, !busy || ENABLED(BABYSTEP_ZPROBE_OFFSET)); //only enabled when not busy or have baby step + + // Cur Z + motionAxisState.zValuePos.x = x; + motionAxisState.zValuePos.y = y + BTN_HEIGHT + 2; + drawAxisValue(Z_AXIS); + + // ROW 4 -> step_size disable steppers back + y = TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT; // + x = xplus_x - CUR_STEP_VALUE_WIDTH - 10; + motionAxisState.stepValuePos.x = yplus_x + BTN_WIDTH - CUR_STEP_VALUE_WIDTH; + motionAxisState.stepValuePos.y = TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT; + if (!busy) { + drawCurStepValue(); + TERN_(HAS_TFT_XPT2046, touch.add_control(BUTTON, motionAxisState.stepValuePos.x, motionAxisState.stepValuePos.y, CUR_STEP_VALUE_WIDTH, BTN_HEIGHT, (intptr_t)step_size)); + } + + // aligned with x+ + drawBtn(xplus_x, y, "off", (intptr_t)disable_steppers, imgCancel, COLOR_WHITE, !busy); - // aligned with x+ - drawBtn(xplus_x, y, "off", (intptr_t)disable_steppers, imgCancel, COLOR_WHITE, !busy); + #endif // !TFT_COLOR_UI_PORTRAIT TERN_(HAS_TFT_XPT2046, add_control(TFT_WIDTH - X_MARGIN - BTN_WIDTH, y, BACK, imgBack)); } diff --git a/Marlin/src/lcd/tft/ui_320x240.h b/Marlin/src/lcd/tft/ui_320x240.h index 72aafbf245c0d..555ca3616a091 100644 --- a/Marlin/src/lcd/tft/ui_320x240.h +++ b/Marlin/src/lcd/tft/ui_320x240.h @@ -44,4 +44,6 @@ #define FONT_SIZE 10 #endif +#define FONT_LINE_HEIGHT 24 + #include "tft_font.h" diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index e8d51d89a10fb..02e9ca196aba3 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -746,10 +746,8 @@ static void z_minus() { moveAxis(Z_AXIS, -1); } #if ENABLED(TOUCH_SCREEN) static void e_select() { - motionAxisState.e_selection++; - if (motionAxisState.e_selection >= EXTRUDERS) { + if (++motionAxisState.e_selection >= EXTRUDERS) motionAxisState.e_selection = 0; - } quick_feedback(); drawCurESelection(); @@ -791,8 +789,8 @@ static void disable_steppers() { } static void drawBtn(int x, int y, const char *label, intptr_t data, MarlinImage img, uint16_t bgColor, bool enabled = true) { - uint16_t width = Images[imgBtn52Rounded].width; - uint16_t height = Images[imgBtn52Rounded].height; + uint16_t width = Images[imgBtn52Rounded].width, + height = Images[imgBtn52Rounded].height; if (!enabled) bgColor = COLOR_CONTROL_DISABLED; diff --git a/Marlin/src/lcd/tft_io/tft_io.h b/Marlin/src/lcd/tft_io/tft_io.h index c1c4a8e3b192b..8f68d789009db 100644 --- a/Marlin/src/lcd/tft_io/tft_io.h +++ b/Marlin/src/lcd/tft_io/tft_io.h @@ -49,19 +49,14 @@ #define TFT_MIRROR_X (TFT_INVERT_Y) #define TFT_MIRROR_Y (TFT_INVERT_X) -#define TFT_ROTATE_90_MIRROR_X (TFT_ROTATE_90 ^ TFT_INVERT_Y) -#define TFT_ROTATE_90_MIRROR_Y (TFT_ROTATE_90 ^ TFT_INVERT_X) +#define TFT_ROTATE_90_MIRROR_X (TFT_ROTATE_90 ^ TFT_MIRROR_X) +#define TFT_ROTATE_90_MIRROR_Y (TFT_ROTATE_90 ^ TFT_MIRROR_Y) -#define TFT_ROTATE_180_MIRROR_X (TFT_ROTATE_180 ^ TFT_INVERT_Y) -#define TFT_ROTATE_180_MIRROR_Y (TFT_ROTATE_180 ^ TFT_INVERT_X) +#define TFT_ROTATE_180_MIRROR_X (TFT_ROTATE_180 ^ TFT_MIRROR_X) +#define TFT_ROTATE_180_MIRROR_Y (TFT_ROTATE_180 ^ TFT_MIRROR_Y) -#define TFT_ROTATE_270_MIRROR_X (TFT_ROTATE_270 ^ TFT_INVERT_Y) -#define TFT_ROTATE_270_MIRROR_Y (TFT_ROTATE_270 ^ TFT_INVERT_X) - -// TFT_ROTATION is user configurable -#ifndef TFT_ROTATION - #define TFT_ROTATION TFT_NO_ROTATION -#endif +#define TFT_ROTATE_270_MIRROR_X (TFT_ROTATE_270 ^ TFT_MIRROR_X) +#define TFT_ROTATE_270_MIRROR_Y (TFT_ROTATE_270 ^ TFT_MIRROR_Y) // TFT_ORIENTATION is the "sum" of TFT_DEFAULT_ORIENTATION plus user TFT_ROTATION #define TFT_ORIENTATION ((TFT_DEFAULT_ORIENTATION) ^ (TFT_ROTATION)) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index 59441dc806097..cd4989d73d49b 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -149,26 +149,27 @@ * If the screen stays white, disable 'LCD_RESET_PIN' * to let the bootloader init the screen. */ -#if EITHER(HAS_FSMC_GRAPHICAL_TFT, TFT_320x240) - #define FSMC_CS_PIN PD7 // NE4 - #define FSMC_RS_PIN PD11 // A0 +#if HAS_FSMC_TFT - #define TFT_CS_PIN FSMC_CS_PIN - #define TFT_RS_PIN FSMC_RS_PIN + #define TFT_CS_PIN PD7 // NE4 + #define TFT_RS_PIN PD11 // A0 + #define LCD_RESET_PIN PC6 // FSMC_RST + #define LCD_BACKLIGHT_PIN PD13 + + #define FSMC_CS_PIN TFT_CS_PIN // NE4 + #define FSMC_RS_PIN TFT_RS_PIN // A0 #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT #define FSMC_DMA_DEV DMA2 #define FSMC_DMA_CHANNEL DMA_CH5 - #define LCD_RESET_PIN PC6 // FSMC_RST - #define LCD_BACKLIGHT_PIN PD13 -#endif + #if NEED_TOUCH_PINS + #define TOUCH_CS_PIN PC2 // SPI2_NSS + #define TOUCH_SCK_PIN PB13 // SPI2_SCK + #define TOUCH_MISO_PIN PB14 // SPI2_MISO + #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI + #endif -#if BOTH(NEED_TOUCH_PINS, HAS_FSMC_GRAPHICAL_TFT) || ENABLED(TFT_320x240) - #define TOUCH_CS_PIN PC2 // SPI2_NSS - #define TOUCH_SCK_PIN PB13 // SPI2_SCK - #define TOUCH_MISO_PIN PB14 // SPI2_MISO - #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI #endif #if ENABLED(TFT_320x240) // TFT32/28 diff --git a/buildroot/tests/mks_robin_nano_v1v2_maple b/buildroot/tests/mks_robin_nano_v1v2_maple index ebd5466ce61c5..e241c14b9fe63 100755 --- a/buildroot/tests/mks_robin_nano_v1v2_maple +++ b/buildroot/tests/mks_robin_nano_v1v2_maple @@ -40,11 +40,10 @@ exec_test $1 $2 "MKS Robin v2 nano LVGL SPI w/ WiFi" "$3" # (Robin v2 nano has no FSMC interface) # use_example_configs Mks/Robin -opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 -opt_disable TFT_INTERFACE_FSMC TFT_RES_320x240 -opt_enable TFT_INTERFACE_SPI TFT_RES_480x320 -opt_enable BINARY_FILE_TRANSFER -exec_test $1 $2 "MKS Robin v2 nano New Color UI 480x320 SPI + BINARY_FILE_TRANSFER" "$3" +opt_set MOTHERBOARD BOARD_MKS_ROBIN_NANO_V2 TFT_ROTATION TFT_ROTATE_90 +opt_disable TFT_INTERFACE_FSMC +opt_enable TFT_INTERFACE_SPI BINARY_FILE_TRANSFER +exec_test $1 $2 "MKS Robin v2 nano New Color UI 240x320 SPI + BINARY_FILE_TRANSFER" "$3" # # MKS Robin v2 nano LVGL SPI + TMC From b3f65b674f23db5c32e4d7e96ad2dff97c77c717 Mon Sep 17 00:00:00 2001 From: Miguel Risco-Castillo Date: Tue, 17 Jan 2023 18:41:36 -0500 Subject: [PATCH 16/54] =?UTF-8?q?=F0=9F=9A=B8=20ProUI=20MPC=20menu=20(#252?= =?UTF-8?q?32)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/inc/Conditionals_post.h | 8 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 200 +++++++++++++------- Marlin/src/lcd/e3v2/proui/dwin.h | 39 +++- Marlin/src/lcd/e3v2/proui/dwin_defines.h | 4 +- Marlin/src/lcd/e3v2/proui/dwinui.h | 10 +- Marlin/src/lcd/e3v2/proui/gcode_preview.cpp | 17 +- Marlin/src/lcd/e3v2/proui/gcode_preview.h | 24 ++- Marlin/src/lcd/e3v2/proui/menus.cpp | 14 -- Marlin/src/lcd/e3v2/proui/menus.h | 16 +- Marlin/src/lcd/e3v2/proui/plot.cpp | 27 +-- Marlin/src/lcd/e3v2/proui/plot.h | 23 +-- Marlin/src/lcd/language/language_en.h | 5 + Marlin/src/module/temperature.cpp | 10 +- buildroot/tests/STM32F103RE_creality | 6 +- 14 files changed, 228 insertions(+), 175 deletions(-) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 515d5f7984ace..3faef307a8ae8 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2504,9 +2504,15 @@ // PID heating #if ANY(PIDTEMP, PIDTEMPBED, PIDTEMPCHAMBER) #define HAS_PID_HEATING 1 - #if ENABLED(DWIN_LCD_PROUI) && EITHER(PIDTEMP, PIDTEMPBED) +#endif + +#if ENABLED(DWIN_LCD_PROUI) + #if EITHER(PIDTEMP, PIDTEMPBED) #define DWIN_PID_TUNE 1 #endif + #if EITHER(DWIN_PID_TUNE, MPCTEMP) && DISABLED(DISABLE_TUNING_GRAPH) + #define SHOW_TUNING_GRAPH 1 + #endif #endif // Thermal protection diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 4be0819441380..e8430d591c980 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -31,37 +31,6 @@ #if ENABLED(DWIN_LCD_PROUI) -#if DISABLED(LIMITED_MAX_FR_EDITING) - #warning "LIMITED_MAX_FR_EDITING is recommended with ProUI." -#endif -#if DISABLED(LIMITED_MAX_ACCEL_EDITING) - #warning "LIMITED_MAX_ACCEL_EDITING is recommended with ProUI." -#endif -#if ENABLED(CLASSIC_JERK) && DISABLED(LIMITED_JERK_EDITING) - #warning "LIMITED_JERK_EDITING is recommended with ProUI." -#endif -#if DISABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) - #warning "INDIVIDUAL_AXIS_HOMING_SUBMENU is recommended with ProUI." -#endif -#if DISABLED(SET_PROGRESS_MANUALLY) - #warning "SET_PROGRESS_MANUALLY is recommended with ProUI." -#endif -#if DISABLED(STATUS_MESSAGE_SCROLLING) - #warning "STATUS_MESSAGE_SCROLLING is recommended with ProUI." -#endif -#if DISABLED(BAUD_RATE_GCODE) - #warning "BAUD_RATE_GCODE is recommended with ProUI." -#endif -#if DISABLED(SOUND_MENU_ITEM) - #warning "SOUND_MENU_ITEM is recommended with ProUI." -#endif -#if DISABLED(PRINTCOUNTER) - #warning "PRINTCOUNTER is recommended with ProUI." -#endif -#if HAS_MESH && DISABLED(MESH_EDIT_MENU) - #warning "MESH_EDIT_MENU is recommended with ProUI." -#endif - #include "../../fontutils.h" #include "../../marlinui.h" @@ -142,7 +111,7 @@ #include "endstop_diag.h" #endif -#if HAS_PIDPLOT +#if SHOW_TUNING_GRAPH #include "plot.h" #endif @@ -297,6 +266,9 @@ MenuClass *MaxAccelMenu = nullptr; MenuClass *MaxJerkMenu = nullptr; #endif MenuClass *StepsMenu = nullptr; +#if ENABLED(MPCTEMP) + MenuClass *HotendMPCMenu = nullptr; +#endif #if ENABLED(PIDTEMP) MenuClass *HotendPIDMenu = nullptr; #endif @@ -1275,8 +1247,8 @@ void EachMomentUpdate() { #if HAS_ESDIAG if (checkkey == ESDiagProcess) ESDiag.Update(); #endif - #if HAS_PIDPLOT - if (checkkey == PidProcess) Plot.Update((HMI_value.pidresult == PIDTEMP_START) ? thermalManager.wholeDegHotend(0) : thermalManager.wholeDegBed()); + #if SHOW_TUNING_GRAPH + if (checkkey == PidProcess) plot.Update((HMI_value.pidresult == PIDTEMP_START) ? thermalManager.wholeDegHotend(0) : thermalManager.wholeDegBed()); #endif } @@ -1498,36 +1470,64 @@ void DWIN_LevelingDone() { } #endif -// PID process +// PID/MPC process -#if BOTH(HAS_PIDPLOT, DWIN_PID_TUNE) +#if SHOW_TUNING_GRAPH + + #include "plot.h" - void DWIN_Draw_PIDPopup() { - frame_rect_t gfrm = { 40, 180, DWIN_WIDTH - 80, 120 }; + celsius_t _maxtemp, _target; + void DWIN_Draw_PID_MPC_Popup() { + constexpr frame_rect_t gfrm = { 40, 180, DWIN_WIDTH - 80, 120 }; DWINUI::ClearMainArea(); Draw_Popup_Bkgd(); - DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_PID_AUTOTUNE)); - DWINUI::Draw_String(HMI_data.PopupTxt_Color, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius")); - switch (HMI_value.pidresult) { - #if ENABLED(PIDTEMP) + + #if ENABLED(MPCTEMP) + + switch (HMI_value.pidresult) { + case MPCTEMP_START: + _maxtemp = thermalManager.hotend_maxtemp[0]; + _target = 200; + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_MPC_AUTOTUNE)); + DWINUI::Draw_String(HMI_data.PopupTxt_Color, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("MPC target: Celsius")); + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for Nozzle is running.")); + break; + case PIDTEMPBED_START: + _maxtemp = BED_MAXTEMP; + _target = HMI_data.BedPidT; + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_PID_AUTOTUNE)); + DWINUI::Draw_String(HMI_data.PopupTxt_Color, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius")); + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for BED is running.")); + break; + default: return; + } + + #else // PID + + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_PID_AUTOTUNE)); + DWINUI::Draw_String(HMI_data.PopupTxt_Color, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius")); + + switch (HMI_value.pidresult) { case PIDTEMP_START: + _maxtemp = thermalManager.hotend_maxtemp[0]; + _target = HMI_data.HotendPidT; DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for Nozzle is running.")); - Plot.Draw(gfrm, thermalManager.hotend_maxtemp[0], HMI_data.HotendPidT); - DWINUI::Draw_Int(HMI_data.PopupTxt_Color, 3, gfrm.x + 90, gfrm.y - DWINUI::fontHeight() - 4, HMI_data.HotendPidT); break; - #endif - #if ENABLED(PIDTEMPBED) case PIDTEMPBED_START: + _maxtemp = BED_MAXTEMP; + _target = HMI_data.BedPidT; DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for BED is running.")); - Plot.Draw(gfrm, BED_MAXTEMP, HMI_data.BedPidT); - DWINUI::Draw_Int(HMI_data.PopupTxt_Color, 3, gfrm.x + 90, gfrm.y - DWINUI::fontHeight() - 4, HMI_data.BedPidT); break; - #endif - default: break; - } + default: return; + } + + #endif // PID + + plot.Draw(gfrm, _maxtemp, _target); + DWINUI::Draw_Int(HMI_data.PopupTxt_Color, 3, gfrm.x + 90, gfrm.y - DWINUI::fontHeight() - 4, _target); } -#endif +#endif // SHOW_TUNING_GRAPH #if DWIN_PID_TUNE @@ -1542,40 +1542,40 @@ void DWIN_LevelingDone() { } } - void DWIN_PidTuning(pidresult_t result) { + void DWIN_PidTuning(tempcontrol_t result) { HMI_value.pidresult = result; switch (result) { #if ENABLED(PIDTEMP) case PIDTEMP_START: HMI_SaveProcessID(PidProcess); - #if HAS_PIDPLOT - DWIN_Draw_PIDPopup(); + #if SHOW_TUNING_GRAPH + DWIN_Draw_PID_MPC_Popup(); #else DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for Nozzle is running.")); #endif break; - case PID_BAD_HEATER_ID: + case PID_TEMP_TOO_HIGH: checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_BAD_HEATER_ID)); + DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_TEMP_TOO_HIGH)); break; #endif #if ENABLED(PIDTEMPBED) case PIDTEMPBED_START: HMI_SaveProcessID(PidProcess); - #if HAS_PIDPLOT - DWIN_Draw_PIDPopup(); + #if SHOW_TUNING_GRAPH + DWIN_Draw_PID_MPC_Popup(); #else DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for BED is running.")); #endif break; #endif - case PID_TUNING_TIMEOUT: + case PID_BAD_HEATER_ID: checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_ERROR), GET_TEXT_F(MSG_PID_TIMEOUT)); + DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_PID_BAD_HEATER_ID)); break; - case PID_TEMP_TOO_HIGH: + case PID_TUNING_TIMEOUT: checkkey = last_checkkey; - DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_TEMP_TOO_HIGH)); + DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_ERROR), GET_TEXT_F(MSG_PID_TIMEOUT)); break; case PID_DONE: checkkey = last_checkkey; @@ -1589,6 +1589,43 @@ void DWIN_LevelingDone() { #endif // DWIN_PID_TUNE +#if ENABLED(MPCTEMP) + + void DWIN_MPCTuning(tempcontrol_t result) { + HMI_value.pidresult = result; + switch (result) { + case MPCTEMP_START: + HMI_SaveProcessID(MPCProcess); + #if SHOW_TUNING_GRAPH + DWIN_Draw_PID_MPC_Popup(); + #else + DWIN_Draw_Popup(ICON_TempTooHigh, GET_TEXT_F(MSG_MPC_AUTOTUNE), F("for Nozzle is running.")); + #endif + break; + case MPC_TEMP_ERROR: + checkkey = last_checkkey; + DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), F(STR_MPC_TEMPERATURE_ERROR)); + ui.reset_alert_level(); + break; + case MPC_INTERRUPTED: + checkkey = last_checkkey; + DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_ERROR), F(STR_MPC_AUTOTUNE STR_MPC_AUTOTUNE_INTERRUPTED)); + ui.reset_alert_level(); + break; + case MPC_DONE: + checkkey = last_checkkey; + DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_MPC_AUTOTUNE), GET_TEXT_F(MSG_BUTTON_DONE)); + ui.reset_alert_level(); + break; + default: + checkkey = last_checkkey; + ui.reset_alert_level(); + break; + } + } + +#endif // MPCTEMP + // Started a Print Job void DWIN_Print_Started() { DEBUG_ECHOLNPGM("DWIN_Print_Started: ", SD_Printing()); @@ -3054,7 +3091,7 @@ void Draw_Control_Menu() { void Draw_AdvancedSettings_Menu() { checkkey = Menu; - if (SET_MENU(AdvancedSettings, MSG_ADVANCED_SETTINGS, 18)) { + if (SET_MENU(AdvancedSettings, MSG_ADVANCED_SETTINGS, 19)) { BACK_ITEM(Goto_Main_Menu); #if ENABLED(EEPROM_SETTINGS) MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, WriteEeprom); @@ -3069,6 +3106,9 @@ void Draw_AdvancedSettings_Menu() { #if ENABLED(PIDTEMP) MENU_ITEM_F(ICON_PIDNozzle, STR_HOTEND_PID " Settings", onDrawSubMenu, Draw_HotendPID_Menu); #endif + #if ENABLED(MPCTEMP) + MENU_ITEM_F(ICON_MPCNozzle, STR_MPC_AUTOTUNE " Settings", onDrawSubMenu, Draw_HotendMPC_Menu); + #endif #if ENABLED(PIDTEMPBED) MENU_ITEM_F(ICON_PIDBed, STR_BED_PID " Settings", onDrawSubMenu, Draw_BedPID_Menu); #endif @@ -3500,6 +3540,38 @@ void Draw_Steps_Menu() { #endif +#if ENABLED(MPCTEMP) + + void HotendMPC() { thermalManager.MPC_autotune(); } + void SetHeaterPower() { SetPFloatOnClick(1, 200, 1); } + void SetBlkHeatCapacity() { SetPFloatOnClick(0, 40, 2); } + void SetSensorRespons() { SetPFloatOnClick(0, 1, 4); } + void SetAmbientXfer() { SetPFloatOnClick(0, 1, 4); } + #if ENABLED(MPC_INCLUDE_FAN) + void onDrawFanAdj(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 4, thermalManager.temp_hotend[0].fanCoefficient()); } + void ApplyFanAdj() { thermalManager.temp_hotend[0].applyFanAdjustment(MenuData.Value / POW(10, 4)); } + void SetFanAdj() { SetFloatOnClick(0, 1, 4, thermalManager.temp_hotend[0].fanCoefficient(), ApplyFanAdj); } + #endif + + void Draw_HotendMPC_Menu() { + checkkey = Menu; + if (SET_MENU_F(HotendMPCMenu, STR_MPC_AUTOTUNE " Settings", 7)) { + MPC_t &mpc = thermalManager.temp_hotend[0].mpc; + BACK_ITEM(Draw_AdvancedSettings_Menu); + MENU_ITEM(ICON_MPCNozzle, MSG_MPC_AUTOTUNE, onDrawMenuItem, HotendMPC); + EDIT_ITEM(ICON_MPCHeater, MSG_MPC_POWER, onDrawPFloatMenu, SetHeaterPower, &mpc.heater_power); + EDIT_ITEM(ICON_MPCHeatCap, MSG_MPC_BLOCK_HEAT_CAPACITY, onDrawPFloat2Menu, SetBlkHeatCapacity, &mpc.block_heat_capacity); + EDIT_ITEM(ICON_MPCValue, MSG_SENSOR_RESPONSIVENESS, onDrawPFloat4Menu, SetSensorRespons, &mpc.sensor_responsiveness); + EDIT_ITEM(ICON_MPCValue, MSG_MPC_AMBIENT_XFER_COEFF, onDrawPFloat4Menu, SetAmbientXfer, &mpc.ambient_xfer_coeff_fan0); + #if ENABLED(MPC_INCLUDE_FAN) + EDIT_ITEM(ICON_MPCFan, MSG_MPC_AMBIENT_XFER_COEFF_FAN, onDrawFanAdj, SetFanAdj, &mpc.fan255_adjustment); + #endif + } + UpdateMenu(HotendMPCMenu); + } + +#endif // MPCTEMP + #if ENABLED(PIDTEMPBED) void Draw_BedPID_Menu() { diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index bc050abd2e1ea..112df5cae144e 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -70,17 +70,30 @@ enum processID : uint8_t { WaitResponse, Homing, PidProcess, + MPCProcess, NothingToDo }; -enum pidresult_t : uint8_t { - PIDTEMP_START = 0, - PIDTEMPBED_START, - PID_BAD_HEATER_ID, - PID_TEMP_TOO_HIGH, - PID_TUNING_TIMEOUT, - PID_DONE, -}; +#if EITHER(DWIN_PID_TUNE, MPCTEMP) + + enum tempcontrol_t : uint8_t { + #if DWIN_PID_TUNE + PID_DONE, + PIDTEMP_START, + PIDTEMPBED_START, + PID_BAD_HEATER_ID, + PID_TEMP_TOO_HIGH, + PID_TUNING_TIMEOUT, + #endif + #if ENABLED(MPCTEMP) + MPC_DONE, + MPCTEMP_START, + MPC_TEMP_ERROR, + MPC_INTERRUPTED + #endif + }; + +#endif #define DWIN_CHINESE 123 #define DWIN_ENGLISH 0 @@ -142,7 +155,7 @@ static constexpr size_t eeprom_data_size = sizeof(HMI_data_t); typedef struct { int8_t Color[3]; // Color components #if DWIN_PID_TUNE - pidresult_t pidresult = PID_DONE; + tempcontrol_t pidresult = PID_DONE; #endif uint8_t Select = 0; // Auxiliary selector variable AxisEnum axis = X_AXIS; // Axis Select @@ -361,7 +374,7 @@ void Draw_Steps_Menu(); #if DWIN_PID_TUNE #include "../../../module/temperature.h" void DWIN_StartM303(const bool seenC, const int c, const bool seenS, const heater_id_t hid, const celsius_t temp); - void DWIN_PidTuning(pidresult_t result); + void DWIN_PidTuning(tempcontrol_t result); #if ENABLED(PIDTEMP) void Draw_HotendPID_Menu(); #endif @@ -369,3 +382,9 @@ void Draw_Steps_Menu(); void Draw_BedPID_Menu(); #endif #endif + +// MPC +#if ENABLED(MPCTEMP) + void DWIN_MPCTuning(tempcontrol_t result); + void Draw_HotendMPC_Menu(); +#endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index de3f40e2814bf..e87aedf311791 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -19,6 +19,8 @@ * along with this program. If not, see . * */ +#pragma once + /** * DWIN general defines and data structs for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) @@ -26,8 +28,6 @@ * Date: 2022/08/08 */ -#pragma once - //#define DEBUG_DWIN 1 //#define NEED_HEX_PRINT 1 diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.h b/Marlin/src/lcd/e3v2/proui/dwinui.h index 55345a789985c..85d969043f02f 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.h +++ b/Marlin/src/lcd/e3v2/proui/dwinui.h @@ -19,6 +19,7 @@ * along with this program. If not, see . * */ +#pragma once /** * DWIN Enhanced implementation for PRO UI @@ -27,8 +28,6 @@ * Date: 2022/07/05 */ -#pragma once - #include "../../../inc/MarlinConfigPre.h" #include "../common/dwin_set.h" @@ -147,6 +146,13 @@ #define ICON_CaseLight ICON_Motion #define ICON_LedControl ICON_Motion +// MPC +#define ICON_MPCNozzle ICON_SetEndTemp +#define ICON_MPCValue ICON_Contact +#define ICON_MPCHeater ICON_Temperature +#define ICON_MPCHeatCap ICON_SetBedTemp +#define ICON_MPCFan ICON_FanSpeed + // Buttons #define BTN_Continue 85 #define BTN_Cancel 87 diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp index 6411b669bbc8f..bc489dd1fa8f2 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp @@ -21,25 +21,10 @@ */ /** - * DWIN g-code thumbnail preview + * DWIN G-code thumbnail preview * Author: Miguel A. Risco-Castillo * version: 3.1.2 * Date: 2022/09/03 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - * For commercial applications additional licenses can be requested */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.h b/Marlin/src/lcd/e3v2/proui/gcode_preview.h index c1949c5abc12c..2452797d0c62a 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.h +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.h @@ -1,12 +1,13 @@ /** - * DWIN g-code thumbnail preview - * Author: Miguel A. Risco-Castillo - * version: 3.1.2 - * Date: 2022/09/03 + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -14,14 +15,19 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License + * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * For commercial applications additional licenses can be requested */ - #pragma once +/** + * DWIN G-code thumbnail preview + * Author: Miguel A. Risco-Castillo + * version: 3.1.2 + * Date: 2022/09/03 + */ + void Preview_DrawFromSD(); void Preview_Invalidate(); bool Preview_Valid(); diff --git a/Marlin/src/lcd/e3v2/proui/menus.cpp b/Marlin/src/lcd/e3v2/proui/menus.cpp index 540f9e1f417b2..dfcfaa7bbc191 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.cpp +++ b/Marlin/src/lcd/e3v2/proui/menus.cpp @@ -25,20 +25,6 @@ * Author: Miguel A. Risco-Castillo * Version: 1.9.1 * Date: 2022/12/02 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/e3v2/proui/menus.h b/Marlin/src/lcd/e3v2/proui/menus.h index 33712f8959ef3..072bf7584d906 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.h +++ b/Marlin/src/lcd/e3v2/proui/menus.h @@ -19,28 +19,14 @@ * along with this program. If not, see . * */ +#pragma once /** * Menu functions for ProUI * Author: Miguel A. Risco-Castillo * Version: 1.9.1 * Date: 2022/12/02 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * */ -#pragma once #include "dwinui.h" diff --git a/Marlin/src/lcd/e3v2/proui/plot.cpp b/Marlin/src/lcd/e3v2/proui/plot.cpp index 53178e3ea705f..fddaf3963ae1b 100644 --- a/Marlin/src/lcd/e3v2/proui/plot.cpp +++ b/Marlin/src/lcd/e3v2/proui/plot.cpp @@ -25,26 +25,11 @@ * Author: Miguel A. Risco-Castillo * Version: 2.1.2 * Date: 2022/11/20 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - * For commercial applications additional licenses can be requested */ -#include "../../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfig.h" -#if BOTH(DWIN_LCD_PROUI, HAS_PIDPLOT) +#if BOTH(DWIN_LCD_PROUI, SHOW_TUNING_GRAPH) #include "plot.h" #include "../../../core/types.h" @@ -55,13 +40,13 @@ #define Plot_Bg_Color RGB( 1, 12, 8) -PlotClass Plot; +PlotClass plot; uint16_t grphpoints, r, x2, y2 = 0; frame_rect_t grphframe = {0}; float scale = 0; -void PlotClass::Draw(const frame_rect_t frame, const float max, const float ref) { +void PlotClass::Draw(const frame_rect_t &frame, const celsius_t max, const_float_t ref/*=0*/) { grphframe = frame; grphpoints = 0; scale = frame.h / max; @@ -76,7 +61,7 @@ void PlotClass::Draw(const frame_rect_t frame, const float max, const float ref) void PlotClass::Update(const_float_t value) { if (!scale) return; - uint16_t y = round((y2) - value * scale); + const uint16_t y = round((y2) - value * scale); if (grphpoints < grphframe.w) { DWIN_Draw_Point(Color_Yellow, 1, 1, grphpoints + grphframe.x, y); } @@ -89,4 +74,4 @@ void PlotClass::Update(const_float_t value) { grphpoints++; } -#endif // DWIN_LCD_PROUI && HAS_PIDPLOT +#endif // DWIN_LCD_PROUI && SHOW_TUNING_GRAPH diff --git a/Marlin/src/lcd/e3v2/proui/plot.h b/Marlin/src/lcd/e3v2/proui/plot.h index 2663776dc4fc5..14e7058b01712 100644 --- a/Marlin/src/lcd/e3v2/proui/plot.h +++ b/Marlin/src/lcd/e3v2/proui/plot.h @@ -19,36 +19,21 @@ * along with this program. If not, see . * */ +#pragma once /** * DWIN Single var plot * Author: Miguel A. Risco-Castillo * Version: 2.1.2 * Date: 2022/11/20 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - * For commercial applications additional licenses can be requested */ -#pragma once #include "dwinui.h" class PlotClass { public: - void Draw(frame_rect_t frame, float max, float ref = 0); - void Update(const_float_t value); + static void Draw(const frame_rect_t &frame, const celsius_t max, const_float_t ref=0); + static void Update(const_float_t value); }; -extern PlotClass Plot; +extern PlotClass plot; diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 8352ef8886221..425c948dbe39d 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -376,10 +376,15 @@ namespace Language_en { LSTR MSG_MPC_COOLING_TO_AMBIENT = _UxGT("Cooling to ambient"); LSTR MSG_MPC_AUTOTUNE = _UxGT("MPC Autotune"); LSTR MSG_MPC_EDIT = _UxGT("Edit * MPC"); + LSTR MSG_MPC_POWER = _UxGT("Heater Power"); LSTR MSG_MPC_POWER_E = _UxGT("Power *"); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY = _UxGT("Heat Capacity"); LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Heat Cap. *"); + LSTR MSG_SENSOR_RESPONSIVENESS = _UxGT("Sensor Resp."); LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Sensor Resp. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF = _UxGT("Ambient Coeff."); LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ambient Co. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN = _UxGT("Fan coeff."); LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Fan coeff. *"); LSTR MSG_SELECT_E = _UxGT("Select *"); LSTR MSG_ACC = _UxGT("Accel"); diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index a4f528a4c8196..99d5603566b66 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -903,6 +903,7 @@ volatile bool Temperature::raw_temps_ready = false; if (!wait_for_heatup) { SERIAL_ECHOPGM(STR_MPC_AUTOTUNE); SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_INTERRUPTED); + TERN_(DWIN_LCD_PROUI, DWIN_MPCTuning(MPC_INTERRUPTED)); return false; } @@ -942,7 +943,12 @@ volatile bool Temperature::raw_temps_ready = false; do_blocking_move_to(xyz_pos_t(MPC_TUNING_POS)); SERIAL_ECHOLNPGM(STR_MPC_COOLING_TO_AMBIENT); - LCD_MESSAGE(MSG_COOLING); + #if ENABLED(DWIN_LCD_PROUI) + DWIN_MPCTuning(MPCTEMP_START); + LCD_ALERTMESSAGE(MSG_MPC_COOLING_TO_AMBIENT); + #else + LCD_MESSAGE(MSG_COOLING); + #endif millis_t ms = millis(), next_report_ms = ms, next_test_ms = ms + 10000UL; celsius_float_t current_temp = degHotend(active_extruder), @@ -1063,6 +1069,7 @@ volatile bool Temperature::raw_temps_ready = false; if (!WITHIN(current_temp, t3 - 15.0f, hotend.target + 15.0f)) { SERIAL_ECHOLNPGM(STR_MPC_TEMPERATURE_ERROR); + TERN_(DWIN_LCD_PROUI, DWIN_MPCTuning(MPC_TEMP_ERROR)); break; } } @@ -1084,6 +1091,7 @@ volatile bool Temperature::raw_temps_ready = false; SERIAL_ECHOPGM(STR_MPC_AUTOTUNE); SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_FINISHED); + TERN_(DWIN_LCD_PROUI, DWIN_MPCTuning(MPC_DONE)); #if 0 SERIAL_ECHOLNPGM("t1_time ", t1_time); diff --git a/buildroot/tests/STM32F103RE_creality b/buildroot/tests/STM32F103RE_creality index a3c52372ef379..8c0a40d8ae223 100755 --- a/buildroot/tests/STM32F103RE_creality +++ b/buildroot/tests/STM32F103RE_creality @@ -25,7 +25,11 @@ opt_enable DWIN_LCD_PROUI INDIVIDUAL_AXIS_HOMING_SUBMENU SET_PROGRESS_MANUALLY S BLTOUCH Z_SAFE_HOMING AUTO_BED_LEVELING_UBL MESH_EDIT_MENU \ LIMITED_MAX_FR_EDITING LIMITED_MAX_ACCEL_EDITING LIMITED_JERK_EDITING BAUD_RATE_GCODE opt_set PREHEAT_3_LABEL '"CUSTOM"' PREHEAT_3_TEMP_HOTEND 240 PREHEAT_3_TEMP_BED 60 PREHEAT_3_FAN_SPEED 128 -exec_test $1 $2 "Ender-3 S1 with ProUI" "$3" +exec_test $1 $2 "Ender-3 S1 with ProUI (PIDTEMP)" "$3" + +opt_disable PIDTEMP +opt_enable MPCTEMP +exec_test $1 $2 "Ender-3 S1 with ProUI (MPCTEMP)" "$3" restore_configs opt_set MOTHERBOARD BOARD_CREALITY_V452 SERIAL_PORT 1 From f81c468f1e4fab9df0741011d34852886a6ab8cc Mon Sep 17 00:00:00 2001 From: John Robertson Date: Tue, 17 Jan 2023 23:53:39 +0000 Subject: [PATCH 17/54] =?UTF-8?q?=F0=9F=90=9B=20Fix=20potential=20I2S=20bu?= =?UTF-8?q?ffer=20overwrite=20(#25113)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/ESP32/i2s.cpp | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/Marlin/src/HAL/ESP32/i2s.cpp b/Marlin/src/HAL/ESP32/i2s.cpp index d9bad4ec2d123..63ceed4c9dcde 100644 --- a/Marlin/src/HAL/ESP32/i2s.cpp +++ b/Marlin/src/HAL/ESP32/i2s.cpp @@ -149,30 +149,28 @@ void stepperTask(void *parameter) { dma.rw_pos = 0; while (dma.rw_pos < DMA_SAMPLE_COUNT) { - // Fill with the port data post pulse_phase until the next step - if (nextMainISR && TERN1(LIN_ADVANCE, nextAdvanceISR)) - i2s_push_sample(); - - // i2s_push_sample() is also called from Stepper::pulse_phase_isr() and Stepper::advance_isr() - // in a rare case where both are called, we need to double decrement the counters - const uint8_t push_count = 1 + (!nextMainISR && TERN0(LIN_ADVANCE, !nextAdvanceISR)); - + if (!nextMainISR) { + Stepper::pulse_phase_isr(); + nextMainISR = Stepper::block_phase_isr(); + } #if ENABLED(LIN_ADVANCE) - if (!nextAdvanceISR) { + else if (!nextAdvanceISR) { Stepper::advance_isr(); nextAdvanceISR = Stepper::la_interval; } - else if (nextAdvanceISR == Stepper::LA_ADV_NEVER) - nextAdvanceISR = Stepper::la_interval; #endif + else + i2s_push_sample(); - if (!nextMainISR) { - Stepper::pulse_phase_isr(); - nextMainISR = Stepper::block_phase_isr(); - } + nextMainISR--; - nextMainISR -= push_count; - TERN_(LIN_ADVANCE, nextAdvanceISR -= push_count); + #if ENABLED(LIN_ADVANCE) + if (nextAdvanceISR == Stepper::LA_ADV_NEVER) + nextAdvanceISR = Stepper::la_interval; + + if (nextAdvanceISR && nextAdvanceISR != Stepper::LA_ADV_NEVER) + nextAdvanceISR--; + #endif } } } From f2b8942adc6ff85fe99c0bd5ebae83acdf4e1b75 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 18 Jan 2023 00:22:56 +0000 Subject: [PATCH 18/54] [cron] Bump distribution date (2023-01-18) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index a4c4a580c832c..3a5d0eafdbec0 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-17" +//#define STRING_DISTRIBUTION_DATE "2023-01-18" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index cd87b9255c46e..0646321c07a23 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 "2023-01-17" + #define STRING_DISTRIBUTION_DATE "2023-01-18" #endif /** From b7c23631c5840e2338cae531b171459e9e9c5301 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sun, 22 Jan 2023 15:08:37 +1300 Subject: [PATCH 19/54] =?UTF-8?q?=F0=9F=90=9B=20Fix=20misc.=20UI=20issues?= =?UTF-8?q?=20(#25252)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/gcode/host/M115.cpp | 4 +++- Marlin/src/inc/Conditionals_adv.h | 4 ++++ Marlin/src/inc/SanityCheck.h | 2 +- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 2 +- Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp | 6 +++--- Marlin/src/lcd/marlinui.cpp | 11 +++++++---- Marlin/src/lcd/marlinui.h | 4 +++- Marlin/src/lcd/menu/menu_advanced.cpp | 2 +- Marlin/src/lcd/tft/ui_1024x600.cpp | 10 ++++------ Marlin/src/lcd/tft/ui_320x240.cpp | 10 ++++------ Marlin/src/lcd/tft/ui_480x320.cpp | 10 ++++------ Marlin/src/lcd/tft_io/tft_io.h | 5 +++++ Marlin/src/module/motion.cpp | 8 ++------ Marlin/src/module/temperature.cpp | 3 +++ Marlin/src/module/temperature.h | 2 ++ Marlin/src/module/tool_change.cpp | 12 +++++------- 16 files changed, 52 insertions(+), 43 deletions(-) diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index 6e8c406adc1ae..d28d53eeddba8 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -232,7 +232,7 @@ void GcodeSuite::M115() { const xyz_pos_t lmin = dmin.asLogical(), lmax = dmax.asLogical(), wmin = cmin.asLogical(), wmax = cmax.asLogical(); - SERIAL_ECHOLNPGM( + SERIAL_ECHOPGM( "area:{" "full:{" "min:{" @@ -249,6 +249,8 @@ void GcodeSuite::M115() { ), "}" // max "}," // full + ); + SERIAL_ECHOLNPGM( "work:{" "min:{" LIST_N(DOUBLE(NUM_AXES), diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index ea52c9b998618..9833b300d3684 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -656,6 +656,10 @@ #define HAS_MEDIA_SUBCALLS 1 #endif +#if ANY(SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME) + #define HAS_EXTRA_PROGRESS 1 +#endif + #if HAS_PRINT_PROGRESS && EITHER(PRINT_PROGRESS_SHOW_DECIMALS, SHOW_REMAINING_TIME) #define HAS_PRINT_PROGRESS_PERMYRIAD 1 #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index b17bf2b7196f2..1aadbb19e3e25 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -944,7 +944,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "SET_PROGRESS_MANUALLY requires at least one of SET_PROGRESS_PERCENT, SET_REMAINING_TIME, SET_INTERACTION_TIME to be enabled." #endif -#if HAS_LCDPRINT && LCD_HEIGHT < 4 && ANY(SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME) +#if HAS_LCDPRINT && HAS_EXTRA_PROGRESS && LCD_HEIGHT < 4 #error "Displays with fewer than 4 rows of text can't show progress values." #endif diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index cba58f5c02f9b..03e83c218104e 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -444,7 +444,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const } // Prepare strings for progress display -#if HAS_PRINT_PROGRESS +#if HAS_EXTRA_PROGRESS static MarlinUI::progress_t progress = 0; static char bufferc[13]; diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index 9ed0d8a9d6740..3d1594aca2c00 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -705,7 +705,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() { void ST7920_Lite_Status_Screen::drawRemain() { const duration_t remaint = TERN0(SET_REMAINING_TIME, ui.get_remaining_time()); if (printJobOngoing() && remaint.value) { - draw_progress_string( PPOS, prepare_time_string(remaint, 'R')); + draw_progress_string(PPOS, prepare_time_string(remaint, 'R')); } } #endif @@ -714,7 +714,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() { void ST7920_Lite_Status_Screen::drawInter() { const duration_t interactt = ui.interaction_time; if (printingIsActive() && interactt.value) { - draw_progress_string( PPOS, prepare_time_string(interactt, 'C')); + draw_progress_string(PPOS, prepare_time_string(interactt, 'C')); } } #endif @@ -723,7 +723,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() { void ST7920_Lite_Status_Screen::drawElapsed() { if (printJobOngoing()) { const duration_t elapsedt = print_job_timer.duration(); - draw_progress_string( PPOS, prepare_time_string(elapsedt, 'E')); + draw_progress_string(PPOS, prepare_time_string(elapsedt, 'E')); } } #endif diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index ff12703ca94c5..91982b54801e6 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -1743,9 +1743,11 @@ void MarlinUI::init() { ); } - #if LCD_WITH_BLINK && DISABLED(HAS_GRAPHICAL_TFT) - typedef void (*PrintProgress_t)(); - void MarlinUI::rotate_progress() { // Renew and redraw all enabled progress strings + #if LCD_WITH_BLINK && HAS_EXTRA_PROGRESS + + // Renew and redraw all enabled progress strings + void MarlinUI::rotate_progress() { + typedef void (*PrintProgress_t)(); const PrintProgress_t progFunc[] = { OPTITEM(SHOW_PROGRESS_PERCENT, drawPercent) OPTITEM(SHOW_ELAPSED_TIME, drawElapsed) @@ -1760,7 +1762,8 @@ void MarlinUI::init() { (*progFunc[i])(); } } - #endif + + #endif // LCD_WITH_BLINK && HAS_EXTRA_PROGRESS #endif // HAS_PRINT_PROGRESS diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index ec19f8bd34ba0..827a71a29dc3f 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -334,7 +334,7 @@ class MarlinUI { FORCE_INLINE static uint16_t get_progress_permyriad() { return _get_progress(); } #endif static uint8_t get_progress_percent() { return uint8_t(_get_progress() / (PROGRESS_SCALE)); } - #if LCD_WITH_BLINK + #if LCD_WITH_BLINK && HAS_EXTRA_PROGRESS #if ENABLED(SHOW_PROGRESS_PERCENT) static void drawPercent(); #endif @@ -348,6 +348,8 @@ class MarlinUI { static void drawInter(); #endif static void rotate_progress(); + #else + static void rotate_progress() {} #endif #else static constexpr uint8_t get_progress_percent() { return 0; } diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 6f404f20e11eb..0e24d0ed8087c 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -377,7 +377,7 @@ void menu_backlash(); #if ENABLED(MPC_INCLUDE_FAN) #define MPC_EDIT_ITEMS(N) \ - MPC_t &mpc = thermalManager.temp_hotend[MenuItemBase::itemIndex].constants; \ + MPC_t &mpc = thermalManager.temp_hotend[MenuItemBase::itemIndex].mpc; \ _MPC_EDIT_ITEMS(N); \ EDIT_ITEM_FAST_N(float43, N, MSG_MPC_AMBIENT_XFER_COEFF_FAN_E, &editable.decimal, 0, 1, []{ \ thermalManager.temp_hotend[MenuItemBase::itemIndex].applyFanAdjustment(editable.decimal); \ diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index f3eb83eb9f50e..363e8eaf9925e 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -675,12 +675,10 @@ static void drawAxisValue(const AxisEnum axis) { static void moveAxis(const AxisEnum axis, const int8_t direction) { quick_feedback(); - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { - drawMessage(F("Too cold")); - return; - } - #endif + if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { + drawMessage(F("Too cold")); + return; + } const float diff = motionAxisState.currentStepSize * direction; diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index 07fa95732726f..fa433645d7b2f 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -768,12 +768,10 @@ static void drawAxisValue(const AxisEnum axis) { static void moveAxis(const AxisEnum axis, const int8_t direction) { quick_feedback(); - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { - drawMessage(F("Too cold")); - return; - } - #endif + if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { + drawMessage(F("Too cold")); + return; + } const float diff = motionAxisState.currentStepSize * direction; diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 02e9ca196aba3..5bf50a5818439 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -656,12 +656,10 @@ static void drawAxisValue(const AxisEnum axis) { static void moveAxis(const AxisEnum axis, const int8_t direction) { quick_feedback(); - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { - drawMessage(F("Too cold")); - return; - } - #endif + if (axis == E_AXIS && thermalManager.tooColdToExtrude(motionAxisState.e_selection)) { + drawMessage(F("Too cold")); + return; + } const float diff = motionAxisState.currentStepSize * direction; diff --git a/Marlin/src/lcd/tft_io/tft_io.h b/Marlin/src/lcd/tft_io/tft_io.h index 8f68d789009db..a3635aaa93d6f 100644 --- a/Marlin/src/lcd/tft_io/tft_io.h +++ b/Marlin/src/lcd/tft_io/tft_io.h @@ -58,6 +58,11 @@ #define TFT_ROTATE_270_MIRROR_X (TFT_ROTATE_270 ^ TFT_MIRROR_X) #define TFT_ROTATE_270_MIRROR_Y (TFT_ROTATE_270 ^ TFT_MIRROR_Y) +// TFT_ROTATION is user configurable +#ifndef TFT_ROTATION + #define TFT_ROTATION TFT_NO_ROTATION +#endif + // TFT_ORIENTATION is the "sum" of TFT_DEFAULT_ORIENTATION plus user TFT_ROTATION #define TFT_ORIENTATION ((TFT_DEFAULT_ORIENTATION) ^ (TFT_ROTATION)) diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 17c607da08306..39506e21d6a8a 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1418,12 +1418,8 @@ void prepare_line_to_destination() { #if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE) if (!DEBUGGING(DRYRUN) && destination.e != current_position.e) { - bool ignore_e = false; - - #if ENABLED(PREVENT_COLD_EXTRUSION) - ignore_e = thermalManager.tooColdToExtrude(active_extruder); - if (ignore_e) SERIAL_ECHO_MSG(STR_ERR_COLD_EXTRUDE_STOP); - #endif + bool ignore_e = thermalManager.tooColdToExtrude(active_extruder); + if (ignore_e) SERIAL_ECHO_MSG(STR_ERR_COLD_EXTRUDE_STOP); #if ENABLED(PREVENT_LENGTHY_EXTRUDE) const float e_delta = ABS(destination.e - current_position.e) * planner.e_factor[active_extruder]; diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 99d5603566b66..5d4ccc0a5189a 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -517,6 +517,9 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); #if ENABLED(PREVENT_COLD_EXTRUSION) bool Temperature::allow_cold_extrude = false; celsius_t Temperature::extrude_min_temp = EXTRUDE_MINTEMP; +#else + constexpr bool Temperature::allow_cold_extrude; + constexpr celsius_t Temperature::extrude_min_temp; #endif #if HAS_ADC_BUTTONS diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 0b5f8caf3facb..9ac5db44edfa1 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -643,6 +643,8 @@ class Temperature { static bool tooColdToExtrude(const uint8_t E_NAME) { return tooCold(wholeDegHotend(HOTEND_INDEX)); } static bool targetTooColdToExtrude(const uint8_t E_NAME) { return tooCold(degTargetHotend(HOTEND_INDEX)); } #else + static constexpr bool allow_cold_extrude = true; + static constexpr celsius_t extrude_min_temp = 0; static bool tooColdToExtrude(const uint8_t) { return false; } static bool targetTooColdToExtrude(const uint8_t) { return false; } #endif diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 7322098c0bb7d..74e99ac093445 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -929,7 +929,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. * Returns FALSE if able to move. */ bool too_cold(uint8_t toolID){ - if (TERN0(PREVENT_COLD_EXTRUSION, !DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(toolID))) { + if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(toolID)) { SERIAL_ECHO_MSG(STR_ERR_HOTEND_TOO_COLD); return true; } @@ -1429,12 +1429,10 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { bool extruder_migration() { - #if ENABLED(PREVENT_COLD_EXTRUSION) - if (thermalManager.targetTooColdToExtrude(active_extruder)) { - DEBUG_ECHOLNPGM("Migration Source Too Cold"); - return false; - } - #endif + if (thermalManager.targetTooColdToExtrude(active_extruder)) { + DEBUG_ECHOLNPGM("Migration Source Too Cold"); + return false; + } // No auto-migration or specified target? if (!migration.target && active_extruder >= migration.last) { From 7e72981b8cbaa7a6276f6833527e97cb10e060e7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 21 Jan 2023 22:57:56 -0600 Subject: [PATCH 20/54] =?UTF-8?q?=F0=9F=9A=B8=20Fix=20homing=5Fneeded=5Fer?= =?UTF-8?q?ror=20language?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_ca.h | 2 +- Marlin/src/lcd/language/language_cz.h | 2 +- Marlin/src/lcd/language/language_da.h | 2 +- Marlin/src/lcd/language/language_de.h | 2 +- Marlin/src/lcd/language/language_en.h | 2 +- Marlin/src/lcd/language/language_es.h | 2 +- Marlin/src/lcd/language/language_eu.h | 2 +- Marlin/src/lcd/language/language_fr.h | 2 +- Marlin/src/lcd/language/language_gl.h | 2 +- Marlin/src/lcd/language/language_hu.h | 2 +- Marlin/src/lcd/language/language_it.h | 2 +- Marlin/src/lcd/language/language_jp_kana.h | 2 +- Marlin/src/lcd/language/language_nl.h | 2 +- Marlin/src/lcd/language/language_pl.h | 2 +- Marlin/src/lcd/language/language_pt_br.h | 2 +- Marlin/src/lcd/language/language_ro.h | 2 +- Marlin/src/lcd/language/language_ru.h | 2 +- Marlin/src/lcd/language/language_sk.h | 2 +- Marlin/src/lcd/language/language_sv.h | 2 +- Marlin/src/lcd/language/language_tr.h | 2 +- Marlin/src/lcd/language/language_uk.h | 2 +- Marlin/src/lcd/language/language_vi.h | 2 +- Marlin/src/lcd/language/language_zh_CN.h | 2 +- Marlin/src/lcd/language/language_zh_TW.h | 2 +- Marlin/src/module/motion.cpp | 11 ++++++++--- 25 files changed, 32 insertions(+), 27 deletions(-) diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index d3a1c2eac1bba..13b5d70837ad5 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -151,7 +151,7 @@ namespace Language_ca { LSTR MSG_CHANGE_MEDIA = _UxGT("Canvia SD"); LSTR MSG_ZPROBE_OUT = _UxGT("Sonda Z fora"); LSTR MSG_BLTOUCH_RESET = _UxGT("Reinicia BLTouch"); - LSTR MSG_HOME_FIRST = _UxGT("Home %s%s%s primer"); + LSTR MSG_HOME_FIRST = _UxGT("Home %s primer"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Decalatge Z"); LSTR MSG_BABYSTEP_X = _UxGT("Micropas X"); LSTR MSG_BABYSTEP_Y = _UxGT("Micropas Y"); diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index db50def2da879..bb930eb7846cb 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -395,7 +395,7 @@ namespace Language_cz { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("vysunout TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Vysunout Z-sondu"); LSTR MSG_MANUAL_STOW = _UxGT("Zasunout Z-sondu"); - LSTR MSG_HOME_FIRST = _UxGT("Domů %s%s%s první"); + LSTR MSG_HOME_FIRST = _UxGT("Domů %s první"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Z ofset"); LSTR MSG_BABYSTEP_X = _UxGT("Babystep X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystep Y"); diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index 7d3867c3584c8..56c53b84fd51e 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -138,7 +138,7 @@ namespace Language_da { LSTR MSG_CHANGE_MEDIA = _UxGT("Skift SD kort"); LSTR MSG_ZPROBE_OUT = _UxGT("Probe udenfor plade"); LSTR MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Selv-Test"); - LSTR MSG_HOME_FIRST = _UxGT("Home %s%s%s først"); + LSTR MSG_HOME_FIRST = _UxGT("Home %s først"); LSTR MSG_HEATING_FAILED_LCD = _UxGT("Opvarmning fejlet"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Fejl: reserve temp"); LSTR MSG_THERMAL_RUNAWAY = _UxGT("Temp løber løbsk"); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 56f91e0ed23bb..1cbddf860e252 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -539,7 +539,7 @@ namespace Language_de { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("TouchMI ausfahren"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Z-Sonde ausfahren"); LSTR MSG_MANUAL_STOW = _UxGT("Z-Sonde einfahren"); - LSTR MSG_HOME_FIRST = _UxGT("Vorher %s%s%s homen"); + LSTR MSG_HOME_FIRST = _UxGT("Vorher %s homen"); LSTR MSG_ZPROBE_SETTINGS = _UxGT("Sondeneinstellungen"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Sondenversatz"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Sondenversatz X"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 425c948dbe39d..a1520c0a7ed13 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -597,7 +597,7 @@ namespace Language_en { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Deploy TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Deploy Z-Probe"); LSTR MSG_MANUAL_STOW = _UxGT("Stow Z-Probe"); - LSTR MSG_HOME_FIRST = _UxGT("Home %s%s%s First"); + LSTR MSG_HOME_FIRST = _UxGT("Home %s First"); LSTR MSG_ZPROBE_SETTINGS = _UxGT("Probe Settings"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Probe Offsets"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Probe X Offset"); diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index 92e469576536c..d95275c317ac2 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -398,7 +398,7 @@ namespace Language_es { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Subir TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Subir Sonda Z"); LSTR MSG_MANUAL_STOW = _UxGT("Bajar Sonda Z"); - LSTR MSG_HOME_FIRST = _UxGT("Origen %s%s%s Prim."); + LSTR MSG_HOME_FIRST = _UxGT("Origen %s Prim."); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Desf. Sonda"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Desf. Sonda X"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Desf. Sonda Y"); diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index e5e1d898ab70f..0c29cdd2aabaa 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -235,7 +235,7 @@ namespace Language_eu { LSTR MSG_BLTOUCH_RESET = _UxGT("BLTouch berrabia."); LSTR MSG_BLTOUCH_DEPLOY = _UxGT("BLTouch jaitsi/luzatu"); LSTR MSG_BLTOUCH_STOW = _UxGT("BLTouch igo/jaso"); - LSTR MSG_HOME_FIRST = _UxGT("Etxera %s%s%s lehenengo"); + LSTR MSG_HOME_FIRST = _UxGT("Etxera %s lehenengo"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Z Konpentsatu"); LSTR MSG_BABYSTEP_X = _UxGT("Mikro-urratsa X"); LSTR MSG_BABYSTEP_Y = _UxGT("Mikro-urratsa Y"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 35e8502b940c1..d9d43427c27aa 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -424,7 +424,7 @@ namespace Language_fr { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Déployer TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Déployer Sonde Z"); LSTR MSG_MANUAL_STOW = _UxGT("Ranger Sonde Z"); - LSTR MSG_HOME_FIRST = _UxGT("Origine %s%s%s Premier"); + LSTR MSG_HOME_FIRST = _UxGT("Origine %s Premier"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Position sonde Z"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Décalage X"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Décalage Y"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index abad80bbecb80..28917bad35bf3 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -413,7 +413,7 @@ namespace Language_gl { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Estender TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Estender Sonda Z"); LSTR MSG_MANUAL_STOW = _UxGT("Recoller Sonda Z"); - LSTR MSG_HOME_FIRST = _UxGT("Orixe %s%s%s Primeiro"); + LSTR MSG_HOME_FIRST = _UxGT("Orixe %s Primeiro"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Desfases Sonda"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Desfase Sonda X"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Desfase Sonda Y"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index 598da662cc74a..61c7d9f9c4e41 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -467,7 +467,7 @@ namespace Language_hu { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("TouchMI használ"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Z-Szonda telepítés"); LSTR MSG_MANUAL_STOW = _UxGT("Z-Szonda elhelyezés"); - LSTR MSG_HOME_FIRST = _UxGT("Elöször %s%s%s kell"); + LSTR MSG_HOME_FIRST = _UxGT("Elöször %s kell"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Szonda eltolások"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("X szonda eltolás"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Y szonda eltolás"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 12a9c572b5e94..a520972b0f7d4 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -564,7 +564,7 @@ namespace Language_it { LSTR MSG_MANUAL_DEPLOY = _UxGT("Estendi Sonda-Z"); LSTR MSG_BLTOUCH_STOW = _UxGT("Ritrai BLTouch"); LSTR MSG_MANUAL_STOW = _UxGT("Ritrai Sonda-Z"); - LSTR MSG_HOME_FIRST = _UxGT("Home %s%s%s prima"); + LSTR MSG_HOME_FIRST = _UxGT("Home %s prima"); LSTR MSG_ZPROBE_SETTINGS = _UxGT("Impostazioni sonda"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Offsets sonda"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Offset X sonda"); diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h index 989d5844f6032..335d4533daa67 100644 --- a/Marlin/src/lcd/language/language_jp_kana.h +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -175,7 +175,7 @@ namespace Language_jp_kana { LSTR MSG_ZPROBE_OUT = _UxGT("Zプローブ ベッドガイ"); // "Z probe out. bed" LSTR MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch ジコシンダン"); // "BLTouch Self-Test" LSTR MSG_BLTOUCH_RESET = _UxGT("BLTouch リセット"); // "Reset BLTouch" - LSTR MSG_HOME_FIRST = _UxGT("サキニ %s%s%s ヲフッキサセテクダサイ"); // "Home ... first" + LSTR MSG_HOME_FIRST = _UxGT("サキニ %s ヲフッキサセテクダサイ"); // "Home ... first" LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Zオフセット"); // "Z Offset" LSTR MSG_BABYSTEP_X = _UxGT("Xジク ビドウ"); // "Babystep X" LSTR MSG_BABYSTEP_Y = _UxGT("Yジク ビドウ"); // "Babystep Y" diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index 0636899c9523a..9ad16bcd8c148 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -152,7 +152,7 @@ namespace Language_nl { LSTR MSG_ZPROBE_OUT = _UxGT("Z probe uit. bed"); LSTR MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Zelf-Test"); LSTR MSG_BLTOUCH_RESET = _UxGT("Reset BLTouch"); - LSTR MSG_HOME_FIRST = _UxGT("Home %s%s%s Eerst"); + LSTR MSG_HOME_FIRST = _UxGT("Home %s Eerst"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Z Offset"); // accepted English term in Dutch LSTR MSG_BABYSTEP_X = _UxGT("Babystap X"); LSTR MSG_BABYSTEP_Y = _UxGT("Babystap Y"); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 7eb17e93f73b5..b39c084ec89a1 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -372,7 +372,7 @@ namespace Language_pl { LSTR MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Self-Test"); LSTR MSG_BLTOUCH_RESET = _UxGT("Reset BLTouch"); LSTR MSG_BLTOUCH_MODE_CHANGE = _UxGT("UWAGA: Złe ustawienia mogą uszkodzić drukarkę. Kontynuować?"); - LSTR MSG_HOME_FIRST = _UxGT("Najpierw Home %s%s%s"); + LSTR MSG_HOME_FIRST = _UxGT("Najpierw Home %s"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Offset Z"); LSTR MSG_MOVE_NOZZLE_TO_BED = _UxGT("Przesuń dyszę do stołu"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Łącznie"); diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index d34cd0c0c1879..d52728d10726d 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -340,7 +340,7 @@ namespace Language_pt_br { LSTR MSG_BLTOUCH_DEPLOY = _UxGT("Estender BLTouch"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Estender Sonda-Z"); LSTR MSG_MANUAL_STOW = _UxGT("Recolher Sonda-Z"); - LSTR MSG_HOME_FIRST = _UxGT("Home %s%s%s Primeiro"); + LSTR MSG_HOME_FIRST = _UxGT("Home %s Primeiro"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Compensar Sonda"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Compensar Sonda em X"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Compensar Sonda em Y"); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index 48751f8cd2a4f..c5fdcc786f683 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -419,7 +419,7 @@ namespace Language_ro { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Deploy TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Deploy Z-Probe"); LSTR MSG_MANUAL_STOW = _UxGT("Stow Z-Probe"); - LSTR MSG_HOME_FIRST = _UxGT("Home %s%s%s First"); + LSTR MSG_HOME_FIRST = _UxGT("Home %s First"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Probe Offsets"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Probe X Offset"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Probe Y Offset"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 1f3c77752e73f..b8a08afc2294e 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -581,7 +581,7 @@ namespace Language_ru { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Установить TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Установить зонд"); LSTR MSG_MANUAL_STOW = _UxGT("Загрузить зонд"); - LSTR MSG_HOME_FIRST = _UxGT("Сначала паркуй %s%s%s"); + LSTR MSG_HOME_FIRST = _UxGT("Сначала паркуй %s"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Смещения Z-зонда"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Смещение X"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Смещение Y"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 323ae684d5ead..ef50f5988c927 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -550,7 +550,7 @@ namespace Language_sk { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Zasunúť TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Zasunúť sondu Z"); LSTR MSG_MANUAL_STOW = _UxGT("Vysunúť sondu Z"); - LSTR MSG_HOME_FIRST = _UxGT("Najskôr os %s%s%s domov"); + LSTR MSG_HOME_FIRST = _UxGT("Najskôr os %s domov"); LSTR MSG_ZPROBE_SETTINGS = _UxGT("Nastav. sondy"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Ofsety sondy Z"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("X ofset"); diff --git a/Marlin/src/lcd/language/language_sv.h b/Marlin/src/lcd/language/language_sv.h index a18691fe0e5e4..e550e877a1b37 100644 --- a/Marlin/src/lcd/language/language_sv.h +++ b/Marlin/src/lcd/language/language_sv.h @@ -452,7 +452,7 @@ namespace Language_sv { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Fällut TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Fällut Z-Sond"); LSTR MSG_MANUAL_STOW = _UxGT("Stuva undan Z-Sond"); - LSTR MSG_HOME_FIRST = _UxGT("Hem %s%s%s Först"); + LSTR MSG_HOME_FIRST = _UxGT("Hem %s Först"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Sond Offsets"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Sond X Offset"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Sond Y Offset"); diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index 84d33f764de06..5ff8ab7b4882a 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -390,7 +390,7 @@ namespace Language_tr { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("TouchMI Aç"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Z-Probe Aç"); LSTR MSG_MANUAL_STOW = _UxGT("Z-Probe Kapat"); - LSTR MSG_HOME_FIRST = _UxGT("Önce %s%s%s Sıfırla"); + LSTR MSG_HOME_FIRST = _UxGT("Önce %s Sıfırla"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Prob Ofsetleri"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("X Prob Ofset"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Y Prob Ofset"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 697445288dbb3..16f3c9527866e 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -598,7 +598,7 @@ namespace Language_uk { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Установити TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Установити Z-зонд"); LSTR MSG_MANUAL_STOW = _UxGT("Завантажити Z-зонд"); - LSTR MSG_HOME_FIRST = _UxGT("Спочатку дім %s%s%s"); + LSTR MSG_HOME_FIRST = _UxGT("Спочатку дім %s"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Зміщення зонду"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("Зміщення по X"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Зміщення по Y"); diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index ed50cca6633bc..575191f50b28b 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -326,7 +326,7 @@ namespace Language_vi { LSTR MSG_BLTOUCH_STOW = _UxGT("Cất BLTouch"); // Stow BLTouch LSTR MSG_MANUAL_DEPLOY = _UxGT("Đem Đầu Dò-Z"); // Deploy Z-Probe LSTR MSG_MANUAL_STOW = _UxGT("Cất Đầu Dò-Z"); // Stow Z-Probe - LSTR MSG_HOME_FIRST = _UxGT("Về nhà %s%s%s Trước"); + LSTR MSG_HOME_FIRST = _UxGT("Về nhà %s Trước"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Đầu Dò Bù Đắp Z"); // Probe Z Offset LSTR MSG_BABYSTEP_X = _UxGT("Nhít X"); // Babystep X LSTR MSG_BABYSTEP_Y = _UxGT("Nhít Y"); diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 79c59be44b073..6e2864ce6f78a 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -419,7 +419,7 @@ namespace Language_zh_CN { LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("部署TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("部署Z探针"); LSTR MSG_MANUAL_STOW = _UxGT("收好Z探针"); - LSTR MSG_HOME_FIRST = _UxGT("归位 %s%s%s 先"); // "Home ... first" + LSTR MSG_HOME_FIRST = _UxGT("归位 %s 先"); // "Home ... first" LSTR MSG_ZPROBE_OFFSETS = _UxGT("探针偏移量"); LSTR MSG_ZPROBE_XOFFSET = _UxGT("探针X偏移"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("探针Y偏移"); diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 6bc00e712acaf..79d4ba75a7ba9 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -369,7 +369,7 @@ namespace Language_zh_TW { LSTR MSG_BLTOUCH_STOW = _UxGT("裝載BLTouch"); // "Stow BLTouch" LSTR MSG_BLTOUCH_DEPLOY = _UxGT("部署BLTouch"); // "Deploy BLTouch" - LSTR MSG_HOME_FIRST = _UxGT("歸位 %s%s%s 先"); // "Home ... first" + LSTR MSG_HOME_FIRST = _UxGT("歸位 %s 先"); // "Home ... first" LSTR MSG_ZPROBE_OFFSETS = _UxGT("探針偏移"); //Probe Offsets LSTR MSG_ZPROBE_XOFFSET = _UxGT("探針X偏移量"); //Probe X Offset LSTR MSG_ZPROBE_YOFFSET = _UxGT("探針Y偏移量"); //Probe Y Offset diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 39506e21d6a8a..8b1a8b6e502c4 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1488,12 +1488,17 @@ void prepare_line_to_destination() { bool homing_needed_error(main_axes_bits_t axis_bits/*=main_axes_mask*/) { if ((axis_bits = axes_should_home(axis_bits))) { - PGM_P home_first = GET_TEXT(MSG_HOME_FIRST); + char all_axes[] = STR_AXES_MAIN, need[NUM_AXES]; + uint8_t n = 0; + LOOP_NUM_AXES(i) if (TEST(axis_bits, i)) need[n++] = all_axes[i]; + need[n] = '\0'; + char msg[30]; - #define _AXIS_CHAR(N) TEST(axis_bits, _AXIS(N)) ? STR_##N : "" - sprintf_P(msg, home_first, MAPLIST(_AXIS_CHAR, MAIN_AXIS_NAMES)); + sprintf_P(msg, GET_EN_TEXT(MSG_HOME_FIRST), need); SERIAL_ECHO_START(); SERIAL_ECHOLN(msg); + + sprintf_P(msg, GET_TEXT(MSG_HOME_FIRST), need); ui.set_status(msg); return true; } From e656f108c8161de94427dfb65ca74153cd231a31 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 22 Jan 2023 06:05:45 +0000 Subject: [PATCH 21/54] [cron] Bump distribution date (2023-01-22) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 3a5d0eafdbec0..a6a8076ed5817 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-18" +//#define STRING_DISTRIBUTION_DATE "2023-01-22" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 0646321c07a23..103e61992d4df 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 "2023-01-18" + #define STRING_DISTRIBUTION_DATE "2023-01-22" #endif /** From fffc96661f53735691b6287c8bb90d0229dbfaae Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 23 Jan 2023 01:22:03 -0600 Subject: [PATCH 22/54] =?UTF-8?q?=F0=9F=90=9B=20Fix=20homing=5Fneeded=5Fer?= =?UTF-8?q?ror=20bits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/motion.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 8b1a8b6e502c4..d440093b169bb 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1487,8 +1487,8 @@ void prepare_line_to_destination() { } bool homing_needed_error(main_axes_bits_t axis_bits/*=main_axes_mask*/) { - if ((axis_bits = axes_should_home(axis_bits))) { - char all_axes[] = STR_AXES_MAIN, need[NUM_AXES]; + if ((axis_bits &= axes_should_home(axis_bits))) { + char all_axes[] = STR_AXES_MAIN, need[NUM_AXES + 1]; uint8_t n = 0; LOOP_NUM_AXES(i) if (TEST(axis_bits, i)) need[n++] = all_axes[i]; need[n] = '\0'; From 32688979a166d334bb20d696f521bdffeaf92357 Mon Sep 17 00:00:00 2001 From: Bob Kuhn Date: Mon, 23 Jan 2023 01:37:35 -0600 Subject: [PATCH 23/54] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Ender-2=20Stock=20Di?= =?UTF-8?q?splay=20with=20Melzi=20(#25258)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 2 +- .../src/pins/sanguino/pins_MELZI_CREALITY.h | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) 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 aac839808119f..a574a9fe8d0dc 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -358,11 +358,11 @@ #define BEEPER_PIN EXP1_01_PIN #elif ENABLED(CR10_STOCKDISPLAY) - #define BTN_ENC EXP1_02_PIN // (58) open-drain #define LCD_PINS_RS EXP1_07_PIN #define BTN_EN1 EXP1_03_PIN #define BTN_EN2 EXP1_05_PIN + #define BTN_ENC EXP1_02_PIN #define LCD_PINS_ENABLE EXP1_08_PIN #define LCD_PINS_D4 EXP1_06_PIN diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h index f508093c22576..437ba35eeadca 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h @@ -43,13 +43,19 @@ #endif // -// For the stock CR-10 enable CR10_STOCKDISPLAY in Configuration.h +// LCD / Controller // -#if ENABLED(CR10_STOCKDISPLAY) - #define LCD_SDSS 31 // Smart Controller SD card reader (rather than the Melzi) - #define LCD_PINS_RS 28 // ST9720 CS - #define LCD_PINS_ENABLE 17 // ST9720 DAT - #define LCD_PINS_D4 30 // ST9720 CLK +#if ANY(MKS_MINI_12864, CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY) + #if ENABLED(CR10_STOCKDISPLAY) + #define LCD_PINS_RS 28 // ST9720 CS + #define LCD_PINS_ENABLE 17 // ST9720 DAT + #define LCD_PINS_D4 30 // ST9720 CLK + #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) + #define DOGLCD_CS 28 + #define DOGLCD_A0 30 + #endif + + #define LCD_SDSS 31 // Controller's SD card #define BTN_ENC 16 #define BTN_EN1 11 @@ -57,6 +63,7 @@ #define BEEPER_PIN 27 #define LCD_PINS_DEFINED + #endif #include "pins_MELZI.h" // ... SANGUINOLOLU_12 ... SANGUINOLOLU_11 From 4099763cfc06cc6b2d71a1fce76d73422183fac0 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 23 Jan 2023 12:07:26 +0000 Subject: [PATCH 24/54] [cron] Bump distribution date (2023-01-23) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index a6a8076ed5817..f4c528b1663b8 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-22" +//#define STRING_DISTRIBUTION_DATE "2023-01-23" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 103e61992d4df..79f59cc83084b 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 "2023-01-22" + #define STRING_DISTRIBUTION_DATE "2023-01-23" #endif /** From e0ae072f5a7094af02704fd7ccc4f3894f076d7a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 24 Jan 2023 02:21:02 -0600 Subject: [PATCH 25/54] =?UTF-8?q?=F0=9F=94=A7=20Overridable=20Stepper=20EN?= =?UTF-8?q?=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/stepper.cpp | 68 ++++++++++++++++++++++++++--------- 1 file changed, 52 insertions(+), 16 deletions(-) diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 9c3d459634e36..2a9487f09697b 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -2776,35 +2776,44 @@ void Stepper::init() { // Init Enable Pins - steppers default to disabled. #if HAS_X_ENABLE + #ifndef X_ENABLE_INIT_STATE + #define X_ENABLE_INIT_STATE !X_ENABLE_ON + #endif X_ENABLE_INIT(); - if (!X_ENABLE_ON) X_ENABLE_WRITE(HIGH); + if (X_ENABLE_INIT_STATE) X_ENABLE_WRITE(X_ENABLE_INIT_STATE); #if BOTH(HAS_X2_STEPPER, HAS_X2_ENABLE) X2_ENABLE_INIT(); - if (!X_ENABLE_ON) X2_ENABLE_WRITE(HIGH); + if (X_ENABLE_INIT_STATE) X2_ENABLE_WRITE(X_ENABLE_INIT_STATE); #endif #endif #if HAS_Y_ENABLE + #ifndef Y_ENABLE_INIT_STATE + #define Y_ENABLE_INIT_STATE !Y_ENABLE_ON + #endif Y_ENABLE_INIT(); - if (!Y_ENABLE_ON) Y_ENABLE_WRITE(HIGH); + if (Y_ENABLE_INIT_STATE) Y_ENABLE_WRITE(Y_ENABLE_INIT_STATE); #if BOTH(HAS_DUAL_Y_STEPPERS, HAS_Y2_ENABLE) Y2_ENABLE_INIT(); - if (!Y_ENABLE_ON) Y2_ENABLE_WRITE(HIGH); + if (Y_ENABLE_INIT_STATE) Y2_ENABLE_WRITE(Y_ENABLE_INIT_STATE); #endif #endif #if HAS_Z_ENABLE + #ifndef Z_ENABLE_INIT_STATE + #define Z_ENABLE_INIT_STATE !Z_ENABLE_ON + #endif Z_ENABLE_INIT(); - if (!Z_ENABLE_ON) Z_ENABLE_WRITE(HIGH); + if (Z_ENABLE_INIT_STATE) Z_ENABLE_WRITE(Z_ENABLE_INIT_STATE); #if NUM_Z_STEPPERS >= 2 && HAS_Z2_ENABLE Z2_ENABLE_INIT(); - if (!Z_ENABLE_ON) Z2_ENABLE_WRITE(HIGH); + if (Z_ENABLE_INIT_STATE) Z2_ENABLE_WRITE(Z_ENABLE_INIT_STATE); #endif #if NUM_Z_STEPPERS >= 3 && HAS_Z3_ENABLE Z3_ENABLE_INIT(); - if (!Z_ENABLE_ON) Z3_ENABLE_WRITE(HIGH); + if (Z_ENABLE_INIT_STATE) Z3_ENABLE_WRITE(Z_ENABLE_INIT_STATE); #endif #if NUM_Z_STEPPERS >= 4 && HAS_Z4_ENABLE Z4_ENABLE_INIT(); - if (!Z_ENABLE_ON) Z4_ENABLE_WRITE(HIGH); + if (Z_ENABLE_INIT_STATE) Z4_ENABLE_WRITE(Z_ENABLE_INIT_STATE); #endif #endif #if HAS_I_ENABLE @@ -2832,36 +2841,63 @@ void Stepper::init() { if (!W_ENABLE_ON) W_ENABLE_WRITE(HIGH); #endif #if HAS_E0_ENABLE + #ifndef E_ENABLE_INIT_STATE + #define E_ENABLE_INIT_STATE !E_ENABLE_ON + #endif + #ifndef E0_ENABLE_INIT_STATE + #define E0_ENABLE_INIT_STATE E_ENABLE_INIT_STATE + #endif E0_ENABLE_INIT(); - if (!E_ENABLE_ON) E0_ENABLE_WRITE(HIGH); + if (E0_ENABLE_INIT_STATE) E0_ENABLE_WRITE(E0_ENABLE_INIT_STATE); #endif #if HAS_E1_ENABLE + #ifndef E1_ENABLE_INIT_STATE + #define E1_ENABLE_INIT_STATE E_ENABLE_INIT_STATE + #endif E1_ENABLE_INIT(); - if (!E_ENABLE_ON) E1_ENABLE_WRITE(HIGH); + if (E1_ENABLE_INIT_STATE) E1_ENABLE_WRITE(E1_ENABLE_INIT_STATE); #endif #if HAS_E2_ENABLE + #ifndef E2_ENABLE_INIT_STATE + #define E2_ENABLE_INIT_STATE E_ENABLE_INIT_STATE + #endif E2_ENABLE_INIT(); - if (!E_ENABLE_ON) E2_ENABLE_WRITE(HIGH); + if (E2_ENABLE_INIT_STATE) E2_ENABLE_WRITE(E2_ENABLE_INIT_STATE); #endif #if HAS_E3_ENABLE + #ifndef E3_ENABLE_INIT_STATE + #define E3_ENABLE_INIT_STATE E_ENABLE_INIT_STATE + #endif E3_ENABLE_INIT(); - if (!E_ENABLE_ON) E3_ENABLE_WRITE(HIGH); + if (E3_ENABLE_INIT_STATE) E3_ENABLE_WRITE(E3_ENABLE_INIT_STATE); #endif #if HAS_E4_ENABLE + #ifndef E4_ENABLE_INIT_STATE + #define E4_ENABLE_INIT_STATE E_ENABLE_INIT_STATE + #endif E4_ENABLE_INIT(); - if (!E_ENABLE_ON) E4_ENABLE_WRITE(HIGH); + if (E4_ENABLE_INIT_STATE) E4_ENABLE_WRITE(E4_ENABLE_INIT_STATE); #endif #if HAS_E5_ENABLE + #ifndef E5_ENABLE_INIT_STATE + #define E5_ENABLE_INIT_STATE E_ENABLE_INIT_STATE + #endif E5_ENABLE_INIT(); - if (!E_ENABLE_ON) E5_ENABLE_WRITE(HIGH); + if (E5_ENABLE_INIT_STATE) E5_ENABLE_WRITE(E5_ENABLE_INIT_STATE); #endif #if HAS_E6_ENABLE + #ifndef E6_ENABLE_INIT_STATE + #define E6_ENABLE_INIT_STATE E_ENABLE_INIT_STATE + #endif E6_ENABLE_INIT(); - if (!E_ENABLE_ON) E6_ENABLE_WRITE(HIGH); + if (E6_ENABLE_INIT_STATE) E6_ENABLE_WRITE(E6_ENABLE_INIT_STATE); #endif #if HAS_E7_ENABLE + #ifndef E7_ENABLE_INIT_STATE + #define E7_ENABLE_INIT_STATE E_ENABLE_INIT_STATE + #endif E7_ENABLE_INIT(); - if (!E_ENABLE_ON) E7_ENABLE_WRITE(HIGH); + if (E7_ENABLE_INIT_STATE) E7_ENABLE_WRITE(E7_ENABLE_INIT_STATE); #endif #define _STEP_INIT(AXIS) AXIS ##_STEP_INIT() From 73932855609aa949fa13e3570659ce26c43b0ab8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 20 Jan 2023 21:17:13 -0600 Subject: [PATCH 26/54] SDIO retry, hsd clock, etc. --- Marlin/src/HAL/STM32/sdio.cpp | 8 +++++++- Marlin/src/feature/stepper_driver_safety.cpp | 2 +- Marlin/src/gcode/config/M220.cpp | 15 +++++++-------- Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h | 10 +++++----- docs/Serial.md | 4 ++-- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/Marlin/src/HAL/STM32/sdio.cpp b/Marlin/src/HAL/STM32/sdio.cpp index 41fe90b825406..72518ef1cc87e 100644 --- a/Marlin/src/HAL/STM32/sdio.cpp +++ b/Marlin/src/HAL/STM32/sdio.cpp @@ -286,6 +286,9 @@ void HAL_SD_MspInit(SD_HandleTypeDef *hsd) { go_to_transfer_speed(); + hsd.Init.ClockPowerSave = SDIO_CLOCK_POWER_SAVE_ENABLE; + hsd.Init.ClockDiv = 8; + #if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // go to 4 bit wide mode if pins are defined retry_Cnt = retryCnt; for (;;) { @@ -433,7 +436,10 @@ bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) { #else uint8_t retries = SDIO_READ_RETRIES; - while (retries--) if (SDIO_ReadWriteBlock_DMA(block, src, nullptr)) return true; + while (retries--) { + if (SDIO_ReadWriteBlock_DMA(block, src, nullptr)) return true; + delay(10); + } return false; #endif diff --git a/Marlin/src/feature/stepper_driver_safety.cpp b/Marlin/src/feature/stepper_driver_safety.cpp index b8762da9b0c02..d3fc1614861e6 100644 --- a/Marlin/src/feature/stepper_driver_safety.cpp +++ b/Marlin/src/feature/stepper_driver_safety.cpp @@ -43,7 +43,7 @@ void stepper_driver_backward_check() { SET_INPUT(AXIS##_ENABLE_PIN); \ OUT_WRITE(AXIS##_STEP_PIN, false); \ delay(20); \ - if (READ(AXIS##_ENABLE_PIN) == false) { \ + if (READ(AXIS##_ENABLE_PIN) == LOW) { \ SBI(axis_plug_backward, BIT); \ stepper_driver_backward_error(F(STRINGIFY(AXIS))); \ } \ diff --git a/Marlin/src/gcode/config/M220.cpp b/Marlin/src/gcode/config/M220.cpp index c9070df803b89..6797df25d562e 100644 --- a/Marlin/src/gcode/config/M220.cpp +++ b/Marlin/src/gcode/config/M220.cpp @@ -36,16 +36,15 @@ * R : Flag to restore the last-saved factor */ void GcodeSuite::M220() { + if (!parser.seen_any()) { + SERIAL_ECHOLNPGM("FR:", feedrate_percentage, "%"); + return; + } static int16_t backup_feedrate_percentage = 100; - if (parser.seen('B')) backup_feedrate_percentage = feedrate_percentage; - if (parser.seen('R')) feedrate_percentage = backup_feedrate_percentage; - + const int16_t now_feedrate_perc = feedrate_percentage; + if (parser.seen_test('R')) feedrate_percentage = backup_feedrate_percentage; + if (parser.seen_test('B')) backup_feedrate_percentage = now_feedrate_perc; if (parser.seenval('S')) feedrate_percentage = parser.value_int(); - if (!parser.seen_any()) { - SERIAL_ECHOPGM("FR:", feedrate_percentage); - SERIAL_CHAR('%'); - SERIAL_EOL(); - } } diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h index 7ce7b5e6ba857..268c0e1d1dcd8 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/settings.h @@ -65,12 +65,12 @@ * multiple serial ports are available. * For example Serial3. */ -#if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define USB_HOST_SERIAL MYSERIAL1 -#endif - #ifndef USB_HOST_SERIAL - #define USB_HOST_SERIAL Serial + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_HOST_SERIAL MYSERIAL1 + #else + #define USB_HOST_SERIAL Serial + #endif #endif //////////////////////////////////////////////////////////////////////////////// diff --git a/docs/Serial.md b/docs/Serial.md index be3b23e87dd79..88846e1bb45ad 100644 --- a/docs/Serial.md +++ b/docs/Serial.md @@ -64,9 +64,9 @@ The following macros are defined (in `serial.h`) to output data to the serial po | `SERIAL_ECHOLNPGM_P` | Same as `SERIAL_ECHOPGM_P` | Do `SERIAL_ECHOPGM_P`, adding a newline | `SERIAL_ECHOLNPGM_P(PSTR("Alice"), 78);` | `alice78\n` | | `SERIAL_ECHOLIST` | String literal, values | Print a string literal and a list of values | `SERIAL_ECHOLIST(F("Key "), 1, 2, 3);` | `Key 1, 2, 3` | | `SERIAL_ECHO_START` | None | Prefix an echo line | `SERIAL_ECHO_START();` | `echo:` | -| `SERIAL_ECHO_MSG` | Same as `SERIAL_ECHOLN_PAIR` | Print a full echo line | `SERIAL_ECHO_MSG("Count is ", count);` | `echo:Count is 3` | +| `SERIAL_ECHO_MSG` | Same as `SERIAL_ECHOLNPGM` | Print a full echo line | `SERIAL_ECHO_MSG("Count is ", count);` | `echo:Count is 3` | | `SERIAL_ERROR_START`| None | Prefix an error line | `SERIAL_ERROR_START();` | `Error:` | -| `SERIAL_ERROR_MSG` | Same as `SERIAL_ECHOLN_PAIR` | Print a full error line | `SERIAL_ERROR_MSG("Not found");` | `Error:Not found` | +| `SERIAL_ERROR_MSG` | Same as `SERIAL_ECHOLNPGM` | Print a full error line | `SERIAL_ERROR_MSG("Not found");` | `Error:Not found` | | `SERIAL_ECHO_SP` | Number of spaces | Print one or more spaces | `SERIAL_ECHO_SP(3)` | ` ` | | `SERIAL_EOL` | None | Print an end of line | `SERIAL_EOL();` | `\n` | | `SERIAL_OUT` | `SERIAL_OUT(myMethod)` | Call a custom serial method | `SERIAL_OUT(msgDone);` | ... | From 7a49fab16d9fd3df238cbd341f90b067e401b17c Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 24 Jan 2023 12:07:25 +0000 Subject: [PATCH 27/54] [cron] Bump distribution date (2023-01-24) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index f4c528b1663b8..0866724b5f293 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-23" +//#define STRING_DISTRIBUTION_DATE "2023-01-24" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 79f59cc83084b..98b7bfcccdfa9 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 "2023-01-23" + #define STRING_DISTRIBUTION_DATE "2023-01-24" #endif /** From cf02107e6a8f9a122f15b38ed6b699215ee7cf16 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 25 Jan 2023 21:37:10 -0600 Subject: [PATCH 28/54] =?UTF-8?q?=F0=9F=94=A7=20Refine=20Input=20Shaping?= =?UTF-8?q?=20check=20(#25280)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 15 +++++++++++---- Marlin/src/inc/Warnings.cpp | 7 +++++++ Marlin/src/module/stepper.cpp | 8 ++++---- Marlin/src/module/stepper.h | 27 ++++++++++++++------------- 4 files changed, 36 insertions(+), 21 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 1aadbb19e3e25..d571ddd7f4a29 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -4379,10 +4379,17 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #error "Input Shaping is not compatible with POLARGRAPH kinematics." #elif ENABLED(DIRECT_STEPPING) #error "Input Shaping is not compatible with DIRECT_STEPPING." - #elif ENABLED(INPUT_SHAPING_X) && ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_YX) - #error "INPUT_SHAPING_X is not supported with COREXY, COREYX, COREXZ, COREZX, or MARKFORGED_*." - #elif ENABLED(INPUT_SHAPING_Y) && ANY(CORE_IS_XY, CORE_IS_YZ, MARKFORGED_XY, MARKFORGED_YX) - #error "INPUT_SHAPING_Y is not supported with COREXY, COREYX, COREYZ, COREZY, or MARKFORGED_*." + #elif BOTH(INPUT_SHAPING_X, CORE_IS_XZ) + #error "INPUT_SHAPING_X is not supported with COREXZ." + #elif BOTH(INPUT_SHAPING_Y, CORE_IS_YZ) + #error "INPUT_SHAPING_Y is not supported with COREYZ." + #elif ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) + #if !BOTH(INPUT_SHAPING_X, INPUT_SHAPING_Y) + #error "INPUT_SHAPING_X and INPUT_SHAPING_Y must both be enabled for COREXY, COREYX, or MARKFORGED_*." + #else + static_assert(SHAPING_FREQ_X == SHAPING_FREQ_Y, "SHAPING_FREQ_X and SHAPING_FREQ_Y must be the same for COREXY / COREYX / MARKFORGED_*."); + static_assert(SHAPING_ZETA_X == SHAPING_ZETA_Y, "SHAPING_ZETA_X and SHAPING_ZETA_Y must be the same for COREXY / COREYX / MARKFORGED_*."); + #endif #endif #ifdef __AVR__ diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 561c8f43a34ed..1d1426936f956 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -790,3 +790,10 @@ #if BOTH(POLAR, S_CURVE_ACCELERATION) #warning "POLAR kinematics may not work well with S_CURVE_ACCELERATION." #endif + +/** + * Input Shaping + */ +#if HAS_SHAPING && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) + #warning "Input Shaping for CORE / MARKFORGED kinematic axes is still experimental." +#endif diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 2a9487f09697b..54b52cd16e0af 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -3020,7 +3020,7 @@ void Stepper::init() { * Calculate a fixed point factor to apply to the signal and its echo * when shaping an axis. */ - void Stepper::set_shaping_damping_ratio(const AxisEnum axis, const float zeta) { + void Stepper::set_shaping_damping_ratio(const AxisEnum axis, const_float_t zeta) { // from the damping ratio, get a factor that can be applied to advance_dividend for fixed point maths // for ZV, we use amplitudes 1/(1+K) and K/(1+K) where K = exp(-zeta * M_PI / sqrt(1.0f - zeta * zeta)) // which can be converted to 1:7 fixed point with an excellent fit with a 3rd order polynomial @@ -3029,9 +3029,9 @@ void Stepper::init() { else if (zeta >= 1.0f) factor2 = 0.0f; else { factor2 = 64.44056192 + -99.02008832 * zeta; - const float zeta2 = zeta * zeta; + const_float_t zeta2 = zeta * zeta; factor2 += -7.58095488 * zeta2; - const float zeta3 = zeta2 * zeta; + const_float_t zeta3 = zeta2 * zeta; factor2 += 43.073216 * zeta3; factor2 = floor(factor2); } @@ -3049,7 +3049,7 @@ void Stepper::init() { return -1; } - void Stepper::set_shaping_frequency(const AxisEnum axis, const float freq) { + void Stepper::set_shaping_frequency(const AxisEnum axis, const_float_t freq) { // enabling or disabling shaping whilst moving can result in lost steps planner.synchronize(); diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index e86498e841da0..3bbfeac9cab8b 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -154,38 +154,39 @@ // Add time for each stepper #if HAS_X_STEP - #define ISR_X_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_X_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_Y_STEP - #define ISR_Y_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_Y_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_Z_STEP - #define ISR_Z_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_Z_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_I_STEP - #define ISR_I_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_I_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_J_STEP - #define ISR_J_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_J_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_K_STEP - #define ISR_K_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_K_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_U_STEP - #define ISR_U_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_U_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_V_STEP - #define ISR_V_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_V_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_W_STEP - #define ISR_W_STEPPER_CYCLES ISR_STEPPER_CYCLES + #define ISR_W_STEPPER_CYCLES ISR_STEPPER_CYCLES #endif #if HAS_EXTRUDERS - #define ISR_E_STEPPER_CYCLES ISR_STEPPER_CYCLES // E is always interpolated, even for mixing extruders + #define ISR_E_STEPPER_CYCLES ISR_STEPPER_CYCLES // E is always interpolated, even for mixing extruders #endif // And the total minimum loop time, not including the base -#define MIN_ISR_LOOP_CYCLES (ISR_MIXING_STEPPER_CYCLES LOGICAL_AXIS_GANG(+ ISR_E_STEPPER_CYCLES, + ISR_X_STEPPER_CYCLES, + ISR_Y_STEPPER_CYCLES, + ISR_Z_STEPPER_CYCLES, + ISR_I_STEPPER_CYCLES, + ISR_J_STEPPER_CYCLES, + ISR_K_STEPPER_CYCLES, + ISR_U_STEPPER_CYCLES, + ISR_V_STEPPER_CYCLES, + ISR_W_STEPPER_CYCLES)) +#define _PLUS_AXIS_CYCLES(A) + (ISR_##A##_STEPPER_CYCLES) +#define MIN_ISR_LOOP_CYCLES (ISR_MIXING_STEPPER_CYCLES LOGICAL_AXIS_MAP(_PLUS_AXIS_CYCLES)) // Calculate the minimum MPU cycles needed per pulse to enforce, limited to the max stepper rate #define _MIN_STEPPER_PULSE_CYCLES(N) _MAX(uint32_t((F_CPU) / (MAXIMUM_STEPPER_RATE)), ((F_CPU) / 500000UL) * (N)) @@ -802,9 +803,9 @@ class Stepper { } #if HAS_SHAPING - static void set_shaping_damping_ratio(const AxisEnum axis, const float zeta); + static void set_shaping_damping_ratio(const AxisEnum axis, const_float_t zeta); static float get_shaping_damping_ratio(const AxisEnum axis); - static void set_shaping_frequency(const AxisEnum axis, const float freq); + static void set_shaping_frequency(const AxisEnum axis, const_float_t freq); static float get_shaping_frequency(const AxisEnum axis); #endif From 4f902ac950e02d1d4e4b13afdec46937364ec22d Mon Sep 17 00:00:00 2001 From: Alexander Gavrilenko Date: Thu, 26 Jan 2023 07:05:43 +0300 Subject: [PATCH 29/54] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Simulator=20TFT=20co?= =?UTF-8?q?mpile=20(#25279)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/NATIVE_SIM/tft/tft_spi.h | 11 ++-- Marlin/src/inc/Conditionals_LCD.h | 25 +------- Marlin/src/lcd/tft_io/tft_io.h | 59 +---------------- Marlin/src/lcd/tft_io/tft_orientation.h | 85 +++++++++++++++++++++++++ 4 files changed, 96 insertions(+), 84 deletions(-) create mode 100644 Marlin/src/lcd/tft_io/tft_orientation.h diff --git a/Marlin/src/HAL/NATIVE_SIM/tft/tft_spi.h b/Marlin/src/HAL/NATIVE_SIM/tft/tft_spi.h index b3e622f19ac4a..f412e09e11020 100644 --- a/Marlin/src/HAL/NATIVE_SIM/tft/tft_spi.h +++ b/Marlin/src/HAL/NATIVE_SIM/tft/tft_spi.h @@ -31,10 +31,11 @@ #endif #define DATASIZE_8BIT 8 -#define DATASIZE_16BIT 16 -#define TFT_IO_DRIVER TFT_SPI +#define DATASIZE_16BIT 16 +#define TFT_IO_DRIVER TFT_SPI +#define DMA_MAX_SIZE 0xFFFF -#define DMA_MINC_ENABLE 1 +#define DMA_MINC_ENABLE 1 #define DMA_MINC_DISABLE 0 class TFT_SPI { @@ -58,7 +59,9 @@ class TFT_SPI { static void WriteData(uint16_t Data); static void WriteReg(uint16_t Reg); + static void WriteSequence_DMA(uint16_t *Data, uint16_t Count) { WriteSequence(Data, Count); } + static void WriteMultiple_DMA(uint16_t Color, uint16_t Count) { WriteMultiple(Color, Count); } + static void WriteSequence(uint16_t *Data, uint16_t Count); - // static void WriteMultiple(uint16_t Color, uint16_t Count); static void WriteMultiple(uint16_t Color, uint32_t Count); }; diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index af9dd22557997..b411d3e7c6077 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1549,29 +1549,8 @@ #endif #endif -// Set TFT_COLOR_UI_PORTRAIT flag, if needed -#if defined(TFT_ROTATION) && (HAS_SPI_TFT || HAS_FSMC_TFT || HAS_LTDC_TFT) - #define _CMP_TFT_ROTATE_90 90 - #define _CMP_TFT_ROTATE_270 270 - #define _CMP_TFT_ROTATE_90_MIRROR_X 90 - #define _CMP_TFT_ROTATE_90_MIRROR_Y 90 - #define _CMP_TFT_ROTATE_270_MIRROR_X 270 - #define _CMP_TFT_ROTATE_270_MIRROR_Y 270 - #define _ISROT(N) || (_CAT(_CMP_, TFT_ROTATION) == N) - #define ISROT(V...) (0 MAP(_ISROT, V)) - - #if ISROT(90, 270) - #define TFT_COLOR_UI_PORTRAIT 1 - #endif - - #undef _CMP_TFT_ROTATE_90 - #undef _CMP_TFT_ROTATE_270 - #undef _CMP_TFT_ROTATE_90_MIRROR_X - #undef _CMP_TFT_ROTATE_90_MIRROR_Y - #undef _CMP_TFT_ROTATE_270_MIRROR_X - #undef _CMP_TFT_ROTATE_270_MIRROR_Y - #undef _ISROT - #undef ISROT +#if ANY(HAS_SPI_TFT, HAS_FSMC_TFT, HAS_LTDC_TFT) + #include "../lcd/tft_io/tft_orientation.h" #endif #if ENABLED(TFT_RES_320x240) diff --git a/Marlin/src/lcd/tft_io/tft_io.h b/Marlin/src/lcd/tft_io/tft_io.h index a3635aaa93d6f..9cfb2137df5e1 100644 --- a/Marlin/src/lcd/tft_io/tft_io.h +++ b/Marlin/src/lcd/tft_io/tft_io.h @@ -34,65 +34,10 @@ #endif #ifndef DMA_MAX_SIZE - #error "MAX_DMA_SIZE is not configured for this platform." + #error "DMA_MAX_SIZE is not configured for this platform." #endif -#define TFT_EXCHANGE_XY _BV32(1) -#define TFT_INVERT_X _BV32(2) -#define TFT_INVERT_Y _BV32(3) - -#define TFT_NO_ROTATION (0x00) -#define TFT_ROTATE_90 (TFT_EXCHANGE_XY | TFT_INVERT_X) -#define TFT_ROTATE_180 (TFT_INVERT_X | TFT_INVERT_Y) -#define TFT_ROTATE_270 (TFT_EXCHANGE_XY | TFT_INVERT_Y) - -#define TFT_MIRROR_X (TFT_INVERT_Y) -#define TFT_MIRROR_Y (TFT_INVERT_X) - -#define TFT_ROTATE_90_MIRROR_X (TFT_ROTATE_90 ^ TFT_MIRROR_X) -#define TFT_ROTATE_90_MIRROR_Y (TFT_ROTATE_90 ^ TFT_MIRROR_Y) - -#define TFT_ROTATE_180_MIRROR_X (TFT_ROTATE_180 ^ TFT_MIRROR_X) -#define TFT_ROTATE_180_MIRROR_Y (TFT_ROTATE_180 ^ TFT_MIRROR_Y) - -#define TFT_ROTATE_270_MIRROR_X (TFT_ROTATE_270 ^ TFT_MIRROR_X) -#define TFT_ROTATE_270_MIRROR_Y (TFT_ROTATE_270 ^ TFT_MIRROR_Y) - -// TFT_ROTATION is user configurable -#ifndef TFT_ROTATION - #define TFT_ROTATION TFT_NO_ROTATION -#endif - -// TFT_ORIENTATION is the "sum" of TFT_DEFAULT_ORIENTATION plus user TFT_ROTATION -#define TFT_ORIENTATION ((TFT_DEFAULT_ORIENTATION) ^ (TFT_ROTATION)) - -#define TFT_COLOR_RGB _BV32(3) -#define TFT_COLOR_BGR _BV32(4) - -// Each TFT Driver is responsible for its default color mode. -// #ifndef TFT_COLOR -// #define TFT_COLOR TFT_COLOR_RGB -// #endif - -#define TOUCH_ORIENTATION_NONE 0 -#define TOUCH_LANDSCAPE 1 -#define TOUCH_PORTRAIT 2 - -#ifndef TOUCH_CALIBRATION_X - #define TOUCH_CALIBRATION_X 0 -#endif -#ifndef TOUCH_CALIBRATION_Y - #define TOUCH_CALIBRATION_Y 0 -#endif -#ifndef TOUCH_OFFSET_X - #define TOUCH_OFFSET_X 0 -#endif -#ifndef TOUCH_OFFSET_Y - #define TOUCH_OFFSET_Y 0 -#endif -#ifndef TOUCH_ORIENTATION - #define TOUCH_ORIENTATION TOUCH_LANDSCAPE -#endif +#include "tft_orientation.h" #ifndef TFT_DRIVER #define TFT_DRIVER AUTO diff --git a/Marlin/src/lcd/tft_io/tft_orientation.h b/Marlin/src/lcd/tft_io/tft_orientation.h new file mode 100644 index 0000000000000..7822fc6b04f26 --- /dev/null +++ b/Marlin/src/lcd/tft_io/tft_orientation.h @@ -0,0 +1,85 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#define TFT_EXCHANGE_XY _BV32(1) +#define TFT_INVERT_X _BV32(2) +#define TFT_INVERT_Y _BV32(3) + +#define TFT_NO_ROTATION (0x00) +#define TFT_ROTATE_90 (TFT_EXCHANGE_XY | TFT_INVERT_X) +#define TFT_ROTATE_180 (TFT_INVERT_X | TFT_INVERT_Y) +#define TFT_ROTATE_270 (TFT_EXCHANGE_XY | TFT_INVERT_Y) + +#define TFT_MIRROR_X (TFT_INVERT_Y) +#define TFT_MIRROR_Y (TFT_INVERT_X) + +#define TFT_ROTATE_90_MIRROR_X (TFT_ROTATE_90 ^ TFT_MIRROR_X) +#define TFT_ROTATE_90_MIRROR_Y (TFT_ROTATE_90 ^ TFT_MIRROR_Y) + +#define TFT_ROTATE_180_MIRROR_X (TFT_ROTATE_180 ^ TFT_MIRROR_X) +#define TFT_ROTATE_180_MIRROR_Y (TFT_ROTATE_180 ^ TFT_MIRROR_Y) + +#define TFT_ROTATE_270_MIRROR_X (TFT_ROTATE_270 ^ TFT_MIRROR_X) +#define TFT_ROTATE_270_MIRROR_Y (TFT_ROTATE_270 ^ TFT_MIRROR_Y) + +// TFT_ROTATION is user configurable +#ifndef TFT_ROTATION + #define TFT_ROTATION TFT_NO_ROTATION +#endif + +// TFT_ORIENTATION is the "sum" of TFT_DEFAULT_ORIENTATION plus user TFT_ROTATION +#define TFT_ORIENTATION ((TFT_DEFAULT_ORIENTATION) ^ (TFT_ROTATION)) + +// Set TFT_COLOR_UI_PORTRAIT flag, if needed +#if ((TFT_ORIENTATION) & TFT_EXCHANGE_XY) == 0 + #define TFT_COLOR_UI_PORTRAIT 1 +#endif + +#define TFT_COLOR_RGB _BV32(3) +#define TFT_COLOR_BGR _BV32(4) + +// Each TFT Driver is responsible for its default color mode. +// #ifndef TFT_COLOR +// #define TFT_COLOR TFT_COLOR_RGB +// #endif + +#define TOUCH_ORIENTATION_NONE 0 +#define TOUCH_LANDSCAPE 1 +#define TOUCH_PORTRAIT 2 + +#ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X 0 +#endif +#ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 0 +#endif +#ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 0 +#endif +#ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y 0 +#endif +#ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE +#endif + From a2c93c24a69ab5342bd92c92426628e45b790d8f Mon Sep 17 00:00:00 2001 From: avionix-g <63542699+avionix-g@users.noreply.github.com> Date: Wed, 25 Jan 2023 23:14:52 -0500 Subject: [PATCH 30/54] =?UTF-8?q?=F0=9F=90=9B=20Fix=20MKS=20board=20Ultipa?= =?UTF-8?q?nel=20support=20(#25278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h | 2 +- Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h | 2 +- Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h index b1031de8d5b74..1896cd5441b33 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h @@ -344,7 +344,7 @@ #else #define LCD_PINS_D4 EXP1_05_PIN - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 EXP1_06_PIN #define LCD_PINS_D6 EXP1_07_PIN #define LCD_PINS_D7 EXP1_08_PIN diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h index d26811199bc8b..42b252d320e7e 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -361,7 +361,7 @@ #else // !MKS_MINI_12864 #define LCD_PINS_D4 EXP1_05_PIN - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 EXP1_06_PIN #define LCD_PINS_D6 EXP1_07_PIN #define LCD_PINS_D7 EXP1_08_PIN diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h index 873ba3e90d66c..14b3d6616830a 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -363,7 +363,7 @@ #else // !MKS_MINI_12864 #define LCD_PINS_D4 EXP1_05_PIN - #if ENABLED(ULTIPANEL) + #if IS_ULTIPANEL #define LCD_PINS_D5 EXP1_06_PIN #define LCD_PINS_D6 EXP1_07_PIN #define LCD_PINS_D7 EXP1_08_PIN From 2637153575a6ee695a6edb0ac561ee7899fba2f2 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 26 Jan 2023 06:05:55 +0000 Subject: [PATCH 31/54] [cron] Bump distribution date (2023-01-26) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 0866724b5f293..73363610f75ef 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-24" +//#define STRING_DISTRIBUTION_DATE "2023-01-26" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 98b7bfcccdfa9..3bc302e61d267 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 "2023-01-24" + #define STRING_DISTRIBUTION_DATE "2023-01-26" #endif /** From 0e748da7d39f6d2193257478e6f997cb4a4fc1a5 Mon Sep 17 00:00:00 2001 From: xBiohazardx <36756950+xBiohazardx@users.noreply.github.com> Date: Fri, 27 Jan 2023 01:05:04 +0100 Subject: [PATCH 32/54] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20probe=20invert?= =?UTF-8?q?=20flag=20(#25282)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 8 ++++---- Marlin/src/pins/ramps/pins_K8400.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index d571ddd7f4a29..b4e0699403da9 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1808,7 +1808,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "BLTOUCH requires DEACTIVATE_SERVOS_AFTER_MOVE to be to disabled. Please update your Configuration.h file." #endif - #if HAS_INVERTED_PROBE + #if ENABLED(INVERTED_PROBE_STATE) #if !Z_MIN_PROBE_ENDSTOP_INVERTING #error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to true." #endif @@ -1816,7 +1816,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to false." #endif #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #if HAS_INVERTED_PROBE + #if ENABLED(INVERTED_PROBE_STATE) #if !Z_MIN_ENDSTOP_INVERTING #error "BLTOUCH requires Z_MIN_ENDSTOP_INVERTING set to true." #endif @@ -1848,7 +1848,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #elif !HAS_RESUME_CONTINUE #error "TOUCH_MI_PROBE currently requires an LCD controller or EMERGENCY_PARSER." #endif - #if HAS_INVERTED_PROBE + #if ENABLED(INVERTED_PROBE_STATE) #if !Z_MIN_PROBE_ENDSTOP_INVERTING #error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING set to true." #endif @@ -1856,7 +1856,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING set to false." #endif #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - #if HAS_INVERTED_PROBE + #if ENABLED(INVERTED_PROBE_STATE) #if !Z_MIN_ENDSTOP_INVERTING #error "TOUCH_MI_PROBE requires Z_MIN_ENDSTOP_INVERTING set to true." #endif diff --git a/Marlin/src/pins/ramps/pins_K8400.h b/Marlin/src/pins/ramps/pins_K8400.h index 686c29b7fb8f8..22ac1be8abc98 100644 --- a/Marlin/src/pins/ramps/pins_K8400.h +++ b/Marlin/src/pins/ramps/pins_K8400.h @@ -51,7 +51,7 @@ #define Y_STOP_PIN 14 #if EITHER(BLTOUCH, TOUCH_MI_PROBE) - #define HAS_INVERTED_PROBE + #define INVERTED_PROBE_STATE #endif #include "pins_3DRAG.h" // ... RAMPS From ab767a4586a5c0c9ca1c7afeb43d0ee226a1e38d Mon Sep 17 00:00:00 2001 From: alexgrach Date: Fri, 27 Jan 2023 03:20:09 +0300 Subject: [PATCH 33/54] =?UTF-8?q?=F0=9F=90=9B=20Fix=20TFT=20Color=20UI=20L?= =?UTF-8?q?CD=5FHEIGHT=20(#25281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index b411d3e7c6077..c4926edd51c7d 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1620,9 +1620,11 @@ #define HAS_UI_1024x600 1 #endif #if ANY(HAS_UI_320x240, HAS_UI_480x320, HAS_UI_480x272) - #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen -#elif HAS_UI_240x320 - #define LCD_HEIGHT TERN(TOUCH_SCREEN, 8, 6) // Fewer lines with touch buttons onscreen + #if ENABLED(TFT_COLOR_UI_PORTRAIT) + #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen + #else + #define LCD_HEIGHT TERN(TOUCH_SCREEN, 8, 9) // Fewer lines with touch buttons onscreen + #endif #elif HAS_UI_1024x600 #define LCD_HEIGHT TERN(TOUCH_SCREEN, 12, 13) // Fewer lines with touch buttons onscreen #endif From 67bc855000345921281a2c8c210e4363542f6a81 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 27 Jan 2023 00:27:06 +0000 Subject: [PATCH 34/54] [cron] Bump distribution date (2023-01-27) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 73363610f75ef..77f889518c3ef 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-26" +//#define STRING_DISTRIBUTION_DATE "2023-01-27" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 3bc302e61d267..d6535886bdaee 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 "2023-01-26" + #define STRING_DISTRIBUTION_DATE "2023-01-27" #endif /** From 0c181fc9d3ebd77d613cff63ccb82f2e4d4c39ec Mon Sep 17 00:00:00 2001 From: Bob Kuhn Date: Mon, 30 Jan 2023 21:57:36 -0600 Subject: [PATCH 35/54] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20G61=20axis=20paramet?= =?UTF-8?q?ers=20with=20no=20offset=20(#25312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/feature/pause/G61.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Marlin/src/gcode/feature/pause/G61.cpp b/Marlin/src/gcode/feature/pause/G61.cpp index b85487af45c2e..889709c04531d 100644 --- a/Marlin/src/gcode/feature/pause/G61.cpp +++ b/Marlin/src/gcode/feature/pause/G61.cpp @@ -35,11 +35,24 @@ /** * G61: Return to saved position * - * F - Feedrate (optional) for the move back. - * S - Slot # (0-based) to restore from (default 0). - * X Y Z E - Axes to restore. At least one is required. + * F - Feedrate (optional) for the move back. + * S - Slot # (0-based) to restore from (default 0). + * X - Restore X axis, applying the given offset (default 0) + * Y - Restore Y axis, applying the given offset (default 0) + * Z - Restore Z axis, applying the given offset (default 0) * - * If XYZE are not given, default restore uses the smart blocking move. + * If there is an Extruder: + * E - Restore E axis, applying the given offset (default 0) + * + * With extra axes using default names: + * A - Restore 4th axis, applying the given offset (default 0) + * B - Restore 5th axis, applying the given offset (default 0) + * C - Restore 6th axis, applying the given offset (default 0) + * U - Restore 7th axis, applying the given offset (default 0) + * V - Restore 8th axis, applying the given offset (default 0) + * W - Restore 9th axis, applying the given offset (default 0) + * + * If no axes are specified then all axes are restored. */ void GcodeSuite::G61() { @@ -71,7 +84,7 @@ void GcodeSuite::G61() { if (parser.seen(STR_AXES_MAIN)) { DEBUG_ECHOPGM(STR_RESTORING_POS " S", slot); LOOP_NUM_AXES(i) { - destination[i] = parser.seenval(AXIS_CHAR(i)) + destination[i] = parser.seen(AXIS_CHAR(i)) ? stored_position[slot][i] + parser.value_axis_units((AxisEnum)i) : current_position[i]; DEBUG_CHAR(' ', AXIS_CHAR(i)); From d0a965a1df3cab6522704c4a9b2e85b53b3c5c40 Mon Sep 17 00:00:00 2001 From: Darren Garnier Date: Mon, 30 Jan 2023 23:00:49 -0500 Subject: [PATCH 36/54] =?UTF-8?q?=F0=9F=94=A8=20Fix=20config.ini=20URL=20f?= =?UTF-8?q?etch=20(#25313)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/scripts/configuration.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/configuration.py b/buildroot/share/PlatformIO/scripts/configuration.py index d752ebc2c8283..42fc91038ecc5 100644 --- a/buildroot/share/PlatformIO/scripts/configuration.py +++ b/buildroot/share/PlatformIO/scripts/configuration.py @@ -85,13 +85,12 @@ def apply_opt(name, val, conf=None): # Return True if any files were fetched. def fetch_example(url): if url.endswith("/"): url = url[:-1] - if url.startswith('http'): - url = url.replace("%", "%25").replace(" ", "%20") - else: + if not url.startswith('http'): brch = "bugfix-2.1.x" - if '@' in path: path, brch = map(str.strip, path.split('@')) + if '@' in url: url, brch = map(str.strip, url.split('@')) url = f"https://raw.githubusercontent.com/MarlinFirmware/Configurations/{brch}/config/{url}" - + url = url.replace("%", "%25").replace(" ", "%20") + # Find a suitable fetch command if shutil.which("curl") is not None: fetch = "curl -L -s -S -f -o" From 087e19a0ed4b769224d42cca83c8caccefce63c9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 30 Jan 2023 22:11:50 -0600 Subject: [PATCH 37/54] =?UTF-8?q?=F0=9F=94=A7=20Fix=20build=20with=20no=20?= =?UTF-8?q?Y=20axis=20(#25311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/fastio.h | 6 +- Marlin/src/core/serial.h | 4 +- Marlin/src/core/types.h | 117 ++++++++++-------- Marlin/src/gcode/calibrate/G28.cpp | 19 ++- Marlin/src/inc/Conditionals_LCD.h | 60 ++++----- Marlin/src/inc/Conditionals_adv.h | 51 +++++--- Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/inc/SanityCheck.h | 4 +- .../generic/move_axis_screen.cpp | 66 +++++----- Marlin/src/module/motion.cpp | 4 +- 10 files changed, 184 insertions(+), 149 deletions(-) diff --git a/Marlin/src/HAL/AVR/fastio.h b/Marlin/src/HAL/AVR/fastio.h index 612ab902e36f1..8a5e4650f4c6c 100644 --- a/Marlin/src/HAL/AVR/fastio.h +++ b/Marlin/src/HAL/AVR/fastio.h @@ -293,11 +293,11 @@ enum ClockSource2 : uint8_t { #if HAS_MOTOR_CURRENT_PWM #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1 || P == MOTOR_CURRENT_PWM_Z || P == MOTOR_CURRENT_PWM_XY) + #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E_PIN || P == MOTOR_CURRENT_PWM_E0_PIN || P == MOTOR_CURRENT_PWM_E1_PIN || P == MOTOR_CURRENT_PWM_Z_PIN || P == MOTOR_CURRENT_PWM_XY_PIN) #elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1 || P == MOTOR_CURRENT_PWM_Z) + #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E_PIN || P == MOTOR_CURRENT_PWM_E0_PIN || P == MOTOR_CURRENT_PWM_E1_PIN || P == MOTOR_CURRENT_PWM_Z_PIN) #else - #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1) + #define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E_PIN || P == MOTOR_CURRENT_PWM_E0_PIN || P == MOTOR_CURRENT_PWM_E1_PIN) #endif #else #define PWM_CHK_MOTOR_CURRENT(P) false diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index c19bc087833dd..a1126d74615c5 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -337,8 +337,8 @@ void serial_offset(const_float_t v, const uint8_t sp=0); // For v==0 draw space void print_bin(const uint16_t val); void print_pos(NUM_AXIS_ARGS(const_float_t), FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr); -inline void print_pos(const xyz_pos_t &xyz, FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr) { - print_pos(NUM_AXIS_ELEM(xyz), prefix, suffix); +inline void print_pos(const xyze_pos_t &xyze, FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr) { + print_pos(NUM_AXIS_ELEM(xyze), prefix, suffix); } #define SERIAL_POS(SUFFIX,VAR) do { print_pos(VAR, F(" " STRINGIFY(VAR) "="), F(" : " SUFFIX "\n")); }while(0) diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 61c182448e451..f1fae85b5ca4f 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -430,21 +430,24 @@ struct XYval { FI XYval& operator+=(const XYval &rs) { x += rs.x; y += rs.y; return *this; } FI XYval& operator-=(const XYval &rs) { x -= rs.x; y -= rs.y; return *this; } FI XYval& operator*=(const XYval &rs) { x *= rs.x; y *= rs.y; return *this; } - FI XYval& operator+=(const XYZval &rs) { x += rs.x; y += rs.y; return *this; } - FI XYval& operator-=(const XYZval &rs) { x -= rs.x; y -= rs.y; return *this; } - FI XYval& operator*=(const XYZval &rs) { x *= rs.x; y *= rs.y; return *this; } - FI XYval& operator+=(const XYZEval &rs) { x += rs.x; y += rs.y; return *this; } - FI XYval& operator-=(const XYZEval &rs) { x -= rs.x; y -= rs.y; return *this; } - FI XYval& operator*=(const XYZEval &rs) { x *= rs.x; y *= rs.y; return *this; } + FI XYval& operator/=(const XYval &rs) { x /= rs.x; y /= rs.y; return *this; } + FI XYval& operator+=(const XYZval &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y,,,,,,, ); return *this; } + FI XYval& operator-=(const XYZval &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y,,,,,,, ); return *this; } + FI XYval& operator*=(const XYZval &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y,,,,,,, ); return *this; } + FI XYval& operator/=(const XYZval &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y,,,,,,, ); return *this; } + FI XYval& operator+=(const XYZEval &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y,,,,,,, ); return *this; } + FI XYval& operator-=(const XYZEval &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y,,,,,,, ); return *this; } + FI XYval& operator*=(const XYZEval &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y,,,,,,, ); return *this; } + FI XYval& operator/=(const XYZEval &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y,,,,,,, ); return *this; } FI XYval& operator*=(const float &p) { x *= p; y *= p; return *this; } FI XYval& operator*=(const int &p) { x *= p; y *= p; return *this; } FI XYval& operator>>=(const int &p) { _RS(x); _RS(y); return *this; } FI XYval& operator<<=(const int &p) { _LS(x); _LS(y); return *this; } // Exact comparisons. For floats a "NEAR" operation may be better. - FI bool operator==(const XYval &rs) const { return x == rs.x && y == rs.y; } - FI bool operator==(const XYZval &rs) const { return x == rs.x && y == rs.y; } - FI bool operator==(const XYZEval &rs) const { return x == rs.x && y == rs.y; } + FI bool operator==(const XYval &rs) const { return NUM_AXIS_GANG(x == rs.x, && y == rs.y,,,,,,, ); } + FI bool operator==(const XYZval &rs) const { return NUM_AXIS_GANG(x == rs.x, && y == rs.y,,,,,,, ); } + FI bool operator==(const XYZEval &rs) const { return NUM_AXIS_GANG(x == rs.x, && y == rs.y,,,,,,, ); } FI bool operator!=(const XYval &rs) const { return !operator==(rs); } FI bool operator!=(const XYZval &rs) const { return !operator==(rs); } FI bool operator!=(const XYZEval &rs) const { return !operator==(rs); } @@ -465,15 +468,9 @@ struct XYZval { FI void reset() { NUM_AXIS_GANG(x =, y =, z =, i =, j =, k =, u =, v =, w =) 0; } // Setters taking struct types and arrays - FI void set(const T px) { x = px; } - FI void set(const T px, const T py) { x = px; y = py; } - FI void set(const XYval pxy) { x = pxy.x; y = pxy.y; } - FI void set(const XYval pxy, const T pz) { NUM_AXIS_CODE(x = pxy.x, y = pxy.y, z = pz, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP); } - FI void set(const T (&arr)[XY]) { x = arr[0]; y = arr[1]; } - #if HAS_Z_AXIS - FI void set(const T (&arr)[NUM_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); } - FI void set(NUM_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w ); } - #endif + FI void set(const XYval pxy) { NUM_AXIS_CODE(x = pxy.x, y = pxy.y,,,,,,,); } + FI void set(const XYval pxy, const T pz) { NUM_AXIS_CODE(x = pxy.x, y = pxy.y, z = pz,,,,,,); } + FI void set(const T (&arr)[NUM_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); } #if LOGICAL_AXES > NUM_AXES FI void set(const T (&arr)[LOGICAL_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); } FI void set(LOGICAL_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w ); } @@ -481,6 +478,17 @@ struct XYZval { FI void set(const T (&arr)[DISTINCT_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); } #endif #endif + + // Setter for all individual args + FI void set(NUM_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); } + + // Setters with fewer elements leave the rest untouched + #if HAS_Y_AXIS + FI void set(const T px) { x = px; } + #endif + #if HAS_Z_AXIS + FI void set(const T px, const T py) { x = px; y = py; } + #endif #if HAS_I_AXIS FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; } #endif @@ -545,14 +553,14 @@ struct XYZval { FI XYZval& operator= (const XYZEval &rs) { set(NUM_AXIS_ELEM(rs)); return *this; } // Override other operators to get intuitive behaviors - FI XYZval operator+ (const XYval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; } - FI XYZval operator+ (const XYval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; } - FI XYZval operator- (const XYval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; } - FI XYZval operator- (const XYval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; } - FI XYZval operator* (const XYval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; } - FI XYZval operator* (const XYval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; } - FI XYZval operator/ (const XYval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; } - FI XYZval operator/ (const XYval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; } + FI XYZval operator+ (const XYval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y,,,,,,, ); return ls; } + FI XYZval operator+ (const XYval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y,,,,,,, ); return ls; } + FI XYZval operator- (const XYval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y,,,,,,, ); return ls; } + FI XYZval operator- (const XYval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y,,,,,,, ); return ls; } + FI XYZval operator* (const XYval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y,,,,,,, ); return ls; } + FI XYZval operator* (const XYval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y,,,,,,, ); return ls; } + FI XYZval operator/ (const XYval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y,,,,,,, ); return ls; } + FI XYZval operator/ (const XYval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y,,,,,,, ); return ls; } FI XYZval operator+ (const XYZval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; } FI XYZval operator+ (const XYZval &rs) { XYZval ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; } FI XYZval operator- (const XYZval &rs) const { XYZval ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; } @@ -585,10 +593,10 @@ struct XYZval { FI XYZval operator-() { XYZval o = *this; NUM_AXIS_CODE(o.x = -x, o.y = -y, o.z = -z, o.i = -i, o.j = -j, o.k = -k, o.u = -u, o.v = -v, o.w = -w); return o; } // Modifier operators - FI XYZval& operator+=(const XYval &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP ); return *this; } - FI XYZval& operator-=(const XYval &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP ); return *this; } - FI XYZval& operator*=(const XYval &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP ); return *this; } - FI XYZval& operator/=(const XYval &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP ); return *this; } + FI XYZval& operator+=(const XYval &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y,,,,,,, ); return *this; } + FI XYZval& operator-=(const XYval &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y,,,,,,, ); return *this; } + FI XYZval& operator*=(const XYval &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y,,,,,,, ); return *this; } + FI XYZval& operator/=(const XYval &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y,,,,,,, ); return *this; } FI XYZval& operator+=(const XYZval &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k, u += rs.u, v += rs.v, w += rs.w); return *this; } FI XYZval& operator-=(const XYZval &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; } FI XYZval& operator*=(const XYZval &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; } @@ -620,9 +628,31 @@ struct XYZEval { // Reset all to 0 FI void reset() { LOGICAL_AXIS_GANG(e =, x =, y =, z =, i =, j =, k =, u =, v =, w =) 0; } - // Setters for some number of linear axes, not all - FI void set(const T px) { x = px; } - FI void set(const T px, const T py) { x = px; y = py; } + // Setters taking struct types and arrays + FI void set(const XYval pxy) { x = pxy.x; OPTCODE(HAS_Y_AXIS, y = pxy.y) } + FI void set(const XYZval pxyz) { set(NUM_AXIS_ELEM(pxyz)); } + FI void set(const XYval pxy, const T pz) { set(pxy); TERN_(HAS_Z_AXIS, z = pz); } + FI void set(const T (&arr)[NUM_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); } + #if LOGICAL_AXES > NUM_AXES + FI void set(const T (&arr)[LOGICAL_AXES]) { LOGICAL_AXIS_CODE(e = arr[LOGICAL_AXES-1], x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); } + FI void set(const XYval pxy, const T pz, const T pe) { set(pxy, pz); e = pe; } + FI void set(const XYZval pxyz, const T pe) { set(pxyz); e = pe; } + FI void set(LOGICAL_AXIS_ARGS(const T)) { LOGICAL_AXIS_CODE(_e = e, a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); } + #if DISTINCT_AXES > LOGICAL_AXES + FI void set(const T (&arr)[DISTINCT_AXES]) { LOGICAL_AXIS_CODE(e = arr[LOGICAL_AXES-1], x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); } + #endif + #endif + + // Setter for all individual args + FI void set(NUM_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); } + + // Setters with fewer elements leave the rest untouched + #if HAS_Y_AXIS + FI void set(const T px) { x = px; } + #endif + #if HAS_Z_AXIS + FI void set(const T px, const T py) { x = px; y = py; } + #endif #if HAS_I_AXIS FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; } #endif @@ -642,19 +672,6 @@ struct XYZEval { FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk, const T pu, const T pv) { x = px; y = py; z = pz; i = pi; j = pj; k = pk; u = pu; v = pv; } #endif - // Setters taking struct types and arrays - FI void set(const XYval pxy) { x = pxy.x; y = pxy.y; } - FI void set(const XYZval pxyz) { set(NUM_AXIS_ELEM(pxyz)); } - #if HAS_Z_AXIS - FI void set(NUM_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); } - #endif - FI void set(const XYval pxy, const T pz) { set(pxy); TERN_(HAS_Z_AXIS, z = pz); } - #if LOGICAL_AXES > NUM_AXES - FI void set(const XYval pxy, const T pz, const T pe) { set(pxy, pz); e = pe; } - FI void set(const XYZval pxyz, const T pe) { set(pxyz); e = pe; } - FI void set(LOGICAL_AXIS_ARGS(const T)) { LOGICAL_AXIS_CODE(_e = e, a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); } - #endif - // Length reduced to one dimension FI T magnitude() const { return (T)sqrtf(LOGICAL_AXIS_GANG(+ e*e, + x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)); } // Pointer to the data as a simple array @@ -739,10 +756,10 @@ struct XYZEval { FI XYZEval operator-() { return LOGICAL_AXIS_ARRAY(-e, -x, -y, -z, -i, -j, -k, -u, -v, -w); } // Modifier operators - FI XYZEval& operator+=(const XYval &rs) { x += rs.x; y += rs.y; return *this; } - FI XYZEval& operator-=(const XYval &rs) { x -= rs.x; y -= rs.y; return *this; } - FI XYZEval& operator*=(const XYval &rs) { x *= rs.x; y *= rs.y; return *this; } - FI XYZEval& operator/=(const XYval &rs) { x /= rs.x; y /= rs.y; return *this; } + FI XYZEval& operator+=(const XYval &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y,,,,,,, ); return *this; } + FI XYZEval& operator-=(const XYval &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y,,,,,,, ); return *this; } + FI XYZEval& operator*=(const XYval &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y,,,,,,, ); return *this; } + FI XYZEval& operator/=(const XYval &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y,,,,,,, ); return *this; } FI XYZEval& operator+=(const XYZval &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k, u += rs.u, v += rs.v, w += rs.w); return *this; } FI XYZEval& operator-=(const XYZval &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; } FI XYZEval& operator*=(const XYZval &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; } diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index a6dff2d75a41f..0b6548a3e3fae 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -403,6 +403,9 @@ void GcodeSuite::G28() { UNUSED(needZ); UNUSED(homeZZ); #else constexpr bool doZ = false; + #if !HAS_Y_AXIS + constexpr bool doY = false; + #endif #endif TERN_(HOME_Z_FIRST, if (doZ) homeaxis(Z_AXIS)); @@ -420,9 +423,11 @@ void GcodeSuite::G28() { // Diagonal move first if both are homing TERN_(QUICK_HOME, if (doX && doY) quick_home_xy()); - // Home Y (before X) - if (ENABLED(HOME_Y_BEFORE_X) && (doY || TERN0(CODEPENDENT_XY_HOMING, doX))) - homeaxis(Y_AXIS); + #if HAS_Y_AXIS + // Home Y (before X) + if (ENABLED(HOME_Y_BEFORE_X) && (doY || TERN0(CODEPENDENT_XY_HOMING, doX))) + homeaxis(Y_AXIS); + #endif // Home X if (doX || (doY && ENABLED(CODEPENDENT_XY_HOMING) && DISABLED(HOME_Y_BEFORE_X))) { @@ -455,9 +460,11 @@ void GcodeSuite::G28() { if (doI) homeaxis(I_AXIS); #endif - // Home Y (after X) - if (DISABLED(HOME_Y_BEFORE_X) && doY) - homeaxis(Y_AXIS); + #if HAS_Y_AXIS + // Home Y (after X) + if (DISABLED(HOME_Y_BEFORE_X) && doY) + homeaxis(Y_AXIS); + #endif #if BOTH(FOAMCUTTER_XYUV, HAS_J_AXIS) // Home J (after Y) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index c4926edd51c7d..7d4098d1cfa60 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -603,12 +603,26 @@ #else #undef EXTRUDERS #define EXTRUDERS 0 + #undef TEMP_SENSOR_0 + #undef TEMP_SENSOR_1 + #undef TEMP_SENSOR_2 + #undef TEMP_SENSOR_3 + #undef TEMP_SENSOR_4 + #undef TEMP_SENSOR_5 + #undef TEMP_SENSOR_6 + #undef TEMP_SENSOR_7 #undef SINGLENOZZLE #undef SWITCHING_EXTRUDER #undef SWITCHING_NOZZLE #undef MIXING_EXTRUDER #undef HOTEND_IDLE_TIMEOUT #undef DISABLE_E + #undef THERMAL_PROTECTION_HOTENDS + #undef PREVENT_COLD_EXTRUSION + #undef PREVENT_LENGTHY_EXTRUDE + #undef FILAMENT_RUNOUT_SENSOR + #undef FILAMENT_RUNOUT_DISTANCE_MM + #undef DISABLE_INACTIVE_EXTRUDER #endif #define E_OPTARG(N) OPTARG(HAS_MULTI_EXTRUDER, N) @@ -682,20 +696,28 @@ #if E_STEPPERS <= 7 #undef INVERT_E7_DIR + #undef E7_DRIVER_TYPE #if E_STEPPERS <= 6 #undef INVERT_E6_DIR + #undef E6_DRIVER_TYPE #if E_STEPPERS <= 5 #undef INVERT_E5_DIR + #undef E5_DRIVER_TYPE #if E_STEPPERS <= 4 #undef INVERT_E4_DIR + #undef E4_DRIVER_TYPE #if E_STEPPERS <= 3 #undef INVERT_E3_DIR + #undef E3_DRIVER_TYPE #if E_STEPPERS <= 2 #undef INVERT_E2_DIR + #undef E2_DRIVER_TYPE #if E_STEPPERS <= 1 #undef INVERT_E1_DIR + #undef E1_DRIVER_TYPE #if E_STEPPERS == 0 #undef INVERT_E0_DIR + #undef E0_DRIVER_TYPE #endif #endif #endif @@ -733,6 +755,7 @@ #else #define NUM_AXES 1 #endif +#define HAS_X_AXIS 1 #if NUM_AXES >= XY #define HAS_Y_AXIS 1 #if NUM_AXES >= XYZ @@ -767,31 +790,6 @@ #endif #endif -#if E_STEPPERS <= 0 - #undef E0_DRIVER_TYPE -#endif -#if E_STEPPERS <= 1 - #undef E1_DRIVER_TYPE -#endif -#if E_STEPPERS <= 2 - #undef E2_DRIVER_TYPE -#endif -#if E_STEPPERS <= 3 - #undef E3_DRIVER_TYPE -#endif -#if E_STEPPERS <= 4 - #undef E4_DRIVER_TYPE -#endif -#if E_STEPPERS <= 5 - #undef E5_DRIVER_TYPE -#endif -#if E_STEPPERS <= 6 - #undef E6_DRIVER_TYPE -#endif -#if E_STEPPERS <= 7 - #undef E7_DRIVER_TYPE -#endif - #if !HAS_Y_AXIS #undef ENDSTOPPULLUP_YMIN #undef ENDSTOPPULLUP_YMAX @@ -807,7 +805,6 @@ #undef MANUAL_Y_HOME_POS #undef MIN_SOFTWARE_ENDSTOP_Y #undef MAX_SOFTWARE_ENDSTOP_Y - #undef SAFE_BED_LEVELING_START_Y #endif #if !HAS_Z_AXIS @@ -827,7 +824,6 @@ #undef MANUAL_Z_HOME_POS #undef MIN_SOFTWARE_ENDSTOP_Z #undef MAX_SOFTWARE_ENDSTOP_Z - #undef SAFE_BED_LEVELING_START_Z #endif #if !HAS_I_AXIS @@ -844,7 +840,6 @@ #undef MANUAL_I_HOME_POS #undef MIN_SOFTWARE_ENDSTOP_I #undef MAX_SOFTWARE_ENDSTOP_I - #undef SAFE_BED_LEVELING_START_I #endif #if !HAS_J_AXIS @@ -861,7 +856,6 @@ #undef MANUAL_J_HOME_POS #undef MIN_SOFTWARE_ENDSTOP_J #undef MAX_SOFTWARE_ENDSTOP_J - #undef SAFE_BED_LEVELING_START_J #endif #if !HAS_K_AXIS @@ -878,7 +872,6 @@ #undef MANUAL_K_HOME_POS #undef MIN_SOFTWARE_ENDSTOP_K #undef MAX_SOFTWARE_ENDSTOP_K - #undef SAFE_BED_LEVELING_START_K #endif #if !HAS_U_AXIS @@ -895,7 +888,6 @@ #undef MANUAL_U_HOME_POS #undef MIN_SOFTWARE_ENDSTOP_U #undef MAX_SOFTWARE_ENDSTOP_U - #undef SAFE_BED_LEVELING_START_U #endif #if !HAS_V_AXIS @@ -912,7 +904,6 @@ #undef MANUAL_V_HOME_POS #undef MIN_SOFTWARE_ENDSTOP_V #undef MAX_SOFTWARE_ENDSTOP_V - #undef SAFE_BED_LEVELING_START_V #endif #if !HAS_W_AXIS @@ -929,7 +920,6 @@ #undef MANUAL_W_HOME_POS #undef MIN_SOFTWARE_ENDSTOP_W #undef MAX_SOFTWARE_ENDSTOP_W - #undef SAFE_BED_LEVELING_START_W #endif #ifdef X2_DRIVER_TYPE @@ -1665,7 +1655,9 @@ #endif #endif -#if X_HOME_DIR || (HAS_Y_AXIS && Y_HOME_DIR) || (HAS_Z_AXIS && Z_HOME_DIR) || (HAS_I_AXIS && I_HOME_DIR) || (HAS_J_AXIS && J_HOME_DIR) || (HAS_K_AXIS && K_HOME_DIR) +#if X_HOME_DIR || (HAS_Y_AXIS && Y_HOME_DIR) || (HAS_Z_AXIS && Z_HOME_DIR) \ + || (HAS_I_AXIS && I_HOME_DIR) || (HAS_J_AXIS && J_HOME_DIR) || (HAS_K_AXIS && K_HOME_DIR) \ + || (HAS_U_AXIS && U_HOME_DIR) || (HAS_V_AXIS && V_HOME_DIR) || (HAS_W_AXIS && W_HOME_DIR) #define HAS_ENDSTOPS 1 #define COORDINATE_OKAY(N,L,H) WITHIN(N,L,H) #else diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 9833b300d3684..bfd8caf3dd849 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -86,31 +86,47 @@ #undef PROBE_DEPLOY_STOW_MENU #endif +// Some options are disallowed without required axes +#if !HAS_Y_AXIS + #undef SAFE_BED_LEVELING_START_Y + #undef ARC_SUPPORT + #undef INPUT_SHAPING_Y + #undef SHAPING_FREQ_Y + #undef SHAPING_BUFFER_Y +#endif +#if !HAS_Z_AXIS + #undef SAFE_BED_LEVELING_START_Z +#endif +#if !HAS_I_AXIS + #undef SAFE_BED_LEVELING_START_I +#endif +#if !HAS_J_AXIS + #undef SAFE_BED_LEVELING_START_J +#endif +#if !HAS_K_AXIS + #undef SAFE_BED_LEVELING_START_K +#endif +#if !HAS_U_AXIS + #undef SAFE_BED_LEVELING_START_U +#endif +#if !HAS_V_AXIS + #undef SAFE_BED_LEVELING_START_V +#endif +#if !HAS_W_AXIS + #undef SAFE_BED_LEVELING_START_W +#endif + +// Disallowed with no extruders #if !HAS_EXTRUDERS #define NO_VOLUMETRICS - #undef TEMP_SENSOR_0 - #undef TEMP_SENSOR_1 - #undef TEMP_SENSOR_2 - #undef TEMP_SENSOR_3 - #undef TEMP_SENSOR_4 - #undef TEMP_SENSOR_5 - #undef TEMP_SENSOR_6 - #undef TEMP_SENSOR_7 #undef FWRETRACT #undef PIDTEMP #undef AUTOTEMP #undef PID_EXTRUSION_SCALING #undef LIN_ADVANCE - #undef FILAMENT_RUNOUT_SENSOR #undef ADVANCED_PAUSE_FEATURE - #undef FILAMENT_RUNOUT_DISTANCE_MM - #undef FILAMENT_LOAD_UNLOAD_GCODES - #undef DISABLE_INACTIVE_EXTRUDER #undef FILAMENT_LOAD_UNLOAD_GCODES #undef EXTRUDER_RUNOUT_PREVENT - #undef PREVENT_COLD_EXTRUSION - #undef PREVENT_LENGTHY_EXTRUDE - #undef THERMAL_PROTECTION_HOTENDS #undef THERMAL_PROTECTION_PERIOD #undef WATCH_TEMP_PERIOD #undef SHOW_TEMP_ADC_VALUES @@ -1127,11 +1143,6 @@ #endif // Input shaping -#if !HAS_Y_AXIS - #undef INPUT_SHAPING_Y - #undef SHAPING_FREQ_Y - #undef SHAPING_BUFFER_Y -#endif #if EITHER(INPUT_SHAPING_X, INPUT_SHAPING_Y) #define HAS_SHAPING 1 #endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 3faef307a8ae8..5ec428edf29db 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2250,7 +2250,7 @@ #define IS_Z3_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 3 && Z3_USE_ENDSTOP == _##A##M##_) #define IS_Z4_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 4 && Z4_USE_ENDSTOP == _##A##M##_) -#define _HAS_STOP(A,M) (PIN_EXISTS(A##_##M) && !IS_PROBE_PIN(A,M) && !IS_X2_ENDSTOP(A,M) && !IS_Y2_ENDSTOP(A,M) && !IS_Z2_ENDSTOP(A,M) && !IS_Z3_ENDSTOP(A,M) && !IS_Z4_ENDSTOP(A,M)) +#define _HAS_STOP(A,M) (HAS_##A##_AXIS && PIN_EXISTS(A##_##M) && !IS_PROBE_PIN(A,M) && !IS_X2_ENDSTOP(A,M) && !IS_Y2_ENDSTOP(A,M) && !IS_Z2_ENDSTOP(A,M) && !IS_Z3_ENDSTOP(A,M) && !IS_Z4_ENDSTOP(A,M)) #if _HAS_STOP(X,MIN) #define HAS_X_MIN 1 #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index b4e0699403da9..b5a37307ab325 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -849,7 +849,9 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L * Validate that the bed size fits */ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS) are too narrow to contain X_BED_SIZE."); -static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS) are too narrow to contain Y_BED_SIZE."); +#if HAS_Y_AXIS + static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS) are too narrow to contain Y_BED_SIZE."); +#endif /** * Granular software endstops (Marlin >= 1.1.7) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/move_axis_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/move_axis_screen.cpp index e077eb371ac04..c3927c21a7dda 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/move_axis_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/move_axis_screen.cpp @@ -61,9 +61,9 @@ void MoveAxisScreen::onRedraw(draw_mode_t what) { w.adjuster( 10, GET_TEXT_F(MSG_AXIS_E2), mydata.e_rel[1], canMove(E1)); #if EXTRUDERS > 2 w.adjuster( 12, GET_TEXT_F(MSG_AXIS_E3), mydata.e_rel[2], canMove(E2)); - #endif - #if EXTRUDERS > 3 - w.adjuster( 14, GET_TEXT_F(MSG_AXIS_E4), mydata.e_rel[3], canMove(E3)); + #if EXTRUDERS > 3 + w.adjuster( 14, GET_TEXT_F(MSG_AXIS_E4), mydata.e_rel[3], canMove(E3)); + #endif #endif #endif #if Z_HOME_TO_MIN @@ -79,40 +79,44 @@ bool BaseMoveAxisScreen::onTouchHeld(uint8_t tag) { switch (tag) { case 2: UI_DECREMENT_AXIS(X); break; case 3: UI_INCREMENT_AXIS(X); break; - case 4: UI_DECREMENT_AXIS(Y); break; - case 5: UI_INCREMENT_AXIS(Y); break; - case 6: UI_DECREMENT_AXIS(Z); break; - case 7: UI_INCREMENT_AXIS(Z); break; - // For extruders, also update relative distances. - case 8: UI_DECREMENT_AXIS(E0); mydata.e_rel[0] -= increment; break; - case 9: UI_INCREMENT_AXIS(E0); mydata.e_rel[0] += increment; break; - #if HAS_MULTI_EXTRUDER - case 10: UI_DECREMENT_AXIS(E1); mydata.e_rel[1] -= increment; break; - case 11: UI_INCREMENT_AXIS(E1); mydata.e_rel[1] += increment; break; - #endif - #if EXTRUDERS > 2 - case 12: UI_DECREMENT_AXIS(E2); mydata.e_rel[2] -= increment; break; - case 13: UI_INCREMENT_AXIS(E2); mydata.e_rel[2] += increment; break; + #if HAS_EXTRUDERS + // For extruders, also update relative distances. + case 8: UI_DECREMENT_AXIS(E0); mydata.e_rel[0] -= increment; break; + case 9: UI_INCREMENT_AXIS(E0); mydata.e_rel[0] += increment; break; + #if HAS_MULTI_EXTRUDER + case 10: UI_DECREMENT_AXIS(E1); mydata.e_rel[1] -= increment; break; + case 11: UI_INCREMENT_AXIS(E1); mydata.e_rel[1] += increment; break; + #if EXTRUDERS > 2 + case 12: UI_DECREMENT_AXIS(E2); mydata.e_rel[2] -= increment; break; + case 13: UI_INCREMENT_AXIS(E2); mydata.e_rel[2] += increment; break; + #if EXTRUDERS > 3 + case 14: UI_DECREMENT_AXIS(E3); mydata.e_rel[3] -= increment; break; + case 15: UI_INCREMENT_AXIS(E3); mydata.e_rel[3] += increment; break; + #endif + #endif + #endif #endif - #if EXTRUDERS > 3 - case 14: UI_DECREMENT_AXIS(E3); mydata.e_rel[3] -= increment; break; - case 15: UI_INCREMENT_AXIS(E3); mydata.e_rel[3] += increment; break; + #if HAS_Y_AXIS + case 4: UI_DECREMENT_AXIS(Y); break; + case 5: UI_INCREMENT_AXIS(Y); break; + case 20: SpinnerDialogBox::enqueueAndWait(F("G28X")); break; + case 21: SpinnerDialogBox::enqueueAndWait(F("G28Y")); break; + #if HAS_Z_AXIS + case 6: UI_DECREMENT_AXIS(Z); break; + case 7: UI_INCREMENT_AXIS(Z); break; + case 22: SpinnerDialogBox::enqueueAndWait(F("G28Z")); break; + case 24: raiseZtoTop(); break; + #endif #endif - case 20: SpinnerDialogBox::enqueueAndWait(F("G28X")); break; - case 21: SpinnerDialogBox::enqueueAndWait(F("G28Y")); break; - case 22: SpinnerDialogBox::enqueueAndWait(F("G28Z")); break; case 23: SpinnerDialogBox::enqueueAndWait(F("G28")); break; - case 24: raiseZtoTop(); break; default: return false; } - #undef UI_DECREMENT_AXIS - #undef UI_INCREMENT_AXIS return true; } void BaseMoveAxisScreen::raiseZtoTop() { - constexpr xyze_feedrate_t homing_feedrate = HOMING_FEEDRATE_MM_M; + constexpr xyz_feedrate_t homing_feedrate = HOMING_FEEDRATE_MM_M; setAxisPosition_mm(Z_MAX_POS - 5, Z, homing_feedrate.z); } @@ -128,9 +132,11 @@ void BaseMoveAxisScreen::setManualFeedrate(ExtUI::axis_t axis, float increment_m ExtUI::setFeedrate_mm_s(getManualFeedrate(X_AXIS + (axis - ExtUI::X), increment_mm)); } -void BaseMoveAxisScreen::setManualFeedrate(ExtUI::extruder_t, float increment_mm) { - ExtUI::setFeedrate_mm_s(getManualFeedrate(E_AXIS, increment_mm)); -} +#if HAS_EXTRUDERS + void BaseMoveAxisScreen::setManualFeedrate(ExtUI::extruder_t, float increment_mm) { + ExtUI::setFeedrate_mm_s(getManualFeedrate(E_AXIS, increment_mm)); + } +#endif void MoveAxisScreen::onIdle() { if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index d440093b169bb..a76bd967c0cd0 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -361,7 +361,7 @@ void report_current_position_projected() { // Return true if the given position is within the machine bounds. bool position_is_reachable(const_float_t rx, const_float_t ry) { - if (!COORDINATE_OKAY(ry, Y_MIN_POS - fslop, Y_MAX_POS + fslop)) return false; + if (TERN0(HAS_Y_AXIS, !COORDINATE_OKAY(ry, Y_MIN_POS - fslop, Y_MAX_POS + fslop))) return false; #if ENABLED(DUAL_X_CARRIAGE) if (active_extruder) return COORDINATE_OKAY(rx, X2_MIN_POS - fslop, X2_MAX_POS + fslop); @@ -630,7 +630,7 @@ void do_blocking_move_to(NUM_AXIS_ARGS(const float), const_feedRate_t fr_mm_s/*= if (current_position.z < z) { current_position.z = z; line_to_current_position(z_feedrate); } #endif - current_position.set(x, y); line_to_current_position(xy_feedrate); + current_position.set(x OPTARG(HAS_Y_AXIS, y)); line_to_current_position(xy_feedrate); #if HAS_I_AXIS current_position.i = i; line_to_current_position(i_feedrate); From 7ad3586f822f3a3f5c79ab4a6b067660799b1de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Morav=C4=8D=C3=ADk?= Date: Tue, 31 Jan 2023 06:07:03 +0100 Subject: [PATCH 38/54] =?UTF-8?q?=F0=9F=8C=90=20Update=20Slovak=20language?= =?UTF-8?q?=20(#25305)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_sk.h | 82 +++++++++++++++++++++------ 1 file changed, 64 insertions(+), 18 deletions(-) diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index ef50f5988c927..4167fc802ab97 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -58,7 +58,7 @@ namespace Language_sk { LSTR MSG_MEDIA_INSERTED = _UxGT("Karta vložená"); LSTR MSG_MEDIA_REMOVED = _UxGT("Karta vybraná"); LSTR MSG_MEDIA_WAITING = _UxGT("Čakám na kartu"); - LSTR MSG_MEDIA_INIT_FAIL = _UxGT("Inicial. SD zlyhala"); + LSTR MSG_MEDIA_INIT_FAIL = _UxGT("Inicial.karty zlyhala"); LSTR MSG_MEDIA_READ_ERROR = _UxGT("Chyba čítania karty"); LSTR MSG_MEDIA_USB_REMOVED = _UxGT("USB zaria. odstrán."); LSTR MSG_MEDIA_USB_FAILED = _UxGT("Chyba spúšťania USB"); @@ -80,6 +80,7 @@ namespace Language_sk { LSTR MSG_AUTO_HOME_X = _UxGT("Domov os X"); LSTR MSG_AUTO_HOME_Y = _UxGT("Domov os Y"); LSTR MSG_AUTO_HOME_Z = _UxGT("Domov os Z"); + LSTR MSG_Z_AFTER_HOME = _UxGT("Os Z po domov.poz."); LSTR MSG_FILAMENT_SET = _UxGT("Nastav. filamentu"); LSTR MSG_FILAMENT_MAN = _UxGT("Správa filamentu"); LSTR MSG_MANUAL_LEVELING = _UxGT("Ručné rovnanie"); @@ -104,6 +105,7 @@ namespace Language_sk { LSTR MSG_HOME_OFFSET_Y = _UxGT("Y Ofset"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Z Ofset"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofsety nastavené"); + LSTR MSG_ERR_M428_TOO_FAR = _UxGT("Chyba: Príliš ďaleko!"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Spriev. vyrovn."); LSTR MSG_SELECT_ORIGIN = _UxGT("Vyberte začiatok"); LSTR MSG_LAST_VALUE_SP = _UxGT("Posl. hodnota "); @@ -131,6 +133,7 @@ namespace Language_sk { LSTR MSG_PREHEAT_M_BEDONLY = _UxGT("Zahriať $ podlož"); LSTR MSG_PREHEAT_M_SETTINGS = _UxGT("Zahriať $ nast."); #endif + LSTR MSG_PREHEAT_HOTEND = _UxGT("Zahriať hotend"); LSTR MSG_PREHEAT_CUSTOM = _UxGT("Vlastná teplota"); LSTR MSG_COOLDOWN = _UxGT("Schladiť"); @@ -252,6 +255,7 @@ namespace Language_sk { LSTR MSG_UBL_SMART_FILLIN = _UxGT("Chytré vyplnenie"); LSTR MSG_UBL_FILLIN_MESH = _UxGT("Vyplniť mriežku"); LSTR MSG_UBL_MESH_FILLED = _UxGT("Doplnené chýb. body"); + LSTR MSG_UBL_MESH_INVALID = _UxGT("Neplatná sieť"); LSTR MSG_UBL_INVALIDATE_ALL = _UxGT("Zrušiť všetko"); LSTR MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Zrušiť najbližší"); LSTR MSG_UBL_FINE_TUNE_ALL = _UxGT("Upraviť všetky"); @@ -263,6 +267,7 @@ namespace Language_sk { LSTR MSG_UBL_INVALID_SLOT = _UxGT("Najskôr zvol. slot siete"); LSTR MSG_MESH_LOADED = _UxGT("Sieť %i načítaná"); LSTR MSG_MESH_SAVED = _UxGT("Sieť %i uložená"); + LSTR MSG_MESH_ACTIVE = _UxGT("Sieť %i aktívna"); LSTR MSG_UBL_NO_STORAGE = _UxGT("Nedostatok miesta"); LSTR MSG_UBL_SAVE_ERROR = _UxGT("Chyba: Ukladanie UBL"); LSTR MSG_UBL_RESTORE_ERROR = _UxGT("Chyba: Obnovenie UBL"); @@ -313,11 +318,14 @@ namespace Language_sk { LSTR MSG_MOVE_01MM = _UxGT("Posunúť o 0,1mm"); LSTR MSG_MOVE_1MM = _UxGT("Posunúť o 1mm"); LSTR MSG_MOVE_10MM = _UxGT("Posunúť o 10mm"); + LSTR MSG_MOVE_50MM = _UxGT("Posunúť o 50mm"); LSTR MSG_MOVE_100MM = _UxGT("Posunúť o 100mm"); LSTR MSG_MOVE_0001IN = _UxGT("Posunúť o 0,001in"); LSTR MSG_MOVE_001IN = _UxGT("Posunúť o 0,01in"); LSTR MSG_MOVE_01IN = _UxGT("Posunúť o 0,1in"); + LSTR MSG_MOVE_05IN = _UxGT("Posunúť o 0,5in"); LSTR MSG_MOVE_1IN = _UxGT("Posunúť o 1,0in"); + LSTR MSG_LIVE_MOVE = _UxGT("Živý pohyb"); LSTR MSG_SPEED = _UxGT("Rýchlosť"); LSTR MSG_BED_Z = _UxGT("Výška podl."); LSTR MSG_NOZZLE = _UxGT("Tryska"); @@ -329,6 +337,7 @@ namespace Language_sk { LSTR MSG_COOLER = _UxGT("Chladen. lasera"); LSTR MSG_COOLER_TOGGLE = _UxGT("Prepnúť chladenie"); LSTR MSG_FLOWMETER_SAFETY = _UxGT("Bezpeč. prietok"); + LSTR MSG_CUTTER = _UxGT("Rezačka"); LSTR MSG_LASER = _UxGT("Laser"); LSTR MSG_FAN_SPEED = _UxGT("Rýchlosť vent."); LSTR MSG_FAN_SPEED_N = _UxGT("Rýchlosť vent. ~"); @@ -361,13 +370,20 @@ namespace Language_sk { LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-kal. zlyhala! Príliš vysoká tepl."); LSTR MSG_PID_TIMEOUT = _UxGT("Auto-kal. zlyhala! Čas vypršal."); LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Test. tepl. straty"); + LSTR MSG_MPC_HEATING_PAST_200 = _UxGT("Zahriať na >200C"); + LSTR MSG_MPC_COOLING_TO_AMBIENT = _UxGT("Schladiť na okolie"); LSTR MSG_MPC_AUTOTUNE = _UxGT("Auto-kal. MPC"); LSTR MSG_MPC_EDIT = _UxGT("Upraviť * MPC"); + LSTR MSG_MPC_POWER = _UxGT("Výkon ohrievača"); LSTR MSG_MPC_POWER_E = _UxGT("Výkon *"); - LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Blokovať C *"); - LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Rozliš. senz. *"); - LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("H okolia *"); - LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("H vent. okolia *"); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY = _UxGT("Tepelná kapacita"); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Tepelná kap. *"); + LSTR MSG_SENSOR_RESPONSIVENESS = _UxGT("Reakcia senzoru"); + LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Reakcia senz. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF = _UxGT("Koef. okolia"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Koef. okolia *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN = _UxGT("Koef. vent."); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Koef. vent. *"); LSTR MSG_SELECT_E = _UxGT("Vybrať *"); LSTR MSG_ACC = _UxGT("Zrýchlenie"); LSTR MSG_JERK = _UxGT("Skok"); @@ -395,6 +411,11 @@ namespace Language_sk { LSTR MSG_AMAX_EN = _UxGT("Amax *"); LSTR MSG_A_RETRACT = _UxGT("A-retrakt"); LSTR MSG_A_TRAVEL = _UxGT("A-prejazd"); + LSTR MSG_INPUT_SHAPING = _UxGT("Tvarov. vstupu"); + LSTR MSG_SHAPING_ENABLE = _UxGT("Povol. tvarov. @"); + LSTR MSG_SHAPING_DISABLE = _UxGT("Zakáz. tvarov. @"); + LSTR MSG_SHAPING_FREQ = _UxGT("Frekvencia @"); + LSTR MSG_SHAPING_ZETA = _UxGT("Tlmenie @"); LSTR MSG_XY_FREQUENCY_LIMIT = _UxGT("Max. frekvencia"); LSTR MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Min. posun"); LSTR MSG_STEPS_PER_MM = _UxGT("Kroky/mm"); @@ -414,6 +435,12 @@ namespace Language_sk { LSTR MSG_FILAMENT_DIAM_E = _UxGT("Priem. fil. *"); LSTR MSG_FILAMENT_UNLOAD = _UxGT("Vysunúť mm"); LSTR MSG_FILAMENT_LOAD = _UxGT("Zaviesť mm"); + LSTR MSG_SEGMENTS_PER_SECOND = _UxGT("Segmentov/sek"); + LSTR MSG_DRAW_MIN_X = _UxGT("Min. X kresby"); + LSTR MSG_DRAW_MAX_X = _UxGT("Max. X kresby"); + LSTR MSG_DRAW_MIN_Y = _UxGT("Min. Y kresby"); + LSTR MSG_DRAW_MAX_Y = _UxGT("Max. Y kresby"); + LSTR MSG_MAX_BELT_LEN = _UxGT("Max. dĺžka pásu"); LSTR MSG_ADVANCE_K = _UxGT("K pre posun"); LSTR MSG_ADVANCE_K_E = _UxGT("K pre posun *"); LSTR MSG_CONTRAST = _UxGT("Kontrast LCD"); @@ -428,7 +455,7 @@ namespace Language_sk { LSTR MSG_ERR_EEPROM_INDEX = _UxGT("Chyba: EEPROM Index"); LSTR MSG_ERR_EEPROM_VERSION = _UxGT("Chyba: Verzia EEPROM"); LSTR MSG_SETTINGS_STORED = _UxGT("Nastavenie uložené"); - LSTR MSG_MEDIA_UPDATE = _UxGT("Aktualizovať z SD"); + LSTR MSG_MEDIA_UPDATE = _UxGT("Aktualiz. z karty"); LSTR MSG_RESET_PRINTER = _UxGT("Reštart. tlačiar."); LSTR MSG_REFRESH = LCD_STR_REFRESH _UxGT("Obnoviť"); LSTR MSG_INFO_SCREEN = _UxGT("Info. obrazovka"); @@ -467,16 +494,28 @@ namespace Language_sk { LSTR MSG_PAUSE_PRINT = _UxGT("Pozastaviť tlač"); LSTR MSG_ADVANCED_PAUSE = _UxGT("Pokročil. pauza"); LSTR MSG_RESUME_PRINT = _UxGT("Obnoviť tlač"); - LSTR MSG_HOST_START_PRINT = _UxGT("Spustiť z hosta"); LSTR MSG_STOP_PRINT = _UxGT("Zastaviť tlač"); - LSTR MSG_END_LOOPS = _UxGT("Koniec opak. sluč."); - LSTR MSG_PRINTING_OBJECT = _UxGT("Tlačím objekt"); - LSTR MSG_CANCEL_OBJECT = _UxGT("Zrušiť objekt"); - LSTR MSG_CANCEL_OBJECT_N = _UxGT("Zrušiť objekt ="); LSTR MSG_OUTAGE_RECOVERY = _UxGT("Obnova po výp. nap."); - LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Pokračovať v úlohe"); - LSTR MSG_MEDIA_MENU = _UxGT("Tlačiť z SD"); - LSTR MSG_NO_MEDIA = _UxGT("Žiadna SD karta"); + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 + LSTR MSG_HOST_START_PRINT = _UxGT("Spustiť z hosta"); + LSTR MSG_PRINTING_OBJECT = _UxGT("Tlačím objekt"); + LSTR MSG_CANCEL_OBJECT = _UxGT("Zrušiť objekt"); + LSTR MSG_CANCEL_OBJECT_N = _UxGT("Zrušiť objekt ="); + LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Pokračovať v úlohe"); + LSTR MSG_MEDIA_MENU = _UxGT("Vytlačiť z karty"); + LSTR MSG_TURN_OFF = _UxGT("Vypnite tlačiareň"); + LSTR MSG_END_LOOPS = _UxGT("Ukončiť opak. sluč."); + #else + LSTR MSG_HOST_START_PRINT = _UxGT("Spustiť z hosta"); + LSTR MSG_PRINTING_OBJECT = _UxGT("Tlačím obj."); + LSTR MSG_CANCEL_OBJECT = _UxGT("Zrušiť obj."); + LSTR MSG_CANCEL_OBJECT_N = _UxGT("Zrušiť obj. ="); + LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Pokrač. v úlohe"); + LSTR MSG_MEDIA_MENU = _UxGT("Tlač z karty"); + LSTR MSG_TURN_OFF = _UxGT("Vypnit. teraz"); + LSTR MSG_END_LOOPS = _UxGT("Ukončiť sluč."); + #endif + LSTR MSG_NO_MEDIA = _UxGT("Žiadna karta"); LSTR MSG_DWELL = _UxGT("Spím..."); LSTR MSG_USERWAIT = _UxGT("Pokrač. kliknutím..."); LSTR MSG_PRINT_PAUSED = _UxGT("Tlač pozastavená"); @@ -486,7 +525,6 @@ namespace Language_sk { LSTR MSG_PRINT_ABORTED = _UxGT("Tlač zrušená"); LSTR MSG_PRINT_DONE = _UxGT("Tlač dokončená"); LSTR MSG_PRINTER_KILLED = _UxGT("Tlačiareň zastavená!"); - LSTR MSG_TURN_OFF = _UxGT("Vypnite tlačiareň"); LSTR MSG_NO_MOVE = _UxGT("Žiadny pohyb."); LSTR MSG_KILLED = _UxGT("PRERUŠENÉ. "); LSTR MSG_STOPPED = _UxGT("ZASTAVENÉ. "); @@ -506,8 +544,10 @@ namespace Language_sk { LSTR MSG_TOOL_CHANGE = _UxGT("Výmena nástroja"); LSTR MSG_TOOL_CHANGE_ZLIFT = _UxGT("Zdvihnúť Z"); LSTR MSG_SINGLENOZZLE_PRIME_SPEED = _UxGT("Primárna rýchl."); + LSTR MSG_SINGLENOZZLE_WIPE_RETRACT = _UxGT("Očist. retrakciou"); LSTR MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Rýchl. retrakcie"); LSTR MSG_FILAMENT_PARK_ENABLED = _UxGT("Parkovať hlavu"); + LSTR MSG_PARK_FAILED = _UxGT("Hlava sa nedá zapark."); LSTR MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Rýchl. obnovenia"); LSTR MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Rýchlosť vent."); LSTR MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Doba fúkania"); @@ -524,9 +564,14 @@ namespace Language_sk { LSTR MSG_FILAMENTUNLOAD = _UxGT("Vysunúť filament"); LSTR MSG_FILAMENTUNLOAD_E = _UxGT("Vysunúť filament *"); LSTR MSG_FILAMENTUNLOAD_ALL = _UxGT("Vysunúť všetko"); - LSTR MSG_ATTACH_MEDIA = _UxGT("Načítať SD kartu"); - LSTR MSG_CHANGE_MEDIA = _UxGT("Vymeniť SD kartu"); - LSTR MSG_RELEASE_MEDIA = _UxGT("Odpojiť SD kartu"); + #if ENABLED(MULTI_VOLUME) + LSTR MSG_ATTACH_MEDIA = _UxGT("Načítať SD kartu"); + LSTR MSG_ATTACH_USB_MEDIA = _UxGT("Načítať USB disk"); + #else + LSTR MSG_ATTACH_MEDIA = _UxGT("Načítať kartu"); + #endif + LSTR MSG_CHANGE_MEDIA = _UxGT("Vymeniť kartu"); + LSTR MSG_RELEASE_MEDIA = _UxGT("Odpojiť kartu"); LSTR MSG_ZPROBE_OUT = _UxGT("Sonda Z mimo podl."); LSTR MSG_SKEW_FACTOR = _UxGT("Faktor skosenia"); LSTR MSG_BLTOUCH = _UxGT("BLTouch"); @@ -608,6 +653,7 @@ namespace Language_sk { LSTR MSG_MESH_LEVELING = _UxGT("Mriežkové rovnanie"); LSTR MSG_MESH_DONE = _UxGT("Mriežka dokončená"); LSTR MSG_INFO_STATS_MENU = _UxGT("Štatistika"); + LSTR MSG_RESET_STATS = _UxGT("Vynulovať štatis.?"); LSTR MSG_INFO_BOARD_MENU = _UxGT("Info. o doske"); LSTR MSG_INFO_THERMISTOR_MENU = _UxGT("Termistory"); LSTR MSG_INFO_EXTRUDERS = _UxGT("Extrudéry"); From 2dda0c0da2528c88b4a5660c60883d95896999b8 Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Tue, 31 Jan 2023 06:07:51 +0100 Subject: [PATCH 39/54] =?UTF-8?q?=F0=9F=8C=90=20Update=20Italian=20languag?= =?UTF-8?q?e=20(#25309)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_it.h | 32 ++++++++++++++++++++------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index a520972b0f7d4..ee8d51203c09e 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -77,6 +77,7 @@ namespace Language_it { LSTR MSG_AUTO_HOME_X = _UxGT("Home X"); LSTR MSG_AUTO_HOME_Y = _UxGT("Home Y"); LSTR MSG_AUTO_HOME_Z = _UxGT("Home Z"); + LSTR MSG_Z_AFTER_HOME = _UxGT("Z dopo homing"); LSTR MSG_FILAMENT_SET = _UxGT("Impostaz.filamento"); LSTR MSG_FILAMENT_MAN = _UxGT("Gestione filamento"); LSTR MSG_MANUAL_LEVELING = _UxGT("Livel.manuale"); @@ -101,6 +102,7 @@ namespace Language_it { LSTR MSG_HOME_OFFSET_Y = _UxGT("Offset home Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Offset home Z"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offset applicato"); + LSTR MSG_ERR_M428_TOO_FAR = _UxGT("Err: Troppo lontano!"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Wizard Tramming"); LSTR MSG_SELECT_ORIGIN = _UxGT("Selez. origine"); LSTR MSG_LAST_VALUE_SP = _UxGT("Ultimo valore "); @@ -128,6 +130,7 @@ namespace Language_it { LSTR MSG_PREHEAT_M_BEDONLY = _UxGT("Preris.$ Piatto"); LSTR MSG_PREHEAT_M_SETTINGS = _UxGT("Preris.$ conf"); #endif + LSTR MSG_PREHEAT_HOTEND = _UxGT("Prerisc.Hotend"); LSTR MSG_PREHEAT_CUSTOM = _UxGT("Prerisc.personal."); LSTR MSG_COOLDOWN = _UxGT("Raffredda"); @@ -263,6 +266,7 @@ namespace Language_it { LSTR MSG_UBL_INVALID_SLOT = _UxGT("Prima selez. uno slot Mesh"); LSTR MSG_MESH_LOADED = _UxGT("Mesh %i caricata"); LSTR MSG_MESH_SAVED = _UxGT("Mesh %i salvata"); + LSTR MSG_MESH_ACTIVE = _UxGT("Mesh %i attiva"); LSTR MSG_UBL_NO_STORAGE = _UxGT("Nessuna memoria"); LSTR MSG_UBL_SAVE_ERROR = _UxGT("Err: Salvataggio UBL"); LSTR MSG_UBL_RESTORE_ERROR = _UxGT("Err: Ripristino UBL"); @@ -320,6 +324,7 @@ namespace Language_it { LSTR MSG_MOVE_01IN = _UxGT("Muovi di 0.1\""); LSTR MSG_MOVE_05IN = _UxGT("Muovi di 0.5\""); LSTR MSG_MOVE_1IN = _UxGT("Muovi di 1\""); + LSTR MSG_LIVE_MOVE = _UxGT("Modalità Live"); LSTR MSG_SPEED = _UxGT("Velocità"); LSTR MSG_BED_Z = _UxGT("Piatto Z"); LSTR MSG_NOZZLE = _UxGT("Ugello"); @@ -331,6 +336,7 @@ namespace Language_it { LSTR MSG_COOLER = _UxGT("Raffreddam. laser"); LSTR MSG_COOLER_TOGGLE = _UxGT("Alterna raffreddam."); LSTR MSG_FLOWMETER_SAFETY = _UxGT("Sicurezza flusso"); + LSTR MSG_CUTTER = _UxGT("Taglio"); LSTR MSG_LASER = _UxGT("Laser"); LSTR MSG_FAN_SPEED = _UxGT("Vel. ventola"); // Max 15 characters LSTR MSG_FAN_SPEED_N = _UxGT("Vel. ventola ~"); // Max 15 characters @@ -362,14 +368,21 @@ namespace Language_it { LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Calibrazione fallita! Estrusore errato."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Calibrazione fallita! Temperatura troppo alta."); LSTR MSG_PID_TIMEOUT = _UxGT("Calibrazione fallita! Tempo scaduto."); - LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Testing heat loss"); + LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Verif.perdita calore"); + LSTR MSG_MPC_HEATING_PAST_200 = _UxGT("Riscalda a >200C"); + LSTR MSG_MPC_COOLING_TO_AMBIENT = _UxGT("Raffredda a amb."); LSTR MSG_MPC_AUTOTUNE = _UxGT("MPC Autotune"); LSTR MSG_MPC_EDIT = _UxGT("Modif.MPC *"); + LSTR MSG_MPC_POWER = _UxGT("Potenza riscald."); LSTR MSG_MPC_POWER_E = _UxGT("Potenza *"); - LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("C blocco *"); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY = _UxGT("Capacità riscald."); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Capac.riscald. *"); + LSTR MSG_SENSOR_RESPONSIVENESS = _UxGT("Reattiv.Sens."); LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Reattiv.Sens. *"); - LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("H ambiente *"); - LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("H Amb. vent. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF = _UxGT("Coeff.ambiente"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Coeff.amb. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN = _UxGT("Coeff.ventola"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Coeff.ventola *"); LSTR MSG_SELECT_E = _UxGT("Seleziona *"); LSTR MSG_ACC = _UxGT("Accel"); LSTR MSG_JERK = _UxGT("Jerk"); @@ -398,10 +411,10 @@ namespace Language_it { LSTR MSG_A_RETRACT = _UxGT("A-Ritrazione"); LSTR MSG_A_TRAVEL = _UxGT("A-Spostamento"); LSTR MSG_INPUT_SHAPING = _UxGT("Input Shaping"); - LSTR MSG_SHAPING_X_FREQ = _UxGT("Frequenza ") STR_X; - LSTR MSG_SHAPING_Y_FREQ = _UxGT("Frequenza ") STR_Y; - LSTR MSG_SHAPING_X_ZETA = _UxGT("Smorzamento ") STR_X; - LSTR MSG_SHAPING_Y_ZETA = _UxGT("Smorzamento ") STR_Y; + LSTR MSG_SHAPING_ENABLE = _UxGT("Abilita shaping @"); + LSTR MSG_SHAPING_DISABLE = _UxGT("Disabil. shaping @"); + LSTR MSG_SHAPING_FREQ = _UxGT("Frequenza @"); + LSTR MSG_SHAPING_ZETA = _UxGT("Smorzamento @"); LSTR MSG_XY_FREQUENCY_LIMIT = _UxGT("Frequenza max"); LSTR MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Feed min"); LSTR MSG_STEPS_PER_MM = _UxGT("Passi/mm"); @@ -522,6 +535,7 @@ namespace Language_it { LSTR MSG_SINGLENOZZLE_WIPE_RETRACT = _UxGT("Ritrazione pulizia"); LSTR MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Velocità ritrazione"); LSTR MSG_FILAMENT_PARK_ENABLED = _UxGT("Parcheggia testa"); + LSTR MSG_PARK_FAILED = _UxGT("Parcheggio fallito"); LSTR MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Veloc. di recupero"); LSTR MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Velocità ventola"); LSTR MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Tempo ventola"); @@ -539,6 +553,7 @@ namespace Language_it { LSTR MSG_FILAMENTUNLOAD_E = _UxGT("Rimuovi filam. *"); LSTR MSG_FILAMENTUNLOAD_ALL = _UxGT("Rimuovi tutto"); LSTR MSG_ATTACH_MEDIA = _UxGT("Collega media"); + LSTR MSG_ATTACH_USB_MEDIA = _UxGT("Collega penna USB"); LSTR MSG_CHANGE_MEDIA = _UxGT("Cambia media"); LSTR MSG_RELEASE_MEDIA = _UxGT("Rilascia media"); LSTR MSG_ZPROBE_OUT = _UxGT("Z probe fuori piatto"); @@ -622,6 +637,7 @@ namespace Language_it { LSTR MSG_MESH_LEVELING = _UxGT("Livel. Mesh"); LSTR MSG_MESH_DONE = _UxGT("Sond.mesh eseguito"); LSTR MSG_INFO_STATS_MENU = _UxGT("Statistiche"); + LSTR MSG_RESET_STATS = _UxGT("Reset stat.stampa?"); LSTR MSG_INFO_BOARD_MENU = _UxGT("Info. scheda"); LSTR MSG_INFO_THERMISTOR_MENU = _UxGT("Termistori"); LSTR MSG_INFO_EXTRUDERS = _UxGT("Estrusori"); From 5446968a5885ff0fef6cc66516db72b123511200 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 31 Jan 2023 06:05:55 +0000 Subject: [PATCH 40/54] [cron] Bump distribution date (2023-01-31) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 77f889518c3ef..08e374ae0bbc0 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-27" +//#define STRING_DISTRIBUTION_DATE "2023-01-31" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index d6535886bdaee..85de0e5bcda6e 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 "2023-01-27" + #define STRING_DISTRIBUTION_DATE "2023-01-31" #endif /** From 738f0a10f532881204d567a6c07240ec8c3c3052 Mon Sep 17 00:00:00 2001 From: Dan Royer Date: Mon, 30 Jan 2023 22:12:03 -0800 Subject: [PATCH 41/54] =?UTF-8?q?=E2=9C=A8=20POLARGRAPH=20/=20PEN=5FUP=5FD?= =?UTF-8?q?OWN=5FMENU=20(#25303)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dan Royer <1464454+i-make-robots@users.noreply.github.com> --- Marlin/Configuration.h | 5 +++-- Marlin/src/lcd/language/language_en.h | 2 ++ Marlin/src/lcd/menu/menu_motion.cpp | 7 +++++++ Marlin/src/module/motion.cpp | 2 ++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index f639b68787a8e..c66ca4e9e8b9b 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -878,8 +878,9 @@ // Enable for Polargraph Kinematics //#define POLARGRAPH #if ENABLED(POLARGRAPH) - #define POLARGRAPH_MAX_BELT_LEN 1035.0 - #define DEFAULT_SEGMENTS_PER_SECOND 5 + #define POLARGRAPH_MAX_BELT_LEN 1035.0 // (mm) Belt length at full extension. Override with M665 H. + #define DEFAULT_SEGMENTS_PER_SECOND 5 // Move segmentation based on duration + #define PEN_UP_DOWN_MENU // Add "Pen Up" and "Pen Down" to the MarlinUI menu #endif // @section delta diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index a1520c0a7ed13..5adc5275fc6e6 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -596,6 +596,8 @@ namespace Language_en { LSTR MSG_TOUCHMI_SAVE = _UxGT("Save"); LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Deploy TouchMI"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Deploy Z-Probe"); + LSTR MSG_MANUAL_PENUP = _UxGT("Pen up"); + LSTR MSG_MANUAL_PENDOWN = _UxGT("Pen down"); LSTR MSG_MANUAL_STOW = _UxGT("Stow Z-Probe"); LSTR MSG_HOME_FIRST = _UxGT("Home %s First"); LSTR MSG_ZPROBE_SETTINGS = _UxGT("Probe Settings"); diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 1bd580aa2b343..6ce75d59aeb37 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -360,6 +360,13 @@ void menu_motion() { #endif // + // Pen up/down menu + // + #if ENABLED(PEN_UP_DOWN_MENU) + GCODES_ITEM(MSG_MANUAL_PENUP, F("M280 P0 S90")); + GCODES_ITEM(MSG_MANUAL_PENDOWN, F("M280 P0 S50")); + #endif + // Probe Offset Wizard // #if ENABLED(PROBE_OFFSET_WIZARD) diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index a76bd967c0cd0..7c90ae7159861 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -926,6 +926,8 @@ void restore_feedrate_and_scaling() { #if BOTH(HAS_HOTEND_OFFSET, DELTA) // The effector center position will be the target minus the hotend offset. const xy_pos_t offs = hotend_offset[active_extruder]; + #elif ENABLED(POLARGRAPH) + // POLARGRAPH uses draw_area_* below... #elif ENABLED(POLAR) // For now, we don't limit POLAR #else From aae103e3592eceefe46320882cc96320b995a245 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 1 Feb 2023 00:25:54 +0000 Subject: [PATCH 42/54] [cron] Bump distribution date (2023-02-01) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 08e374ae0bbc0..bfb8ef1d3e407 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-01-31" +//#define STRING_DISTRIBUTION_DATE "2023-02-01" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 85de0e5bcda6e..93b82e293d44e 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 "2023-01-31" + #define STRING_DISTRIBUTION_DATE "2023-02-01" #endif /** From d6f4f24658cd6d307d395077020be85ecb0d2210 Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Wed, 1 Feb 2023 07:25:13 +0000 Subject: [PATCH 43/54] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20PID=20/=20MPC=20heat?= =?UTF-8?q?ing=20flags=20(#25314)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 4 ++-- Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/inc/SanityCheck.h | 2 ++ Marlin/src/module/temperature.cpp | 21 ++++++++++++++++----- Marlin/src/module/temperature.h | 2 +- buildroot/tests/LPC1768 | 2 +- buildroot/tests/LPC1769 | 2 +- 7 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 71f46bfe8a793..16f8bdee1adfe 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -304,8 +304,8 @@ #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops - #if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP) - //#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303 + #if ENABLED(ADAPTIVE_FAN_SLOWING) && EITHER(MPCTEMP, PIDTEMP) + //#define TEMP_TUNING_MAINTAIN_FAN // Don't slow fan speed during M303 or M306 T #endif /** diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 5ec428edf29db..cf6c560b5cc72 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -3054,7 +3054,7 @@ */ #if !HAS_FAN #undef ADAPTIVE_FAN_SLOWING - #undef NO_FAN_SLOWING_IN_PID_TUNING + #undef TEMP_TUNING_MAINTAIN_FAN #endif #if !BOTH(HAS_BED_PROBE, HAS_FAN) #undef PROBING_FANS_OFF diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index b5a37307ab325..c501c328c769b 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -97,6 +97,8 @@ #error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS." #elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD) #error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED." +#elif defined(NO_FAN_SLOWING_IN_PID_TUNING) + #error "NO_FAN_SLOWING_IN_PID_TUNING is now TEMP_TUNING_MAINTAIN_FAN." #elif (CORE_IS_XZ || CORE_IS_YZ) && ENABLED(Z_LATE_ENABLE) #error "Z_LATE_ENABLE can't be used with COREXZ, COREZX, COREYZ, or COREZY." #elif defined(X_HOME_RETRACT_MM) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 5d4ccc0a5189a..d5508401dec0b 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -311,7 +311,7 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); * public: */ -#if ENABLED(NO_FAN_SLOWING_IN_PID_TUNING) +#if ENABLED(TEMP_TUNING_MAINTAIN_FAN) bool Temperature::adaptive_fan_slowing = true; #endif @@ -688,7 +688,7 @@ volatile bool Temperature::raw_temps_ready = false; LEDColor color = ONHEATINGSTART(); #endif - TERN_(NO_FAN_SLOWING_IN_PID_TUNING, adaptive_fan_slowing = false); + TERN_(TEMP_TUNING_MAINTAIN_FAN, adaptive_fan_slowing = false); LCD_MESSAGE(MSG_HEATING); @@ -876,7 +876,7 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(DWIN_PID_TUNE, DWIN_PidTuning(PID_DONE)); EXIT_M303: - TERN_(NO_FAN_SLOWING_IN_PID_TUNING, adaptive_fan_slowing = true); + TERN_(TEMP_TUNING_MAINTAIN_FAN, adaptive_fan_slowing = true); return; } @@ -910,6 +910,7 @@ volatile bool Temperature::raw_temps_ready = false; return false; } + wait_for_heatup = false; return true; }; @@ -927,6 +928,8 @@ volatile bool Temperature::raw_temps_ready = false; #endif do_z_clearance(MPC_TUNING_END_Z); + + TERN_(TEMP_TUNING_MAINTAIN_FAN, adaptive_fan_slowing = true); } } on_exit; @@ -935,6 +938,8 @@ volatile bool Temperature::raw_temps_ready = false; MPCHeaterInfo &hotend = temp_hotend[active_extruder]; MPC_t &mpc = hotend.mpc; + TERN_(TEMP_TUNING_MAINTAIN_FAN, adaptive_fan_slowing = false); + // Move to center of bed, just above bed height and cool with max fan gcode.home_all_axes(true); disable_all_heaters(); @@ -970,7 +975,6 @@ volatile bool Temperature::raw_temps_ready = false; next_test_ms += 10000UL; } } - wait_for_heatup = false; #if HAS_FAN set_fan_speed(EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0); @@ -989,6 +993,7 @@ volatile bool Temperature::raw_temps_ready = false; uint16_t sample_distance = 1; float t1_time = 0; + wait_for_heatup = true; for (;;) { // Can be interrupted with M108 if (!housekeeping(ms, current_temp, next_report_ms)) return; @@ -1045,6 +1050,7 @@ volatile bool Temperature::raw_temps_ready = false; #endif float last_temp = current_temp; + wait_for_heatup = true; for (;;) { // Can be interrupted with M108 if (!housekeeping(ms, current_temp, next_report_ms)) return; @@ -4124,6 +4130,7 @@ void Temperature::isr() { } while (wait_for_heatup && TEMP_CONDITIONS); + // If wait_for_heatup is set, temperature was reached, no cancel if (wait_for_heatup) { wait_for_heatup = false; #if HAS_DWIN_E3V2_BASIC @@ -4262,6 +4269,7 @@ void Temperature::isr() { } while (wait_for_heatup && TEMP_BED_CONDITIONS); + // If wait_for_heatup is set, temperature was reached, no cancel if (wait_for_heatup) { wait_for_heatup = false; ui.reset_status(); @@ -4340,6 +4348,7 @@ void Temperature::isr() { } } + // If wait_for_heatup is set, temperature was reached, no cancel if (wait_for_heatup) { wait_for_heatup = false; ui.reset_status(); @@ -4439,6 +4448,7 @@ void Temperature::isr() { } } while (wait_for_heatup && TEMP_CHAMBER_CONDITIONS); + // If wait_for_heatup is set, temperature was reached, no cancel if (wait_for_heatup) { wait_for_heatup = false; ui.reset_status(); @@ -4525,6 +4535,7 @@ void Temperature::isr() { first_loop = false; #endif // TEMP_COOLER_RESIDENCY_TIME > 0 + // Prevent a wait-forever situation if R is misused i.e. M191 R0 if (wants_to_cool) { // Break after MIN_COOLING_SLOPE_TIME_CHAMBER seconds // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_CHAMBER @@ -4537,7 +4548,7 @@ void Temperature::isr() { } while (wait_for_heatup && TEMP_COOLER_CONDITIONS); - // Prevent a wait-forever situation if R is misused i.e. M191 R0 + // If wait_for_heatup is set, temperature was reached, no cancel if (wait_for_heatup) { wait_for_heatup = false; ui.reset_status(); diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 9ac5db44edfa1..c947a6789abee 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -1173,7 +1173,7 @@ class Temperature { static void PID_autotune(const celsius_t target, const heater_id_t heater_id, const int8_t ncycles, const bool set_result=false); - #if ENABLED(NO_FAN_SLOWING_IN_PID_TUNING) + #if ENABLED(TEMP_TUNING_MAINTAIN_FAN) static bool adaptive_fan_slowing; #elif ENABLED(ADAPTIVE_FAN_SLOWING) static constexpr bool adaptive_fan_slowing = true; diff --git a/buildroot/tests/LPC1768 b/buildroot/tests/LPC1768 index 535e776a3892c..2e680b60d797b 100755 --- a/buildroot/tests/LPC1768 +++ b/buildroot/tests/LPC1768 @@ -40,7 +40,7 @@ opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EEB \ NOZZLE_CLEAN_MIN_TEMP 170 \ NOZZLE_CLEAN_START_POINT "{ { 10, 10, 3 }, { 10, 10, 3 } }" \ NOZZLE_CLEAN_END_POINT "{ { 10, 20, 3 }, { 10, 20, 3 } }" -opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ +opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER ADAPTIVE_FAN_SLOWING TEMP_TUNING_MAINTAIN_FAN \ FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY PID_EXTRUSION_SCALING SOUND_MENU_ITEM \ NOZZLE_AS_PROBE AUTO_BED_LEVELING_BILINEAR PREHEAT_BEFORE_LEVELING G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ ASSISTED_TRAMMING ASSISTED_TRAMMING_WIZARD REPORT_TRAMMING_MM ASSISTED_TRAMMING_WAIT_POSITION \ diff --git a/buildroot/tests/LPC1769 b/buildroot/tests/LPC1769 index 086dffffc92c2..ec5c824450c69 100755 --- a/buildroot/tests/LPC1769 +++ b/buildroot/tests/LPC1769 @@ -18,7 +18,7 @@ opt_set MOTHERBOARD BOARD_SMOOTHIEBOARD \ GRID_MAX_POINTS_X 16 \ NOZZLE_CLEAN_START_POINT "{ { 10, 10, 3 }, { 10, 10, 3 } }" \ NOZZLE_CLEAN_END_POINT "{ { 10, 20, 3 }, { 10, 20, 3 } }" -opt_enable TFTGLCD_PANEL_SPI SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \ +opt_enable TFTGLCD_PANEL_SPI SDSUPPORT ADAPTIVE_FAN_SLOWING TEMP_TUNING_MAINTAIN_FAN \ MAX31865_SENSOR_OHMS_0 MAX31865_CALIBRATION_OHMS_0 \ FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BED_TRAMMING_USE_PROBE BED_TRAMMING_VERIFY_RAISED \ From fbe9237a6c934b8c16e39b879b04973063c3988c Mon Sep 17 00:00:00 2001 From: alexgrach Date: Wed, 1 Feb 2023 10:40:13 +0300 Subject: [PATCH 44/54] =?UTF-8?q?=F0=9F=90=9B=20Fix=20TFT=20touch=20button?= =?UTF-8?q?s,=20button=20colors=20(#25300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 4 ++-- Marlin/src/lcd/tft/tft_color.h | 13 +++++++++++++ Marlin/src/lcd/tft/ui_1024x600.cpp | 5 ----- Marlin/src/lcd/tft/ui_320x240.cpp | 5 ----- Marlin/src/lcd/tft/ui_480x320.cpp | 5 ----- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 7d4098d1cfa60..920ad15c6cc6b 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1611,9 +1611,9 @@ #endif #if ANY(HAS_UI_320x240, HAS_UI_480x320, HAS_UI_480x272) #if ENABLED(TFT_COLOR_UI_PORTRAIT) - #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen - #else #define LCD_HEIGHT TERN(TOUCH_SCREEN, 8, 9) // Fewer lines with touch buttons onscreen + #else + #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen #endif #elif HAS_UI_1024x600 #define LCD_HEIGHT TERN(TOUCH_SCREEN, 12, 13) // Fewer lines with touch buttons onscreen diff --git a/Marlin/src/lcd/tft/tft_color.h b/Marlin/src/lcd/tft/tft_color.h index a8668179e5793..07518028aa803 100644 --- a/Marlin/src/lcd/tft/tft_color.h +++ b/Marlin/src/lcd/tft/tft_color.h @@ -178,3 +178,16 @@ #ifndef COLOR_KILL_SCREEN_TEXT #define COLOR_KILL_SCREEN_TEXT COLOR_WHITE #endif + +#ifndef E_BTN_COLOR + #define E_BTN_COLOR COLOR_YELLOW +#endif +#ifndef X_BTN_COLOR + #define X_BTN_COLOR COLOR_CORAL_RED +#endif +#ifndef Y_BTN_COLOR + #define Y_BTN_COLOR COLOR_VIVID_GREEN +#endif +#ifndef Z_BTN_COLOR + #define Z_BTN_COLOR COLOR_LIGHT_BLUE +#endif diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index 363e8eaf9925e..771f12d89897d 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -592,11 +592,6 @@ struct MotionAxisState { MotionAxisState motionAxisState; -#define E_BTN_COLOR COLOR_YELLOW -#define X_BTN_COLOR COLOR_CORAL_RED -#define Y_BTN_COLOR COLOR_VIVID_GREEN -#define Z_BTN_COLOR COLOR_LIGHT_BLUE - #define BTN_WIDTH 64 #define BTN_HEIGHT 52 #define X_MARGIN 20 diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index fa433645d7b2f..76cce4dad14ed 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -674,11 +674,6 @@ struct MotionAxisState { MotionAxisState motionAxisState; -#define E_BTN_COLOR COLOR_YELLOW -#define X_BTN_COLOR COLOR_CORAL_RED -#define Y_BTN_COLOR COLOR_VIVID_GREEN -#define Z_BTN_COLOR COLOR_LIGHT_BLUE - #define BTN_WIDTH 48 #define BTN_HEIGHT 39 #define X_MARGIN 15 diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 5bf50a5818439..c4395460d569e 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -573,11 +573,6 @@ struct MotionAxisState { MotionAxisState motionAxisState; -#define E_BTN_COLOR COLOR_YELLOW -#define X_BTN_COLOR COLOR_CORAL_RED -#define Y_BTN_COLOR COLOR_VIVID_GREEN -#define Z_BTN_COLOR COLOR_LIGHT_BLUE - #define BTN_WIDTH 64 #define BTN_HEIGHT 52 #define X_MARGIN 20 From 64338dfccb8416a16951d3bd4dcf6aab96bf2e4f Mon Sep 17 00:00:00 2001 From: Bob Kuhn Date: Wed, 1 Feb 2023 01:51:11 -0600 Subject: [PATCH 45/54] =?UTF-8?q?=F0=9F=94=A7=20Fix=20SD=20sorting=20sanit?= =?UTF-8?q?y=20checks=20(#25318)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index c501c328c769b..dc8c8a22cc36c 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -994,12 +994,12 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS #error "SDSORT_LIMIT must be 256 or smaller." #elif SDSORT_LIMIT < 10 #error "SDSORT_LIMIT should be greater than 9 to be useful." - #elif DISABLED(SDSORT_USES_RAM) - #if ENABLED(SDSORT_DYNAMIC_RAM) - #error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)." - #elif ENABLED(SDSORT_CACHE_NAMES) - #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)." - #endif + #elif ENABLED(SDSORT_DYNAMIC_RAM) && DISABLED(SDSORT_USES_RAM) + #error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)." + #elif ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_USES_RAM) + #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)." + #elif ENABLED(SDSORT_DYNAMIC_RAM) && DISABLED(SDSORT_CACHE_NAMES) + #error "SDSORT_DYNAMIC_RAM requires SDSORT_CACHE_NAMES." #endif #if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM) From 57a7e28145de06d58be25d5d873586970e6db3d0 Mon Sep 17 00:00:00 2001 From: Bob Kuhn Date: Wed, 1 Feb 2023 02:43:06 -0600 Subject: [PATCH 46/54] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20progress=20DOGM=20co?= =?UTF-8?q?mpile=20error=20(#25319)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 03e83c218104e..8bdba4234282c 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -444,9 +444,12 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const } // Prepare strings for progress display -#if HAS_EXTRA_PROGRESS +#if EITHER(HAS_EXTRA_PROGRESS, HAS_PRINT_PROGRESS) static MarlinUI::progress_t progress = 0; static char bufferc[13]; +#endif + +#if HAS_EXTRA_PROGRESS static void prepare_time_string(const duration_t &time, char prefix) { char str[13]; @@ -484,7 +487,8 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const if (printJobOngoing()) prepare_time_string(print_job_timer.duration(), 'E'); } #endif -#endif // HAS_PRINT_PROGRESS + +#endif // HAS_EXTRA_PROGRESS /** * Draw the Status Screen for a 128x64 DOGM (U8glib) display. From 3be967bcb4f2e66500756163ebd036b7d235af1f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 1 Feb 2023 02:19:47 -0600 Subject: [PATCH 47/54] =?UTF-8?q?=F0=9F=A9=B9=20PID=20/=20MPC=20heating=20?= =?UTF-8?q?followup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #25314 --- Marlin/src/module/temperature.cpp | 17 ++++++++++------- Marlin/src/module/temperature.h | 12 ++++++------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index d5508401dec0b..4b0ee355d4cfa 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -907,11 +907,10 @@ volatile bool Temperature::raw_temps_ready = false; SERIAL_ECHOPGM(STR_MPC_AUTOTUNE); SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_INTERRUPTED); TERN_(DWIN_LCD_PROUI, DWIN_MPCTuning(MPC_INTERRUPTED)); - return false; + return true; } - wait_for_heatup = false; - return true; + return false; }; struct OnExit { @@ -964,7 +963,7 @@ volatile bool Temperature::raw_temps_ready = false; wait_for_heatup = true; for (;;) { // Can be interrupted with M108 - if (!housekeeping(ms, current_temp, next_report_ms)) return; + if (housekeeping(ms, current_temp, next_report_ms)) return; if (ELAPSED(ms, next_test_ms)) { if (current_temp >= ambient_temp) { @@ -975,6 +974,7 @@ volatile bool Temperature::raw_temps_ready = false; next_test_ms += 10000UL; } } + wait_for_heatup = false; #if HAS_FAN set_fan_speed(EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0); @@ -986,7 +986,7 @@ volatile bool Temperature::raw_temps_ready = false; SERIAL_ECHOLNPGM(STR_MPC_HEATING_PAST_200); TERN(DWIN_LCD_PROUI, LCD_ALERTMESSAGE(MSG_MPC_HEATING_PAST_200), LCD_MESSAGE(MSG_HEATING)); hotend.target = 200.0f; // So M105 looks nice - hotend.soft_pwm_amount = MPC_MAX >> 1; + hotend.soft_pwm_amount = (MPC_MAX) >> 1; const millis_t heat_start_time = next_test_ms = ms; celsius_float_t temp_samples[16]; uint8_t sample_count = 0; @@ -995,7 +995,7 @@ volatile bool Temperature::raw_temps_ready = false; wait_for_heatup = true; for (;;) { // Can be interrupted with M108 - if (!housekeeping(ms, current_temp, next_report_ms)) return; + if (housekeeping(ms, current_temp, next_report_ms)) return; if (ELAPSED(ms, next_test_ms)) { // Record samples between 100C and 200C @@ -1017,6 +1017,8 @@ volatile bool Temperature::raw_temps_ready = false; next_test_ms += 1000UL * sample_distance; } } + wait_for_heatup = false; + hotend.soft_pwm_amount = 0; // Calculate physical constants from three equally-spaced samples @@ -1052,7 +1054,7 @@ volatile bool Temperature::raw_temps_ready = false; wait_for_heatup = true; for (;;) { // Can be interrupted with M108 - if (!housekeeping(ms, current_temp, next_report_ms)) return; + if (housekeeping(ms, current_temp, next_report_ms)) return; if (ELAPSED(ms, next_test_ms)) { hotend.soft_pwm_amount = (int)get_pid_output_hotend(active_extruder) >> 1; @@ -1082,6 +1084,7 @@ volatile bool Temperature::raw_temps_ready = false; break; } } + wait_for_heatup = false; const float power_fan0 = total_energy_fan0 * 1000 / test_duration; mpc.ambient_xfer_coeff_fan0 = power_fan0 / (hotend.target - ambient_temp); diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index c947a6789abee..afbf656a7ab6e 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -1162,6 +1162,12 @@ class Temperature { static void auto_job_check_timer(const bool can_start, const bool can_stop); #endif + #if ENABLED(TEMP_TUNING_MAINTAIN_FAN) + static bool adaptive_fan_slowing; + #elif ENABLED(ADAPTIVE_FAN_SLOWING) + static constexpr bool adaptive_fan_slowing = true; + #endif + /** * Perform auto-tuning for hotend or bed in response to M303 */ @@ -1173,12 +1179,6 @@ class Temperature { static void PID_autotune(const celsius_t target, const heater_id_t heater_id, const int8_t ncycles, const bool set_result=false); - #if ENABLED(TEMP_TUNING_MAINTAIN_FAN) - static bool adaptive_fan_slowing; - #elif ENABLED(ADAPTIVE_FAN_SLOWING) - static constexpr bool adaptive_fan_slowing = true; - #endif - // Update the temp manager when PID values change #if ENABLED(PIDTEMP) static void updatePID() { HOTEND_LOOP() temp_hotend[e].pid.reset(); } From 8f11428db11e83f92c4810c6e27108912b01d8b7 Mon Sep 17 00:00:00 2001 From: kg333 Date: Wed, 1 Feb 2023 19:02:26 -0500 Subject: [PATCH 48/54] =?UTF-8?q?=F0=9F=93=BA=20Melzi=20v4=20with=20BTT=20?= =?UTF-8?q?SKR=20Mini=20E3=20(#25321)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stm32f1/pins_BTT_SKR_MINI_E3_common.h | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h index 8ed09417f0dfb..9448d4f0c5b83 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h @@ -163,8 +163,8 @@ #if ENABLED(CR10_STOCKDISPLAY) #define BEEPER_PIN EXP1_01_PIN - #define BTN_ENC EXP1_02_PIN + #define BTN_ENC EXP1_02_PIN #define BTN_EN1 EXP1_03_PIN #define BTN_EN2 EXP1_05_PIN @@ -172,6 +172,37 @@ #define LCD_PINS_ENABLE EXP1_08_PIN #define LCD_PINS_D4 EXP1_06_PIN + #elif ENABLED(LCD_FOR_MELZI) + + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! LCD for Melzi v4 display requires a custom cable. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif + + /** + * LCD for Melzi v4 needs a custom cable with reversed GND/5V pins; plugging in a standard cable may damage the board or LCD! + * 1. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!) + * 2. Swap pin 4 on the Melzi LCD to pin 7 on the SKR Mini E3 EXP1 connector (pin 4 on the SKR is a RESET and cannot be used) + * + * LCD for Melzi V4 SKR Mini E3 V2.0 + * ------ ------ + * LCD RS | 1 2 | EN1 LCD RS | 1 2 | EN1 + * LCD EN | 3 4 | EN2 LCD EN | 3 4 | OPEN (RESET) + * LCD D4 | 5 6 | ENC LCD D4 | 5 6 | ENC + * E-Stop | 7 8 | BEEP EN2 | 7 8 | BEEP + * 5V | 9 10 | GND GND | 9 10 | 5V + * ------ ------ + * EXP1 EXP1 + */ + #define BEEPER_PIN EXP1_08_PIN + + #define BTN_ENC EXP1_06_PIN + #define BTN_EN1 EXP1_02_PIN + #define BTN_EN2 EXP1_07_PIN + + #define LCD_PINS_RS EXP1_01_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING @@ -306,7 +337,7 @@ #define FORCE_SOFT_SPI #else - #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, TFTGLCD_PANEL_(SPI|I2C), FYSETC_MINI_12864_2_1, MKS_MINI_12864_V3, and BTT_MINI_12864_V1 are currently supported on the BIGTREE_SKR_MINI_E3." + #error "Only CR10_STOCKDISPLAY, LCD_FOR_MELZI, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, TFTGLCD_PANEL_(SPI|I2C), FYSETC_MINI_12864_2_1, MKS_MINI_12864_V3, and BTT_MINI_12864_V1 are currently supported on the BIGTREE_SKR_MINI_E3." #endif #endif // HAS_WIRED_LCD From a80036e3ca867ffdd4a4ffb9607eaeeb33cd581a Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 2 Feb 2023 00:23:18 +0000 Subject: [PATCH 49/54] [cron] Bump distribution date (2023-02-02) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index bfb8ef1d3e407..05611a5b1f959 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-02-01" +//#define STRING_DISTRIBUTION_DATE "2023-02-02" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 93b82e293d44e..a8ef1e71402b9 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 "2023-02-01" + #define STRING_DISTRIBUTION_DATE "2023-02-02" #endif /** From cb7af50bafcd377a77aa4965e3fa85caa5e6bdcb Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Thu, 2 Feb 2023 17:41:46 -0800 Subject: [PATCH 50/54] =?UTF-8?q?=F0=9F=93=9D=20Fix=20Z*=5FENDSTOP=5FADJUS?= =?UTF-8?q?TMENT=20comments=20(#25295)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 16f8bdee1adfe..31cbd678bfd41 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -843,20 +843,20 @@ //#define Z_MULTI_ENDSTOPS // Other Z axes have their own endstops #if ENABLED(Z_MULTI_ENDSTOPS) #define Z2_USE_ENDSTOP _XMAX_ // Z2 endstop board plug. Don't forget to enable USE_*_PLUG. - #define Z2_ENDSTOP_ADJUSTMENT 0 // Z2 offset relative to Y endstop + #define Z2_ENDSTOP_ADJUSTMENT 0 // Z2 offset relative to Z endstop #endif #ifdef Z3_DRIVER_TYPE //#define INVERT_Z3_VS_Z_DIR // Z3 direction signal is the opposite of Z #if ENABLED(Z_MULTI_ENDSTOPS) #define Z3_USE_ENDSTOP _YMAX_ // Z3 endstop board plug. Don't forget to enable USE_*_PLUG. - #define Z3_ENDSTOP_ADJUSTMENT 0 // Z3 offset relative to Y endstop + #define Z3_ENDSTOP_ADJUSTMENT 0 // Z3 offset relative to Z endstop #endif #endif #ifdef Z4_DRIVER_TYPE //#define INVERT_Z4_VS_Z_DIR // Z4 direction signal is the opposite of Z #if ENABLED(Z_MULTI_ENDSTOPS) #define Z4_USE_ENDSTOP _ZMAX_ // Z4 endstop board plug. Don't forget to enable USE_*_PLUG. - #define Z4_ENDSTOP_ADJUSTMENT 0 // Z4 offset relative to Y endstop + #define Z4_ENDSTOP_ADJUSTMENT 0 // Z4 offset relative to Z endstop #endif #endif #endif From cea176ab3658cfbf68b73aff79b2e52eef4b5948 Mon Sep 17 00:00:00 2001 From: Martin Turski Date: Fri, 3 Feb 2023 04:01:22 +0100 Subject: [PATCH 51/54] =?UTF-8?q?=F0=9F=94=A8=20Fix=20test=20build=20path?= =?UTF-8?q?=20with=20spaces=20(#25329)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/bin/run_tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot/bin/run_tests b/buildroot/bin/run_tests index 26284fa693305..9a03be3cc7346 100755 --- a/buildroot/bin/run_tests +++ b/buildroot/bin/run_tests @@ -67,7 +67,7 @@ else printf "\033[0;32mMatching test \033[0m#$3\033[0;32m: '\033[0m$test_name\033[0;32m'\n" fi fi - $TESTS/$2 $1 $2 "$test_name" + "$TESTS/$2" $1 $2 "$test_name" if [[ $GIT_RESET_HARD == "true" ]]; then git reset --hard HEAD else From 7c0b4657546d62a740651d3fee802cae62bd99da Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 3 Feb 2023 06:06:11 +0000 Subject: [PATCH 52/54] [cron] Bump distribution date (2023-02-03) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 05611a5b1f959..3aca533cead06 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-02-02" +//#define STRING_DISTRIBUTION_DATE "2023-02-03" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index a8ef1e71402b9..83b051753439e 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 "2023-02-02" + #define STRING_DISTRIBUTION_DATE "2023-02-03" #endif /** From 08d9cbb9306a032d706a6ded0bf576fd0c58ca8d Mon Sep 17 00:00:00 2001 From: vyacheslav-shubin Date: Sat, 4 Feb 2023 10:36:07 +0300 Subject: [PATCH 53/54] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Add?= =?UTF-8?q?=20SD=20Card=20'hide'=20method=20for=20dev=20usage=20(#22425)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/sd/SdBaseFile.cpp | 22 ++++++++++++++++++++++ Marlin/src/sd/SdBaseFile.h | 5 +++++ 2 files changed, 27 insertions(+) diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index 1c1e0c7d145a6..e3f95623acbcc 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -1668,6 +1668,28 @@ bool SdBaseFile::remove(SdBaseFile *dirFile, const char *path) { return file.open(dirFile, path, O_WRITE) ? file.remove() : false; } +bool SdBaseFile::hide(const bool hidden) { + if (ENABLED(SDCARD_READONLY)) return false; + // must be an open file or subdirectory + if (!(isFile() || isSubDir())) return false; + // sync() and cache directory entry + sync(); + dir_t *d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); + if (!d) return false; + uint8_t a = d->attributes; + if (hidden) + a |= DIR_ATT_HIDDEN; + else + a &= ~DIR_ATT_HIDDEN; + + if (a != d->attributes) { + d->attributes = a; + return vol_->cacheFlush(); + } + + return true; +} + /** * Rename a file or subdirectory. * diff --git a/Marlin/src/sd/SdBaseFile.h b/Marlin/src/sd/SdBaseFile.h index bda44c6bd5c37..dd8e2aff4bd43 100644 --- a/Marlin/src/sd/SdBaseFile.h +++ b/Marlin/src/sd/SdBaseFile.h @@ -310,6 +310,11 @@ class SdBaseFile { bool rmdir(); bool rmRfStar(); + /** + * Set or clear DIR_ATT_HIDDEN attribute for directory entry + */ + bool hide(const bool hidden); + /** * Set the files position to current position + \a pos. See seekSet(). * \param[in] offset The new position in bytes from the current position. From 218ca0530432d6b1194ccac5fc32a72bbc9a7c96 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sat, 4 Feb 2023 05:10:26 -0300 Subject: [PATCH 54/54] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Gener?= =?UTF-8?q?al=20'MediaFile'=20type=20alias=20(#24424)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/STM32/eeprom_sdcard.cpp | 4 +- Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp | 4 +- Marlin/src/feature/powerloss.cpp | 2 +- Marlin/src/feature/powerloss.h | 2 +- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 2 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 2 +- .../archim2-flash/media_file_reader.h | 2 +- Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp | 2 +- Marlin/src/lcd/extui/mks_ui/draw_ui.cpp | 4 +- Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp | 2 +- Marlin/src/lcd/extui/mks_ui/pic_manager.cpp | 6 +- Marlin/src/lcd/extui/mks_ui/wifi_module.cpp | 10 +-- Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp | 2 +- Marlin/src/sd/SdFile.h | 2 + Marlin/src/sd/SdVolume.h | 2 + Marlin/src/sd/cardreader.cpp | 44 +++++------ Marlin/src/sd/cardreader.h | 23 +++--- Marlin/src/sd/disk_io_driver.h | 1 + Marlin/src/sd/storage.h | 74 +++++++++++++++++++ 19 files changed, 135 insertions(+), 55 deletions(-) create mode 100644 Marlin/src/sd/storage.h diff --git a/Marlin/src/HAL/STM32/eeprom_sdcard.cpp b/Marlin/src/HAL/STM32/eeprom_sdcard.cpp index 473b656f9a3c0..1b5c0ae5b2c05 100644 --- a/Marlin/src/HAL/STM32/eeprom_sdcard.cpp +++ b/Marlin/src/HAL/STM32/eeprom_sdcard.cpp @@ -48,7 +48,7 @@ static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE]; bool PersistentStore::access_start() { if (!card.isMounted()) return false; - SdFile file, root = card.getroot(); + MediaFile file, root = card.getroot(); if (!file.open(&root, EEPROM_FILENAME, O_RDONLY)) return true; @@ -63,7 +63,7 @@ bool PersistentStore::access_start() { bool PersistentStore::access_finish() { if (!card.isMounted()) return false; - SdFile file, root = card.getroot(); + MediaFile file, root = card.getroot(); int bytes_written = 0; if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) { bytes_written = file.write(HAL_eeprom_data, MARLIN_EEPROM_SIZE); diff --git a/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp b/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp index d608ccee14413..9cfa97c1ab6eb 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp @@ -47,7 +47,7 @@ static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE]; bool PersistentStore::access_start() { if (!card.isMounted()) return false; - SdFile file, root = card.getroot(); + MediaFile file, root = card.getroot(); if (!file.open(&root, EEPROM_FILENAME, O_RDONLY)) return true; // false aborts the save @@ -62,7 +62,7 @@ bool PersistentStore::access_start() { bool PersistentStore::access_finish() { if (!card.isMounted()) return false; - SdFile file, root = card.getroot(); + MediaFile file, root = card.getroot(); int bytes_written = 0; if (file.open(&root, EEPROM_FILENAME, O_CREAT | O_WRITE | O_TRUNC)) { bytes_written = file.write(HAL_eeprom_data, MARLIN_EEPROM_SIZE); diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index d4450adcd8539..2825f4d4f2192 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -33,7 +33,7 @@ bool PrintJobRecovery::enabled; // Initialized by settings.load() -SdFile PrintJobRecovery::file; +MediaFile PrintJobRecovery::file; job_recovery_info_t PrintJobRecovery::info; const char PrintJobRecovery::filename[5] = "/PLR"; uint8_t PrintJobRecovery::queue_index_r; diff --git a/Marlin/src/feature/powerloss.h b/Marlin/src/feature/powerloss.h index 4bf0c06e2d7ee..d241fdb74c8e6 100644 --- a/Marlin/src/feature/powerloss.h +++ b/Marlin/src/feature/powerloss.h @@ -138,7 +138,7 @@ class PrintJobRecovery { public: static const char filename[5]; - static SdFile file; + static MediaFile file; static job_recovery_info_t info; static uint8_t queue_index_r; //!< Queue index of the active command diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 0f78e58ef5d7f..8894150c9885a 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -4663,7 +4663,7 @@ void CrealityDWINClass::Start_Print(bool sd) { if (sd) { #if ENABLED(POWER_LOSS_RECOVERY) if (recovery.valid()) { - SdFile *diveDir = nullptr; + MediaFile *diveDir = nullptr; const char * const fname = card.diveToFile(true, diveDir, recovery.info.sd_filename); card.selectFileByName(fname); } diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index e8430d591c980..c45aae6044de6 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1347,7 +1347,7 @@ void EachMomentUpdate() { DWINUI::Draw_Button(BTN_Cancel, 26, 280); DWINUI::Draw_Button(BTN_Continue, 146, 280); } - SdFile *dir = nullptr; + MediaFile *dir = nullptr; const char * const filename = card.diveToFile(true, dir, recovery.info.sd_filename); card.selectFileByName(filename); DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 207, card.longest_filename()); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h index eb76bb9b2b2c3..9a20c2a038d79 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/archim2-flash/media_file_reader.h @@ -32,7 +32,7 @@ class MediaFileReader { private: #if ENABLED(SDSUPPORT) - SdFile root, file; + MediaFile root, file; #endif public: diff --git a/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp index a69c54bcff636..a214e7d1e0e70 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp @@ -90,7 +90,7 @@ static void btn_ok_event_cb(lv_obj_t *btn, lv_event_t event) { char *cur_name; cur_name = strrchr(list_file.file_name[sel_id], '/'); - SdFile file, *curDir; + MediaFile file, *curDir; card.abortFilePrintNow(); const char * const fname = card.diveToFile(false, curDir, cur_name); if (!fname) return; diff --git a/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp index 6a8333fd66df4..b510e3c0c6f37 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_ui.cpp @@ -647,8 +647,8 @@ char *creat_title_text() { char *cur_name = strrchr(list_file.file_name[sel_id], '/'); - SdFile file; - SdFile *curDir; + MediaFile file; + MediaFile *curDir; const char * const fname = card.diveToFile(false, curDir, cur_name); if (!fname) return; if (file.open(curDir, fname, O_READ)) { diff --git a/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp b/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp index 00bb9833fc723..0c6315d438706 100644 --- a/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp +++ b/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp @@ -727,7 +727,7 @@ void disp_assets_update_progress(FSTR_P const fmsg) { uint8_t mks_test_flag = 0; const char *MKSTestPath = "MKS_TEST"; void mks_test_get() { - SdFile dir, root = card.getroot(); + MediaFile dir, root = card.getroot(); if (dir.open(&root, MKSTestPath, O_RDONLY)) mks_test_flag = 0x1E; } diff --git a/Marlin/src/lcd/extui/mks_ui/pic_manager.cpp b/Marlin/src/lcd/extui/mks_ui/pic_manager.cpp index c618127980bbc..d642d81f6baa9 100644 --- a/Marlin/src/lcd/extui/mks_ui/pic_manager.cpp +++ b/Marlin/src/lcd/extui/mks_ui/pic_manager.cpp @@ -403,8 +403,8 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { #define ASSET_TYPE_TITLE_LOGO 2 #define ASSET_TYPE_G_PREVIEW 3 #define ASSET_TYPE_FONT 4 - static void loadAsset(SdFile &dir, dir_t& entry, FSTR_P const fn, int8_t assetType) { - SdFile file; + static void loadAsset(MediaFile &dir, dir_t& entry, FSTR_P const fn, int8_t assetType) { + MediaFile file; char dosFilename[FILENAME_LENGTH]; createFilename(dosFilename, entry); if (!file.open(&dir, dosFilename, O_READ)) { @@ -488,7 +488,7 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) { void UpdateAssets() { if (!card.isMounted()) return; - SdFile dir, root = card.getroot(); + MediaFile dir, root = card.getroot(); if (dir.open(&root, assetsPath, O_RDONLY)) { disp_assets_update(); diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp index 23a39aabc4697..a8d30b442a9b6 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp +++ b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp @@ -736,7 +736,7 @@ int32_t lastFragment = 0; char saveFilePath[50]; -static SdFile upload_file, *upload_curDir; +static MediaFile upload_file, *upload_curDir; static filepos_t pos; int write_to_file(char *buf, int len) { @@ -974,8 +974,8 @@ static void wifi_gcode_exec(uint8_t *cmd_line) { if (!gcode_preview_over) { char *cur_name = strrchr(list_file.file_name[sel_id], '/'); - SdFile file; - SdFile *curDir; + MediaFile file; + MediaFile *curDir; card.abortFilePrintNow(); const char * const fname = card.diveToFile(false, curDir, cur_name); if (!fname) return; @@ -1595,7 +1595,7 @@ static void file_fragment_msg_handle(uint8_t * msg, uint16_t msgLen) { } } upload_file.close(); - SdFile file, *curDir; + MediaFile file, *curDir; const char * const fname = card.diveToFile(false, curDir, saveFilePath); if (file.open(curDir, fname, O_RDWR)) { gCfgItems.curFilesize = file.fileSize(); @@ -1969,7 +1969,7 @@ void mks_wifi_firmware_update() { if (wifi_upload(0) >= 0) { card.removeFile((char *)ESP_FIRMWARE_FILE_RENAME); - SdFile file, *curDir; + MediaFile file, *curDir; const char * const fname = card.diveToFile(false, curDir, ESP_FIRMWARE_FILE); if (file.open(curDir, fname, O_READ)) { file.rename(curDir, (char *)ESP_FIRMWARE_FILE_RENAME); diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp index c07cc47a36891..18a311303ccf2 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp +++ b/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp @@ -86,7 +86,7 @@ static const uint32_t defaultTimeout = 500; static const uint32_t eraseTimeout = 15000; static const uint32_t blockWriteTimeout = 200; static const uint32_t blockWriteInterval = 15; // 15ms is long enough, 10ms is mostly too short -static SdFile update_file, *update_curDir; +static MediaFile update_file, *update_curDir; // Messages corresponding to result codes, should make sense when followed by " error" const char *resultMessages[] = { diff --git a/Marlin/src/sd/SdFile.h b/Marlin/src/sd/SdFile.h index 1ff05828d2729..81eeadf5b5719 100644 --- a/Marlin/src/sd/SdFile.h +++ b/Marlin/src/sd/SdFile.h @@ -53,3 +53,5 @@ class SdFile : public SdBaseFile { void write_P(PGM_P str); void writeln_P(PGM_P str); }; + +using MediaFile = SdFile; diff --git a/Marlin/src/sd/SdVolume.h b/Marlin/src/sd/SdVolume.h index b8e70ca9d7f57..3097773030927 100644 --- a/Marlin/src/sd/SdVolume.h +++ b/Marlin/src/sd/SdVolume.h @@ -199,3 +199,5 @@ class SdVolume { bool readBlock(uint32_t block, uint8_t *dst) { return sdCard_->readBlock(block, dst); } bool writeBlock(uint32_t block, const uint8_t *dst) { return sdCard_->writeBlock(block, dst); } }; + +using MarlinVolume = SdVolume; diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 3ec1183083d97..fb2721a2b2825 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -79,7 +79,7 @@ IF_DISABLED(NO_SD_AUTOSTART, uint8_t CardReader::autofile_index); // = 0 // private: -SdFile CardReader::root, CardReader::workDir, CardReader::workDirParents[MAX_DIR_DEPTH]; +MediaFile CardReader::root, CardReader::workDir, CardReader::workDirParents[MAX_DIR_DEPTH]; uint8_t CardReader::workDirDepth; #if ENABLED(SDCARD_SORT_ALPHA) @@ -133,8 +133,8 @@ uint8_t CardReader::workDirDepth; #endif DiskIODriver* CardReader::driver = nullptr; -SdVolume CardReader::volume; -SdFile CardReader::file; +MarlinVolume CardReader::volume; +MediaFile CardReader::file; #if HAS_MEDIA_SUBCALLS uint8_t CardReader::file_subcall_ctr; @@ -228,7 +228,7 @@ bool CardReader::is_visible_entity(const dir_t &p OPTARG(CUSTOM_FIRMWARE_UPLOAD, // // Get the number of (compliant) items in the folder // -int CardReader::countItems(SdFile dir) { +int CardReader::countItems(MediaFile dir) { dir_t p; int c = 0; while (dir.readDir(&p, longFilename) > 0) @@ -244,7 +244,7 @@ int CardReader::countItems(SdFile dir) { // // Get file/folder info for an item by index // -void CardReader::selectByIndex(SdFile dir, const uint8_t index) { +void CardReader::selectByIndex(MediaFile dir, const uint8_t index) { dir_t p; for (uint8_t cnt = 0; dir.readDir(&p, longFilename) > 0;) { if (is_visible_entity(p)) { @@ -260,7 +260,7 @@ void CardReader::selectByIndex(SdFile dir, const uint8_t index) { // // Get file/folder info for an item by name // -void CardReader::selectByName(SdFile dir, const char * const match) { +void CardReader::selectByName(MediaFile dir, const char * const match) { dir_t p; for (uint8_t cnt = 0; dir.readDir(&p, longFilename) > 0; cnt++) { if (is_visible_entity(p)) { @@ -280,7 +280,7 @@ void CardReader::selectByName(SdFile dir, const char * const match) { * this can blow up the stack, so a 'depth' parameter would be a * good addition. */ -void CardReader::printListing(SdFile parent, const char * const prepend, const uint8_t lsflags +void CardReader::printListing(MediaFile parent, const char * const prepend, const uint8_t lsflags OPTARG(LONG_FILENAME_HOST_SUPPORT, const char * const prependLong/*=nullptr*/) ) { const bool includeTime = TERN0(M20_TIMESTAMP_SUPPORT, TEST(lsflags, LS_TIMESTAMP)); @@ -304,7 +304,7 @@ void CardReader::printListing(SdFile parent, const char * const prepend, const // Get a new directory object using the full path // and dive recursively into it. - SdFile child; // child.close() in destructor + MediaFile child; // child.close() in destructor if (child.open(&parent, dosFilename, O_READ)) { #if ENABLED(LONG_FILENAME_HOST_SUPPORT) if (includeLong) { @@ -375,7 +375,7 @@ void CardReader::ls(const uint8_t lsflags) { // Zero out slashes to make segments for (i = 0; i < pathLen; i++) if (path[i] == '/') path[i] = '\0'; - SdFile diveDir = root; // start from the root for segment 1 + MediaFile diveDir = root; // start from the root for segment 1 for (i = 0; i < pathLen;) { if (path[i] == '\0') i++; // move past a single nul @@ -404,7 +404,7 @@ void CardReader::ls(const uint8_t lsflags) { // SERIAL_ECHOPGM("Opening dir: "); SERIAL_ECHOLN(segment); // Open the sub-item as the new dive parent - SdFile dir; + MediaFile dir; if (!dir.open(&diveDir, segment, O_READ)) { SERIAL_EOL(); SERIAL_ECHO_START(); @@ -604,7 +604,7 @@ void CardReader::getAbsFilenameInCWD(char *dst) { *dst++ = '/'; uint8_t cnt = 1; - auto appendAtom = [&](SdFile &file) { + auto appendAtom = [&](MediaFile &file) { file.getDosName(dst); while (*dst && cnt < MAXPATHNAMELENGTH) { dst++; cnt++; } if (cnt < MAXPATHNAMELENGTH) { *dst = '/'; dst++; cnt++; } @@ -683,7 +683,7 @@ void CardReader::openFileRead(const char * const path, const uint8_t subcall_typ abortFilePrintNow(); - SdFile *diveDir; + MediaFile *diveDir; const char * const fname = diveToFile(true, diveDir, path); if (!fname) return openFailed(path); @@ -719,7 +719,7 @@ void CardReader::openFileWrite(const char * const path) { abortFilePrintNow(); - SdFile *diveDir; + MediaFile *diveDir; const char * const fname = diveToFile(false, diveDir, path); if (!fname) return openFailed(path); @@ -747,7 +747,7 @@ bool CardReader::fileExists(const char * const path) { DEBUG_ECHOLNPGM("fileExists: ", path); // Dive to the file's directory and get the base name - SdFile *diveDir = nullptr; + MediaFile *diveDir = nullptr; const char * const fname = diveToFile(false, diveDir, path); if (!fname) return false; @@ -757,7 +757,7 @@ bool CardReader::fileExists(const char * const path) { //diveDir->close(); // Try to open the file and return the result - SdFile tmpFile; + MediaFile tmpFile; const bool success = tmpFile.open(diveDir, fname, O_READ); if (success) tmpFile.close(); return success; @@ -771,7 +771,7 @@ void CardReader::removeFile(const char * const name) { //abortFilePrintNow(); - SdFile *itsDirPtr; + MediaFile *itsDirPtr; const char * const fname = diveToFile(false, itsDirPtr, name); if (!fname) return; @@ -919,23 +919,23 @@ uint16_t CardReader::countFilesInWorkDir() { * - The workDir points to the last-set navigation target by cd, cdup, cdroot, or diveToFile(true, ...) * * On exit: - * - Your curDir pointer contains an SdFile reference to the file's directory. + * - Your curDir pointer contains an MediaFile reference to the file's directory. * - If update_cwd was 'true' the workDir now points to the file's directory. * * Returns a pointer to the last segment (filename) of the given DOS 8.3 path. - * On exit, inDirPtr contains an SdFile reference to the file's directory. + * On exit, inDirPtr contains an MediaFile reference to the file's directory. * * A nullptr result indicates an unrecoverable error. * * NOTE: End the path with a slash to dive to a folder. In this case the * returned filename will be blank (points to the end of the path). */ -const char* CardReader::diveToFile(const bool update_cwd, SdFile* &inDirPtr, const char * const path, const bool echo/*=false*/) { +const char* CardReader::diveToFile(const bool update_cwd, MediaFile* &inDirPtr, const char * const path, const bool echo/*=false*/) { DEBUG_SECTION(est, "diveToFile", true); // Track both parent and subfolder - static SdFile newDir1, newDir2; - SdFile *sub = &newDir1, *startDirPtr; + static MediaFile newDir1, newDir2; + MediaFile *sub = &newDir1, *startDirPtr; // Parsing the path string const char *atom_ptr = path; @@ -1017,7 +1017,7 @@ const char* CardReader::diveToFile(const bool update_cwd, SdFile* &inDirPtr, con } void CardReader::cd(const char * relpath) { - SdFile newDir, *parent = &getWorkDir(); + MediaFile newDir, *parent = &getWorkDir(); if (newDir.open(parent, relpath, O_READ)) { workDir = newDir; diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 6fe75f760e2d6..86acb1b8628ca 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -116,7 +116,7 @@ class CardReader { static void changeMedia(DiskIODriver *_driver) { driver = _driver; } - static SdFile getroot() { return root; } + static MediaFile getroot() { return root; } static void mount(); static void release(); @@ -190,12 +190,12 @@ class CardReader { * Relative paths apply to the workDir. * * update_cwd: Pass 'true' to update the workDir on success. - * inDirPtr: On exit your pointer points to the target SdFile. + * inDirPtr: On exit your pointer points to the target MediaFile. * A nullptr indicates failure. * path: Start with '/' for abs path. End with '/' to get a folder ref. * echo: Set 'true' to print the path throughout the loop. */ - static const char* diveToFile(const bool update_cwd, SdFile* &inDirPtr, const char * const path, const bool echo=false); + static const char* diveToFile(const bool update_cwd, MediaFile* &inDirPtr, const char * const path, const bool echo=false); #if ENABLED(SDCARD_SORT_ALPHA) static void presort(); @@ -223,7 +223,7 @@ class CardReader { // Current Working Dir - Set by cd, cdup, cdroot, and diveToFile(true, ...) static char* getWorkDirName() { workDir.getDosName(filename); return filename; } - static SdFile& getWorkDir() { return workDir.isOpen() ? workDir : root; } + static MediaFile& getWorkDir() { return workDir.isOpen() ? workDir : root; } // Print File stats static uint32_t getFileSize() { return filesize; } @@ -262,7 +262,7 @@ class CardReader { // // Working directory and parents // - static SdFile root, workDir, workDirParents[MAX_DIR_DEPTH]; + static MediaFile root, workDir, workDirParents[MAX_DIR_DEPTH]; static uint8_t workDirDepth; // @@ -322,8 +322,8 @@ class CardReader { #endif // SDCARD_SORT_ALPHA static DiskIODriver *driver; - static SdVolume volume; - static SdFile file; + static MarlinVolume volume; + static MediaFile file; static uint32_t filesize, // Total size of the current file, in bytes sdpos; // Index most recently read (one behind file.getPos) @@ -341,10 +341,11 @@ class CardReader { // Directory items // static bool is_visible_entity(const dir_t &p OPTARG(CUSTOM_FIRMWARE_UPLOAD, const bool onlyBin=false)); - static int countItems(SdFile dir); - static void selectByIndex(SdFile dir, const uint8_t index); - static void selectByName(SdFile dir, const char * const match); - static void printListing(SdFile parent, const char * const prepend, const uint8_t lsflags + static int countItems(MediaFile dir); + static void selectByIndex(MediaFile dir, const uint8_t index); + static void selectByName(MediaFile dir, const char * const match); + static void printListing( + MediaFile parent, const char * const prepend, const uint8_t lsflags OPTARG(LONG_FILENAME_HOST_SUPPORT, const char * const prependLong=nullptr) ); diff --git a/Marlin/src/sd/disk_io_driver.h b/Marlin/src/sd/disk_io_driver.h index 02e2b3c739916..3e2d688aea720 100644 --- a/Marlin/src/sd/disk_io_driver.h +++ b/Marlin/src/sd/disk_io_driver.h @@ -22,6 +22,7 @@ #pragma once #include +#include "SdInfo.h" /** * DiskIO Interface diff --git a/Marlin/src/sd/storage.h b/Marlin/src/sd/storage.h new file mode 100644 index 0000000000000..3510e04bbe55a --- /dev/null +++ b/Marlin/src/sd/storage.h @@ -0,0 +1,74 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Marlin Storage Architecture: + * + * DiskIODriver: + * Do all low level IO with the underline hardware or block device: SPI, SDIO, OTG + * + * FilesystemDriver: + * Handle the filesystem format / implementation. Uses the io driver to read and write data. + * Sd2Card is the very first and current filesystem implementation on Marlin, supporting FAT. + * FatFS - Work in progress. + * + * + * Marlin Abstractions: + * + * Using this names allow us to isolate filesystem driver code, keeping all Marlin code agnostic. + * + * MediaFilesystem: + * Abstraction of systemwide filesystem operation. + * + * MarlinVolume: + * Abstraction of a filesystem volume. + * + * MediaFile: + * Abstraction of a generic file. Using this name allow us to isolate filesystem driver code, + * keeping all Marlin code agnostic. + * + * PrintFromStorage: + * Class to handle printing from any attached storage. + * + */ + +/* + +Interface definition. Doesn't need to be compiled, as we use duck typing, +allowing drivers to just use type alias. + +Class MarlinVolume { +public: +}; + +Class MediaFile { +public: +}; + +Class MediaFilesystem { +public: + static void init(); + static MarlinVolume* openVolume(const char *); +}; + +*/