From 082fce5e3e68c7b8657201e5de5adba0e4f86a33 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 29 Apr 2021 00:34:04 +0000 Subject: [PATCH 01/14] [cron] Bump distribution date (2021-04-29) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index e3bfb9dd7216..266ed629a8a0 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 "2021-04-28" + #define STRING_DISTRIBUTION_DATE "2021-04-29" #endif /** From b5fac1ac9587a495188660c23946b298d065ea6d Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 30 Apr 2021 00:24:56 +0000 Subject: [PATCH 02/14] [cron] Bump distribution date (2021-04-30) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 266ed629a8a0..11e9cb1456e7 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 "2021-04-29" + #define STRING_DISTRIBUTION_DATE "2021-04-30" #endif /** From 636facf40d668bee1cc4c866dab340d1d35d73c4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 28 Apr 2021 02:04:07 -0500 Subject: [PATCH 03/14] Silence warning in gcode_D --- Marlin/src/gcode/gcode_d.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/src/gcode/gcode_d.cpp b/Marlin/src/gcode/gcode_d.cpp index 74277291e532..a8a6bdfc3d06 100644 --- a/Marlin/src/gcode/gcode_d.cpp +++ b/Marlin/src/gcode/gcode_d.cpp @@ -216,7 +216,8 @@ } break; case 102: { // D102 Test SD Read - card.openFileRead("test.gco"); + char testfile[] = "test.gco"; + card.openFileRead(testfile); if (!card.isFileOpen()) { SERIAL_ECHOLNPAIR("Failed to open test.gco to read."); return; From cfdfd167794de13de75d99c161f61a0898549717 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 30 Apr 2021 08:51:26 +0200 Subject: [PATCH 04/14] Fix Thermal Runaway false-alarm in M303, add HeaterWatch::check (#21743) Co-authored-by: Scott Lahteine --- Marlin/src/module/temperature.cpp | 26 +++++++++++++------------- Marlin/src/module/temperature.h | 2 ++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 462af7f61a3a..69f5e9b58e90 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -543,7 +543,7 @@ volatile bool Temperature::raw_temps_ready = false; #define GTV(C,B,H) C_GTV(ischamber, C, B_GTV(isbed, B, H)) const uint16_t watch_temp_period = GTV(WATCH_CHAMBER_TEMP_PERIOD, WATCH_BED_TEMP_PERIOD, WATCH_TEMP_PERIOD); const uint8_t watch_temp_increase = GTV(WATCH_CHAMBER_TEMP_INCREASE, WATCH_BED_TEMP_INCREASE, WATCH_TEMP_INCREASE); - const celsius_float_t watch_temp_target = celsius_float_t(target - watch_temp_increase + GTV(TEMP_CHAMBER_HYSTERESIS, TEMP_BED_HYSTERESIS, TEMP_HYSTERESIS) + 1); + const celsius_float_t watch_temp_target = celsius_float_t(target - (watch_temp_increase + GTV(TEMP_CHAMBER_HYSTERESIS, TEMP_BED_HYSTERESIS, TEMP_HYSTERESIS) + 1)); millis_t temp_change_ms = next_temp_ms + SEC_TO_MS(watch_temp_period); celsius_float_t next_watch_temp = 0.0; bool heated = false; @@ -1253,13 +1253,13 @@ void Temperature::manage_heater() { #if WATCH_HOTENDS // Make sure temperature is increasing - if (watch_hotend[e].next_ms && ELAPSED(ms, watch_hotend[e].next_ms)) { // Time to check this extruder? - if (degHotend(e) < watch_hotend[e].target) { // Failed to increase enough? + if (watch_hotend[e].elapsed(ms)) { // Enabled and time to check? + if (watch_hotend[e].check(degHotend(e))) // Increased enough? + start_watching_hotend(e); // If temp reached, turn off elapsed check + else { TERN_(DWIN_CREALITY_LCD, DWIN_Popup_Temperature(0)); _temp_error((heater_id_t)e, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD)); } - else // Start again if the target is still far off - start_watching_hotend(e); } #endif @@ -1296,13 +1296,13 @@ void Temperature::manage_heater() { #if WATCH_BED // Make sure temperature is increasing - if (watch_bed.elapsed(ms)) { // Time to check the bed? - if (degBed() < watch_bed.target) { // Failed to increase enough? + if (watch_bed.elapsed(ms)) { // Time to check the bed? + if (watch_bed.check(degBed())) // Increased enough? + start_watching_bed(); // If temp reached, turn off elapsed check + else { TERN_(DWIN_CREALITY_LCD, DWIN_Popup_Temperature(0)); _temp_error(H_BED, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD)); } - else // Start again if the target is still far off - start_watching_bed(); } #endif // WATCH_BED @@ -1377,11 +1377,11 @@ void Temperature::manage_heater() { #if WATCH_CHAMBER // Make sure temperature is increasing - if (watch_chamber.elapsed(ms)) { // Time to check the chamber? - if (degChamber() < watch_chamber.target) // Failed to increase enough? - _temp_error(H_CHAMBER, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD)); + if (watch_chamber.elapsed(ms)) { // Time to check the chamber? + if (watch_chamber.check(degChamber())) // Increased enough? Error below. + start_watching_chamber(); // If temp reached, turn off elapsed check. else - start_watching_chamber(); // Start again if the target is still far off + _temp_error(H_CHAMBER, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD)); } #endif diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 2bb773f805d1..adc10c3ccda9 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -233,6 +233,8 @@ struct HeaterWatch { inline bool elapsed(const millis_t &ms) { return next_ms && ELAPSED(ms, next_ms); } inline bool elapsed() { return elapsed(millis()); } + inline bool check(const celsius_t curr) { return curr >= target; } + inline void restart(const celsius_t curr, const celsius_t tgt) { if (tgt) { const celsius_t newtarget = curr + INCREASE; From f58b923fd4df7c59a14e91fcd5977feb50774b5b Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Fri, 30 Apr 2021 01:07:18 -0700 Subject: [PATCH 05/14] Fix BTT E3 RRF and SKR V2 (Generic PIO) (#21741) Follow-up to #21655 --- ini/stm32f4.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index d6418f439e41..ff9929687719 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -181,7 +181,7 @@ build_flags = ${stm_flash_drive.build_flags} [env:BIGTREE_E3_RRF] platform = ${common_stm32.platform} extends = common_stm32 -board = genericSTM32F407VGT6 +board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_BIGTREE_E3_RRF build_flags = ${common_stm32.build_flags} -DSTM32F407_5VX -DVECT_TAB_OFFSET=0x8000 @@ -234,7 +234,7 @@ extra_scripts = ${common.extra_scripts} platform = ${common_stm32.platform} platform_packages = ${stm_flash_drive.platform_packages} extends = common_stm32 -board = genericSTM32F407VGT6 +board = marlin_STM32F407VGT6_CCM board_build.core = stm32 board_build.variant = MARLIN_F4x7Vx board_build.ldscript = ldscript.ld From e4f60f82a4cbcac1921b6bf444fa803910e2adf3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 30 Apr 2021 03:21:59 -0500 Subject: [PATCH 06/14] Heater error status --- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 2 +- Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 75ff1f52c269..2e5f967c2fce 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -535,7 +535,7 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char pr if (prefix >= 0) lcd_put_wchar(prefix); - lcd_put_u8str(i16tostr3rj(t1)); + lcd_put_u8str(t1 < 0 ? "err" : i16tostr3rj(t1)); lcd_put_wchar('/'); #if !HEATER_IDLE_HANDLER diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 81e89f7cf5ac..68b75900ef91 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -186,10 +186,14 @@ #define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X) FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, const uint8_t ty) { - const char *str = i16tostr3rj(temp); - const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1; - lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, &str[3-len]); - lcd_put_wchar(LCD_STR_DEGREE[0]); + if (temp < 0) + lcd_put_u8str(tx - 3 * (INFO_FONT_WIDTH) / 2 + 1, ty, "err"); + else { + const char *str = i16tostr3rj(temp); + const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1; + lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, &str[3-len]); + lcd_put_wchar(LCD_STR_DEGREE[0]); + } } #if DO_DRAW_FLOWMETER From 4e4c3ef8fc68afb66ebc434764ba4079c57baf1c Mon Sep 17 00:00:00 2001 From: lujios <83166168+lujios@users.noreply.github.com> Date: Fri, 30 Apr 2021 11:38:30 +0200 Subject: [PATCH 07/14] Fix compile with DISTINCT_E_FACTORS + SLIM_LCD_MENUS (#21733) Co-authored-by: Scott Lahteine --- Marlin/src/lcd/menu/menu_advanced.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 463433685ecf..044797b74946 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -350,16 +350,6 @@ void menu_backlash(); #if DISABLED(SLIM_LCD_MENUS) - #if ENABLED(DISTINCT_E_FACTORS) - inline void _reset_e_acceleration_rate(const uint8_t e) { if (e == active_extruder) planner.reset_acceleration_rates(); } - inline void _planner_refresh_e_positioning(const uint8_t e) { - if (e == active_extruder) - planner.refresh_positioning(); - else - planner.steps_to_mm[E_AXIS_N(e)] = 1.0f / planner.settings.axis_steps_per_mm[E_AXIS_N(e)]; - } - #endif - // M203 / M205 Velocity options void menu_advanced_velocity() { // M203 Max Feedrate @@ -443,7 +433,10 @@ void menu_backlash(); #if ENABLED(DISTINCT_E_FACTORS) EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(active_extruder)], 100, max_accel_edit_scaled.e, []{ planner.reset_acceleration_rates(); }); LOOP_L_N(n, E_STEPPERS) - EDIT_ITEM_FAST_N(long5_25, n, MSG_AMAX_EN, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(n)], 100, max_accel_edit_scaled.e, []{ _reset_e_acceleration_rate(MenuItemBase::itemIndex); }); + EDIT_ITEM_FAST_N(long5_25, n, MSG_AMAX_EN, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(n)], 100, max_accel_edit_scaled.e, []{ + if (MenuItemBase::itemIndex == active_extruder) + planner.reset_acceleration_rates(); + }); #elif E_STEPPERS EDIT_ITEM_FAST(long5_25, MSG_AMAX_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS], 100, max_accel_edit_scaled.e, []{ planner.reset_acceleration_rates(); }); #endif @@ -530,7 +523,13 @@ void menu_advanced_steps_per_mm() { #if ENABLED(DISTINCT_E_FACTORS) LOOP_L_N(n, E_STEPPERS) - EDIT_ITEM_FAST_N(float51, n, MSG_EN_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(n)], 5, 9999, []{ _planner_refresh_e_positioning(MenuItemBase::itemIndex); }); + EDIT_ITEM_FAST_N(float51, n, MSG_EN_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(n)], 5, 9999, []{ + const uint8_t e = MenuItemBase::itemIndex; + if (e == active_extruder) + planner.refresh_positioning(); + else + planner.steps_to_mm[E_AXIS_N(e)] = 1.0f / planner.settings.axis_steps_per_mm[E_AXIS_N(e)]; + }); #elif E_STEPPERS EDIT_ITEM_FAST(float51, MSG_E_STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, []{ planner.refresh_positioning(); }); #endif From 68c010f82ad7a5c5c3dd15ee985654e0f3bc79b5 Mon Sep 17 00:00:00 2001 From: Nikolay March Date: Fri, 30 Apr 2021 12:45:43 +0300 Subject: [PATCH 08/14] Sanity-check for COREnn backlash (#21731) --- Marlin/src/inc/SanityCheck.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 97f9a6373a14..24ea6ce80801 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3034,8 +3034,10 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) "BACKLASH_COMPENSATION can only apply to " STRINGIFY(NORMAL_AXIS) " on a MarkForged system."); #elif IS_CORE constexpr float backlash_arr[] = BACKLASH_DISTANCE_MM; - static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2], + #ifndef CORE_BACKLASH + static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2], "BACKLASH_COMPENSATION can only apply to " STRINGIFY(NORMAL_AXIS) " with your CORE system."); + #endif #endif #endif From 2f537768bc9481a10b25d9f7c5af3627707c836e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 30 Apr 2021 08:30:31 -0500 Subject: [PATCH 09/14] MKS Robin flash address --- buildroot/share/PlatformIO/scripts/mks_robin_mini.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot/share/PlatformIO/scripts/mks_robin_mini.py b/buildroot/share/PlatformIO/scripts/mks_robin_mini.py index 4c52035965c6..3ff9ccf4a67a 100644 --- a/buildroot/share/PlatformIO/scripts/mks_robin_mini.py +++ b/buildroot/share/PlatformIO/scripts/mks_robin_mini.py @@ -2,4 +2,4 @@ # buildroot/share/PlatformIO/scripts/mks_robin_mini.py # import marlin -marlin.prepare_robin("0x08005000", "mks_robin_mini.ld", "Robin_mini.bin") +marlin.prepare_robin("0x08007000", "mks_robin_mini.ld", "Robin_mini.bin") From ff41bf5be823bd9564045c1c522adec2f9984ac7 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 1 May 2021 01:04:09 +0000 Subject: [PATCH 10/14] [cron] Bump distribution date (2021-05-01) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 11e9cb1456e7..74fde2f7acf7 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 "2021-04-30" + #define STRING_DISTRIBUTION_DATE "2021-05-01" #endif /** From 8c912d7ece490e9b0598d365248d07d6bfd204ae Mon Sep 17 00:00:00 2001 From: ellensp Date: Sat, 1 May 2021 16:15:16 +1200 Subject: [PATCH 11/14] Fix SDCARD_CONNECTION default for BTT SKR (#21755) --- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h | 82 +++++++++++-------- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h | 12 --- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 18 ---- Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h | 16 ++++ 4 files changed, 66 insertions(+), 62 deletions(-) diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h index 8c1396d3fe2f..05072b6c9e0d 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h @@ -52,6 +52,37 @@ #define E0_DIR_PIN P2_13 #define E0_ENABLE_PIN P2_12 + +/** + * _____ _____ + * NC | 1 2 | GND 5V | 1 2 | GND + * RESET | 3 4 | 1.31 NC | 3 4 | NC + * 0.18 | 5 6 3.25 NC | 5 6 0.15 + * 1.23 | 7 8 | 3.26 0.16 | 7 8 | 0.18 + * 0.15 | 9 10| 0.17 2.11 | 9 10| 1.30 + * ----- ----- + * EXP2 EXP1 + */ + +#define EXP1_03_PIN -1 +#define EXP1_04_PIN -1 +#define EXP1_05_PIN -1 +#define EXP1_06_PIN P0_15 +#define EXP1_07_PIN P0_16 +#define EXP1_08_PIN P0_18 +#define EXP1_09_PIN P2_11 +#define EXP1_10_PIN P1_30 + +#define EXP2_03_PIN -1 +#define EXP2_04_PIN P1_31 +#define EXP2_05_PIN P0_18 +#define EXP2_06_PIN P3_25 +#define EXP2_07_PIN P1_23 +#define EXP2_08_PIN P3_26 +#define EXP2_09_PIN P0_15 +#define EXP2_10_PIN P0_17 + + /** * LCD / Controller * @@ -68,26 +99,23 @@ #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS P3_26 + #define TFTGLCD_CS EXP2_08_PIN #endif - #define SD_DETECT_PIN P1_31 - #elif HAS_WIRED_LCD - #define BTN_EN1 P3_26 - #define BTN_EN2 P3_25 - #define BTN_ENC P2_11 + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_09_PIN - #define SD_DETECT_PIN P1_31 - #define LCD_SDSS P1_23 - #define LCD_PINS_RS P0_16 - #define LCD_PINS_ENABLE P0_18 - #define LCD_PINS_D4 P0_15 + #define LCD_SDSS EXP2_07_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP2_05_PIN + #define LCD_PINS_D4 EXP2_09_PIN #if ENABLED(MKS_MINI_12864) #define DOGLCD_CS P2_06 - #define DOGLCD_A0 P0_16 + #define DOGLCD_A0 EXP1_07_PIN #endif #endif // HAS_WIRED_LCD @@ -106,10 +134,6 @@ #endif #endif -#if SD_CONNECTION_IS(LCD) - #define SD_SS_PIN P1_23 -#endif - // Trinamic driver support #if HAS_TRINAMIC_CONFIG @@ -140,10 +164,10 @@ // When using any TMC SPI-based drivers, software SPI is used // because pins may be shared with the display or SD card. #define TMC_USE_SW_SPI - #define TMC_SW_MOSI P0_18 - #define TMC_SW_MISO P0_17 + #define TMC_SW_MOSI EXP2_05_PIN + #define TMC_SW_MISO EXP2_10_PIN // To minimize pin usage use the same clock pin as the display/SD card reader. (May generate LCD noise.) - #define TMC_SW_SCK P0_15 + #define TMC_SW_SCK EXP2_09_PIN // If pin 2_06 is unused, it can be used for the clock to avoid the LCD noise. //#define TMC_SW_SCK P2_06 @@ -186,14 +210,11 @@ // SDCARD_CONNECTION must not be 'LCD'. Nothing should be connected to EXP1/EXP2. //#define SKR_USE_LCD_PINS_FOR_CS #if ENABLED(SKR_USE_LCD_PINS_FOR_CS) - #if SD_CONNECTION_IS(LCD) - #error "SDCARD_CONNECTION must not be 'LCD' with SKR_USE_LCD_PINS_FOR_CS." - #endif - #define X_CS_PIN P1_23 - #define Y_CS_PIN P3_26 - #define Z_CS_PIN P2_11 - #define E0_CS_PIN P3_25 - #define E1_CS_PIN P1_31 + #define X_CS_PIN EXP2_07_PIN + #define Y_CS_PIN EXP2_08_PIN + #define Z_CS_PIN EXP1_09_PIN + #define E0_CS_PIN EXP2_06_PIN + #define E1_CS_PIN EXP2_04_PIN #endif // Example 2: A REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER @@ -201,19 +222,16 @@ // the pins will be in use. So SDCARD_CONNECTION must not be 'LCD'. //#define SKR_USE_LCD_SD_CARD_PINS_FOR_CS #if ENABLED(SKR_USE_LCD_SD_CARD_PINS_FOR_CS) - #if SD_CONNECTION_IS(LCD) - #error "SDCARD_CONNECTION must not be 'LCD' with SKR_USE_LCD_SD_CARD_PINS_FOR_CS." - #endif #define X_CS_PIN P0_02 #define Y_CS_PIN P0_03 #define Z_CS_PIN P2_06 // We use SD_DETECT_PIN for E0 #undef SD_DETECT_PIN - #define E0_CS_PIN P1_31 + #define E0_CS_PIN EXP2_04_PIN // We use LCD_SDSS pin for E1 #undef LCD_SDSS #define LCD_SDSS -1 - #define E1_CS_PIN P1_23 + #define E1_CS_PIN EXP2_07_PIN #endif // Example 3: Use the driver enable pins for chip-select. diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h index 89f0e1783253..e671429f84a1 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -367,18 +367,6 @@ #endif // HAS_WIRED_LCD -// -// SD Support -// - -#ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION LCD -#endif - -#if SD_CONNECTION_IS(LCD) - #define SD_SS_PIN EXP2_07_PIN -#endif - /** * Special pins * P1_30 (37) (NOT 5V tolerant) 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 94165d39482c..f3ecf30fc85f 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -31,13 +31,6 @@ #define BOARD_CUSTOM_BUILD_FLAGS -DLPC_PINCFG_UART3_P4_28 #endif -// -// SD Connection -// -#ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION LCD -#endif - // // Servos // @@ -263,13 +256,6 @@ #define EXP2_09_PIN P0_15 #define EXP2_10_PIN P0_17 -// -// SD Connection -// -#if SD_CONNECTION_IS(LCD) - #define SD_SS_PIN EXP2_07_PIN -#endif - /** * _____ _____ * NC | · · | GND 5V | · · | GND @@ -443,10 +429,6 @@ #define LCD_SDSS EXP2_07_PIN // (16) J3-7 & AUX-4 - #if SD_CONNECTION_IS(LCD) - #define SD_DETECT_PIN EXP2_04_PIN // (49) (NOT 5V tolerant) - #endif - #if ENABLED(FYSETC_MINI_12864) #define DOGLCD_CS EXP1_08_PIN #define DOGLCD_A0 EXP1_07_PIN diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h index 98e4f8ee2679..eadb91a8b3de 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h @@ -105,12 +105,28 @@ // // SD Support // +#ifndef SDCARD_CONNECTION + #if HAS_WIRED_LCD + #define SDCARD_CONNECTION LCD + #else + #define SDCARD_CONNECTION ONBOARD + #endif +#endif + + #define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card +#if SD_CONNECTION_IS(LCD) && ENABLED(SKR_USE_LCD_SD_CARD_PINS_FOR_CS) + #error "SDCARD_CONNECTION must not be 'LCD' with SKR_USE_LCD_PINS_FOR_CS." +#endif + #if SD_CONNECTION_IS(LCD) #define SD_SCK_PIN P0_15 #define SD_MISO_PIN P0_17 #define SD_MOSI_PIN P0_18 + #define SD_SS_PIN EXP2_07_PIN + #define SD_DETECT_PIN EXP2_04_PIN + #elif SD_CONNECTION_IS(ONBOARD) #undef SD_DETECT_PIN #define SD_DETECT_PIN P0_27 From ef9ca61039514efef6e2bf100c4b6b1db8f0316c Mon Sep 17 00:00:00 2001 From: ellensp Date: Sat, 1 May 2021 20:21:18 +1200 Subject: [PATCH 12/14] Fix Singlenozzle Standby issues (#21759) Fixes #21758 Co-authored-by: Scott Lahteine --- Marlin/src/inc/Conditionals_LCD.h | 10 +++++++++ Marlin/src/lcd/menu/menu_temperature.cpp | 2 +- Marlin/src/lcd/menu/menu_tune.cpp | 2 +- Marlin/src/module/temperature.cpp | 26 +++++++++++++----------- Marlin/src/module/temperature.h | 8 +++++--- Marlin/src/module/tool_change.cpp | 4 +++- 6 files changed, 34 insertions(+), 18 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 429877ce8419..a6df825ad999 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -640,6 +640,16 @@ #endif #endif +/** + * Disable unused SINGLENOZZLE sub-options + */ +#if DISABLED(SINGLENOZZLE) + #undef SINGLENOZZLE_STANDBY_TEMP +#endif +#if !BOTH(HAS_FAN, SINGLENOZZLE) + #undef SINGLENOZZLE_STANDBY_FAN +#endif + /** * DISTINCT_E_FACTORS affects how some E factors are accessed */ diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index 47643cfb579a..33a3d2f44541 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -171,7 +171,7 @@ void menu_temperature() { #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) LOOP_S_L_N(e, 1, EXTRUDERS) - EDIT_ITEM_FAST_N(uint16_3, e, MSG_NOZZLE_STANDBY, &thermalManager.singlenozzle_temp[e], 0, thermalManager.hotend_max_target(0)); + EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_STANDBY, &thermalManager.singlenozzle_temp[e], 0, thermalManager.hotend_max_target(0)); #endif // diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index feabae437dac..1a972f63f295 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -134,7 +134,7 @@ void menu_tune() { #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) LOOP_S_L_N(e, 1, EXTRUDERS) - EDIT_ITEM_FAST_N(uint16_3, e, MSG_NOZZLE_STANDBY, &thermalManager.singlenozzle_temp[e], 0, thermalManager.hotend_max_target(0)); + EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_STANDBY, &thermalManager.singlenozzle_temp[e], 0, thermalManager.hotend_max_target(0)); #endif // diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 69f5e9b58e90..53d6c14d5b77 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -466,9 +466,9 @@ volatile bool Temperature::raw_temps_ready = false; #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) celsius_t Temperature::singlenozzle_temp[EXTRUDERS]; - #if HAS_FAN - uint8_t Temperature::singlenozzle_fan_speed[EXTRUDERS]; - #endif +#endif +#if ENABLED(SINGLENOZZLE_STANDBY_FAN) + uint8_t Temperature::singlenozzle_fan_speed[EXTRUDERS]; #endif #if ENABLED(PROBING_HEATERS_OFF) @@ -2500,20 +2500,22 @@ void Temperature::disable_all_heaters() { #endif // PROBING_HEATERS_OFF -#if ENABLED(SINGLENOZZLE_STANDBY_TEMP) +#if EITHER(SINGLENOZZLE_STANDBY_TEMP, SINGLENOZZLE_STANDBY_FAN) void Temperature::singlenozzle_change(const uint8_t old_tool, const uint8_t new_tool) { - #if HAS_FAN + #if ENABLED(SINGLENOZZLE_STANDBY_FAN) singlenozzle_fan_speed[old_tool] = fan_speed[0]; fan_speed[0] = singlenozzle_fan_speed[new_tool]; #endif - singlenozzle_temp[old_tool] = temp_hotend[0].target; - if (singlenozzle_temp[new_tool] && singlenozzle_temp[new_tool] != singlenozzle_temp[old_tool]) { - setTargetHotend(singlenozzle_temp[new_tool], 0); - TERN_(AUTOTEMP, planner.autotemp_update()); - TERN_(HAS_STATUS_MESSAGE, set_heating_message(0)); - (void)wait_for_hotend(0, false); // Wait for heating or cooling - } + #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) + singlenozzle_temp[old_tool] = temp_hotend[0].target; + if (singlenozzle_temp[new_tool] && singlenozzle_temp[new_tool] != singlenozzle_temp[old_tool]) { + setTargetHotend(singlenozzle_temp[new_tool], 0); + TERN_(AUTOTEMP, planner.autotemp_update()); + TERN_(HAS_STATUS_MESSAGE, set_heating_message(0)); + (void)wait_for_hotend(0, false); // Wait for heating or cooling + } + #endif } #endif diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index adc10c3ccda9..702a3ea04db2 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -372,9 +372,11 @@ class Temperature { static inline bool hotEnoughToExtrude(const uint8_t e) { return !tooColdToExtrude(e); } static inline bool targetHotEnoughToExtrude(const uint8_t e) { return !targetTooColdToExtrude(e); } - #if ENABLED(SINGLENOZZLE_STANDBY_FAN) - static celsius_t singlenozzle_temp[EXTRUDERS]; - #if HAS_FAN + #if EITHER(SINGLENOZZLE_STANDBY_TEMP, SINGLENOZZLE_STANDBY_FAN) + #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) + static celsius_t singlenozzle_temp[EXTRUDERS]; + #endif + #if ENABLED(SINGLENOZZLE_STANDBY_FAN) static uint8_t singlenozzle_fan_speed[EXTRUDERS]; #endif static void singlenozzle_change(const uint8_t old_tool, const uint8_t new_tool); diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 2e5e59c0afee..0c5673b31c7a 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -1194,7 +1194,9 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { const bool should_move = safe_to_move && !no_move && IsRunning(); if (should_move) { - TERN_(SINGLENOZZLE_STANDBY_TEMP, thermalManager.singlenozzle_change(old_tool, new_tool)); + #if EITHER(SINGLENOZZLE_STANDBY_TEMP, SINGLENOZZLE_STANDBY_FAN) + thermalManager.singlenozzle_change(old_tool, new_tool); + #endif #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) if (should_swap && !too_cold) { From eddce4182b8e3579ae4e74e0f2954d51678ea023 Mon Sep 17 00:00:00 2001 From: hartmannathan <59230071+hartmannathan@users.noreply.github.com> Date: Sat, 1 May 2021 04:43:32 -0400 Subject: [PATCH 13/14] Comment correction (#21729) --- Marlin/src/libs/duration_t.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/src/libs/duration_t.h b/Marlin/src/libs/duration_t.h index bd654b7bad1e..148aa23211b5 100644 --- a/Marlin/src/libs/duration_t.h +++ b/Marlin/src/libs/duration_t.h @@ -115,7 +115,8 @@ struct duration_t { * @brief Formats the duration as a string * @details String will be formated using a "full" representation of duration * - * @param buffer The array pointed to must be able to accommodate 21 bytes + * @param buffer The array pointed to must be able to accommodate 22 bytes + * (21 for the string, 1 more for the terminating nul) * * Output examples: * 123456789012345678901 (strlen) From 05c25b8cdb99fd67047704f65d69e5b8b1797a07 Mon Sep 17 00:00:00 2001 From: tobuh <32395668+tobuh@users.noreply.github.com> Date: Sat, 1 May 2021 10:46:26 +0200 Subject: [PATCH 14/14] Fix Power-Loss Save on Pause (#21749) --- Marlin/src/gcode/feature/pause/M125.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/src/gcode/feature/pause/M125.cpp b/Marlin/src/gcode/feature/pause/M125.cpp index 9391b8661b2c..e65b48545b84 100644 --- a/Marlin/src/gcode/feature/pause/M125.cpp +++ b/Marlin/src/gcode/feature/pause/M125.cpp @@ -78,8 +78,9 @@ void GcodeSuite::M125() { // If possible, show an LCD prompt with the 'P' flag const bool show_lcd = TERN0(HAS_LCD_MENU, parser.boolval('P')); + TERN_(POWER_LOSS_RECOVERY, if (recovery.enabled) recovery.save(true)); + if (pause_print(retract, park_point, 0, show_lcd)) { - TERN_(POWER_LOSS_RECOVERY, if (recovery.enabled) recovery.save(true)); if (ENABLED(EXTENSIBLE_UI) || !sd_printing || show_lcd) { wait_for_confirmation(false, 0); resume_print(0, 0, -retract, 0);