From 8285953c1b5be6ecc7ff9103f287776bede8cfb2 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 19 Oct 2020 00:16:11 +0000 Subject: [PATCH 1/7] [cron] Bump distribution date (2020-10-19) --- 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 cf21b49bd8..9fdbc72153 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-18" + #define STRING_DISTRIBUTION_DATE "2020-10-19" #endif /** From f5019307280a8216d5ea506fc7ff3bbb39a1cdf9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 19 Oct 2020 00:37:32 -0500 Subject: [PATCH 2/7] Document M125 P --- Marlin/src/gcode/feature/pause/M125.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Marlin/src/gcode/feature/pause/M125.cpp b/Marlin/src/gcode/feature/pause/M125.cpp index ed9a393310..b1d76e83ae 100644 --- a/Marlin/src/gcode/feature/pause/M125.cpp +++ b/Marlin/src/gcode/feature/pause/M125.cpp @@ -49,10 +49,13 @@ * position and waits, resuming with a button click or M108. * Without PARK_HEAD_ON_PAUSE the M125 command does nothing. * - * L = override retract length - * X = override X - * Y = override Y - * Z = override Z raise + * L = Override retract Length + * X = Override park position X + * Y = Override park position Y + * Z = Override Z raise + * + * With an LCD menu: + * P = Always show a prompt and await a response */ void GcodeSuite::M125() { // Initial retract before move to filament change position @@ -75,7 +78,8 @@ void GcodeSuite::M125() { TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_PARKING, PAUSE_MODE_PAUSE_PRINT)); - const bool show_lcd = TERN0(HAS_LCD_MENU, parser.seenval('P')); + // If possible, show an LCD prompt with the 'P' flag + const bool show_lcd = TERN0(HAS_LCD_MENU, parser.boolval('P')); if (pause_print(retract, park_point, 0, show_lcd)) { TERN_(POWER_LOSS_RECOVERY, if (recovery.enabled) recovery.save(true)); From ea80b2c8fc4209160eed377437610c298312e97f Mon Sep 17 00:00:00 2001 From: ellensp Date: Mon, 19 Oct 2020 21:16:02 +1300 Subject: [PATCH 3/7] Ensure A4988 for unspecified driver type (#19798) Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 8 +-- Marlin/src/inc/Conditionals_LCD.h | 113 +++++++++++++++++++++++++----- Marlin/src/inc/SanityCheck.h | 54 ++++++++++++++ buildroot/tests/teensy35-tests | 3 +- buildroot/tests/teensy41-tests | 3 +- 5 files changed, 156 insertions(+), 25 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 1f6b0db946..60f8368517 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -678,15 +678,15 @@ * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ -//#define X_DRIVER_TYPE A4988 -//#define Y_DRIVER_TYPE A4988 -//#define Z_DRIVER_TYPE A4988 +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 //#define X2_DRIVER_TYPE A4988 //#define Y2_DRIVER_TYPE A4988 //#define Z2_DRIVER_TYPE A4988 //#define Z3_DRIVER_TYPE A4988 //#define Z4_DRIVER_TYPE A4988 -//#define E0_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE A4988 //#define E1_DRIVER_TYPE A4988 //#define E2_DRIVER_TYPE A4988 //#define E3_DRIVER_TYPE A4988 diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index cbc75cfb6d..f909112507 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -755,19 +755,7 @@ #define GRID_LOOP(A,B) LOOP_L_N(A, GRID_MAX_POINTS_X) LOOP_L_N(B, GRID_MAX_POINTS_Y) #endif -#ifndef INVERT_X_DIR - #define INVERT_X_DIR false -#endif -#ifndef INVERT_Y_DIR - #define INVERT_Y_DIR false -#endif -#ifndef INVERT_Z_DIR - #define INVERT_Z_DIR false -#endif -#ifndef INVERT_E_DIR - #define INVERT_E_DIR false -#endif - +// Slim menu optimizations #if ENABLED(SLIM_LCD_MENUS) #define BOOT_MARLIN_LOGO_SMALL #endif @@ -786,14 +774,105 @@ #define HAS_CLASSIC_E_JERK 1 #endif -#ifndef SPI_SPEED - #define SPI_SPEED SPI_FULL_SPEED -#endif - #if SERIAL_PORT == -1 || SERIAL_PORT_2 == -1 #define HAS_USB_SERIAL 1 #endif +// Fallback Stepper Driver types +#ifndef X_DRIVER_TYPE + #define X_DRIVER_TYPE A4988 +#endif +#ifndef Y_DRIVER_TYPE + #define Y_DRIVER_TYPE A4988 +#endif +#ifndef Z_DRIVER_TYPE + #define Z_DRIVER_TYPE A4988 +#endif +#if NONE(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS) + #undef X2_DRIVER_TYPE +#elif !defined(X2_DRIVER_TYPE) + #define X2_DRIVER_TYPE A4988 +#endif +#if DISABLED(Y_DUAL_STEPPER_DRIVERS) + #undef Y2_DRIVER_TYPE +#elif !defined(Y2_DRIVER_TYPE) + #define Y2_DRIVER_TYPE A4988 +#endif +#if NUM_Z_STEPPER_DRIVERS < 2 + #undef Z2_DRIVER_TYPE +#elif !defined(Z2_DRIVER_TYPE) + #define Z2_DRIVER_TYPE A4988 +#endif +#if NUM_Z_STEPPER_DRIVERS < 3 + #undef Z3_DRIVER_TYPE +#elif !defined(Z3_DRIVER_TYPE) + #define Z3_DRIVER_TYPE A4988 +#endif +#if NUM_Z_STEPPER_DRIVERS < 4 + #undef Z4_DRIVER_TYPE +#elif !defined(Z4_DRIVER_TYPE) + #define Z4_DRIVER_TYPE A4988 +#endif +#if E_STEPPERS < 1 + #undef E0_DRIVER_TYPE +#elif !defined(E0_DRIVER_TYPE) + #define E0_DRIVER_TYPE A4988 +#endif +#if E_STEPPERS < 2 + #undef E1_DRIVER_TYPE +#elif !defined(E1_DRIVER_TYPE) + #define E1_DRIVER_TYPE A4988 +#endif +#if E_STEPPERS < 3 + #undef E2_DRIVER_TYPE +#elif !defined(E2_DRIVER_TYPE) + #define E2_DRIVER_TYPE A4988 +#endif +#if E_STEPPERS < 4 + #undef E3_DRIVER_TYPE +#elif !defined(E3_DRIVER_TYPE) + #define E3_DRIVER_TYPE A4988 +#endif +#if E_STEPPERS < 5 + #undef E4_DRIVER_TYPE +#elif !defined(E4_DRIVER_TYPE) + #define E4_DRIVER_TYPE A4988 +#endif +#if E_STEPPERS < 6 + #undef E5_DRIVER_TYPE +#elif !defined(E5_DRIVER_TYPE) + #define E5_DRIVER_TYPE A4988 +#endif +#if E_STEPPERS < 7 + #undef E6_DRIVER_TYPE +#elif !defined(E6_DRIVER_TYPE) + #define E6_DRIVER_TYPE A4988 +#endif +#if E_STEPPERS < 8 + #undef E7_DRIVER_TYPE +#elif !defined(E7_DRIVER_TYPE) + #define E7_DRIVER_TYPE A4988 +#endif + +// Fallback axis inverting +#ifndef INVERT_X_DIR + #define INVERT_X_DIR false +#endif +#ifndef INVERT_Y_DIR + #define INVERT_Y_DIR false +#endif +#ifndef INVERT_Z_DIR + #define INVERT_Z_DIR false +#endif +#ifndef INVERT_E_DIR + #define INVERT_E_DIR false +#endif + +// Fallback SPI Speed +#ifndef SPI_SPEED + #define SPI_SPEED SPI_FULL_SPEED +#endif + /** * This setting is also used by M109 when trying to calculate * a ballpark safe margin to prevent wait-forever situation. diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 9aea18c2d7..657e055241 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3179,5 +3179,59 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #endif #endif +/** + * Sanity check for valid stepper driver types + */ +#define _BAD_DRIVER(A) (defined(A##_DRIVER_TYPE) && !_DRIVER_ID(A##_DRIVER_TYPE)) +#if _BAD_DRIVER(X) + #error "X_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(Y) + #error "Y_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(Z) + #error "Z_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(X2) + #error "X2_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(Y2) + #error "Y2_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(Z2) + #error "Z2_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(Z3) + #error "Z3_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(Z4) + #error "Z4_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(E0) + #error "E0_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(E1) + #error "E1_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(E2) + #error "E2_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(E3) + #error "E3_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(E4) + #error "E4_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(E5) + #error "E5_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(E6) + #error "E6_DRIVER_TYPE is not recognized." +#endif +#if _BAD_DRIVER(E7) + #error "E7_DRIVER_TYPE is not recognized." +#endif +#undef _BAD_DRIVER + // Misc. Cleanup #undef _TEST_PWM diff --git a/buildroot/tests/teensy35-tests b/buildroot/tests/teensy35-tests index c729f212a4..20a0c19726 100755 --- a/buildroot/tests/teensy35-tests +++ b/buildroot/tests/teensy35-tests @@ -112,11 +112,10 @@ exec_test $1 $2 "Teensy 3.5/3.6 COREXZ" # restore_configs opt_set MOTHERBOARD BOARD_TEENSY35_36 -opt_enable Z_MULTI_ENDSTOPS opt_set NUM_Z_STEPPER_DRIVERS 2 +opt_enable Z_MULTI_ENDSTOPS USE_XMAX_PLUG pins_set ramps/RAMPS X_MAX_PIN -1 opt_add Z2_MAX_PIN 2 -opt_enable USE_XMAX_PLUG exec_test $1 $2 "Dual Z with Dual Z endstops" # Clean up diff --git a/buildroot/tests/teensy41-tests b/buildroot/tests/teensy41-tests index 8d32d131e9..415d551f55 100644 --- a/buildroot/tests/teensy41-tests +++ b/buildroot/tests/teensy41-tests @@ -113,11 +113,10 @@ exec_test $1 $2 "Teensy 4.0/4.1 COREXZ" # restore_configs opt_set MOTHERBOARD BOARD_TEENSY41 -opt_enable Z_MULTI_ENDSTOPS +opt_enable Z_MULTI_ENDSTOPS USE_XMAX_PLUG opt_set NUM_Z_STEPPER_DRIVERS 2 pins_set ramps/RAMPS X_MAX_PIN -1 opt_add Z2_MAX_PIN 2 -opt_enable USE_XMAX_PLUG exec_test $1 $2 "Dual Z with Dual Z endstops" # Clean up From 21ce39aa9b304d627e6f2f7eecde873c7edb7af9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 19 Oct 2020 04:24:57 -0500 Subject: [PATCH 4/7] Use PGM serial strings --- Marlin/src/feature/runout.cpp | 15 +++------ Marlin/src/gcode/gcode.cpp | 4 +-- .../extui/lib/anycubic_chiron/chiron_tft.cpp | 2 +- Marlin/src/lcd/tft/touch.cpp | 4 +-- Marlin/src/module/tool_change.cpp | 31 ++++++------------- Marlin/src/module/tool_change.h | 2 ++ 6 files changed, 22 insertions(+), 36 deletions(-) diff --git a/Marlin/src/feature/runout.cpp b/Marlin/src/feature/runout.cpp index 71f31f2145..50e18e52ef 100644 --- a/Marlin/src/feature/runout.cpp +++ b/Marlin/src/feature/runout.cpp @@ -40,8 +40,9 @@ bool FilamentMonitorBase::enabled = true, #endif #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) - //#define DEBUG_TOOLCHANGE_MIGRATION_FEATURE #include "../module/tool_change.h" + #define DEBUG_OUT ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) + #include "../core/debug_out.h" #endif #if HAS_FILAMENT_RUNOUT_DISTANCE @@ -74,15 +75,11 @@ void event_filament_runout() { #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) if (migration.in_progress) { - #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) - SERIAL_ECHOLN("Migration Already In Progress"); - #endif + DEBUG_ECHOLNPGM("Migration Already In Progress"); return; // Action already in progress. Purge triggered repeated runout. } if (migration.automode) { - #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) - SERIAL_ECHOLN("Migration Starting"); - #endif + DEBUG_ECHOLNPGM("Migration Starting"); if (extruder_migration()) return; } #endif @@ -109,9 +106,7 @@ void event_filament_runout() { if (run_runout_script && ( strstr(FILAMENT_RUNOUT_SCRIPT, "M600") || strstr(FILAMENT_RUNOUT_SCRIPT, "M125") - #if ENABLED(ADVANCED_PAUSE_FEATURE) - || strstr(FILAMENT_RUNOUT_SCRIPT, "M25") - #endif + || TERN0(ADVANCED_PAUSE_FEATURE, strstr(FILAMENT_RUNOUT_SCRIPT, "M25")) ) ) { host_action_paused(false); diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index f2bd81e670..852d389b13 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -754,8 +754,8 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 511: M511(); break; // M511: Unlock Printer #endif #if ENABLED(PASSWORD_CHANGE_GCODE) - case 512: M512(); break; - #endif // M512: Set/Change/Remove Password + case 512: M512(); break; // M512: Set/Change/Remove Password + #endif #endif #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp index 5e492573e7..109d82b2a2 100644 --- a/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/lib/anycubic_chiron/chiron_tft.cpp @@ -294,7 +294,7 @@ namespace Anycubic { void ChironTFT::SendtoTFTLN(PGM_P str = nullptr) { if (str != nullptr) { #if ACDEBUG(AC_SOME) - SERIAL_ECHO("> "); + SERIAL_ECHOPGM("> "); #endif SendtoTFT(str); #if ACDEBUG(AC_SOME) diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index 6dcddc5d56..3e0945b227 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -189,12 +189,12 @@ void Touch::touch(touch_control_t *control) { } if (calibration_state == CALIBRATION_SUCCESS) { - SERIAL_ECHOLN("Touch screen calibration completed"); + SERIAL_ECHOLNPGM("Touch screen calibration completed"); SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_X ", calibration.x); SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_Y ", calibration.y); SERIAL_ECHOLNPAIR("TOUCH_OFFSET_X ", calibration.offset_x); SERIAL_ECHOLNPAIR("TOUCH_OFFSET_Y ", calibration.offset_y); - SERIAL_ECHO("TOUCH_ORIENTATION "); if (calibration.orientation == TOUCH_LANDSCAPE) SERIAL_ECHOLN("TOUCH_LANDSCAPE"); else SERIAL_ECHOLN("TOUCH_PORTRAIT"); + SERIAL_ECHOPGM("TOUCH_ORIENTATION "); if (calibration.orientation == TOUCH_LANDSCAPE) SERIAL_ECHOLNPGM("TOUCH_LANDSCAPE"); else SERIAL_ECHOLNPGM("TOUCH_PORTRAIT"); } break; default: break; diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 2c1a1a6017..1cdafe019d 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -1209,25 +1209,22 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) + #define DEBUG_OUT ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) + #include "../core/debug_out.h" + bool extruder_migration() { #if ENABLED(PREVENT_COLD_EXTRUSION) if (thermalManager.targetTooColdToExtrude(active_extruder)) { - #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) - SERIAL_ECHOLN("Migration Source Too Cold"); - #endif + DEBUG_ECHOLNPGM("Migration Source Too Cold"); return false; } #endif // No auto-migration or specified target? if (!migration.target && active_extruder >= migration.last) { - #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) - SERIAL_ECHO_MSG("No Migration Target"); - SERIAL_ECHO_MSG("Target: ", migration.target, - " Last: ", migration.last, - " Active: ", active_extruder); - #endif + DEBUG_ECHO_MSG("No Migration Target"); + DEBUG_ECHO_MSG("Target: ", migration.target, " Last: ", migration.last, " Active: ", active_extruder); migration.automode = false; return false; } @@ -1237,9 +1234,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { uint8_t migration_extruder = active_extruder; if (migration.target) { - #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) - SERIAL_ECHOLN("Migration using fixed target"); - #endif + DEBUG_ECHOLNPGM("Migration using fixed target"); // Specified target ok? const int16_t t = migration.target - 1; if (t != active_extruder) migration_extruder = t; @@ -1248,16 +1243,12 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { migration_extruder++; if (migration_extruder == active_extruder) { - #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) - SERIAL_ECHOLN("Migration source matches active"); - #endif + DEBUG_ECHOLNPGM("Migration source matches active"); return false; } // Migration begins - #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) - SERIAL_ECHOLN("Beginning migration"); - #endif + DEBUG_ECHOLNPGM("Beginning migration"); migration.in_progress = true; // Prevent runout script planner.synchronize(); @@ -1303,9 +1294,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { planner.synchronize(); planner.set_e_position_mm(current_position.e); // New extruder primed and ready - #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE) - SERIAL_ECHOLN("Migration Complete"); - #endif + DEBUG_ECHOLNPGM("Migration Complete"); return true; } diff --git a/Marlin/src/module/tool_change.h b/Marlin/src/module/tool_change.h index 38347191d3..0b22f8b6f1 100644 --- a/Marlin/src/module/tool_change.h +++ b/Marlin/src/module/tool_change.h @@ -24,6 +24,8 @@ #include "../inc/MarlinConfigPre.h" #include "../core/types.h" +//#define DEBUG_TOOLCHANGE_MIGRATION_FEATURE + #if HAS_MULTI_EXTRUDER typedef struct { From 35b9e9b4a5628252b22d78dc0657531ccbb3d8e8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 19 Oct 2020 00:25:51 -0500 Subject: [PATCH 5/7] Tweak a host prompt call --- Marlin/src/feature/host_actions.cpp | 12 ++++++++++-- Marlin/src/feature/host_actions.h | 1 + Marlin/src/feature/pause.cpp | 7 ++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Marlin/src/feature/host_actions.cpp b/Marlin/src/feature/host_actions.cpp index 3012639220..a8b2b51dfc 100644 --- a/Marlin/src/feature/host_actions.cpp +++ b/Marlin/src/feature/host_actions.cpp @@ -113,12 +113,20 @@ void host_action(PGM_P const pstr, const bool eol) { void host_action_prompt_button(PGM_P const pstr) { host_action_prompt_plus(PSTR("button"), pstr); } void host_action_prompt_end() { host_action_prompt(PSTR("end")); } void host_action_prompt_show() { host_action_prompt(PSTR("show")); } - void host_prompt_do(const PromptReason reason, PGM_P const pstr, PGM_P const btn1/*=nullptr*/, PGM_P const btn2/*=nullptr*/) { - host_action_prompt_begin(reason, pstr); + + void _host_prompt_show(PGM_P const btn1/*=nullptr*/, PGM_P const btn2/*=nullptr*/) { if (btn1) host_action_prompt_button(btn1); if (btn2) host_action_prompt_button(btn2); host_action_prompt_show(); } + void host_prompt_do(const PromptReason reason, PGM_P const pstr, PGM_P const btn1/*=nullptr*/, PGM_P const btn2/*=nullptr*/) { + host_action_prompt_begin(reason, pstr); + _host_prompt_show(btn1, btn2); + } + void host_prompt_do(const PromptReason reason, PGM_P const pstr, const char extra_char, PGM_P const btn1/*=nullptr*/, PGM_P const btn2/*=nullptr*/) { + host_action_prompt_begin(reason, pstr, extra_char); + _host_prompt_show(btn1, btn2); + } void filament_load_host_prompt() { const bool disable_to_continue = TERN0(HAS_FILAMENT_SENSOR, runout.filament_ran_out); diff --git a/Marlin/src/feature/host_actions.h b/Marlin/src/feature/host_actions.h index 09eeed23e2..065b59d755 100644 --- a/Marlin/src/feature/host_actions.h +++ b/Marlin/src/feature/host_actions.h @@ -71,6 +71,7 @@ void host_action(PGM_P const pstr, const bool eol=true); void host_action_prompt_end(); void host_action_prompt_show(); void host_prompt_do(const PromptReason reason, PGM_P const pstr, PGM_P const btn1=nullptr, PGM_P const btn2=nullptr); + void host_prompt_do(const PromptReason reason, PGM_P const pstr, const char extra_char, PGM_P const btn1=nullptr, PGM_P const btn2=nullptr); inline void host_prompt_open(const PromptReason reason, PGM_P const pstr, PGM_P const btn1=nullptr, PGM_P const btn2=nullptr) { if (host_prompt_reason == PROMPT_NOT_DEFINED) host_prompt_do(reason, pstr, btn1, btn2); } diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 6f970d1a4c..0a3609b3a1 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -199,17 +199,18 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l first_impatient_beep(max_beep_count); KEEPALIVE_STATE(PAUSED_FOR_USER); + #if ENABLED(HOST_PROMPT_SUPPORT) const char tool = '0' #if NUM_RUNOUT_SENSORS > 1 + active_extruder #endif ; - host_action_prompt_begin(PROMPT_USER_CONTINUE, PSTR("Load Filament T"), tool); - host_action_prompt_button(CONTINUE_STR); - host_action_prompt_show(); + host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Load Filament T"), tool, CONTINUE_STR); #endif + TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Load Filament"))); + while (wait_for_user) { impatient_beep(max_beep_count); idle_no_sleep(); From b320b1a3c2919e95430884fe7916d0ef0a6f9297 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 20 Oct 2020 00:15:55 +0000 Subject: [PATCH 6/7] [cron] Bump distribution date (2020-10-20) --- 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 9fdbc72153..246aa698ae 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-10-19" + #define STRING_DISTRIBUTION_DATE "2020-10-20" #endif /** From 92767f5513924842498af90e8557bdf3da91c000 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 19 Oct 2020 20:38:24 -0500 Subject: [PATCH 7/7] Misc. cleanup, serial strings --- Marlin/src/HAL/TEENSY40_41/HAL.h | 2 +- Marlin/src/gcode/gcode_d.cpp | 12 ++++++------ Marlin/src/gcode/host/M118.cpp | 6 +++--- Marlin/src/gcode/parser.cpp | 4 ---- Marlin/src/module/settings.cpp | 2 +- Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h | 3 --- buildroot/tests/teensy41-tests | 2 +- 7 files changed, 12 insertions(+), 19 deletions(-) diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.h b/Marlin/src/HAL/TEENSY40_41/HAL.h index 75c10e9395..e5bc0d5038 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.h +++ b/Marlin/src/HAL/TEENSY40_41/HAL.h @@ -69,7 +69,7 @@ #elif WITHIN(SERIAL_PORT_2, 0, 8) #define MYSERIAL1 MSERIAL(SERIAL_PORT_2) #else - #error "SERIAL_PORT_2 must be from -1 to 8. Please update your configuration." + #error "SERIAL_PORT_2 must be from -2 to 8. Please update your configuration." #endif #endif diff --git a/Marlin/src/gcode/gcode_d.cpp b/Marlin/src/gcode/gcode_d.cpp index 1f38a85b91..99968b625a 100644 --- a/Marlin/src/gcode/gcode_d.cpp +++ b/Marlin/src/gcode/gcode_d.cpp @@ -107,7 +107,7 @@ SERIAL_EOL(); persistentStore.access_finish(); #else - SERIAL_ECHOLN("NO EEPROM"); + SERIAL_ECHOLNPGM("NO EEPROM"); #endif } else { @@ -125,13 +125,13 @@ SERIAL_EOL(); persistentStore.access_finish(); #else - SERIAL_ECHOLN("NO EEPROM"); + SERIAL_ECHOLNPGM("NO EEPROM"); #endif } SERIAL_EOL(); } } break; - #endif + #endif case 4: { // D4 Read / Write PIN // const uint8_t pin = parser.byteval('P'); @@ -173,8 +173,8 @@ } break; case 100: { // D100 Disable heaters and attempt a hard hang (Watchdog Test) - SERIAL_ECHOLN("Disabling heaters and attempting to trigger Watchdog"); - SERIAL_ECHOLN("(USE_WATCHDOG " TERN(USE_WATCHDOG, "ENABLED", "DISABLED") ")"); + SERIAL_ECHOLNPGM("Disabling heaters and attempting to trigger Watchdog"); + SERIAL_ECHOLNPGM("(USE_WATCHDOG " TERN(USE_WATCHDOG, "ENABLED", "DISABLED") ")"); thermalManager.disable_all_heaters(); delay(1000); // Allow time to print DISABLE_ISRS(); @@ -183,7 +183,7 @@ // watchdog does not work. DELAY_US(10000000); ENABLE_ISRS(); - SERIAL_ECHOLN("FAILURE: Watchdog did not trigger board reset."); + SERIAL_ECHOLNPGM("FAILURE: Watchdog did not trigger board reset."); } } } diff --git a/Marlin/src/gcode/host/M118.cpp b/Marlin/src/gcode/host/M118.cpp index 3be2902541..06576bb75e 100644 --- a/Marlin/src/gcode/host/M118.cpp +++ b/Marlin/src/gcode/host/M118.cpp @@ -57,9 +57,9 @@ void GcodeSuite::M118() { if (WITHIN(port, 0, NUM_SERIAL)) serial_port_index = ( port == 0 ? SERIAL_BOTH - : port == 1 ? SERIAL_PORT - #ifdef SERIAL_PORT_2 - : port == 2 ? SERIAL_PORT_2 + : port == 1 ? 0 + #if HAS_MULTI_SERIAL + : port == 2 ? 1 #endif : SERIAL_PORT ); diff --git a/Marlin/src/gcode/parser.cpp b/Marlin/src/gcode/parser.cpp index 9c5085b97e..bba64dbbc4 100644 --- a/Marlin/src/gcode/parser.cpp +++ b/Marlin/src/gcode/parser.cpp @@ -28,10 +28,6 @@ #include "../MarlinCore.h" -#if HAS_MULTI_SERIAL - #include "queue.h" -#endif - // Must be declared for allocation and to satisfy the linker // Zero values need no initialization. diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index f5a954f5de..e65ace2e01 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -2296,7 +2296,7 @@ void MarlinSettings::postprocess() { #if ENABLED(EEPROM_CHITCHAT) && DISABLED(DISABLE_M503) // Report the EEPROM settings - if (!validating && (DISABLED(EEPROM_BOOT_SILENT) || IsRunning())) report(); + if (!validating && TERN1(EEPROM_BOOT_SILENT, IsRunning())) report(); #endif EEPROM_FINISH(); diff --git a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h index 3c277233d7..0dd8fb69a5 100644 --- a/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h +++ b/Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h @@ -49,9 +49,6 @@ //#define MARLIN_EEPROM_SIZE 0x1000UL // 4KB //#define MARLIN_EEPROM_SIZE (EEPROM_START_ADDRESS + (EEPROM_PAGE_SIZE) * 2UL) -//#define EEPROM_CHITCHAT -//#define DEBUG_EEPROM_READWRITE - // // Limit Switches // diff --git a/buildroot/tests/teensy41-tests b/buildroot/tests/teensy41-tests index 415d551f55..ab4d87d1af 100644 --- a/buildroot/tests/teensy41-tests +++ b/buildroot/tests/teensy41-tests @@ -57,7 +57,7 @@ exec_test $1 $2 "Sled Z Probe with Linear leveling" # exec_test $1 $2 "...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES" # -# Test MAGNETIC_PARKING_EXTRUDER with LCD +# Test MAGNETIC_PARKING_EXTRUDER with no LCD # restore_configs opt_set MOTHERBOARD BOARD_TEENSY41