Browse Source

Merge nightly patches

Scott Lahteine 4 years ago
parent
commit
282f4678cd

+ 22
- 0
Marlin/src/HAL/HAL_ESP32/HAL.cpp View File

@@ -27,6 +27,7 @@
27 27
 #include <rom/rtc.h>
28 28
 #include <driver/adc.h>
29 29
 #include <esp_adc_cal.h>
30
+#include <HardwareSerial.h>
30 31
 
31 32
 #include "../../inc/MarlinConfigPre.h"
32 33
 
@@ -105,6 +106,27 @@ void HAL_init_board() {
105 106
     #endif
106 107
     server.begin();
107 108
   #endif
109
+
110
+  // ESP32 uses a GPIO matrix that allows pins to be assigned to hardware serial ports.
111
+  // The following code initializes hardware Serial1 and Serial2 to use user-defined pins
112
+  // if they have been defined.
113
+  #if defined(HARDWARE_SERIAL1_RX) && defined(HARDWARE_SERIAL1_TX)
114
+    HardwareSerial Serial1(1);
115
+    #ifdef TMC_BAUD_RATE  // use TMC_BAUD_RATE for Serial1 if defined
116
+      Serial1.begin(TMC_BAUD_RATE, SERIAL_8N1, HARDWARE_SERIAL1_RX, HARDWARE_SERIAL1_TX);
117
+    #else  // use default BAUDRATE if TMC_BAUD_RATE not defined
118
+      Serial1.begin(BAUDRATE, SERIAL_8N1, HARDWARE_SERIAL1_RX, HARDWARE_SERIAL1_TX);
119
+    #endif
120
+  #endif
121
+  #if defined(HARDWARE_SERIAL2_RX) && defined(HARDWARE_SERIAL2_TX)
122
+    HardwareSerial Serial2(2);
123
+    #ifdef TMC_BAUD_RATE  // use TMC_BAUD_RATE for Serial1 if defined
124
+      Serial2.begin(TMC_BAUD_RATE, SERIAL_8N1, HARDWARE_SERIAL2_RX, HARDWARE_SERIAL2_TX);
125
+    #else  // use default BAUDRATE if TMC_BAUD_RATE not defined
126
+      Serial2.begin(BAUDRATE, SERIAL_8N1, HARDWARE_SERIAL2_RX, HARDWARE_SERIAL2_TX);
127
+    #endif
128
+  #endif
129
+
108 130
 }
109 131
 
