From cfd49740eb91e63a0319a80ba89c6d0915058327 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 22 Feb 2020 00:03:47 +0000 Subject: [PATCH 01/10] [cron] Bump distribution date (2020-02-22) --- 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 9968c4d7c3..5fb6a7ec4a 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-02-21" + #define STRING_DISTRIBUTION_DATE "2020-02-22" #endif /** From 1ab6f910b630905711203491b6edae39bf8328c1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 21 Feb 2020 07:24:58 -0600 Subject: [PATCH 02/10] Use moves_free in ok_to_send --- Marlin/src/gcode/queue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 397b5a3923..12c3703630 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -253,7 +253,7 @@ void GCodeQueue::ok_to_send() { while (NUMERIC_SIGNED(*p)) SERIAL_ECHO(*p++); } - SERIAL_ECHOPAIR_P(SP_P_STR, int(BLOCK_BUFFER_SIZE - planner.movesplanned() - 1)); + SERIAL_ECHOPAIR_P(SP_P_STR, int(planner.moves_free())); SERIAL_ECHOPAIR(" B", int(BUFSIZE - length)); #endif SERIAL_EOL(); From ac3e27c0260dd1983a5704ba7efa343362456350 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 22 Feb 2020 02:52:21 -0600 Subject: [PATCH 03/10] Hotfix for Babystepping --- Marlin/src/feature/babystep.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/babystep.h b/Marlin/src/feature/babystep.h index 7f017afb55..192817bc7b 100644 --- a/Marlin/src/feature/babystep.h +++ b/Marlin/src/feature/babystep.h @@ -73,7 +73,7 @@ public: // apply accumulated babysteps to the axes. // static inline void task() { - LOOP_L_N(axis, BS_TODO_AXIS(Z_AXIS)) step_axis((AxisEnum)axis); + LOOP_LE_N(axis, BS_TODO_AXIS(Z_AXIS)) step_axis((AxisEnum)axis); } private: From 484e1a624c178f1bb0996892d2c606f6cfebefbe Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 22 Feb 2020 02:52:59 -0600 Subject: [PATCH 04/10] CoreXY Babystepping hotfix --- Marlin/src/module/stepper.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 0a79855bcf..5ccfca2e00 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -2526,12 +2526,12 @@ void Stepper::report_positions() { #elif IS_CORE - #define BABYSTEP_CORE(A, B, INV, DIR) do{ \ + #define BABYSTEP_CORE(A, B, INV, DIR, ALT) do{ \ const xy_byte_t old_dir = { _READ_DIR(A), _READ_DIR(B) }; \ _ENABLE_AXIS(A); _ENABLE_AXIS(B); \ DIR_WAIT_BEFORE(); \ _APPLY_DIR(A, _INVERT_DIR(A)^DIR^INV); \ - _APPLY_DIR(B, _INVERT_DIR(B)^DIR^INV^(CORESIGN(1)<0)); \ + _APPLY_DIR(B, _INVERT_DIR(B)^DIR^INV^ALT); \ DIR_WAIT_AFTER(); \ _SAVE_START(); \ _APPLY_STEP(A, !_INVERT_STEP_PIN(A), true); \ @@ -2560,21 +2560,21 @@ void Stepper::report_positions() { case X_AXIS: #if CORE_IS_XY - BABYSTEP_CORE(X, Y, false, direction); + BABYSTEP_CORE(X, Y, 0, direction, 0); #elif CORE_IS_XZ - BABYSTEP_CORE(X, Z, false, direction); + BABYSTEP_CORE(X, Z, 0, direction, 0); #else - BABYSTEP_AXIS(X, false, direction); + BABYSTEP_AXIS(X, 0, direction, 0); #endif break; case Y_AXIS: #if CORE_IS_XY - BABYSTEP_CORE(X, Y, false, direction); + BABYSTEP_CORE(X, Y, 0, direction, (CORESIGN(1)<0)); #elif CORE_IS_YZ - BABYSTEP_CORE(Y, Z, false, direction); + BABYSTEP_CORE(Y, Z, 0, direction, (CORESIGN(1)<0)); #else - BABYSTEP_AXIS(Y, false, direction); + BABYSTEP_AXIS(Y, 0, direction, (CORESIGN(1)<0)); #endif break; @@ -2583,11 +2583,11 @@ void Stepper::report_positions() { case Z_AXIS: { #if CORE_IS_XZ - BABYSTEP_CORE(X, Z, BABYSTEP_INVERT_Z, direction); + BABYSTEP_CORE(X, Z, BABYSTEP_INVERT_Z, direction, (CORESIGN(1)<0)); #elif CORE_IS_YZ - BABYSTEP_CORE(Y, Z, BABYSTEP_INVERT_Z, direction); + BABYSTEP_CORE(Y, Z, BABYSTEP_INVERT_Z, direction, (CORESIGN(1)<0)); #elif DISABLED(DELTA) - BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction); + BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction, (CORESIGN(1)<0)); #else // DELTA From eeec4c27e7ba4d3692ee0fc27486370628d47278 Mon Sep 17 00:00:00 2001 From: vivian-ng Date: Sat, 22 Feb 2020 19:00:10 +0900 Subject: [PATCH 05/10] [ESP32] Allow user to define pins for hardware Serial1 and Serial2 (#16918) --- Marlin/src/HAL/HAL_ESP32/HAL.cpp | 22 ++++++++++++++++++++++ Marlin/src/pins/esp32/pins_MRR_ESPA.h | 7 +++++++ Marlin/src/pins/esp32/pins_MRR_ESPE.h | 12 +++++++++++- 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/Marlin/src/HAL/HAL_ESP32/HAL.cpp b/Marlin/src/HAL/HAL_ESP32/HAL.cpp index dc6d84e96f..d9afa13ab8 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL.cpp +++ b/Marlin/src/HAL/HAL_ESP32/HAL.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "../../inc/MarlinConfigPre.h" @@ -105,6 +106,27 @@ void HAL_init_board() { #endif server.begin(); #endif + + // ESP32 uses a GPIO matrix that allows pins to be assigned to hardware serial ports. + // The following code initializes hardware Serial1 and Serial2 to use user-defined pins + // if they have been defined. + #if defined(HARDWARE_SERIAL1_RX) && defined(HARDWARE_SERIAL1_TX) + HardwareSerial Serial1(1); + #ifdef TMC_BAUD_RATE // use TMC_BAUD_RATE for Serial1 if defined + Serial1.begin(TMC_BAUD_RATE, SERIAL_8N1, HARDWARE_SERIAL1_RX, HARDWARE_SERIAL1_TX); + #else // use default BAUDRATE if TMC_BAUD_RATE not defined + Serial1.begin(BAUDRATE, SERIAL_8N1, HARDWARE_SERIAL1_RX, HARDWARE_SERIAL1_TX); + #endif + #endif + #if defined(HARDWARE_SERIAL2_RX) && defined(HARDWARE_SERIAL2_TX) + HardwareSerial Serial2(2); + #ifdef TMC_BAUD_RATE // use TMC_BAUD_RATE for Serial1 if defined + Serial2.begin(TMC_BAUD_RATE, SERIAL_8N1, HARDWARE_SERIAL2_RX, HARDWARE_SERIAL2_TX); + #else // use default BAUDRATE if TMC_BAUD_RATE not defined + Serial2.begin(BAUDRATE, SERIAL_8N1, HARDWARE_SERIAL2_RX, HARDWARE_SERIAL2_TX); + #endif + #endif + } void HAL_idletask() { diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPA.h b/Marlin/src/pins/esp32/pins_MRR_ESPA.h index a984ddbe1a..a93f0f05c4 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPA.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPA.h @@ -101,3 +101,10 @@ #define SDSS 5 #define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers +// Hardware serial pins +// Add the following to Configuration.h or Configuration_adv.h to assign +// specific pins to hardware Serial1. +// Note: Serial2 can be defined using HARDWARE_SERIAL2_RX and HARDWARE_SERIAL2_TX but +// MRR ESPA does not have enough spare pins for such reassignment. +//#define HARDWARE_SERIAL1_RX 21 +//#define HARDWARE_SERIAL1_TX 22 diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPE.h b/Marlin/src/pins/esp32/pins_MRR_ESPE.h index cffdfa465d..0096027158 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPE.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPE.h @@ -139,7 +139,7 @@ #define BEEPER_PIN 151 //#define LCD_PINS_D5 150 - //#define LCD_PINS_D6 151 + //#define LCD_PINS_D6 152 //#define LCD_PINS_D7 153 #else @@ -153,3 +153,13 @@ #define BTN_ENC 14 #endif // HAS_GRAPHICAL_LCD + +// Hardware serial pins +// Add the following to Configuration.h or Configuration_adv.h to assign +// specific pins to hardware Serial1 and Serial2. +// Note: Serial2 can be defined using HARDWARE_SERIAL2_RX and HARDWARE_SERIAL2_TX but +// MRR ESPA does not have enough spare pins for such reassignment. +//#define HARDWARE_SERIAL1_RX 21 +//#define HARDWARE_SERIAL1_TX 22 +//#define HARDWARE_SERIAL2_RX 2 +//#define HARDWARE_SERIAL2_TX 4 From 34c92bbc173bdf91cf56902ff0a2e06adb9fbd6e Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 23 Feb 2020 00:03:55 +0000 Subject: [PATCH 06/10] [cron] Bump distribution date (2020-02-23) --- 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 5fb6a7ec4a..18e6215b57 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2020-02-22" + #define STRING_DISTRIBUTION_DATE "2020-02-23" #endif /** From 20df64814e962d6f0aa4fc179f8e7c5ddca0c4c1 Mon Sep 17 00:00:00 2001 From: thisiskeithb <13375512+thisiskeithb@users.noreply.github.com> Date: Sat, 22 Feb 2020 16:33:34 -0800 Subject: [PATCH 07/10] Finish Custom User Menu sanity-check (#16917) --- Marlin/src/inc/SanityCheck.h | 80 ++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 1ae71e2ac7..88cd49f57e 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2474,6 +2474,86 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) constexpr char _chr5 = USER_GCODE_5[strlen(USER_GCODE_5) - 1]; static_assert(_chr5 != '\n' && _chr5 != '\r', "USER_GCODE_5 cannot have a newline at the end. Please remove it."); #endif + #ifdef USER_GCODE_6 + constexpr char _chr6 = USER_GCODE_6[strlen(USER_GCODE_6) - 1]; + static_assert(_chr6 != '\n' && _chr6 != '\r', "USER_GCODE_6 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_7 + constexpr char _chr7 = USER_GCODE_7[strlen(USER_GCODE_7) - 1]; + static_assert(_chr7 != '\n' && _chr7 != '\r', "USER_GCODE_7 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_8 + constexpr char _chr8 = USER_GCODE_8[strlen(USER_GCODE_8) - 1]; + static_assert(_chr8 != '\n' && _chr8 != '\r', "USER_GCODE_8 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_9 + constexpr char _chr9 = USER_GCODE_9[strlen(USER_GCODE_9) - 1]; + static_assert(_chr9 != '\n' && _chr9 != '\r', "USER_GCODE_9 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_10 + constexpr char _chr10 = USER_GCODE_10[strlen(USER_GCODE_10) - 1]; + static_assert(_chr10 != '\n' && _chr10 != '\r', "USER_GCODE_10 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_11 + constexpr char _chr11 = USER_GCODE_11[strlen(USER_GCODE_11) - 1]; + static_assert(_chr11 != '\n' && _chr11 != '\r', "USER_GCODE_11 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_12 + constexpr char _chr12 = USER_GCODE_12[strlen(USER_GCODE_12) - 1]; + static_assert(_chr12 != '\n' && _chr12 != '\r', "USER_GCODE_12 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_13 + constexpr char _chr13 = USER_GCODE_13[strlen(USER_GCODE_13) - 1]; + static_assert(_chr13 != '\n' && _chr13 != '\r', "USER_GCODE_13 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_14 + constexpr char _chr14 = USER_GCODE_14[strlen(USER_GCODE_14) - 1]; + static_assert(_chr14 != '\n' && _chr14 != '\r', "USER_GCODE_14 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_15 + constexpr char _chr15 = USER_GCODE_15[strlen(USER_GCODE_15) - 1]; + static_assert(_chr15 != '\n' && _chr15 != '\r', "USER_GCODE_15 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_16 + constexpr char _chr16 = USER_GCODE_16[strlen(USER_GCODE_16) - 1]; + static_assert(_chr16 != '\n' && _chr16 != '\r', "USER_GCODE_16 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_17 + constexpr char _chr17 = USER_GCODE_17[strlen(USER_GCODE_17) - 1]; + static_assert(_chr17 != '\n' && _chr17 != '\r', "USER_GCODE_17 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_18 + constexpr char _chr18 = USER_GCODE_18[strlen(USER_GCODE_18) - 1]; + static_assert(_chr18 != '\n' && _chr18 != '\r', "USER_GCODE_18 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_19 + constexpr char _chr19 = USER_GCODE_19[strlen(USER_GCODE_19) - 1]; + static_assert(_chr19 != '\n' && _chr19 != '\r', "USER_GCODE_19 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_20 + constexpr char _chr20 = USER_GCODE_20[strlen(USER_GCODE_20) - 1]; + static_assert(_chr20 != '\n' && _chr20 != '\r', "USER_GCODE_20 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_21 + constexpr char _chr21 = USER_GCODE_21[strlen(USER_GCODE_21) - 1]; + static_assert(_chr21 != '\n' && _chr21 != '\r', "USER_GCODE_21 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_22 + constexpr char _chr22 = USER_GCODE_22[strlen(USER_GCODE_22) - 1]; + static_assert(_chr22 != '\n' && _chr22 != '\r', "USER_GCODE_22 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_23 + constexpr char _chr23 = USER_GCODE_23[strlen(USER_GCODE_23) - 1]; + static_assert(_chr23 != '\n' && _chr23 != '\r', "USER_GCODE_23 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_24 + constexpr char _chr24 = USER_GCODE_24[strlen(USER_GCODE_24) - 1]; + static_assert(_chr24 != '\n' && _chr24 != '\r', "USER_GCODE_24 cannot have a newline at the end. Please remove it."); + #endif + #ifdef USER_GCODE_25 + constexpr char _chr25 = USER_GCODE_25[strlen(USER_GCODE_25) - 1]; + static_assert(_chr25 != '\n' && _chr25 != '\r', "USER_GCODE_25 cannot have a newline at the end. Please remove it."); + #endif #endif #if ENABLED(BACKLASH_COMPENSATION) From b9b29bf4c075996f50ed2f8680fbed3862239010 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 22 Feb 2020 07:04:06 -0600 Subject: [PATCH 08/10] Followup to babystep hotfix --- Marlin/src/module/stepper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 5ccfca2e00..d21d1fe359 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -2564,7 +2564,7 @@ void Stepper::report_positions() { #elif CORE_IS_XZ BABYSTEP_CORE(X, Z, 0, direction, 0); #else - BABYSTEP_AXIS(X, 0, direction, 0); + BABYSTEP_AXIS(X, 0, direction); #endif break; @@ -2574,7 +2574,7 @@ void Stepper::report_positions() { #elif CORE_IS_YZ BABYSTEP_CORE(Y, Z, 0, direction, (CORESIGN(1)<0)); #else - BABYSTEP_AXIS(Y, 0, direction, (CORESIGN(1)<0)); + BABYSTEP_AXIS(Y, 0, direction); #endif break; @@ -2587,7 +2587,7 @@ void Stepper::report_positions() { #elif CORE_IS_YZ BABYSTEP_CORE(Y, Z, BABYSTEP_INVERT_Z, direction, (CORESIGN(1)<0)); #elif DISABLED(DELTA) - BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction, (CORESIGN(1)<0)); + BABYSTEP_AXIS(Z, BABYSTEP_INVERT_Z, direction); #else // DELTA From 7bf3581b024c2942d80d03d7e7abeccca612587f Mon Sep 17 00:00:00 2001 From: ellensp Date: Sun, 23 Feb 2020 13:37:39 +1300 Subject: [PATCH 09/10] Fix M0/M1 broken wait loop (#16921) --- Marlin/src/gcode/lcd/M0_M1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/lcd/M0_M1.cpp b/Marlin/src/gcode/lcd/M0_M1.cpp index 9ed7b2af42..bf6a3d23d5 100644 --- a/Marlin/src/gcode/lcd/M0_M1.cpp +++ b/Marlin/src/gcode/lcd/M0_M1.cpp @@ -102,7 +102,7 @@ void GcodeSuite::M0_M1() { #endif if (ms > 0) ms += millis(); // wait until this time for a click - while (wait_for_user && (ms > 0 || PENDING(millis(), ms))) idle(); + while (wait_for_user || (ms > 0 && PENDING(millis(), ms))) idle(); #if HAS_LEDS_OFF_FLAG printerEventLEDs.onResumeAfterWait(); From 2471a8bb91697ba05fa8cea4a15c1ed836e47a3c Mon Sep 17 00:00:00 2001 From: ZMiguel Alves Date: Sun, 23 Feb 2020 00:45:10 +0000 Subject: [PATCH 10/10] Define ANET_FULL_GRAPHICS_LCD pins for SKR 1.4 (#16928) --- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 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 2bb57c09fd..b90ac07a7d 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -232,9 +232,19 @@ * EXP2 EXP1 */ #if HAS_SPI_LCD - #define BTN_ENC P0_28 // (58) open-drain + #if ENABLED(ANET_FULL_GRAPHICS_LCD) - #if ENABLED(CR10_STOCKDISPLAY) + #define LCD_PINS_RS P1_23 + + #define BTN_EN1 P1_20 + #define BTN_EN2 P1_22 + #define BTN_ENC P1_18 + + #define LCD_PINS_ENABLE P1_21 + #define LCD_PINS_D4 P1_19 + + #elif ENABLED(CR10_STOCKDISPLAY) + #define BTN_ENC P0_28 // (58) open-drain #define LCD_PINS_RS P1_22 #define BTN_EN1 P1_18 @@ -244,6 +254,7 @@ #define LCD_PINS_D4 P1_21 #else + #define BTN_ENC P0_28 // (58) open-drain #define LCD_PINS_RS P1_19 #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4