110 132
 void HAL_idletask() {

+ 1
- 1
Marlin/src/gcode/lcd/M0_M1.cpp View File

@@ -102,7 +102,7 @@ void GcodeSuite::M0_M1() {
102 102
   #endif
103 103
 
104 104
   if (ms > 0) ms += millis();  // wait until this time for a click
105
-  while (wait_for_user && (ms > 0 || PENDING(millis(), ms))) idle();
105
+  while (wait_for_user || (ms > 0 && PENDING(millis(), ms))) idle();
106 106
 
107 107
   #if HAS_LEDS_OFF_FLAG
108 108
     printerEventLEDs.onResumeAfterWait();

+ 80
- 0
Marlin/src/inc/SanityCheck.h View File

@@ -2474,6 +2474,86 @@ static_assert(   _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
2474 2474
     constexpr char _chr5 = USER_GCODE_5[strlen(USER_GCODE_5) - 1];
2475 2475
     static_assert(_chr5 != '\n' && _chr5 != '\r', "USER_GCODE_5 cannot have a newline at the end. Please remove it.");
2476 2476
   #endif
2477
+  #ifdef USER_GCODE_6
2478
+    constexpr char _chr6 = USER_GCODE_6[strlen(USER_GCODE_6) - 1];
2479
+    static_assert(_chr6 != '\n' && _chr6 != '\r', "USER_GCODE_6 cannot have a newline at the end. Please remove it.");
2480
+  #endif
2481
+  #ifdef USER_GCODE_7
2482
+    constexpr char _chr7 = USER_GCODE_7[strlen(USER_GCODE_7) - 1];
2483
+    static_assert(_chr7 != '\n' && _chr7 != '\r', "USER_GCODE_7 cannot have a newline at the end. Please remove it.");
2484
+  #endif
2485
+  #ifdef USER_GCODE_8
2486
+    constexpr char _chr8 = USER_GCODE_8[strlen(USER_GCODE_8) - 1];
2487
+    static_assert(_chr8 != '\n' && _chr8 != '\r', "USER_GCODE_8 cannot have a newline at the end. Please remove it.");
2488
+  #endif
2489
+  #ifdef USER_GCODE_9
2490
+    constexpr char _chr9 = USER_GCODE_9[strlen(USER_GCODE_9) - 1];
2491
+    static_assert(_chr9 != '\n' && _chr9 != '\r', "USER_GCODE_9 cannot have a newline at the end. Please remove it.");
2492
+  #endif
2493
+  #ifdef USER_GCODE_10
2494
+    constexpr char _chr10 = USER_GCODE_10[strlen(USER_GCODE_10) - 1];
2495
+    static_assert(_chr10 != '\n' && _chr10 != '\r', "USER_GCODE_10 cannot have a newline at the end. Please remove it.");
2496
+  #endif
2497
+  #ifdef USER_GCODE_11
2498
+    constexpr char _chr11 = USER_GCODE_11[strlen(USER_GCODE_11) - 1];
2499
+    static_assert(_chr11 != '\n' && _chr11 != '\r', "USER_GCODE_11 cannot have a newline at the end. Please remove it.");
2500
+  #endif
2501
+  #ifdef USER_GCODE_12
2502
+    constexpr char _chr12 = USER_GCODE_12[strlen(USER_GCODE_12) - 1];
2503
+    static_assert(_chr12 != '\n' && _chr12 != '\r', "USER_GCODE_12 cannot have a newline at the end. Please remove it.");
2504
+  #endif
2505
+  #ifdef USER_GCODE_13
2506
+    constexpr char _chr13 = USER_GCODE_13[strlen(USER_GCODE_13) - 1];
2507
+    static_assert(_chr13 != '\n' && _chr13 != '\r', "USER_GCODE_13 cannot have a newline at the end. Please remove it.");
2508
+  #endif
2509
+  #ifdef USER_GCODE_14
2510
+    constexpr char _chr14 = USER_GCODE_14[strlen(USER_GCODE_14) - 1];
2511
+    static_assert(_chr14 != '\n' && _chr14 != '\r', "USER_GCODE_14 cannot have a newline at the end. Please remove it.");
2512
+  #endif
2513
+  #ifdef USER_GCODE_15
2514
+    constexpr char _chr15 = USER_GCODE_15[strlen(USER_GCODE_15) - 1];
2515
+    static_assert(_chr15 != '\n' && _chr15 != '\r', "USER_GCODE_15 cannot have a newline at the end. Please remove it.");
2516
+  #endif
2517
+  #ifdef USER_GCODE_16
2518
+    constexpr char _chr16 = USER_GCODE_16[strlen(USER_GCODE_16) - 1];
2519
+    static_assert(_chr16 != '\n' && _chr16 != '\r', "USER_GCODE_16 cannot have a newline at the end. Please remove it.");
2520
+  #endif
2521
+  #ifdef USER_GCODE_17
2522
+    constexpr char _chr17 = USER_GCODE_17[strlen(USER_GCODE_17) - 1];
2523
+    static_assert(_chr17 != '\n' && _chr17 != '\r', "USER_GCODE_17 cannot have a newline at the end. Please remove it.");
2524
+  #endif
2525
+  #ifdef USER_GCODE_18
2526
+    constexpr char _chr18 = USER_GCODE_18[strlen(USER_GCODE_18) - 1];
2527
+    static_assert(_chr18 != '\n' && _chr18 != '\r', "USER_GCODE_18 cannot have a newline at the end. Please remove it.");
2528
+  #endif
2529
+  #ifdef USER_GCODE_19
2530
+    constexpr char _chr19 = USER_GCODE_19[strlen(USER_GCODE_19) - 1];
2531
+    static_assert(_chr19 != '\n' && _chr19 != '\r', "USER_GCODE_19 cannot have a newline at the end. Please remove it.");
2532
+  #endif
2533
+  #ifdef USER_GCODE_20
2534
+    constexpr char _chr20 = USER_GCODE_20[strlen(USER_GCODE_20) - 1];
2535
+    static_assert(_chr20 != '\n' && _chr20 != '\r', "USER_GCODE_20 cannot have a newline at the end. Please remove it.");
2536
+  #endif
2537
+  #ifdef USER_GCODE_21
2538
+    constexpr char _chr21 = USER_GCODE_21[strlen(USER_GCODE_21) - 1];
2539
+    static_assert(_chr21 != '\n' && _chr21 != '\r', "USER_GCODE_21 cannot have a newline at the end. Please remove it.");
2540
+  #endif
2541
+  #ifdef USER_GCODE_22
2542
+    constexpr char _chr22 = USER_GCODE_22[strlen(USER_GCODE_22) - 1];
2543
+    static_assert(_chr22 != '\n' && _chr22 != '\r', "USER_GCODE_22 cannot have a newline at the end. Please remove it.");
2544
+  #endif
2545
+  #ifdef USER_GCODE_23
2546
+    constexpr char _chr23 = USER_GCODE_23[strlen(USER_GCODE_23) - 1];
2547
+    static_assert(_chr23 != '\n' && _chr23 != '\r', "USER_GCODE_23 cannot have a newline at the end. Please remove it.");
2548
+  #endif
2549
+  #ifdef USER_GCODE_24
2550
+    constexpr char _chr24 = USER_GCODE_24[strlen(USER_GCODE_24) - 1];
2551
+    static_assert(_chr24 != '\n' && _chr24 != '\r', "USER_GCODE_24 cannot have a newline at the end. Please remove it.");
2552
+  #endif
2553
+  #ifdef USER_GCODE_25
2554
+    constexpr char _chr25 = USER_GCODE_25[strlen(USER_GCODE_25) - 1];
2555
+    static_assert(_chr25 != '\n' && _chr25 != '\r', "USER_GCODE_25 cannot have a newline at the end. Please remove it.");
2556
+  #endif
2477 2557
 #endif
2478 2558
 
2479 2559
 #if ENABLED(BACKLASH_COMPENSATION)

+ 1
- 1
Marlin/src/inc/Version.h View File

@@ -42,7 +42,7 @@
42 42
  * version was tagged.
43 43
  */
44 44
 #ifndef STRING_DISTRIBUTION_DATE
45
-  #define STRING_DISTRIBUTION_DATE "2020-02-22"
45
+  #define STRING_DISTRIBUTION_DATE "2020-02-23"
46 46
 #endif
47 47
 
48 48
 /**

+ 7
- 0
Marlin/src/pins/esp32/pins_MRR_ESPA.h View File

@@ -101,3 +101,10 @@
101 101
 #define SDSS                5
102 102
 #define USES_SHARED_SPI  // SPI is shared by SD card with TMC SPI drivers
103 103
 
104
+// Hardware serial pins
105
+// Add the following to Configuration.h or Configuration_adv.h to assign
106
+// specific pins to hardware Serial1.
107
+// Note: Serial2 can be defined using HARDWARE_SERIAL2_RX and HARDWARE_SERIAL2_TX but
108
+// MRR ESPA does not have enough spare pins for such reassignment.
109
+//#define HARDWARE_SERIAL1_RX 21
110
+//#define HARDWARE_SERIAL1_TX 22

+ 11
- 1
Marlin/src/pins/esp32/pins_MRR_ESPE.h View File

@@ -139,7 +139,7 @@
139 139
     #define BEEPER_PIN      151
140 140
 
141 141
     //#define LCD_PINS_D5     150
142
-    //#define LCD_PINS_D6     151
142
+    //#define LCD_PINS_D6     152
143 143
     //#define LCD_PINS_D7     153
144 144
 
145 145
   #else
@@ -153,3 +153,13 @@
153 153
   #define BTN_ENC            14
154 154
 
155 155
 #endif // HAS_GRAPHICAL_LCD
156
+
157
+// Hardware serial pins
158
+// Add the following to Configuration.h or Configuration_adv.h to assign
159
+// specific pins to hardware Serial1 and Serial2.
160
+// Note: Serial2 can be defined using HARDWARE_SERIAL2_RX and HARDWARE_SERIAL2_TX but
161
+// MRR ESPA does not have enough spare pins for such reassignment.
162
+//#define HARDWARE_SERIAL1_RX 21
163
+//#define HARDWARE_SERIAL1_TX 22
164
+//#define HARDWARE_SERIAL2_RX  2
165
+//#define HARDWARE_SERIAL2_TX  4

+ 13
- 2
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h View File

@@ -232,9 +232,19 @@
232 232
  *              EXP2                                              EXP1
233 233
  */
234 234
 #if HAS_SPI_LCD
235
-  #define BTN_ENC          P0_28   // (58) open-drain
235
+  #if ENABLED(ANET_FULL_GRAPHICS_LCD)
236 236
 
237
-  #if ENABLED(CR10_STOCKDISPLAY)
237
+    #define LCD_PINS_RS    P1_23
238
+
239
+    #define BTN_EN1        P1_20
240
+    #define BTN_EN2        P1_22
241
+    #define BTN_ENC        P1_18
242
+
243
+    #define LCD_PINS_ENABLE P1_21
244
+    #define LCD_PINS_D4    P1_19
245
+
246
+  #elif ENABLED(CR10_STOCKDISPLAY)
247
+    #define BTN_ENC        P0_28   // (58) open-drain
238 248
     #define LCD_PINS_RS    P1_22
239 249
 
240 250
     #define BTN_EN1        P1_18
@@ -244,6 +254,7 @@
244 254
     #define LCD_PINS_D4    P1_21
245 255
 
246 256
   #else
257
+    #define BTN_ENC        P0_28   // (58) open-drain
247 258
     #define LCD_PINS_RS    P1_19
248 259
 
249 260
     #define BTN_EN1        P3_26   // (31) J3-2 & AUX-4

Loading…
Cancel
Save