Browse Source

Merge commit 'dabf393920' into look_at_201

Scott Lahteine 4 years ago
parent
commit
1525c2530e
51 changed files with 1578 additions and 577 deletions
  1. 2
    1
      Marlin/Configuration.h
  2. 1
    1
      Marlin/Configuration_adv.h
  3. 16
    16
      Marlin/src/MarlinCore.cpp
  4. 2
    1
      Marlin/src/core/boards.h
  5. 17
    6
      Marlin/src/core/macros.h
  6. 1
    1
      Marlin/src/feature/babystep.cpp
  7. 1
    1
      Marlin/src/feature/binary_protocol.h
  8. 2
    2
      Marlin/src/feature/pause.cpp
  9. 3
    3
      Marlin/src/feature/probe_temp_compensation.h
  10. 8
    8
      Marlin/src/feature/prusa_MMU2/mmu2.cpp
  11. 1
    3
      Marlin/src/gcode/calibrate/G33.cpp
  12. 4
    4
      Marlin/src/gcode/calibrate/G76_M871.cpp
  13. 3
    0
      Marlin/src/gcode/calibrate/M48.cpp
  14. 6
    6
      Marlin/src/gcode/control/M17_M18_M84.cpp
  15. 1
    1
      Marlin/src/gcode/feature/pause/G60.cpp
  16. 2
    2
      Marlin/src/gcode/feature/pause/G61.cpp
  17. 4
    4
      Marlin/src/gcode/lcd/M0_M1.cpp
  18. 15
    15
      Marlin/src/gcode/temperature/M104_M109.cpp
  19. 9
    2
      Marlin/src/gcode/temperature/M140_M190.cpp
  20. 7
    2
      Marlin/src/gcode/temperature/M141_M191.cpp
  21. 371
    61
      Marlin/src/inc/Conditionals_post.h
  22. 1
    1
      Marlin/src/inc/Version.h
  23. 2
    2
      Marlin/src/lcd/extensible_ui/ui_api.cpp
  24. 1
    1
      Marlin/src/lcd/menu/menu_filament.cpp
  25. 3
    1
      Marlin/src/lcd/thermistornames.h
  26. 8
    5
      Marlin/src/lcd/ultralcd.cpp
  27. 49
    55
      Marlin/src/libs/L64XX/L64XX_Marlin.cpp
  28. 3
    3
      Marlin/src/libs/L64XX/L64XX_Marlin.h
  29. 1
    1
      Marlin/src/module/motion.cpp
  30. 1
    1
      Marlin/src/module/motion.h
  31. 20
    20
      Marlin/src/module/planner.cpp
  32. 1
    1
      Marlin/src/module/probe.cpp
  33. 8
    8
      Marlin/src/module/stepper.cpp
  34. 50
    0
      Marlin/src/module/stepper/L64xx.h
  35. 335
    243
      Marlin/src/module/stepper/indirection.h
  36. 37
    24
      Marlin/src/module/temperature.cpp
  37. 41
    10
      Marlin/src/module/temperature.h
  38. 77
    0
      Marlin/src/module/thermistor/thermistor_21.h
  39. 5
    1
      Marlin/src/module/thermistor/thermistors.h
  40. 1
    1
      Marlin/src/module/tool_change.cpp
  41. 90
    0
      Marlin/src/pins/esp32/pins_E4D.h
  42. 18
    0
      Marlin/src/pins/linux/pins_RAMPS_LINUX.h
  43. 37
    21
      Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h
  44. 45
    7
      Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h
  45. 144
    19
      Marlin/src/pins/pins.h
  46. 65
    2
      Marlin/src/pins/pinsDebug_list.h
  47. 10
    10
      Marlin/src/pins/rambo/pins_EINSY_RETRO.h
  48. 18
    0
      Marlin/src/pins/ramps/pins_RAMPS.h
  49. 3
    0
      Marlin/src/pins/ramps/pins_TT_OSCAR.h
  50. 18
    0
      Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h
  51. 10
    0
      Marlin/src/sd/SdVolume.cpp

+ 2
- 1
Marlin/Configuration.h View File

@@ -379,7 +379,8 @@
379 379
  *    13 : 100k Hisens 3950  1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
380 380
  *    15 : 100k thermistor calibration for JGAurora A5 hotend
381 381
  *    18 : ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327
382
- *    20 : Pt100 with circuit in the Ultimainboard V2.x
382
+ *    20 : Pt100 with circuit in the Ultimainboard V2.x with 5v excitation (AVR)
383
+ *    21 : Pt100 with circuit in the Ultimainboard V2.x with 3.3v excitation (STM32 \ LPC176x....)
383 384
  *   201 : Pt100 with circuit in Overlord, similar to Ultimainboard V2.x
384 385
  *    60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
385 386
  *    61 : 100k Formbot / Vivedino 3950 350C thermistor 4.7k pullup

+ 1
- 1
Marlin/Configuration_adv.h View File

@@ -819,7 +819,7 @@
819 819
   // probing on a screwhead or hollow washer, probe near the edges.
820 820
   //#define CALIBRATION_MEASURE_AT_TOP_EDGES
821 821
 
822
-  // Define pin which is read during calibration
822
+  // Define the pin to read during calibration
823 823
   #ifndef CALIBRATION_PIN
824 824
     #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop
825 825
     #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin

+ 16
- 16
Marlin/src/MarlinCore.cpp View File

@@ -291,7 +291,7 @@ void quickstop_stepper() {
291 291
 }
292 292
 
293 293
 void enable_e_steppers() {
294
-  #define _ENA_E(N) enable_E##N();
294
+  #define _ENA_E(N) ENABLE_AXIS_E##N();
295 295
   REPEAT(E_STEPPERS, _ENA_E)
296 296
 }
297 297
 
@@ -299,28 +299,28 @@ void enable_all_steppers() {
299 299
   #if ENABLED(AUTO_POWER_CONTROL)
300 300
     powerManager.power_on();
301 301
   #endif
302
-  enable_X();
303
-  enable_Y();
304
-  enable_Z();
302
+  ENABLE_AXIS_X();
303
+  ENABLE_AXIS_Y();
304
+  ENABLE_AXIS_Z();
305 305
   enable_e_steppers();
306 306
 }
307 307
 
308 308
 void disable_e_steppers() {
309
-  #define _DIS_E(N) disable_E##N();
309
+  #define _DIS_E(N) DISABLE_AXIS_E##N();
310 310
   REPEAT(E_STEPPERS, _DIS_E)
311 311
 }
312 312
 
313 313
 void disable_e_stepper(const uint8_t e) {
314
-  #define _CASE_DIS_E(N) case N: disable_E##N(); break;
314
+  #define _CASE_DIS_E(N) case N: DISABLE_AXIS_E##N(); break;
315 315
   switch (e) {
316 316
     REPEAT(EXTRUDERS, _CASE_DIS_E)
317 317
   }
318 318
 }
319 319
 
320 320
 void disable_all_steppers() {
321
-  disable_X();
322
-  disable_Y();
323
-  disable_Z();
321
+  DISABLE_AXIS_X();
322
+  DISABLE_AXIS_Y();
323
+  DISABLE_AXIS_Z();
324 324
   disable_e_steppers();
325 325
 }
326 326
 
@@ -461,13 +461,13 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
461 461
       if (!already_shutdown_steppers) {
462 462
         already_shutdown_steppers = true;  // L6470 SPI will consume 99% of free time without this
463 463
         #if ENABLED(DISABLE_INACTIVE_X)
464
-          disable_X();
464
+          DISABLE_AXIS_X();
465 465
         #endif
466 466
         #if ENABLED(DISABLE_INACTIVE_Y)
467
-          disable_Y();
467
+          DISABLE_AXIS_Y();
468 468
         #endif
469 469
         #if ENABLED(DISABLE_INACTIVE_Z)
470
-          disable_Z();
470
+          DISABLE_AXIS_Z();
471 471
         #endif
472 472
         #if ENABLED(DISABLE_INACTIVE_E)
473 473
           disable_e_steppers();
@@ -542,11 +542,11 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
542 542
       #if ENABLED(SWITCHING_EXTRUDER)
543 543
         bool oldstatus;
544 544
         switch (active_extruder) {
545
-          default: oldstatus = E0_ENABLE_READ(); enable_E0(); break;
545
+          default: oldstatus = E0_ENABLE_READ(); ENABLE_AXIS_E0(); break;
546 546
           #if E_STEPPERS > 1
547
-            case 2: case 3: oldstatus = E1_ENABLE_READ(); enable_E1(); break;
547
+            case 2: case 3: oldstatus = E1_ENABLE_READ(); ENABLE_AXIS_E1(); break;
548 548
             #if E_STEPPERS > 2
549
-              case 4: case 5: oldstatus = E2_ENABLE_READ(); enable_E2(); break;
549
+              case 4: case 5: oldstatus = E2_ENABLE_READ(); ENABLE_AXIS_E2(); break;
550 550
             #endif // E_STEPPERS > 2
551 551
           #endif // E_STEPPERS > 1
552 552
         }
@@ -554,7 +554,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
554 554
         bool oldstatus;
555 555
         switch (active_extruder) {
556 556
           default:
557
-          #define _CASE_EN(N) case N: oldstatus = E##N##_ENABLE_READ(); enable_E##N(); break;
557
+          #define _CASE_EN(N) case N: oldstatus = E##N##_ENABLE_READ(); ENABLE_AXIS_E##N(); break;
558 558
           REPEAT(E_STEPPERS, _CASE_EN);
559 559
         }
560 560
       #endif

+ 2
- 1
Marlin/src/core/boards.h View File

@@ -332,9 +332,10 @@
332 332
 //
333 333
 // Espressif ESP32 WiFi
334 334
 //
335
-#define BOARD_ESPRESSIF_ESP32         6000
335
+#define BOARD_ESPRESSIF_ESP32         6000  // Generic ESP32
336 336
 #define BOARD_MRR_ESPA                6001
337 337
 #define BOARD_MRR_ESPE                6002
338
+#define BOARD_E4D_BOX                 6003  // E4d@BOX
338 339
 
339 340
 //
340 341
 // Simulations

+ 17
- 6
Marlin/src/core/macros.h View File

@@ -29,12 +29,23 @@
29 29
 
30 30
 #define _AXIS(A) (A##_AXIS)
31 31
 
32
-#define _XMIN_ 100
33
-#define _YMIN_ 200
34
-#define _ZMIN_ 300
35
-#define _XMAX_ 101
36
-#define _YMAX_ 201
37
-#define _ZMAX_ 301
32
+#define _XMIN_   100
33
+#define _YMIN_   200
34
+#define _ZMIN_   300
35
+#define _XMAX_   101
36
+#define _YMAX_   201
37
+#define _ZMAX_   301
38
+#define _XDIAG_  102
39
+#define _YDIAG_  202
40
+#define _ZDIAG_  302
41
+#define _E0DIAG_ 400
42
+#define _E1DIAG_ 401
43
+#define _E2DIAG_ 402
44
+#define _E3DIAG_ 403
45
+#define _E4DIAG_ 404
46
+#define _E5DIAG_ 405
47
+#define _E6DIAG_ 406
48
+#define _E7DIAG_ 407
38 49
 
39 50
 #define _FORCE_INLINE_ __attribute__((__always_inline__)) __inline__
40 51
 #define  FORCE_INLINE  __attribute__((always_inline)) inline

+ 1
- 1
Marlin/src/feature/babystep.cpp View File

@@ -78,7 +78,7 @@ void Babystep::add_steps(const AxisEnum axis, const int16_t distance) {
78 78
   #endif
79 79
 
80 80
   #if ENABLED(BABYSTEP_ALWAYS_AVAILABLE)
81
-    #define BSA_ENABLE(AXIS) do{ switch (AXIS) { case X_AXIS: enable_X(); break; case Y_AXIS: enable_Y(); break; case Z_AXIS: enable_Z(); break; default: break; } }while(0)
81
+    #define BSA_ENABLE(AXIS) do{ switch (AXIS) { case X_AXIS: ENABLE_AXIS_X(); break; case Y_AXIS: ENABLE_AXIS_Y(); break; case Z_AXIS: ENABLE_AXIS_Z(); break; default: break; } }while(0)
82 82
   #else
83 83
     #define BSA_ENABLE(AXIS) NOOP
84 84
   #endif

+ 1
- 1
Marlin/src/feature/binary_protocol.h View File

@@ -242,7 +242,7 @@ public:
242 242
       uint8_t protocol() { return (meta >> 4) & 0xF; }
243 243
       uint8_t type() { return meta & 0xF; }
244 244
       void reset() { token = 0; sync = 0; meta = 0; size = 0; checksum = 0; }
245
-      uint8_t data[1];
245
+      uint8_t data[2];
246 246
     };
247 247
 
248 248
     union Footer {

+ 2
- 2
Marlin/src/feature/pause.cpp View File

@@ -564,7 +564,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
564 564
       #endif
565 565
 
566 566
       // Re-enable the heaters if they timed out
567
-      HOTEND_LOOP() thermalManager.reset_heater_idle_timer(e);
567
+      HOTEND_LOOP() thermalManager.reset_hotend_idle_timer(e);
568 568
 
569 569
       // Wait for the heaters to reach the target temperatures
570 570
       ensure_safe_temperature();
@@ -633,7 +633,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
633 633
   bool nozzle_timed_out = false;
634 634
   HOTEND_LOOP() {
635 635
     nozzle_timed_out |= thermalManager.hotend_idle[e].timed_out;
636
-    thermalManager.reset_heater_idle_timer(e);
636
+    thermalManager.reset_hotend_idle_timer(e);
637 637
   }
638 638
 
639 639
   if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) // Load the new filament

+ 3
- 3
Marlin/src/feature/probe_temp_compensation.h View File

@@ -48,10 +48,10 @@ class ProbeTempComp {
48 48
   public:
49 49
 
50 50
     static constexpr temp_calib_t cali_info_init[TSI_COUNT] = {
51
-        {  30, 10,  5,  30 + 10 *  5 },       // Probe
52
-        {  60, 10,  5,  60 + 10 *  5 },       // Bed
51
+        {  10,  5,  30,  30 + 10 *  5 },       // Probe
52
+        {  10,  5,  60,  60 + 10 *  5 },       // Bed
53 53
       #if ENABLED(USE_TEMP_EXT_COMPENSATION)
54
-        { 180,  5, 20, 180 +  5 * 20 }        // Extruder
54
+        {  20,  5, 180, 180 +  5 * 20 }        // Extruder
55 55
       #endif
56 56
     };
57 57
     static const temp_calib_t cali_info[TSI_COUNT];

+ 8
- 8
Marlin/src/feature/prusa_MMU2/mmu2.cpp View File

@@ -448,7 +448,7 @@ void MMU2::tool_change(uint8_t index) {
448 448
 
449 449
   if (index != extruder) {
450 450
 
451
-    disable_E0();
451
+    DISABLE_AXIS_E0();
452 452
     ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
453 453
 
454 454
     command(MMU_CMD_T0 + index);
@@ -459,7 +459,7 @@ void MMU2::tool_change(uint8_t index) {
459 459
     extruder = index; //filament change is finished
460 460
     active_extruder = 0;
461 461
 
462
-    enable_E0();
462
+    ENABLE_AXIS_E0();
463 463
 
464 464
     SERIAL_ECHO_START();
465 465
     SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, int(extruder));
@@ -497,13 +497,13 @@ void MMU2::tool_change(const char* special) {
497 497
       case 'x': {
498 498
         planner.synchronize();
499 499
         uint8_t index = mmu2_choose_filament();
500
-        disable_E0();
500
+        DISABLE_AXIS_E0();
501 501
         command(MMU_CMD_T0 + index);
502 502
         manage_response(true, true);
503 503
         command(MMU_CMD_C0);
504 504
         mmu_loop();
505 505
 
506
-        enable_E0();
506
+        ENABLE_AXIS_E0();
507 507
         extruder = index;
508 508
         active_extruder = 0;
509 509
       } break;
@@ -697,7 +697,7 @@ void MMU2::filament_runout() {
697 697
 
698 698
     LCD_MESSAGEPGM(MSG_MMU2_EJECTING_FILAMENT);
699 699
 
700
-    enable_E0();
700
+    ENABLE_AXIS_E0();
701 701
     current_position.e -= MMU2_FILAMENTCHANGE_EJECT_FEED;
702 702
     line_to_current_position(2500 / 60);
703 703
     planner.synchronize();
@@ -731,7 +731,7 @@ void MMU2::filament_runout() {
731 731
 
732 732
     BUZZ(200, 404);
733 733
 
734
-    disable_E0();
734
+    DISABLE_AXIS_E0();
735 735
 
736 736
     return true;
737 737
   }
@@ -776,7 +776,7 @@ void MMU2::filament_runout() {
776 776
   void MMU2::execute_extruder_sequence(const E_Step * sequence, int steps) {
777 777
 
778 778
     planner.synchronize();
779
-    enable_E0();
779
+    ENABLE_AXIS_E0();
780 780
 
781 781
     const E_Step* step = sequence;
782 782
 
@@ -794,7 +794,7 @@ void MMU2::filament_runout() {
794 794
       step++;
795 795
     }
796 796
 
797
-    disable_E0();
797
+    DISABLE_AXIS_E0();
798 798
   }
799 799
 
800 800
 #endif // HAS_LCD_MENU && MMU2_MENUS

+ 1
- 3
Marlin/src/gcode/calibrate/G33.cpp View File

@@ -439,7 +439,6 @@ void GcodeSuite::G33() {
439 439
              _opposite_results    = (_4p_calibration && !towers_set) || probe_points >= 3,
440 440
              _endstop_results     = probe_points != 1 && probe_points != -1 && probe_points != 0,
441 441
              _angle_results       = probe_points >= 3 && towers_set;
442
-  static const char save_message[] PROGMEM = "Save with M500 and/or copy to Configuration.h";
443 442
   int8_t iterations = 0;
444 443
   float test_precision,
445 444
         zero_std_dev = (verbose_level ? 999.0f : 0.0f), // 0.0 in dry-run mode : forced end
@@ -625,8 +624,7 @@ void GcodeSuite::G33() {
625 624
           sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev_min));
626 625
         ui.set_status(mess);
627 626
         print_calibration_settings(_endstop_results, _angle_results);
628
-        serialprintPGM(save_message);
629
-        SERIAL_EOL();
627
+        SERIAL_ECHOLNPGM("Save with M500 and/or copy to Configuration.h");
630 628
       }
631 629
       else { // !end iterations
632 630
         char mess[15];

+ 4
- 4
Marlin/src/gcode/calibrate/G76_M871.cpp View File

@@ -256,7 +256,7 @@ void GcodeSuite::G76() {
256 256
 
257 257
     // Initialize temperatures
258 258
     uint16_t target_bed = temp_comp.probe_calib_bed_temp,
259
-             target_probe = temp_comp.cali_info_init[TSI_BED].start_temp;
259
+             target_probe = temp_comp.cali_info_init[TSI_PROBE].start_temp;
260 260
     thermalManager.setTargetBed(target_bed);
261 261
     SERIAL_ECHOLNPGM("Waiting for bed and probe temperature.");
262 262
     while (fabs(thermalManager.degBed() - float(target_bed)) > 0.1f
@@ -332,13 +332,13 @@ void GcodeSuite::G76() {
332 332
       else
333 333
         SERIAL_ECHOLNPAIR_F("Measured: ", measured_z);
334 334
 
335
-      if (target_probe == temp_comp.cali_info_init[TSI_BED].start_temp)
335
+      if (target_probe == temp_comp.cali_info_init[TSI_PROBE].start_temp)
336 336
         temp_comp.prepare_new_calibration(measured_z);
337 337
       else
338 338
         temp_comp.push_back_new_measurement(TSI_PROBE, measured_z);
339 339
 
340
-      target_probe += temp_comp.cali_info_init[TSI_BED].temp_res;
341
-      if (target_probe > temp_comp.cali_info_init[TSI_BED].end_temp) break;
340
+      target_probe += temp_comp.cali_info_init[TSI_PROBE].temp_res;
341
+      if (target_probe > temp_comp.cali_info_init[TSI_PROBE].end_temp) break;
342 342
     }
343 343
 
344 344
     SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index());

+ 3
- 0
Marlin/src/gcode/calibrate/M48.cpp View File

@@ -53,6 +53,9 @@
53 53
  *
54 54
  * This function requires the machine to be homed before invocation.
55 55
  */
56
+
57
+extern const char SP_Y_STR[];
58
+
56 59
 void GcodeSuite::M48() {
57 60
 
58 61
   if (axis_unhomed_error()) return;

+ 6
- 6
Marlin/src/gcode/control/M17_M18_M84.cpp View File

@@ -34,9 +34,9 @@
34 34
  */
35 35
 void GcodeSuite::M17() {
36 36
   if (parser.seen("XYZE")) {
37
-    if (parser.seen('X')) enable_X();
38
-    if (parser.seen('Y')) enable_Y();
39
-    if (parser.seen('Z')) enable_Z();
37
+    if (parser.seen('X')) ENABLE_AXIS_X();
38
+    if (parser.seen('Y')) ENABLE_AXIS_Y();
39
+    if (parser.seen('Z')) ENABLE_AXIS_Z();
40 40
     #if HAS_E_STEPPER_ENABLE
41 41
       if (parser.seen('E')) enable_e_steppers();
42 42
     #endif
@@ -57,9 +57,9 @@ void GcodeSuite::M18_M84() {
57 57
   else {
58 58
     if (parser.seen("XYZE")) {
59 59
       planner.synchronize();
60
-      if (parser.seen('X')) disable_X();
61
-      if (parser.seen('Y')) disable_Y();
62
-      if (parser.seen('Z')) disable_Z();
60
+      if (parser.seen('X')) DISABLE_AXIS_X();
61
+      if (parser.seen('Y')) DISABLE_AXIS_Y();
62
+      if (parser.seen('Z')) DISABLE_AXIS_Z();
63 63
       #if HAS_E_STEPPER_ENABLE
64 64
         if (parser.seen('E')) disable_e_steppers();
65 65
       #endif

+ 1
- 1
Marlin/src/gcode/feature/pause/G60.cpp View File

@@ -45,7 +45,7 @@ void GcodeSuite::G60() {
45 45
   }
46 46
 
47 47
   stored_position[slot] = current_position;
48
-  SBI(saved_slots, slot);
48
+  SBI(saved_slots[slot >> 3], slot & 0x07);
49 49
 
50 50
   #if ENABLED(SAVED_POSITIONS_DEBUG)
51 51
     const xyze_pos_t &pos = stored_position[slot];

+ 2
- 2
Marlin/src/gcode/feature/pause/G61.cpp View File

@@ -25,7 +25,7 @@
25 25
 #if SAVED_POSITIONS
26 26
 
27 27
 #include "../../../core/language.h"
28
-#include "../../module/planner.h"
28
+#include "../../../module/planner.h"
29 29
 #include "../../gcode.h"
30 30
 #include "../../../module/motion.h"
31 31
 
@@ -48,7 +48,7 @@ void GcodeSuite::G61(void) {
48 48
   #endif
49 49
 
50 50
   // No saved position? No axes being restored?
51
-  if (!TEST(saved_slots, slot) || !parser.seen("XYZ")) return;
51
+  if (!TEST(saved_slots[slot >> 3], slot & 0x07) || !parser.seen("XYZ")) return;
52 52
 
53 53
   // Apply any given feedrate over 0.0
54 54
   const float fr = parser.linearval('F');

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

@@ -20,12 +20,14 @@
20 20
  *
21 21
  */
22 22
 
23
-#include "../../inc/MarlinConfig.h"
23
+#include "../../inc/MarlinConfigPre.h"
24 24
 
25 25
 #if HAS_RESUME_CONTINUE
26 26
 
27 27
 #include "../gcode.h"
28
-#include "../../module/stepper.h"
28
+#include "../../module/planner.h"
29
+
30
+#include "../../inc/MarlinConfig.h"
29 31
 
30 32
 #if HAS_LCD_MENU
31 33
   #include "../../lcd/ultralcd.h"
@@ -35,8 +37,6 @@
35 37
   #include "../../lcd/extensible_ui/ui_api.h"
36 38
 #endif
37 39
 
38
-#include "../../sd/cardreader.h"
39
-
40 40
 #if HAS_LEDS_OFF_FLAG
41 41
   #include "../../feature/leds/printer_event_leds.h"
42 42
 #endif

+ 15
- 15
Marlin/src/gcode/temperature/M104_M109.cpp View File

@@ -20,6 +20,12 @@
20 20
  *
21 21
  */
22 22
 
23
+/**
24
+ * gcode/temperature/M104_M109.cpp
25
+ *
26
+ * Hotend target temperature control
27
+ */
28
+
23 29
 #include "../../inc/MarlinConfigPre.h"
24 30
 
25 31
 #if EXTRUDERS
@@ -73,14 +79,11 @@ void GcodeSuite::M104() {
73 79
     #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
74 80
       /**
75 81
        * Stop the timer at the end of print. Start is managed by 'heat and wait' M109.
76
-       * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
77
-       * standby mode, for instance in a dual extruder setup, without affecting
78
-       * the running print timer.
82
+       * Hotends use EXTRUDE_MINTEMP / 2 to allow nozzles to be put into hot standby
83
+       * mode, for instance in a dual extruder setup, without affecting the running
84
+       * print timer.
79 85
        */
80
-      if (temp <= (EXTRUDE_MINTEMP) / 2) {
81
-        print_job_timer.stop();
82
-        ui.reset_status();
83
-      }
86
+      thermalManager.check_timer_autostart(false, true);
84 87
     #endif
85 88
   }
86 89
 
@@ -90,8 +93,10 @@ void GcodeSuite::M104() {
90 93
 }
91 94
 
92 95
 /**
93
- * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating.
94
- *       Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling.
96
+ * M109: Sxxx Wait for hotend(s) to reach temperature. Waits only when heating.
97
+ *       Rxxx Wait for hotend(s) to reach temperature. Waits when heating and cooling.
98
+ *
99
+ * With PRINTJOB_TIMER_AUTOSTART also start the job timer on heating and stop it if turned off.
95 100
  */
96 101
 void GcodeSuite::M109() {
97 102
 
@@ -125,12 +130,7 @@ void GcodeSuite::M109() {
125 130
        * standby mode, (e.g., in a dual extruder setup) without affecting
126 131
        * the running print timer.
127 132
        */
128
-      if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) {
129
-        print_job_timer.stop();
130
-        ui.reset_status();
131
-      }
132
-      else
133
-        startOrResumeJob();
133
+      thermalManager.check_timer_autostart(true, true);
134 134
     #endif
135 135
 
136 136
     #if HAS_DISPLAY

+ 9
- 2
Marlin/src/gcode/temperature/M140_M190.cpp View File

@@ -20,6 +20,12 @@
20 20
  *
21 21
  */
22 22
 
23
+/**
24
+ * gcode/temperature/M140_M190.cpp
25
+ *
26
+ * Bed target temperature control
27
+ */
28
+
23 29
 #include "../../inc/MarlinConfig.h"
24 30
 
25 31
 #if HAS_HEATED_BED
@@ -50,6 +56,8 @@ void GcodeSuite::M140() {
50 56
 /**
51 57
  * M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating
52 58
  *       Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
59
+ *
60
+ * With PRINTJOB_TIMER_AUTOSTART also start the job timer on heating.
53 61
  */
54 62
 void GcodeSuite::M190() {
55 63
   if (DEBUGGING(DRYRUN)) return;
@@ -58,8 +66,7 @@ void GcodeSuite::M190() {
58 66
   if (no_wait_for_cooling || parser.seenval('R')) {
59 67
     thermalManager.setTargetBed(parser.value_celsius());
60 68
     #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
61
-      if (parser.value_celsius() > BED_MINTEMP)
62
-        startOrResumeJob();
69
+      thermalManager.check_timer_autostart(true, false);
63 70
     #endif
64 71
   }
65 72
   else return;

+ 7
- 2
Marlin/src/gcode/temperature/M141_M191.cpp View File

@@ -20,6 +20,12 @@
20 20
  *
21 21
  */
22 22
 
23
+/**
24
+ * gcode/temperature/M141_M191.cpp
25
+ *
26
+ * Chamber target temperature control
27
+ */
28
+
23 29
 #include "../../inc/MarlinConfig.h"
24 30
 
25 31
 #if HAS_HEATED_CHAMBER
@@ -59,8 +65,7 @@ void GcodeSuite::M191() {
59 65
   if (no_wait_for_cooling || parser.seenval('R')) {
60 66
     thermalManager.setTargetChamber(parser.value_celsius());
61 67
     #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
62
-      if (parser.value_celsius() > CHAMBER_MINTEMP)
63
-        startOrResumeJob();
68
+      thermalManager.check_timer_autostart(true, false);
64 69
     #endif
65 70
   }
66 71
   else return;

+ 371
- 61
Marlin/src/inc/Conditionals_post.h View File

@@ -679,48 +679,110 @@
679 679
   #if X_HOME_DIR > 0
680 680
     #if X2_USE_ENDSTOP == _XMIN_
681 681
       #define X2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
682
-      #define X2_MAX_PIN X_MIN_PIN
683 682
     #elif X2_USE_ENDSTOP == _XMAX_
684 683
       #define X2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
685
-      #define X2_MAX_PIN X_MAX_PIN
686 684
     #elif X2_USE_ENDSTOP == _YMIN_
687 685
       #define X2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
688
-      #define X2_MAX_PIN Y_MIN_PIN
689 686
     #elif X2_USE_ENDSTOP == _YMAX_
690 687
       #define X2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
691
-      #define X2_MAX_PIN Y_MAX_PIN
692 688
     #elif X2_USE_ENDSTOP == _ZMIN_
693 689
       #define X2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
694
-      #define X2_MAX_PIN Z_MIN_PIN
695 690
     #elif X2_USE_ENDSTOP == _ZMAX_
696 691
       #define X2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
697
-      #define X2_MAX_PIN Z_MAX_PIN
698 692
     #else
699 693
       #define X2_MAX_ENDSTOP_INVERTING false
700 694
     #endif
695
+    #ifndef X2_MAX_PIN
696
+      #if X2_USE_ENDSTOP == _XMIN_
697
+        #define X2_MAX_PIN X_MIN_PIN
698
+      #elif X2_USE_ENDSTOP == _XMAX_
699
+        #define X2_MAX_PIN X_MAX_PIN
700
+      #elif X2_USE_ENDSTOP == _YMIN_
701
+        #define X2_MAX_PIN Y_MIN_PIN
702
+      #elif X2_USE_ENDSTOP == _YMAX_
703
+        #define X2_MAX_PIN Y_MAX_PIN
704
+      #elif X2_USE_ENDSTOP == _ZMIN_
705
+        #define X2_MAX_PIN Z_MIN_PIN
706
+      #elif X2_USE_ENDSTOP == _ZMAX_
707
+        #define X2_MAX_PIN Z_MAX_PIN
708
+      #elif X2_USE_ENDSTOP == _XDIAG_
709
+        #define X2_MAX_PIN X_DIAG_PIN
710
+      #elif X2_USE_ENDSTOP == _YDIAG_
711
+        #define X2_MAX_PIN Y_DIAG_PIN
712
+      #elif X2_USE_ENDSTOP == _ZDIAG_
713
+        #define X2_MAX_PIN Z_DIAG_PIN
714
+      #elif X2_USE_ENDSTOP == _E0DIAG_
715
+        #define X2_MAX_PIN E0_DIAG_PIN
716
+      #elif X2_USE_ENDSTOP == _E1DIAG_
717
+        #define X2_MAX_PIN E1_DIAG_PIN
718
+      #elif X2_USE_ENDSTOP == _E2DIAG_
719
+        #define X2_MAX_PIN E2_DIAG_PIN
720
+      #elif X2_USE_ENDSTOP == _E3DIAG_
721
+        #define X2_MAX_PIN E3_DIAG_PIN
722
+      #elif X2_USE_ENDSTOP == _E4DIAG_
723
+        #define X2_MAX_PIN E4_DIAG_PIN
724
+      #elif X2_USE_ENDSTOP == _E5DIAG_
725
+        #define X2_MAX_PIN E5_DIAG_PIN
726
+      #elif X2_USE_ENDSTOP == _E6DIAG_
727
+        #define X2_MAX_PIN E6_DIAG_PIN
728
+      #elif X2_USE_ENDSTOP == _E7DIAG_
729
+        #define X2_MAX_PIN E7_DIAG_PIN
730
+      #endif
731
+    #endif
701 732
     #define X2_MIN_ENDSTOP_INVERTING false
702 733
   #else
703 734
     #if X2_USE_ENDSTOP == _XMIN_
704 735
       #define X2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
705
-      #define X2_MIN_PIN X_MIN_PIN
706 736
     #elif X2_USE_ENDSTOP == _XMAX_
707 737
       #define X2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
708
-      #define X2_MIN_PIN X_MAX_PIN
709 738
     #elif X2_USE_ENDSTOP == _YMIN_
710 739
       #define X2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
711
-      #define X2_MIN_PIN Y_MIN_PIN
712 740
     #elif X2_USE_ENDSTOP == _YMAX_
713 741
       #define X2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
714
-      #define X2_MIN_PIN Y_MAX_PIN
715 742
     #elif X2_USE_ENDSTOP == _ZMIN_
716 743
       #define X2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
717
-      #define X2_MIN_PIN Z_MIN_PIN
718 744
     #elif X2_USE_ENDSTOP == _ZMAX_
719 745
       #define X2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
720
-      #define X2_MIN_PIN Z_MAX_PIN
721 746
     #else
722 747
       #define X2_MIN_ENDSTOP_INVERTING false
723 748
     #endif
749
+    #ifndef X2_MIN_PIN
750
+      #if X2_USE_ENDSTOP == _XMIN_
751
+        #define X2_MIN_PIN X_MIN_PIN
752
+      #elif X2_USE_ENDSTOP == _XMAX_
753
+        #define X2_MIN_PIN X_MAX_PIN
754
+      #elif X2_USE_ENDSTOP == _YMIN_
755
+        #define X2_MIN_PIN Y_MIN_PIN
756
+      #elif X2_USE_ENDSTOP == _YMAX_
757
+        #define X2_MIN_PIN Y_MAX_PIN
758
+      #elif X2_USE_ENDSTOP == _ZMIN_
759
+        #define X2_MIN_PIN Z_MIN_PIN
760
+      #elif X2_USE_ENDSTOP == _ZMAX_
761
+        #define X2_MIN_PIN Z_MAX_PIN
762
+      #elif X2_USE_ENDSTOP == _XDIAG_
763
+        #define X2_MIN_PIN X_DIAG_PIN
764
+      #elif X2_USE_ENDSTOP == _YDIAG_
765
+        #define X2_MIN_PIN Y_DIAG_PIN
766
+      #elif X2_USE_ENDSTOP == _ZDIAG_
767
+        #define X2_MIN_PIN Z_DIAG_PIN
768
+      #elif X2_USE_ENDSTOP == _E0DIAG_
769
+        #define X2_MIN_PIN E0_DIAG_PIN
770
+      #elif X2_USE_ENDSTOP == _E1DIAG_
771
+        #define X2_MIN_PIN E1_DIAG_PIN
772
+      #elif X2_USE_ENDSTOP == _E2DIAG_
773
+        #define X2_MIN_PIN E2_DIAG_PIN
774
+      #elif X2_USE_ENDSTOP == _E3DIAG_
775
+        #define X2_MIN_PIN E3_DIAG_PIN
776
+      #elif X2_USE_ENDSTOP == _E4DIAG_
777
+        #define X2_MIN_PIN E4_DIAG_PIN
778
+      #elif X2_USE_ENDSTOP == _E5DIAG_
779
+        #define X2_MIN_PIN E5_DIAG_PIN
780
+      #elif X2_USE_ENDSTOP == _E6DIAG_
781
+        #define X2_MIN_PIN E6_DIAG_PIN
782
+      #elif X2_USE_ENDSTOP == _E7DIAG_
783
+        #define X2_MIN_PIN E7_DIAG_PIN
784
+      #endif
785
+    #endif
724 786
     #define X2_MAX_ENDSTOP_INVERTING false
725 787
   #endif
726 788
 #endif
@@ -732,48 +794,110 @@
732 794
   #if Y_HOME_DIR > 0
733 795
     #if Y2_USE_ENDSTOP == _XMIN_
734 796
       #define Y2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
735
-      #define Y2_MAX_PIN X_MIN_PIN
736 797
     #elif Y2_USE_ENDSTOP == _XMAX_
737 798
       #define Y2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
738
-      #define Y2_MAX_PIN X_MAX_PIN
739 799
     #elif Y2_USE_ENDSTOP == _YMIN_
740 800
       #define Y2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
741
-      #define Y2_MAX_PIN Y_MIN_PIN
742 801
     #elif Y2_USE_ENDSTOP == _YMAX_
743 802
       #define Y2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
744
-      #define Y2_MAX_PIN Y_MAX_PIN
745 803
     #elif Y2_USE_ENDSTOP == _ZMIN_
746 804
       #define Y2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
747
-      #define Y2_MAX_PIN Z_MIN_PIN
748 805
     #elif Y2_USE_ENDSTOP == _ZMAX_
749 806
       #define Y2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
750
-      #define Y2_MAX_PIN Z_MAX_PIN
751 807
     #else
752 808
       #define Y2_MAX_ENDSTOP_INVERTING false
753 809
     #endif
810
+    #ifndef Y2_MAX_PIN
811
+      #if Y2_USE_ENDSTOP == _XMIN_
812
+        #define Y2_MAX_PIN X_MIN_PIN
813
+      #elif Y2_USE_ENDSTOP == _XMAX_
814
+        #define Y2_MAX_PIN X_MAX_PIN
815
+      #elif Y2_USE_ENDSTOP == _YMIN_
816
+        #define Y2_MAX_PIN Y_MIN_PIN
817
+      #elif Y2_USE_ENDSTOP == _YMAX_
818
+        #define Y2_MAX_PIN Y_MAX_PIN
819
+      #elif Y2_USE_ENDSTOP == _ZMIN_
820
+        #define Y2_MAX_PIN Z_MIN_PIN
821
+      #elif Y2_USE_ENDSTOP == _ZMAX_
822
+        #define Y2_MAX_PIN Z_MAX_PIN
823
+      #elif Y2_USE_ENDSTOP == _XDIAG_
824
+        #define Y2_MAX_PIN X_DIAG_PIN
825
+      #elif Y2_USE_ENDSTOP == _YDIAG_
826
+        #define Y2_MAX_PIN Y_DIAG_PIN
827
+      #elif Y2_USE_ENDSTOP == _ZDIAG_
828
+        #define Y2_MAX_PIN Z_DIAG_PIN
829
+      #elif Y2_USE_ENDSTOP == _E0DIAG_
830
+        #define Y2_MAX_PIN E0_DIAG_PIN
831
+      #elif Y2_USE_ENDSTOP == _E1DIAG_
832
+        #define Y2_MAX_PIN E1_DIAG_PIN
833
+      #elif Y2_USE_ENDSTOP == _E2DIAG_
834
+        #define Y2_MAX_PIN E2_DIAG_PIN
835
+      #elif Y2_USE_ENDSTOP == _E3DIAG_
836
+        #define Y2_MAX_PIN E3_DIAG_PIN
837
+      #elif Y2_USE_ENDSTOP == _E4DIAG_
838
+        #define Y2_MAX_PIN E4_DIAG_PIN
839
+      #elif Y2_USE_ENDSTOP == _E5DIAG_
840
+        #define Y2_MAX_PIN E5_DIAG_PIN
841
+      #elif Y2_USE_ENDSTOP == _E6DIAG_
842
+        #define Y2_MAX_PIN E6_DIAG_PIN
843
+      #elif Y2_USE_ENDSTOP == _E7DIAG_
844
+        #define Y2_MAX_PIN E7_DIAG_PIN
845
+      #endif
846
+    #endif
754 847
     #define Y2_MIN_ENDSTOP_INVERTING false
755 848
   #else
756 849
     #if Y2_USE_ENDSTOP == _XMIN_
757 850
       #define Y2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
758
-      #define Y2_MIN_PIN X_MIN_PIN
759 851
     #elif Y2_USE_ENDSTOP == _XMAX_
760 852
       #define Y2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
761
-      #define Y2_MIN_PIN X_MAX_PIN
762 853
     #elif Y2_USE_ENDSTOP == _YMIN_
763 854
       #define Y2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
764
-      #define Y2_MIN_PIN Y_MIN_PIN
765 855
     #elif Y2_USE_ENDSTOP == _YMAX_
766 856
       #define Y2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
767
-      #define Y2_MIN_PIN Y_MAX_PIN
768 857
     #elif Y2_USE_ENDSTOP == _ZMIN_
769 858
       #define Y2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
770
-      #define Y2_MIN_PIN Z_MIN_PIN
771 859
     #elif Y2_USE_ENDSTOP == _ZMAX_
772 860
       #define Y2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
773
-      #define Y2_MIN_PIN Z_MAX_PIN
774 861
     #else
775 862
       #define Y2_MIN_ENDSTOP_INVERTING false
776 863
     #endif
864
+    #ifndef Y2_MIN_PIN
865
+      #if Y2_USE_ENDSTOP == _XMIN_
866
+        #define Y2_MIN_PIN X_MIN_PIN
867
+      #elif Y2_USE_ENDSTOP == _XMAX_
868
+        #define Y2_MIN_PIN X_MAX_PIN
869
+      #elif Y2_USE_ENDSTOP == _YMIN_
870
+        #define Y2_MIN_PIN Y_MIN_PIN
871
+      #elif Y2_USE_ENDSTOP == _YMAX_
872
+        #define Y2_MIN_PIN Y_MAX_PIN
873
+      #elif Y2_USE_ENDSTOP == _ZMIN_
874
+        #define Y2_MIN_PIN Z_MIN_PIN
875
+      #elif Y2_USE_ENDSTOP == _ZMAX_
876
+        #define Y2_MIN_PIN Z_MAX_PIN
877
+      #elif Y2_USE_ENDSTOP == _XDIAG_
878
+        #define Y2_MIN_PIN X_DIAG_PIN
879
+      #elif Y2_USE_ENDSTOP == _YDIAG_
880
+        #define Y2_MIN_PIN Y_DIAG_PIN
881
+      #elif Y2_USE_ENDSTOP == _ZDIAG_
882
+        #define Y2_MIN_PIN Z_DIAG_PIN
883
+      #elif Y2_USE_ENDSTOP == _E0DIAG_
884
+        #define Y2_MIN_PIN E0_DIAG_PIN
885
+      #elif Y2_USE_ENDSTOP == _E1DIAG_
886
+        #define Y2_MIN_PIN E1_DIAG_PIN
887
+      #elif Y2_USE_ENDSTOP == _E2DIAG_
888
+        #define Y2_MIN_PIN E2_DIAG_PIN
889
+      #elif Y2_USE_ENDSTOP == _E3DIAG_
890
+        #define Y2_MIN_PIN E3_DIAG_PIN
891
+      #elif Y2_USE_ENDSTOP == _E4DIAG_
892
+        #define Y2_MIN_PIN E4_DIAG_PIN
893
+      #elif Y2_USE_ENDSTOP == _E5DIAG_
894
+        #define Y2_MIN_PIN E5_DIAG_PIN
895
+      #elif Y2_USE_ENDSTOP == _E6DIAG_
896
+        #define Y2_MIN_PIN E6_DIAG_PIN
897
+      #elif Y2_USE_ENDSTOP == _E7DIAG_
898
+        #define Y2_MIN_PIN E7_DIAG_PIN
899
+      #endif
900
+    #endif
777 901
     #define Y2_MAX_ENDSTOP_INVERTING false
778 902
   #endif
779 903
 #endif
@@ -786,48 +910,110 @@
786 910
   #if Z_HOME_DIR > 0
787 911
     #if Z2_USE_ENDSTOP == _XMIN_
788 912
       #define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
789
-      #define Z2_MAX_PIN X_MIN_PIN
790 913
     #elif Z2_USE_ENDSTOP == _XMAX_
791 914
       #define Z2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
792
-      #define Z2_MAX_PIN X_MAX_PIN
793 915
     #elif Z2_USE_ENDSTOP == _YMIN_
794 916
       #define Z2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
795
-      #define Z2_MAX_PIN Y_MIN_PIN
796 917
     #elif Z2_USE_ENDSTOP == _YMAX_
797 918
       #define Z2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
798
-      #define Z2_MAX_PIN Y_MAX_PIN
799 919
     #elif Z2_USE_ENDSTOP == _ZMIN_
800 920
       #define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
801
-      #define Z2_MAX_PIN Z_MIN_PIN
802 921
     #elif Z2_USE_ENDSTOP == _ZMAX_
803 922
       #define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
804
-      #define Z2_MAX_PIN Z_MAX_PIN
805 923
     #else
806 924
       #define Z2_MAX_ENDSTOP_INVERTING false
807 925
     #endif
926
+    #ifndef Z2_MAX_PIN
927
+      #if Z2_USE_ENDSTOP == _XMIN_
928
+        #define Z2_MAX_PIN X_MIN_PIN
929
+      #elif Z2_USE_ENDSTOP == _XMAX_
930
+        #define Z2_MAX_PIN X_MAX_PIN
931
+      #elif Z2_USE_ENDSTOP == _YMIN_
932
+        #define Z2_MAX_PIN Y_MIN_PIN
933
+      #elif Z2_USE_ENDSTOP == _YMAX_
934
+        #define Z2_MAX_PIN Y_MAX_PIN
935
+      #elif Z2_USE_ENDSTOP == _ZMIN_
936
+        #define Z2_MAX_PIN Z_MIN_PIN
937
+      #elif Z2_USE_ENDSTOP == _ZMAX_
938
+        #define Z2_MAX_PIN Z_MAX_PIN
939
+      #elif Z2_USE_ENDSTOP == _XDIAG_
940
+        #define Z2_MAX_PIN X_DIAG_PIN
941
+      #elif Z2_USE_ENDSTOP == _YDIAG_
942
+        #define Z2_MAX_PIN Y_DIAG_PIN
943
+      #elif Z2_USE_ENDSTOP == _ZDIAG_
944
+        #define Z2_MAX_PIN Z_DIAG_PIN
945
+      #elif Z2_USE_ENDSTOP == _E0DIAG_
946
+        #define Z2_MAX_PIN E0_DIAG_PIN
947
+      #elif Z2_USE_ENDSTOP == _E1DIAG_
948
+        #define Z2_MAX_PIN E1_DIAG_PIN
949
+      #elif Z2_USE_ENDSTOP == _E2DIAG_
950
+        #define Z2_MAX_PIN E2_DIAG_PIN
951
+      #elif Z2_USE_ENDSTOP == _E3DIAG_
952
+        #define Z2_MAX_PIN E3_DIAG_PIN
953
+      #elif Z2_USE_ENDSTOP == _E4DIAG_
954
+        #define Z2_MAX_PIN E4_DIAG_PIN
955
+      #elif Z2_USE_ENDSTOP == _E5DIAG_
956
+        #define Z2_MAX_PIN E5_DIAG_PIN
957
+      #elif Z2_USE_ENDSTOP == _E6DIAG_
958
+        #define Z2_MAX_PIN E6_DIAG_PIN
959
+      #elif Z2_USE_ENDSTOP == _E7DIAG_
960
+        #define Z2_MAX_PIN E7_DIAG_PIN
961
+      #endif
962
+    #endif
808 963
     #define Z2_MIN_ENDSTOP_INVERTING false
809 964
   #else
810 965
     #if Z2_USE_ENDSTOP == _XMIN_
811 966
       #define Z2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
812
-      #define Z2_MIN_PIN X_MIN_PIN
813 967
     #elif Z2_USE_ENDSTOP == _XMAX_
814 968
       #define Z2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
815
-      #define Z2_MIN_PIN X_MAX_PIN
816 969
     #elif Z2_USE_ENDSTOP == _YMIN_
817 970
       #define Z2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
818
-      #define Z2_MIN_PIN Y_MIN_PIN
819 971
     #elif Z2_USE_ENDSTOP == _YMAX_
820 972
       #define Z2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
821
-      #define Z2_MIN_PIN Y_MAX_PIN
822 973
     #elif Z2_USE_ENDSTOP == _ZMIN_
823 974
       #define Z2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
824
-      #define Z2_MIN_PIN Z_MIN_PIN
825 975
     #elif Z2_USE_ENDSTOP == _ZMAX_
826 976
       #define Z2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
827
-      #define Z2_MIN_PIN Z_MAX_PIN
828 977
     #else
829 978
       #define Z2_MIN_ENDSTOP_INVERTING false
830 979
     #endif
980
+    #ifndef Z2_MIN_PIN
981
+      #if Z2_USE_ENDSTOP == _XMIN_
982
+        #define Z2_MIN_PIN X_MIN_PIN
983
+      #elif Z2_USE_ENDSTOP == _XMAX_
984
+        #define Z2_MIN_PIN X_MAX_PIN
985
+      #elif Z2_USE_ENDSTOP == _YMIN_
986
+        #define Z2_MIN_PIN Y_MIN_PIN
987
+      #elif Z2_USE_ENDSTOP == _YMAX_
988
+        #define Z2_MIN_PIN Y_MAX_PIN
989
+      #elif Z2_USE_ENDSTOP == _ZMIN_
990
+        #define Z2_MIN_PIN Z_MIN_PIN
991
+      #elif Z2_USE_ENDSTOP == _ZMAX_
992
+        #define Z2_MIN_PIN Z_MAX_PIN
993
+      #elif Z2_USE_ENDSTOP == _XDIAG_
994
+        #define Z2_MIN_PIN X_DIAG_PIN
995
+      #elif Z2_USE_ENDSTOP == _YDIAG_
996
+        #define Z2_MIN_PIN Y_DIAG_PIN
997
+      #elif Z2_USE_ENDSTOP == _ZDIAG_
998
+        #define Z2_MIN_PIN Z_DIAG_PIN
999
+      #elif Z2_USE_ENDSTOP == _E0DIAG_
1000
+        #define Z2_MIN_PIN E0_DIAG_PIN
1001
+      #elif Z2_USE_ENDSTOP == _E1DIAG_
1002
+        #define Z2_MIN_PIN E1_DIAG_PIN
1003
+      #elif Z2_USE_ENDSTOP == _E2DIAG_
1004
+        #define Z2_MIN_PIN E2_DIAG_PIN
1005
+      #elif Z2_USE_ENDSTOP == _E3DIAG_
1006
+        #define Z2_MIN_PIN E3_DIAG_PIN
1007
+      #elif Z2_USE_ENDSTOP == _E4DIAG_
1008
+        #define Z2_MIN_PIN E4_DIAG_PIN
1009
+      #elif Z2_USE_ENDSTOP == _E5DIAG_
1010
+        #define Z2_MIN_PIN E5_DIAG_PIN
1011
+      #elif Z2_USE_ENDSTOP == _E6DIAG_
1012
+        #define Z2_MIN_PIN E6_DIAG_PIN
1013
+      #elif Z2_USE_ENDSTOP == _E7DIAG_
1014
+        #define Z2_MIN_PIN E7_DIAG_PIN
1015
+      #endif
1016
+    #endif
831 1017
     #define Z2_MAX_ENDSTOP_INVERTING false
832 1018
   #endif
833 1019
 
@@ -835,48 +1021,110 @@
835 1021
     #if Z_HOME_DIR > 0
836 1022
       #if Z3_USE_ENDSTOP == _XMIN_
837 1023
         #define Z3_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
838
-        #define Z3_MAX_PIN X_MIN_PIN
839 1024
       #elif Z3_USE_ENDSTOP == _XMAX_
840 1025
         #define Z3_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
841
-        #define Z3_MAX_PIN X_MAX_PIN
842 1026
       #elif Z3_USE_ENDSTOP == _YMIN_
843 1027
         #define Z3_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
844
-        #define Z3_MAX_PIN Y_MIN_PIN
845 1028
       #elif Z3_USE_ENDSTOP == _YMAX_
846 1029
         #define Z3_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
847
-        #define Z3_MAX_PIN Y_MAX_PIN
848 1030
       #elif Z3_USE_ENDSTOP == _ZMIN_
849 1031
         #define Z3_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
850
-        #define Z3_MAX_PIN Z_MIN_PIN
851 1032
       #elif Z3_USE_ENDSTOP == _ZMAX_
852 1033
         #define Z3_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
853
-        #define Z3_MAX_PIN Z_MAX_PIN
854 1034
       #else
855 1035
         #define Z3_MAX_ENDSTOP_INVERTING false
856 1036
       #endif
1037
+      #ifndef Z3_MAX_PIN
1038
+        #if Z3_USE_ENDSTOP == _XMIN_
1039
+          #define Z3_MAX_PIN X_MIN_PIN
1040
+        #elif Z3_USE_ENDSTOP == _XMAX_
1041
+          #define Z3_MAX_PIN X_MAX_PIN
1042
+        #elif Z3_USE_ENDSTOP == _YMIN_
1043
+          #define Z3_MAX_PIN Y_MIN_PIN
1044
+        #elif Z3_USE_ENDSTOP == _YMAX_
1045
+          #define Z3_MAX_PIN Y_MAX_PIN
1046
+        #elif Z3_USE_ENDSTOP == _ZMIN_
1047
+          #define Z3_MAX_PIN Z_MIN_PIN
1048
+        #elif Z3_USE_ENDSTOP == _ZMAX_
1049
+          #define Z3_MAX_PIN Z_MAX_PIN
1050
+        #elif Z3_USE_ENDSTOP == _XDIAG_
1051
+          #define Z3_MAX_PIN X_DIAG_PIN
1052
+        #elif Z3_USE_ENDSTOP == _YDIAG_
1053
+          #define Z3_MAX_PIN Y_DIAG_PIN
1054
+        #elif Z3_USE_ENDSTOP == _ZDIAG_
1055
+          #define Z3_MAX_PIN Z_DIAG_PIN
1056
+        #elif Z3_USE_ENDSTOP == _E0DIAG_
1057
+          #define Z3_MAX_PIN E0_DIAG_PIN
1058
+        #elif Z3_USE_ENDSTOP == _E1DIAG_
1059
+          #define Z3_MAX_PIN E1_DIAG_PIN
1060
+        #elif Z3_USE_ENDSTOP == _E2DIAG_
1061
+          #define Z3_MAX_PIN E2_DIAG_PIN
1062
+        #elif Z3_USE_ENDSTOP == _E3DIAG_
1063
+          #define Z3_MAX_PIN E3_DIAG_PIN
1064
+        #elif Z3_USE_ENDSTOP == _E4DIAG_
1065
+          #define Z3_MAX_PIN E4_DIAG_PIN
1066
+        #elif Z3_USE_ENDSTOP == _E5DIAG_
1067
+          #define Z3_MAX_PIN E5_DIAG_PIN
1068
+        #elif Z3_USE_ENDSTOP == _E6DIAG_
1069
+          #define Z3_MAX_PIN E6_DIAG_PIN
1070
+        #elif Z3_USE_ENDSTOP == _E7DIAG_
1071
+          #define Z3_MAX_PIN E7_DIAG_PIN
1072
+        #endif
1073
+      #endif
857 1074
       #define Z3_MIN_ENDSTOP_INVERTING false
858 1075
     #else
859 1076
       #if Z3_USE_ENDSTOP == _XMIN_
860 1077
         #define Z3_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
861
-        #define Z3_MIN_PIN X_MIN_PIN
862 1078
       #elif Z3_USE_ENDSTOP == _XMAX_
863 1079
         #define Z3_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
864
-        #define Z3_MIN_PIN X_MAX_PIN
865 1080
       #elif Z3_USE_ENDSTOP == _YMIN_
866 1081
         #define Z3_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
867
-        #define Z3_MIN_PIN Y_MIN_PIN
868 1082
       #elif Z3_USE_ENDSTOP == _YMAX_
869 1083
         #define Z3_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
870
-        #define Z3_MIN_PIN Y_MAX_PIN
871 1084
       #elif Z3_USE_ENDSTOP == _ZMIN_
872 1085
         #define Z3_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
873
-        #define Z3_MIN_PIN Z_MIN_PIN
874 1086
       #elif Z3_USE_ENDSTOP == _ZMAX_
875 1087
         #define Z3_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
876
-        #define Z3_MIN_PIN Z_MAX_PIN
877 1088
       #else
878 1089
         #define Z3_MIN_ENDSTOP_INVERTING false
879 1090
       #endif
1091
+      #ifndef Z3_MIN_PIN
1092
+        #if Z3_USE_ENDSTOP == _XMIN_
1093
+          #define Z3_MIN_PIN X_MIN_PIN
1094
+        #elif Z3_USE_ENDSTOP == _XMAX_
1095
+          #define Z3_MIN_PIN X_MAX_PIN
1096
+        #elif Z3_USE_ENDSTOP == _YMIN_
1097
+          #define Z3_MIN_PIN Y_MIN_PIN
1098
+        #elif Z3_USE_ENDSTOP == _YMAX_
1099
+          #define Z3_MIN_PIN Y_MAX_PIN
1100
+        #elif Z3_USE_ENDSTOP == _ZMIN_
1101
+          #define Z3_MIN_PIN Z_MIN_PIN
1102
+        #elif Z3_USE_ENDSTOP == _ZMAX_
1103
+          #define Z3_MIN_PIN Z_MAX_PIN
1104
+        #elif Z3_USE_ENDSTOP == _XDIAG_
1105
+          #define Z3_MIN_PIN X_DIAG_PIN
1106
+        #elif Z3_USE_ENDSTOP == _YDIAG_
1107
+          #define Z3_MIN_PIN Y_DIAG_PIN
1108
+        #elif Z3_USE_ENDSTOP == _ZDIAG_
1109
+          #define Z3_MIN_PIN Z_DIAG_PIN
1110
+        #elif Z3_USE_ENDSTOP == _E0DIAG_
1111
+          #define Z3_MIN_PIN E0_DIAG_PIN
1112
+        #elif Z3_USE_ENDSTOP == _E1DIAG_
1113
+          #define Z3_MIN_PIN E1_DIAG_PIN
1114
+        #elif Z3_USE_ENDSTOP == _E2DIAG_
1115
+          #define Z3_MIN_PIN E2_DIAG_PIN
1116
+        #elif Z3_USE_ENDSTOP == _E3DIAG_
1117
+          #define Z3_MIN_PIN E3_DIAG_PIN
1118
+        #elif Z3_USE_ENDSTOP == _E4DIAG_
1119
+          #define Z3_MIN_PIN E4_DIAG_PIN
1120
+        #elif Z3_USE_ENDSTOP == _E5DIAG_
1121
+          #define Z3_MIN_PIN E5_DIAG_PIN
1122
+        #elif Z3_USE_ENDSTOP == _E6DIAG_
1123
+          #define Z3_MIN_PIN E6_DIAG_PIN
1124
+        #elif Z3_USE_ENDSTOP == _E7DIAG_
1125
+          #define Z3_MIN_PIN E7_DIAG_PIN
1126
+        #endif
1127
+      #endif
880 1128
       #define Z3_MAX_ENDSTOP_INVERTING false
881 1129
     #endif
882 1130
   #endif
@@ -885,48 +1133,110 @@
885 1133
     #if Z_HOME_DIR > 0
886 1134
       #if Z4_USE_ENDSTOP == _XMIN_
887 1135
         #define Z4_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
888
-        #define Z4_MAX_PIN X_MIN_PIN
889 1136
       #elif Z4_USE_ENDSTOP == _XMAX_
890 1137
         #define Z4_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
891
-        #define Z4_MAX_PIN X_MAX_PIN
892 1138
       #elif Z4_USE_ENDSTOP == _YMIN_
893 1139
         #define Z4_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
894
-        #define Z4_MAX_PIN Y_MIN_PIN
895 1140
       #elif Z4_USE_ENDSTOP == _YMAX_
896 1141
         #define Z4_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
897
-        #define Z4_MAX_PIN Y_MAX_PIN
898 1142
       #elif Z4_USE_ENDSTOP == _ZMIN_
899 1143
         #define Z4_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
900
-        #define Z4_MAX_PIN Z_MIN_PIN
901 1144
       #elif Z4_USE_ENDSTOP == _ZMAX_
902 1145
         #define Z4_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
903
-        #define Z4_MAX_PIN Z_MAX_PIN
904 1146
       #else
905 1147
         #define Z4_MAX_ENDSTOP_INVERTING false
906 1148
       #endif
1149
+      #ifndef Z4_MAX_PIN
1150
+        #if Z4_USE_ENDSTOP == _XMIN_
1151
+          #define Z4_MAX_PIN X_MIN_PIN
1152
+        #elif Z4_USE_ENDSTOP == _XMAX_
1153
+          #define Z4_MAX_PIN X_MAX_PIN
1154
+        #elif Z4_USE_ENDSTOP == _YMIN_
1155
+          #define Z4_MAX_PIN Y_MIN_PIN
1156
+        #elif Z4_USE_ENDSTOP == _YMAX_
1157
+          #define Z4_MAX_PIN Y_MAX_PIN
1158
+        #elif Z4_USE_ENDSTOP == _ZMIN_
1159
+          #define Z4_MAX_PIN Z_MIN_PIN
1160
+        #elif Z4_USE_ENDSTOP == _ZMAX_
1161
+          #define Z4_MAX_PIN Z_MAX_PIN
1162
+        #elif Z4_USE_ENDSTOP == _XDIAG_
1163
+          #define Z4_MAX_PIN X_DIAG_PIN
1164
+        #elif Z4_USE_ENDSTOP == _YDIAG_
1165
+          #define Z4_MAX_PIN Y_DIAG_PIN
1166
+        #elif Z4_USE_ENDSTOP == _ZDIAG_
1167
+          #define Z4_MAX_PIN Z_DIAG_PIN
1168
+        #elif Z4_USE_ENDSTOP == _E0DIAG_
1169
+          #define Z4_MAX_PIN E0_DIAG_PIN
1170
+        #elif Z4_USE_ENDSTOP == _E1DIAG_
1171
+          #define Z4_MAX_PIN E1_DIAG_PIN
1172
+        #elif Z4_USE_ENDSTOP == _E2DIAG_
1173
+          #define Z4_MAX_PIN E2_DIAG_PIN
1174
+        #elif Z4_USE_ENDSTOP == _E3DIAG_
1175
+          #define Z4_MAX_PIN E3_DIAG_PIN
1176
+        #elif Z4_USE_ENDSTOP == _E4DIAG_
1177
+          #define Z4_MAX_PIN E4_DIAG_PIN
1178
+        #elif Z4_USE_ENDSTOP == _E5DIAG_
1179
+          #define Z4_MAX_PIN E5_DIAG_PIN
1180
+        #elif Z4_USE_ENDSTOP == _E6DIAG_
1181
+          #define Z4_MAX_PIN E6_DIAG_PIN
1182
+        #elif Z4_USE_ENDSTOP == _E7DIAG_
1183
+          #define Z4_MAX_PIN E7_DIAG_PIN
1184
+        #endif
1185
+      #endif
907 1186
       #define Z4_MIN_ENDSTOP_INVERTING false
908 1187
     #else
909 1188
       #if Z4_USE_ENDSTOP == _XMIN_
910 1189
         #define Z4_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
911
-        #define Z4_MIN_PIN X_MIN_PIN
912 1190
       #elif Z4_USE_ENDSTOP == _XMAX_
913 1191
         #define Z4_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
914
-        #define Z4_MIN_PIN X_MAX_PIN
915 1192
       #elif Z4_USE_ENDSTOP == _YMIN_
916 1193
         #define Z4_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
917
-        #define Z4_MIN_PIN Y_MIN_PIN
918 1194
       #elif Z4_USE_ENDSTOP == _YMAX_
919 1195
         #define Z4_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
920
-        #define Z4_MIN_PIN Y_MAX_PIN
921 1196
       #elif Z4_USE_ENDSTOP == _ZMIN_
922 1197
         #define Z4_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
923
-        #define Z4_MIN_PIN Z_MIN_PIN
924 1198
       #elif Z4_USE_ENDSTOP == _ZMAX_
925 1199
         #define Z4_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
926
-        #define Z4_MIN_PIN Z_MAX_PIN
927 1200
       #else
928 1201
         #define Z4_MIN_ENDSTOP_INVERTING false
929 1202
       #endif
1203
+      #ifndef Z4_MIN_PIN
1204
+        #if Z4_USE_ENDSTOP == _XMIN_
1205
+          #define Z4_MIN_PIN X_MIN_PIN
1206
+        #elif Z4_USE_ENDSTOP == _XMAX_
1207
+          #define Z4_MIN_PIN X_MAX_PIN
1208
+        #elif Z4_USE_ENDSTOP == _YMIN_
1209
+          #define Z4_MIN_PIN Y_MIN_PIN
1210
+        #elif Z4_USE_ENDSTOP == _YMAX_
1211
+          #define Z4_MIN_PIN Y_MAX_PIN
1212
+        #elif Z4_USE_ENDSTOP == _ZMIN_
1213
+          #define Z4_MIN_PIN Z_MIN_PIN
1214
+        #elif Z4_USE_ENDSTOP == _ZMAX_
1215
+          #define Z4_MIN_PIN Z_MAX_PIN
1216
+        #elif Z4_USE_ENDSTOP == _XDIAG_
1217
+          #define Z4_MIN_PIN X_DIAG_PIN
1218
+        #elif Z4_USE_ENDSTOP == _YDIAG_
1219
+          #define Z4_MIN_PIN Y_DIAG_PIN
1220
+        #elif Z4_USE_ENDSTOP == _ZDIAG_
1221
+          #define Z4_MIN_PIN Z_DIAG_PIN
1222
+        #elif Z4_USE_ENDSTOP == _E0DIAG_
1223
+          #define Z4_MIN_PIN E0_DIAG_PIN
1224
+        #elif Z4_USE_ENDSTOP == _E1DIAG_
1225
+          #define Z4_MIN_PIN E1_DIAG_PIN
1226
+        #elif Z4_USE_ENDSTOP == _E2DIAG_
1227
+          #define Z4_MIN_PIN E2_DIAG_PIN
1228
+        #elif Z4_USE_ENDSTOP == _E3DIAG_
1229
+          #define Z4_MIN_PIN E3_DIAG_PIN
1230
+        #elif Z4_USE_ENDSTOP == _E4DIAG_
1231
+          #define Z4_MIN_PIN E4_DIAG_PIN
1232
+        #elif Z4_USE_ENDSTOP == _E5DIAG_
1233
+          #define Z4_MIN_PIN E5_DIAG_PIN
1234
+        #elif Z4_USE_ENDSTOP == _E6DIAG_
1235
+          #define Z4_MIN_PIN E6_DIAG_PIN
1236
+        #elif Z4_USE_ENDSTOP == _E7DIAG_
1237
+          #define Z4_MIN_PIN E7_DIAG_PIN
1238
+        #endif
1239
+      #endif
930 1240
       #define Z4_MAX_ENDSTOP_INVERTING false
931 1241
     #endif
932 1242
   #endif
@@ -1220,7 +1530,7 @@
1220 1530
 
1221 1531
 // Other fans
1222 1532
 #define HAS_FAN0 (PIN_EXISTS(FAN))
1223
-#define _HAS_FAN(P) (PIN_EXISTS(FAN_##P) && CONTROLLER_FAN_PIN != FAN_##P##_PIN && E0_AUTO_FAN_PIN != FAN_##P##_PIN && E1_AUTO_FAN_PIN != FAN_##P##_PIN && E2_AUTO_FAN_PIN != FAN_##P##_PIN && E3_AUTO_FAN_PIN != FAN_##P##_PIN && E4_AUTO_FAN_PIN != FAN_##P##_PIN && E5_AUTO_FAN_PIN != FAN_##P##_PIN && E6_AUTO_FAN_PIN != FAN_##P##_PIN && E7_AUTO_FAN_PIN != FAN_##P##_PIN)
1533
+#define _HAS_FAN(P) (PIN_EXISTS(FAN##P) && CONTROLLER_FAN_PIN != FAN##P##_PIN && E0_AUTO_FAN_PIN != FAN##P##_PIN && E1_AUTO_FAN_PIN != FAN##P##_PIN && E2_AUTO_FAN_PIN != FAN##P##_PIN && E3_AUTO_FAN_PIN != FAN##P##_PIN && E4_AUTO_FAN_PIN != FAN##P##_PIN && E5_AUTO_FAN_PIN != FAN##P##_PIN && E6_AUTO_FAN_PIN != FAN##P##_PIN && E7_AUTO_FAN_PIN != FAN##P##_PIN)
1224 1534
 #define HAS_FAN1 _HAS_FAN(1)
1225 1535
 #define HAS_FAN2 _HAS_FAN(2)
1226 1536
 #define HAS_FAN3 _HAS_FAN(3)

+ 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-01-27"
45
+  #define STRING_DISTRIBUTION_DATE "2020-01-31"
46 46
 #endif
47 47
 
48 48
 /**

+ 2
- 2
Marlin/src/lcd/extensible_ui/ui_api.cpp View File

@@ -171,7 +171,7 @@ namespace ExtUI {
171 171
 
172 172
   void enableHeater(const extruder_t extruder) {
173 173
     #if HOTENDS && HEATER_IDLE_HANDLER
174
-      thermalManager.reset_heater_idle_timer(extruder - E0);
174
+      thermalManager.reset_hotend_idle_timer(extruder - E0);
175 175
     #else
176 176
       UNUSED(extruder);
177 177
     #endif
@@ -190,7 +190,7 @@ namespace ExtUI {
190 190
         #endif
191 191
         default:
192 192
           #if HOTENDS
193
-            thermalManager.reset_heater_idle_timer(heater - H0);
193
+            thermalManager.reset_hotend_idle_timer(heater - H0);
194 194
           #endif
195 195
           break;
196 196
       }

+ 1
- 1
Marlin/src/lcd/menu/menu_filament.cpp View File

@@ -119,7 +119,7 @@ void _menu_temp_filament_op(const PauseMode mode, const int8_t extruder) {
119 119
           SUBMENU_N_P(s, msg, []{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, MenuItemBase::itemIndex); });
120 120
         else {
121 121
           ACTION_ITEM_N_P(s, msg, []{
122
-            char cmd[12];
122
+            char cmd[13];
123 123
             sprintf_P(cmd, PSTR("M600 B0 T%i"), int(MenuItemBase::itemIndex));
124 124
             lcd_enqueue_one_now(cmd);
125 125
           });

+ 3
- 1
Marlin/src/lcd/thermistornames.h View File

@@ -85,7 +85,9 @@
85 85
 #elif THERMISTOR_ID == 18
86 86
   #define THERMISTOR_NAME "ATC Semitec 204GT-2"
87 87
 #elif THERMISTOR_ID == 20
88
-  #define THERMISTOR_NAME "Pt100 UltiMB"
88
+  #define THERMISTOR_NAME "Pt100 UltiMB 5v"
89
+#elif THERMISTOR_ID == 21
90
+  #define THERMISTOR_NAME "Pt100 UltiMB 3.3v"
89 91
 #elif THERMISTOR_ID == 201
90 92
   #define THERMISTOR_NAME "Pt100 OverLord"
91 93
 #elif THERMISTOR_ID == 60

+ 8
- 5
Marlin/src/lcd/ultralcd.cpp View File

@@ -777,13 +777,12 @@ void MarlinUI::update() {
777 777
     static bool wait_for_unclick; // = false
778 778
 
779 779
     #if ENABLED(TOUCH_BUTTONS)
780
-
781 780
       if (touch_buttons) {
782 781
         RESET_STATUS_TIMEOUT();
783
-        if (buttons & (EN_A | EN_B)) {                    // Menu arrows, in priority
782
+        if (touch_buttons & (EN_A | EN_B)) {              // Menu arrows, in priority
784 783
           if (ELAPSED(ms, next_button_update_ms)) {
785 784
             encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * (ENCODER_PULSES_PER_STEP) * encoderDirection;
786
-            if (buttons & EN_A) encoderDiff *= -1;
785
+            if (touch_buttons & EN_A) encoderDiff *= -1;
787 786
             #if ENABLED(AUTO_BED_LEVELING_UBL)
788 787
               if (external_control) ubl.encoder_diff = encoderDiff;
789 788
             #endif
@@ -1246,7 +1245,11 @@ void MarlinUI::update() {
1246 1245
             | slow_buttons
1247 1246
           #endif
1248 1247
           #if ENABLED(TOUCH_BUTTONS) && HAS_ENCODER_ACTION
1249
-            | touch_buttons
1248
+            | (touch_buttons
1249
+              #if HAS_ENCODER_WHEEL
1250
+                & (~(EN_A | EN_B))
1251
+              #endif
1252
+            )
1250 1253
           #endif
1251 1254
         );
1252 1255
 
@@ -1277,7 +1280,7 @@ void MarlinUI::update() {
1277 1280
 
1278 1281
     } // next_button_update_ms
1279 1282
 
1280
-    #if HAS_ENCODER_WHEEL && DISABLED(TOUCH_BUTTONS)
1283
+    #if HAS_ENCODER_WHEEL
1281 1284
       static uint8_t lastEncoderBits;
1282 1285
 
1283 1286
       #define encrot0 0

+ 49
- 55
Marlin/src/libs/L64XX/L64XX_Marlin.cpp View File

@@ -39,39 +39,40 @@ L64XX_Marlin L64xxManager;
39 39
 
40 40
 void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PSTR(" NO ")); }
41 41
 
42
-char L64XX_Marlin::index_to_axis[MAX_L64XX][3] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "Z4", "E0", "E1", "E2", "E3", "E4", "E5", "E6", "E7" };
42
+static const char str_X[] PROGMEM = "X ",  str_Y[] PROGMEM = "Y ",  str_Z[] PROGMEM = "Z ",
43
+                 str_X2[] PROGMEM = "X2", str_Y2[] PROGMEM = "Y2",
44
+                 str_Z2[] PROGMEM = "Z2", str_Z3[] PROGMEM = "Z3", str_Z4[] PROGMEM = "Z4",
45
+                 str_E0[] PROGMEM = "E0", str_E1[] PROGMEM = "E1",
46
+                 str_E2[] PROGMEM = "E2", str_E3[] PROGMEM = "E3",
47
+                 str_E4[] PROGMEM = "E4", str_E5[] PROGMEM = "E5",
48
+                 str_E6[] PROGMEM = "E6", str_E7[] PROGMEM = "E7"
49
+                 ;
50
+
51
+PGM_P const L64XX_Marlin::index_to_axis[] PROGMEM = {
52
+  str_X, str_Y, str_Z, str_X2, str_Y2, str_Z2, str_Z3, str_Z4,
53
+  str_E0, str_E1, str_E2, str_E3, str_E4, str_E5, str_E6, str_E7
54
+};
43 55
 
44 56
 #define DEBUG_OUT ENABLED(L6470_CHITCHAT)
45 57
 #include "../../core/debug_out.h"
46 58
 
47 59
 uint8_t L64XX_Marlin::dir_commands[MAX_L64XX];  // array to hold direction command for each driver
48 60
 
49
-uint8_t L64XX_Marlin::index_to_dir[MAX_L64XX] = { (INVERT_X_DIR),                         //  0 X
50
-                                                  (INVERT_Y_DIR),                         //  1 Y
51
-                                                  (INVERT_Z_DIR),                         //  2 Z
52
-                                                  #if ENABLED(X_DUAL_STEPPER_DRIVERS)     //  3 X2
53
-                                                    (INVERT_X_DIR) ^ (INVERT_X2_VS_X_DIR),
54
-                                                  #else
55
-                                                    (INVERT_X_DIR),
56
-                                                  #endif
57
-                                                  #if ENABLED(Y_DUAL_STEPPER_DRIVERS)     //  4 Y2
58
-                                                    (INVERT_Y_DIR) ^ (INVERT_Y2_VS_Y_DIR),
59
-                                                  #else
60
-                                                    (INVERT_Y_DIR),
61
-                                                  #endif
62
-                                                  (INVERT_Z_DIR),                         //  5 Z2
63
-                                                  (INVERT_Z_DIR),                         //  6 Z3
64
-                                                  (INVERT_Z_DIR),                         //  7 Z4
65
-
66
-                                                  (INVERT_E0_DIR),                        //  8 E0
67
-                                                  (INVERT_E1_DIR),                        //  9 E1
68
-                                                  (INVERT_E2_DIR),                        // 10 E2
69
-                                                  (INVERT_E3_DIR),                        // 11 E3
70
-                                                  (INVERT_E4_DIR),                        // 12 E4
71
-                                                  (INVERT_E5_DIR),                        // 13 E5
72
-                                                  (INVERT_E6_DIR),                        // 14 E6
73
-                                                  (INVERT_E7_DIR)                         // 15 E7
74
-                                                };
61
+const uint8_t L64XX_Marlin::index_to_dir[MAX_L64XX] = {
62
+  INVERT_X_DIR, INVERT_Y_DIR, INVERT_Z_DIR
63
+  , (INVERT_X_DIR)                            // X2
64
+    #if ENABLED(X_DUAL_STEPPER_DRIVERS)
65
+      ^ (INVERT_X2_VS_X_DIR)
66
+    #endif
67
+  , (INVERT_Y_DIR)                            // Y2
68
+    #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
69
+      ^ (INVERT_Y2_VS_Y_DIR)
70
+    #endif
71
+  , INVERT_Z_DIR, INVERT_Z_DIR, INVERT_Z_DIR  // Z2,Z3,Z4
72
+
73
+  , INVERT_E0_DIR, INVERT_E1_DIR, INVERT_E2_DIR, INVERT_E3_DIR
74
+  , INVERT_E4_DIR, INVERT_E5_DIR, INVERT_E6_DIR, INVERT_E7_DIR
75
+};
75 76
 
76 77
 volatile uint8_t L64XX_Marlin::spi_abort = false;
77 78
 uint8_t L64XX_Marlin::spi_active = false;
@@ -379,35 +380,27 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
379 380
     found_displacement = true;
380 381
     displacement = _displacement;
381 382
     uint8_t axis_offset = parser.byteval('J');
382
-    axis_mon[0][0] = axis_codes[i];   // axis ASCII value (target character)
383
+    axis_mon[0][0] = axis_codes[i];         // Axis first character, one of XYZE
384
+    const bool single_or_e = axis_offset >= 2 || axis_mon[0][0] == 'E',
385
+               one_or_more = !single_or_e && axis_offset == 0;
383 386
     uint8_t driver_count_local = 0;         // Can't use "driver_count" directly as a subscript because it's passed by reference
384
-    if (axis_offset >= 2 || axis_mon[0][0] == 'E') {  // Single axis, E0, or E1
385
-      axis_mon[0][1] = axis_offset + '0';
386
-      for (j = 0; j < MAX_L64XX; j++) {       // See how many drivers on this axis
387
-        const char * const str = index_to_axis[j];
388
-        if (axis_mon[0][0] == str[0]) {
389
-          char * const mon = axis_mon[driver_count_local];
390
-          mon[0] = str[0];
391
-          mon[1] = str[1];
392
-          mon[2] = str[2];   // append end of string
393
-          axis_index[driver_count_local] = (L64XX_axis_t)j;        // set axis index
394
-          driver_count_local++;
395
-        }
396
-      }
397
-    }
398
-    else if (axis_offset == 0) {              // One or more axes
399
-      for (j = 0; j < MAX_L64XX; j++) {       // See how many drivers on this axis
400
-        const char * const str = index_to_axis[j];
401
-        if (axis_mon[0][0] == str[0]) {
402
-          char * const mon = axis_mon[driver_count_local];
403
-          mon[0] = str[0];
404
-          mon[1] = str[1];
405
-          mon[2] = str[2];   // append end of string
406
-          axis_index[driver_count_local] = (L64XX_axis_t)j;        // set axis index
387
+    if (single_or_e)                        // Single axis, E0, or E1
388
+      axis_mon[0][1] = axis_offset + '0';   // Index given by 'J' parameter
389
+
390
+    if (single_or_e || one_or_more) {
391
+      for (j = 0; j < MAX_L64XX; j++) {     // Count up the drivers on this axis
392
+        PGM_P str = (PGM_P)pgm_read_ptr(&index_to_axis[j]); // Get a PGM_P from progmem
393
+        const char c = pgm_read_byte(str);                  // Get a char from progmem
394
+        if (axis_mon[0][0] == c) {          // For each stepper on this axis...
395
+          char *mon = axis_mon[driver_count_local];
396
+          *mon++ = c;                        // Copy the 3 letter axis name
397
+          *mon++ = pgm_read_byte(&str[1]);   //  to the axis_mon array
398
+          *mon   = pgm_read_byte(&str[2]);
399
+          axis_index[driver_count_local] = (L64XX_axis_t)j; // And store the L64XX axis index
407 400
           driver_count_local++;
408 401
         }
409 402
       }
410
-      driver_count = driver_count_local;
403
+      if (one_or_more) driver_count = driver_count_local;
411 404
     }
412 405
     break; // only take first axis found
413 406
   }
@@ -494,8 +487,8 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
494 487
   for (uint8_t k = 0; k < driver_count; k++) {
495 488
     uint8_t not_found = true;
496 489
     for (j = 1; j <= L64XX::chain[0]; j++) {
497
-      const char * const ind_axis = index_to_axis[L64XX::chain[j]];
498
-      if (ind_axis[0] == axis_mon[k][0] && ind_axis[1] == axis_mon[k][1]) { // See if a L6470 driver
490
+      PGM_P const str = (PGM_P)pgm_read_ptr(&index_to_axis[L64XX::chain[j]]);
491
+      if (pgm_read_byte(&str[0]) == axis_mon[k][0] && pgm_read_byte(&str[1]) == axis_mon[k][1]) { // See if a L6470 driver
499 492
         not_found = false;
500 493
         break;
501 494
       }
@@ -724,7 +717,8 @@ void L64XX_Marlin::say_axis(const L64XX_axis_t axis, const uint8_t label/*=true*
724 717
   };
725 718
 
726 719
   void L64XX_Marlin::append_stepper_err(char* &p, const uint8_t stepper_index, const char * const err/*=nullptr*/) {
727
-    p += sprintf_P(p, PSTR("Stepper %c%c "), index_to_axis[stepper_index][0], index_to_axis[stepper_index][1]);
720
+    PGM_P const str = (PGM_P)pgm_read_ptr(&index_to_axis[stepper_index]);
721
+    p += sprintf_P(p, PSTR("Stepper %c%c "), pgm_read_byte(&str[0]), pgm_read_byte(&str[1]));
728 722
     if (err) p += sprintf_P(p, err);
729 723
   }
730 724
 

+ 3
- 3
Marlin/src/libs/L64XX/L64XX_Marlin.h View File

@@ -39,9 +39,10 @@ enum L64XX_axis_t : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E
39 39
 
40 40
 class L64XX_Marlin : public L64XXHelper {
41 41
 public:
42
-  static char index_to_axis[MAX_L64XX][3];
42
+  static PGM_P const index_to_axis[MAX_L64XX];
43
+
44
+  static const uint8_t index_to_dir[MAX_L64XX];
43 45
 
44
-  static uint8_t index_to_dir[MAX_L64XX];
45 46
   static uint8_t dir_commands[MAX_L64XX];
46 47
 
47 48
   // Flags to guarantee graceful switch if stepper interrupts L6470 SPI transfer
@@ -69,7 +70,6 @@ public:
69 70
 
70 71
   static void transfer(uint8_t L6470_buf[], const uint8_t length);
71 72
 
72
-  //static char* index_to_axis(const uint8_t index);
73 73
   static void say_axis(const L64XX_axis_t axis, const uint8_t label=true);
74 74
   #if ENABLED(L6470_CHITCHAT)
75 75
     static void error_status_decode(

+ 1
- 1
Marlin/src/module/motion.cpp View File

@@ -111,7 +111,7 @@ xyze_pos_t destination; // {0}
111 111
 
112 112
 // G60/G61 Position Save and Return
113 113
 #if SAVED_POSITIONS
114
-  uint8_t saved_slots;
114
+  uint8_t saved_slots[(SAVED_POSITIONS + 7) >> 3];
115 115
   xyz_pos_t stored_position[SAVED_POSITIONS];
116 116
 #endif
117 117
 

+ 1
- 1
Marlin/src/module/motion.h View File

@@ -67,7 +67,7 @@ extern xyze_pos_t current_position,  // High-level current tool position
67 67
 
68 68
 // G60/G61 Position Save and Return
69 69
 #if SAVED_POSITIONS
70
-  extern uint8_t saved_slots;
70
+  extern uint8_t saved_slots[(SAVED_POSITIONS + 7) >> 3];
71 71
   extern xyz_pos_t stored_position[SAVED_POSITIONS];
72 72
 #endif
73 73
 

+ 20
- 20
Marlin/src/module/planner.cpp View File

@@ -1252,13 +1252,13 @@ void Planner::check_axes_activity() {
1252 1252
   // Disable inactive axes
1253 1253
   //
1254 1254
   #if ENABLED(DISABLE_X)
1255
-    if (!axis_active.x) disable_X();
1255
+    if (!axis_active.x) DISABLE_AXIS_X();
1256 1256
   #endif
1257 1257
   #if ENABLED(DISABLE_Y)
1258
-    if (!axis_active.y) disable_Y();
1258
+    if (!axis_active.y) DISABLE_AXIS_Y();
1259 1259
   #endif
1260 1260
   #if ENABLED(DISABLE_Z)
1261
-    if (!axis_active.z) disable_Z();
1261
+    if (!axis_active.z) DISABLE_AXIS_Z();
1262 1262
   #endif
1263 1263
   #if ENABLED(DISABLE_E)
1264 1264
     if (!axis_active.e) disable_e_steppers();
@@ -1905,29 +1905,29 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
1905 1905
   // Enable active axes
1906 1906
   #if CORE_IS_XY
1907 1907
     if (block->steps.a || block->steps.b) {
1908
-      enable_X();
1909
-      enable_Y();
1908
+      ENABLE_AXIS_X();
1909
+      ENABLE_AXIS_Y();
1910 1910
     }
1911 1911
     #if DISABLED(Z_LATE_ENABLE)
1912
-      if (block->steps.z) enable_Z();
1912
+      if (block->steps.z) ENABLE_AXIS_Z();
1913 1913
     #endif
1914 1914
   #elif CORE_IS_XZ
1915 1915
     if (block->steps.a || block->steps.c) {
1916
-      enable_X();
1917
-      enable_Z();
1916
+      ENABLE_AXIS_X();
1917
+      ENABLE_AXIS_Z();
1918 1918
     }
1919
-    if (block->steps.y) enable_Y();
1919
+    if (block->steps.y) ENABLE_AXIS_Y();
1920 1920
   #elif CORE_IS_YZ
1921 1921
     if (block->steps.b || block->steps.c) {
1922
-      enable_Y();
1923
-      enable_Z();
1922
+      ENABLE_AXIS_Y();
1923
+      ENABLE_AXIS_Z();
1924 1924
     }
1925
-    if (block->steps.x) enable_X();
1925
+    if (block->steps.x) ENABLE_AXIS_X();
1926 1926
   #else
1927
-    if (block->steps.x) enable_X();
1928
-    if (block->steps.y) enable_Y();
1927
+    if (block->steps.x) ENABLE_AXIS_X();
1928
+    if (block->steps.y) ENABLE_AXIS_Y();
1929 1929
     #if DISABLED(Z_LATE_ENABLE)
1930
-      if (block->steps.z) enable_Z();
1930
+      if (block->steps.z) ENABLE_AXIS_Z();
1931 1931
     #endif
1932 1932
   #endif
1933 1933
 
@@ -1945,27 +1945,27 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
1945 1945
 
1946 1946
         #if HAS_DUPLICATION_MODE
1947 1947
           if (extruder_duplication_enabled && extruder == 0) {
1948
-            enable_E1();
1948
+            ENABLE_AXIS_E1();
1949 1949
             g_uc_extruder_last_move[1] = (BLOCK_BUFFER_SIZE) * 2;
1950 1950
           }
1951 1951
         #endif
1952 1952
 
1953 1953
         #define ENABLE_ONE_E(N) do{ \
1954 1954
           if (extruder == N) { \
1955
-            enable_E##N(); \
1955
+            ENABLE_AXIS_E##N(); \
1956 1956
             g_uc_extruder_last_move[N] = (BLOCK_BUFFER_SIZE) * 2; \
1957 1957
           } \
1958 1958
           else if (!g_uc_extruder_last_move[N]) \
1959
-            disable_E##N(); \
1959
+            DISABLE_AXIS_E##N(); \
1960 1960
         }while(0);
1961 1961
 
1962 1962
       #else
1963 1963
 
1964
-        #define ENABLE_ONE_E(N) enable_E##N();
1964
+        #define ENABLE_ONE_E(N) ENABLE_AXIS_E##N();
1965 1965
 
1966 1966
       #endif
1967 1967
 
1968
-      REPEAT(EXTRUDERS, ENABLE_ONE_E);
1968
+      REPEAT(EXTRUDERS, ENABLE_ONE_E); // (ENABLE_ONE_E must end with semicolon)
1969 1969
     }
1970 1970
   #endif // EXTRUDERS
1971 1971
 

+ 1
- 1
Marlin/src/module/probe.cpp View File

@@ -251,7 +251,7 @@ xyz_pos_t probe_offset; // Initialized by settings.load()
251 251
     #if ENABLED(PROBING_STEPPERS_OFF)
252 252
       disable_e_steppers();
253 253
       #if NONE(DELTA, HOME_AFTER_DEACTIVATE)
254
-        disable_X(); disable_Y();
254
+        DISABLE_AXIS_X(); DISABLE_AXIS_Y();
255 255
       #endif
256 256
     #endif
257 257
     if (p) safe_delay(

+ 8
- 8
Marlin/src/module/stepper.cpp View File

@@ -1927,7 +1927,7 @@ uint32_t Stepper::stepper_block_phase_isr() {
1927 1927
         // If delayed Z enable, enable it now. This option will severely interfere with
1928 1928
         // timing between pulses when chaining motion between blocks, and it could lead
1929 1929
         // to lost steps in both X and Y axis, so avoid using it unless strictly necessary!!
1930
-        if (current_block->steps.z) enable_Z();
1930
+        if (current_block->steps.z) ENABLE_AXIS_Z();
1931 1931
       #endif
1932 1932
 
1933 1933
       // Mark the time_nominal as not calculated yet
@@ -2215,12 +2215,12 @@ void Stepper::init() {
2215 2215
 
2216 2216
   #define _STEP_INIT(AXIS) AXIS ##_STEP_INIT()
2217 2217
   #define _WRITE_STEP(AXIS, HIGHLOW) AXIS ##_STEP_WRITE(HIGHLOW)
2218
-  #define _DISABLE(AXIS) disable_## AXIS()
2218
+  #define _DISABLE_AXIS(AXIS) DISABLE_AXIS_## AXIS()
2219 2219
 
2220 2220
   #define AXIS_INIT(AXIS, PIN) \
2221 2221
     _STEP_INIT(AXIS); \
2222 2222
     _WRITE_STEP(AXIS, _INVERT_STEP_PIN(PIN)); \
2223
-    _DISABLE(AXIS)
2223
+    _DISABLE_AXIS(AXIS)
2224 2224
 
2225 2225
   #define E_AXIS_INIT(NUM) AXIS_INIT(E## NUM, E)
2226 2226
 
@@ -2437,7 +2437,7 @@ void Stepper::report_positions() {
2437 2437
   #endif
2438 2438
   #define EXTRA_CYCLES_BABYSTEP (STEP_PULSE_CYCLES - (CYCLES_EATEN_BABYSTEP))
2439 2439
 
2440
-  #define _ENABLE(AXIS) enable_## AXIS()
2440
+  #define _ENABLE_AXIS(AXIS) ENABLE_AXIS_## AXIS()
2441 2441
   #define _READ_DIR(AXIS) AXIS ##_DIR_READ()
2442 2442
   #define _INVERT_DIR(AXIS) INVERT_## AXIS ##_DIR
2443 2443
   #define _APPLY_DIR(AXIS, INVERT) AXIS ##_APPLY_DIR(INVERT, true)
@@ -2460,7 +2460,7 @@ void Stepper::report_positions() {
2460 2460
 
2461 2461
   #define BABYSTEP_AXIS(AXIS, INVERT, DIR) {            \
2462 2462
       const uint8_t old_dir = _READ_DIR(AXIS);          \
2463
-      _ENABLE(AXIS);                                    \
2463
+      _ENABLE_AXIS(AXIS);                                    \
2464 2464
       DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY);              \
2465 2465
       _APPLY_DIR(AXIS, _INVERT_DIR(AXIS)^DIR^INVERT);   \
2466 2466
       DELAY_NS(MINIMUM_STEPPER_POST_DIR_DELAY);              \
@@ -2523,9 +2523,9 @@ void Stepper::report_positions() {
2523 2523
 
2524 2524
           const bool z_direction = direction ^ BABYSTEP_INVERT_Z;
2525 2525
 
2526
-          enable_X();
2527
-          enable_Y();
2528
-          enable_Z();
2526
+          ENABLE_AXIS_X();
2527
+          ENABLE_AXIS_Y();
2528
+          ENABLE_AXIS_Z();
2529 2529
 
2530 2530
           #if MINIMUM_STEPPER_PRE_DIR_DELAY > 0
2531 2531
             DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY);

+ 50
- 0
Marlin/src/module/stepper/L64xx.h View File

@@ -55,6 +55,9 @@
55 55
     #define X_DIR_INIT()        NOOP
56 56
     #define X_DIR_WRITE(STATE)  L64XX_DIR_WRITE(X, STATE)
57 57
     #define X_DIR_READ()        (stepper##X.getStatus() & STATUS_DIR);
58
+    #if AXIS_DRIVER_TYPE_X(L6470)
59
+      #define DISABLE_STEPPER_X() stepperX.free()
60
+    #endif
58 61
   #endif
59 62
 #endif
60 63
 
@@ -72,6 +75,9 @@
72 75
     #define Y_DIR_INIT()        NOOP
73 76
     #define Y_DIR_WRITE(STATE)  L64XX_DIR_WRITE(Y, STATE)
74 77
     #define Y_DIR_READ()        (stepper##Y.getStatus() & STATUS_DIR);
78
+    #if AXIS_DRIVER_TYPE_Y(L6470)
79
+      #define DISABLE_STEPPER_Y() stepperY.free()
80
+    #endif
75 81
   #endif
76 82
 #endif
77 83
 
@@ -89,6 +95,9 @@
89 95
     #define Z_DIR_INIT()        NOOP
90 96
     #define Z_DIR_WRITE(STATE)  L64XX_DIR_WRITE(Z, STATE)
91 97
     #define Z_DIR_READ()        (stepper##Z.getStatus() & STATUS_DIR);
98
+    #if AXIS_DRIVER_TYPE_Z(L6470)
99
+      #define DISABLE_STEPPER_Z() stepperZ.free()
100
+    #endif
92 101
   #endif
93 102
 #endif
94 103
 
@@ -109,6 +118,10 @@
109 118
   #endif
110 119
 #endif
111 120
 
121
+#if AXIS_DRIVER_TYPE_X2(L6470)
122
+  #define DISABLE_STEPPER_X2() stepperX2.free()
123
+#endif
124
+
112 125
 // Y2 Stepper
113 126
 #if HAS_Y2_ENABLE && AXIS_IS_L64XX(Y2)
114 127
   extern L64XX_CLASS(Y2)         stepperY2;
@@ -126,6 +139,10 @@
126 139
   #endif
127 140
 #endif
128 141
 
142
+#if AXIS_DRIVER_TYPE_Y2(L6470)
143
+  #define DISABLE_STEPPER_Y2() stepperY2.free()
144
+#endif
145
+
129 146
 // Z2 Stepper
130 147
 #if HAS_Z2_ENABLE && AXIS_IS_L64XX(Z2)
131 148
   extern L64XX_CLASS(Z2)         stepperZ2;
@@ -143,6 +160,10 @@
143 160
   #endif
144 161
 #endif
145 162
 
163
+#if AXIS_DRIVER_TYPE_Z2(L6470)
164
+  #define DISABLE_STEPPER_Z2() stepperZ2.free()
165
+#endif
166
+
146 167
 // Z3 Stepper
147 168
 #if HAS_Z3_ENABLE && AXIS_IS_L64XX(Z3)
148 169
   extern L64XX_CLASS(Z3)         stepperZ3;
@@ -160,6 +181,10 @@
160 181
   #endif
161 182
 #endif
162 183
 
184
+#if AXIS_DRIVER_TYPE_Z3(L6470)
185
+  #define DISABLE_STEPPER_Z3() stepperZ3.free()
186
+#endif
187
+
163 188
 // Z4 Stepper
164 189
 #if HAS_Z4_ENABLE && AXIS_IS_L64XX(Z4)
165 190
   extern L64XX_CLASS(Z4)         stepperZ4;
@@ -177,6 +202,10 @@
177 202
   #endif
178 203
 #endif
179 204
 
205
+#if AXIS_DRIVER_TYPE_Z4(L6470)
206
+  #define DISABLE_STEPPER_Z4() stepperZ4.free()
207
+#endif
208
+
180 209
 // E0 Stepper
181 210
 #if AXIS_IS_L64XX(E0)
182 211
   extern L64XX_CLASS(E0)         stepperE0;
@@ -191,6 +220,9 @@
191 220
     #define E0_DIR_INIT()        NOOP
192 221
     #define E0_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E0, STATE)
193 222
     #define E0_DIR_READ()        (stepper##E0.getStatus() & STATUS_DIR);
223
+    #if AXIS_DRIVER_TYPE_E0(L6470)
224
+      #define DISABLE_STEPPER_E0() do{ stepperE0.free(); CBI(axis_known_position, E_AXIS); }while(0)
225
+    #endif
194 226
   #endif
195 227
 #endif
196 228
 
@@ -208,6 +240,9 @@
208 240
     #define E1_DIR_INIT()        NOOP
209 241
     #define E1_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E1, STATE)
210 242
     #define E1_DIR_READ()        (stepper##E1.getStatus() & STATUS_DIR);
243
+    #if AXIS_DRIVER_TYPE_E1(L6470)
244
+      #define DISABLE_STEPPER_E1() do{ stepperE1.free(); CBI(axis_known_position, E_AXIS); }while(0)
245
+    #endif
211 246
   #endif
212 247
 #endif
213 248
 
@@ -225,6 +260,9 @@
225 260
     #define E2_DIR_INIT()        NOOP
226 261
     #define E2_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E2, STATE)
227 262
     #define E2_DIR_READ()        (stepper##E2.getStatus() & STATUS_DIR);
263
+    #if AXIS_DRIVER_TYPE_E2(L6470)
264
+      #define DISABLE_STEPPER_E2() do{ stepperE2.free(); CBI(axis_known_position, E_AXIS); }while(0)
265
+    #endif
228 266
   #endif
229 267
 #endif
230 268
 
@@ -259,6 +297,9 @@
259 297
     #define E4_DIR_INIT()        NOOP
260 298
     #define E4_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E4, STATE)
261 299
     #define E4_DIR_READ()        (stepper##E4.getStatus() & STATUS_DIR);
300
+    #if AXIS_DRIVER_TYPE_E4(L6470)
301
+      #define DISABLE_STEPPER_E4() do{ stepperE4.free(); CBI(axis_known_position, E_AXIS); }while(0)
302
+    #endif
262 303
   #endif
263 304
 #endif
264 305
 
@@ -276,6 +317,9 @@
276 317
     #define E5_DIR_INIT()        NOOP
277 318
     #define E5_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E5, STATE)
278 319
     #define E5_DIR_READ()        (stepper##E5.getStatus() & STATUS_DIR);
320
+    #if AXIS_DRIVER_TYPE_E5(L6470)
321
+      #define DISABLE_STEPPER_E5() do{ stepperE5.free(); CBI(axis_known_position, E_AXIS); }while(0)
322
+    #endif
279 323
   #endif
280 324
 #endif
281 325
 
@@ -293,6 +337,9 @@
293 337
     #define E6_DIR_INIT()        NOOP
294 338
     #define E6_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E6, STATE)
295 339
     #define E6_DIR_READ()        (stepper##E6.getStatus() & STATUS_DIR);
340
+    #if AXIS_DRIVER_TYPE_E6(L6470)
341
+      #define DISABLE_STEPPER_E6() do{ stepperE6.free(); CBI(axis_known_position, E_AXIS); }while(0)
342
+    #endif
296 343
   #endif
297 344
 #endif
298 345
 
@@ -310,5 +357,8 @@
310 357
     #define E7_DIR_INIT()        NOOP
311 358
     #define E7_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E7, STATE)
312 359
     #define E7_DIR_READ()        (stepper##E7.getStatus() & STATUS_DIR);
360
+    #if AXIS_DRIVER_TYPE_E7(L6470)
361
+      #define DISABLE_STEPPER_E7() do{ stepperE7.free(); CBI(axis_known_position, E_AXIS); }while(0)
362
+    #endif
313 363
   #endif
314 364
 #endif

+ 335
- 243
Marlin/src/module/stepper/indirection.h View File

@@ -594,320 +594,412 @@ void reset_stepper_drivers();    // Called by settings.load / settings.reset
594 594
 #endif
595 595
 
596 596
 //
597
-// X, Y, Z Stepper enable / disable
597
+// Individual stepper enable / disable macros
598 598
 //
599
-#if AXIS_DRIVER_TYPE_X(L6470)
600
-  extern L6470 stepperX;
601
-  #define X_enable()  NOOP
602
-  #define X_disable() stepperX.free()
603
-#elif HAS_X_ENABLE
604
-  #define X_enable()  X_ENABLE_WRITE( X_ENABLE_ON)
605
-  #define X_disable() X_ENABLE_WRITE(!X_ENABLE_ON)
606
-#else
607
-  #define X_enable()  NOOP
608
-  #define X_disable() NOOP
609
-#endif
610 599
 
611
-#if AXIS_DRIVER_TYPE_X2(L6470)
612
-  extern L6470 stepperX2;
613
-  #define X2_enable()  NOOP
614
-  #define X2_disable() stepperX2.free()
615
-#elif HAS_X2_ENABLE
616
-  #define X2_enable()  X2_ENABLE_WRITE( X_ENABLE_ON)
617
-  #define X2_disable() X2_ENABLE_WRITE(!X_ENABLE_ON)
618
-#else
619
-  #define X2_enable()  NOOP
620
-  #define X2_disable() NOOP
600
+#ifndef ENABLE_STEPPER_X
601
+  #if HAS_X_ENABLE
602
+    #define  ENABLE_STEPPER_X() X_ENABLE_WRITE( X_ENABLE_ON)
603
+  #else
604
+    #define  ENABLE_STEPPER_X() NOOP
605
+  #endif
621 606
 #endif
622
-
623
-#define  enable_X() do{ X_enable(); X2_enable(); }while(0)
624
-#define disable_X() do{ X_disable(); X2_disable(); CBI(axis_known_position, X_AXIS); }while(0)
625
-
626
-#if AXIS_DRIVER_TYPE_Y(L6470)
627
-  extern L6470 stepperY;
628
-  #define Y_enable()  NOOP
629
-  #define Y_disable() stepperY.free()
630
-#elif HAS_Y_ENABLE
631
-  #define Y_enable()  Y_ENABLE_WRITE( Y_ENABLE_ON)
632
-  #define Y_disable() Y_ENABLE_WRITE(!Y_ENABLE_ON)
633
-#else
634
-  #define Y_enable()  NOOP
635
-  #define Y_disable() NOOP
607
+#ifndef DISABLE_STEPPER_X
608
+  #if HAS_X_ENABLE
609
+    #define DISABLE_STEPPER_X() X_ENABLE_WRITE(!X_ENABLE_ON)
610
+  #else
611
+    #define DISABLE_STEPPER_X() NOOP
612
+  #endif
636 613
 #endif
637 614
 
638
-#if AXIS_DRIVER_TYPE_Y2(L6470)
639
-  extern L6470 stepperY2;
640
-  #define Y2_enable()  NOOP
641
-  #define Y2_disable() stepperY2.free()
642
-#elif HAS_Y2_ENABLE
643
-  #define Y2_enable()  Y2_ENABLE_WRITE( Y_ENABLE_ON)
644
-  #define Y2_disable() Y2_ENABLE_WRITE(!Y_ENABLE_ON)
645
-#else
646
-  #define Y2_enable()  NOOP
647
-  #define Y2_disable() NOOP
615
+#ifndef ENABLE_STEPPER_X2
616
+  #if HAS_X2_ENABLE
617
+    #define  ENABLE_STEPPER_X2() X2_ENABLE_WRITE( X_ENABLE_ON)
618
+  #else
619
+    #define  ENABLE_STEPPER_X2() NOOP
620
+  #endif
621
+#endif
622
+#ifndef DISABLE_STEPPER_X2
623
+  #if HAS_X2_ENABLE
624
+    #define DISABLE_STEPPER_X2() X2_ENABLE_WRITE(!X_ENABLE_ON)
625
+  #else
626
+    #define DISABLE_STEPPER_X2() NOOP
627
+  #endif
648 628
 #endif
649 629
 
650
-#define  enable_Y() do{ Y_enable(); Y2_enable(); }while(0)
651
-#define disable_Y() do{ Y_disable(); Y2_disable(); CBI(axis_known_position, Y_AXIS); }while(0)
652
-
653
-#if AXIS_DRIVER_TYPE_Z(L6470)
654
-  extern L6470 stepperZ;
655
-  #define Z_enable()  NOOP
656
-  #define Z_disable() stepperZ.free()
657
-#elif HAS_Z_ENABLE
658
-  #define Z_enable()  Z_ENABLE_WRITE( Z_ENABLE_ON)
659
-  #define Z_disable() Z_ENABLE_WRITE(!Z_ENABLE_ON)
660
-#else
661
-  #define Z_enable()  NOOP
662
-  #define Z_disable() NOOP
630
+#ifndef ENABLE_STEPPER_Y
631
+  #if HAS_Y_ENABLE
632
+    #define  ENABLE_STEPPER_Y() Y_ENABLE_WRITE( Y_ENABLE_ON)
633
+  #else
634
+    #define  ENABLE_STEPPER_Y() NOOP
635
+  #endif
636
+#endif
637
+#ifndef DISABLE_STEPPER_Y
638
+  #if HAS_Y_ENABLE
639
+    #define DISABLE_STEPPER_Y() Y_ENABLE_WRITE(!Y_ENABLE_ON)
640
+  #else
641
+    #define DISABLE_STEPPER_Y() NOOP
642
+  #endif
663 643
 #endif
664 644
 
665
-#if AXIS_DRIVER_TYPE_Z2(L6470)
666
-  extern L6470 stepperZ2;
667
-  #define Z2_enable()  NOOP
668
-  #define Z2_disable() stepperZ2.free()
669
-#elif HAS_Z2_ENABLE
670
-  #define Z2_enable()  Z2_ENABLE_WRITE( Z_ENABLE_ON)
671
-  #define Z2_disable() Z2_ENABLE_WRITE(!Z_ENABLE_ON)
672
-#else
673
-  #define Z2_enable()  NOOP
674
-  #define Z2_disable() NOOP
645
+#ifndef ENABLE_STEPPER_Y2
646
+  #if HAS_Y2_ENABLE
647
+    #define  ENABLE_STEPPER_Y2() Y2_ENABLE_WRITE( Y_ENABLE_ON)
648
+  #else
649
+    #define  ENABLE_STEPPER_Y2() NOOP
650
+  #endif
651
+#endif
652
+#ifndef DISABLE_STEPPER_Y2
653
+  #if HAS_Y2_ENABLE
654
+    #define DISABLE_STEPPER_Y2() Y2_ENABLE_WRITE(!Y_ENABLE_ON)
655
+  #else
656
+    #define DISABLE_STEPPER_Y2() NOOP
657
+  #endif
675 658
 #endif
676 659
 
677
-#if AXIS_DRIVER_TYPE_Z3(L6470)
678
-  extern L6470 stepperZ3;
679
-  #define Z3_enable()  NOOP
680
-  #define Z3_disable() stepperZ3.free()
681
-#elif HAS_Z3_ENABLE
682
-  #define Z3_enable()  Z3_ENABLE_WRITE( Z_ENABLE_ON)
683
-  #define Z3_disable() Z3_ENABLE_WRITE(!Z_ENABLE_ON)
684
-#else
685
-  #define Z3_enable()  NOOP
686
-  #define Z3_disable() NOOP
660
+#ifndef ENABLE_STEPPER_Z
661
+  #if HAS_Z_ENABLE
662
+    #define  ENABLE_STEPPER_Z() Z_ENABLE_WRITE( Z_ENABLE_ON)
663
+  #else
664
+    #define  ENABLE_STEPPER_Z() NOOP
665
+  #endif
666
+#endif
667
+#ifndef DISABLE_STEPPER_Z
668
+  #if HAS_Z_ENABLE
669
+    #define DISABLE_STEPPER_Z() Z_ENABLE_WRITE(!Z_ENABLE_ON)
670
+  #else
671
+    #define DISABLE_STEPPER_Z() NOOP
672
+  #endif
687 673
 #endif
688 674
 
689
-#if AXIS_DRIVER_TYPE_Z4(L6470)
690
-  extern L6470 stepperZ4;
691
-  #define Z4_enable()  NOOP
692
-  #define Z4_disable() stepperZ4.free()
693
-#elif HAS_Z4_ENABLE
694
-  #define Z4_enable()  Z4_ENABLE_WRITE( Z_ENABLE_ON)
695
-  #define Z4_disable() Z4_ENABLE_WRITE(!Z_ENABLE_ON)
696
-#else
697
-  #define Z4_enable()  NOOP
698
-  #define Z4_disable() NOOP
675
+#ifndef ENABLE_STEPPER_Z2
676
+  #if HAS_Z2_ENABLE
677
+    #define  ENABLE_STEPPER_Z2() Z2_ENABLE_WRITE( Z_ENABLE_ON)
678
+  #else
679
+    #define  ENABLE_STEPPER_Z2() NOOP
680
+  #endif
681
+#endif
682
+#ifndef DISABLE_STEPPER_Z2
683
+  #if HAS_Z2_ENABLE
684
+    #define DISABLE_STEPPER_Z2() Z2_ENABLE_WRITE(!Z_ENABLE_ON)
685
+  #else
686
+    #define DISABLE_STEPPER_Z2() NOOP
687
+  #endif
699 688
 #endif
700 689
 
701
-#define  enable_Z() do{ Z_enable();  Z2_enable();  Z3_enable();  Z4_enable(); }while(0)
702
-#define disable_Z() do{ Z_disable(); Z2_disable(); Z3_disable(); Z4_disable(); CBI(axis_known_position, Z_AXIS); }while(0)
690
+#ifndef ENABLE_STEPPER_Z3
691
+  #if HAS_Z3_ENABLE
692
+    #define  ENABLE_STEPPER_Z3() Z3_ENABLE_WRITE( Z_ENABLE_ON)
693
+  #else
694
+    #define  ENABLE_STEPPER_Z3() NOOP
695
+  #endif
696
+#endif
697
+#ifndef DISABLE_STEPPER_Z3
698
+  #if HAS_Z3_ENABLE
699
+    #define DISABLE_STEPPER_Z3() Z3_ENABLE_WRITE(!Z_ENABLE_ON)
700
+  #else
701
+    #define DISABLE_STEPPER_Z3() NOOP
702
+  #endif
703
+#endif
703 704
 
704
-//
705
-// Extruder Stepper enable / disable
706
-//
705
+#ifndef ENABLE_STEPPER_Z4
706
+  #if HAS_Z4_ENABLE
707
+    #define  ENABLE_STEPPER_Z4() Z4_ENABLE_WRITE( Z_ENABLE_ON)
708
+  #else
709
+    #define  ENABLE_STEPPER_Z4() NOOP
710
+  #endif
711
+#endif
712
+#ifndef DISABLE_STEPPER_Z4
713
+  #if HAS_Z4_ENABLE
714
+    #define DISABLE_STEPPER_Z4() Z4_ENABLE_WRITE(!Z_ENABLE_ON)
715
+  #else
716
+    #define DISABLE_STEPPER_Z4() NOOP
717
+  #endif
718
+#endif
707 719
 
708
-// define the individual enables/disables
709
-#if AXIS_DRIVER_TYPE_E0(L6470)
710
-  extern L6470 stepperE0;
711
-  #define  E0_enable() NOOP
712
-  #define E0_disable() do{ stepperE0.free(); CBI(axis_known_position, E_AXIS); }while(0)
713
-#elif HAS_E0_ENABLE
714
-  #define  E0_enable() E0_ENABLE_WRITE( E_ENABLE_ON)
715
-  #define E0_disable() E0_ENABLE_WRITE(!E_ENABLE_ON)
716
-#else
717
-  #define  E0_enable() NOOP
718
-  #define E0_disable() NOOP
720
+#ifndef ENABLE_STEPPER_E0
721
+  #if HAS_E0_ENABLE
722
+    #define  ENABLE_STEPPER_E0() E0_ENABLE_WRITE( E_ENABLE_ON)
723
+  #else
724
+    #define  ENABLE_STEPPER_E0() NOOP
725
+  #endif
726
+#endif
727
+#ifndef DISABLE_STEPPER_E0
728
+  #if HAS_E0_ENABLE
729
+    #define DISABLE_STEPPER_E0() E0_ENABLE_WRITE(!E_ENABLE_ON)
730
+  #else
731
+    #define DISABLE_STEPPER_E0() NOOP
732
+  #endif
719 733
 #endif
720 734
 
721
-#if AXIS_DRIVER_TYPE_E1(L6470)
722
-  extern L6470 stepperE1;
723
-  #define  E1_enable() NOOP
724
-  #define E1_disable() do{ stepperE1.free(); CBI(axis_known_position, E_AXIS); }while(0)
725
-#elif E_STEPPERS > 1 && HAS_E1_ENABLE
726
-  #define  E1_enable() E1_ENABLE_WRITE( E_ENABLE_ON)
727
-  #define E1_disable() E1_ENABLE_WRITE(!E_ENABLE_ON)
728
-#else
729
-  #define  E1_enable() NOOP
730
-  #define E1_disable() NOOP
735
+#ifndef ENABLE_STEPPER_E1
736
+  #if E_STEPPERS > 1 && HAS_E1_ENABLE
737
+    #define  ENABLE_STEPPER_E1() E1_ENABLE_WRITE( E_ENABLE_ON)
738
+  #else
739
+    #define  ENABLE_STEPPER_E1() NOOP
740
+  #endif
741
+#endif
742
+#ifndef DISABLE_STEPPER_E1
743
+  #if E_STEPPERS > 1 && HAS_E1_ENABLE
744
+    #define DISABLE_STEPPER_E1() E1_ENABLE_WRITE(!E_ENABLE_ON)
745
+  #else
746
+    #define DISABLE_STEPPER_E1() NOOP
747
+  #endif
731 748
 #endif
732 749
 
733
-#if AXIS_DRIVER_TYPE_E2(L6470)
734
-  extern L6470 stepperE2;
735
-  #define  E2_enable() NOOP
736
-  #define E2_disable() do{ stepperE2.free(); CBI(axis_known_position, E_AXIS); }while(0)
737
-#elif E_STEPPERS > 2 && HAS_E2_ENABLE
738
-  #define  E2_enable() E2_ENABLE_WRITE( E_ENABLE_ON)
739
-  #define E2_disable() E2_ENABLE_WRITE(!E_ENABLE_ON)
740
-#else
741
-  #define  E2_enable() NOOP
742
-  #define E2_disable() NOOP
750
+#ifndef ENABLE_STEPPER_E2
751
+  #if E_STEPPERS > 2 && HAS_E2_ENABLE
752
+    #define  ENABLE_STEPPER_E2() E2_ENABLE_WRITE( E_ENABLE_ON)
753
+  #else
754
+    #define  ENABLE_STEPPER_E2() NOOP
755
+  #endif
756
+#endif
757
+#ifndef DISABLE_STEPPER_E2
758
+  #if E_STEPPERS > 2 && HAS_E2_ENABLE
759
+    #define DISABLE_STEPPER_E2() E2_ENABLE_WRITE(!E_ENABLE_ON)
760
+  #else
761
+    #define DISABLE_STEPPER_E2() NOOP
762
+  #endif
743 763
 #endif
744 764
 
745
-#if AXIS_DRIVER_TYPE_E3(L6470)
746
-  extern L6470 stepperE3;
747
-  #define  E3_enable() NOOP
748
-  #define E3_disable() do{ stepperE3.free(); CBI(axis_known_position, E_AXIS); }while(0)
749
-#elif E_STEPPERS > 3 && HAS_E3_ENABLE
750
-  #define  E3_enable() E3_ENABLE_WRITE( E_ENABLE_ON)
751
-  #define E3_disable() E3_ENABLE_WRITE(!E_ENABLE_ON)
752
-#else
753
-  #define  E3_enable() NOOP
754
-  #define E3_disable() NOOP
765
+#ifndef ENABLE_STEPPER_E3
766
+  #if E_STEPPERS > 3 && HAS_E3_ENABLE
767
+    #define  ENABLE_STEPPER_E3() E3_ENABLE_WRITE( E_ENABLE_ON)
768
+  #else
769
+    #define  ENABLE_STEPPER_E3() NOOP
770
+  #endif
771
+#endif
772
+#ifndef DISABLE_STEPPER_E3
773
+  #if E_STEPPERS > 3 && HAS_E3_ENABLE
774
+    #define DISABLE_STEPPER_E3() E3_ENABLE_WRITE(!E_ENABLE_ON)
775
+  #else
776
+    #define DISABLE_STEPPER_E3() NOOP
777
+  #endif
755 778
 #endif
756 779
 
757
-#if AXIS_DRIVER_TYPE_E4(L6470)
758
-  extern L6470 stepperE4;
759
-  #define  E4_enable() NOOP
760
-  #define E4_disable() do{ stepperE4.free(); CBI(axis_known_position, E_AXIS); }while(0)
761
-#elif E_STEPPERS > 4 && HAS_E4_ENABLE
762
-  #define  E4_enable() E4_ENABLE_WRITE( E_ENABLE_ON)
763
-  #define E4_disable() E4_ENABLE_WRITE(!E_ENABLE_ON)
764
-#else
765
-  #define  E4_enable() NOOP
766
-  #define E4_disable() NOOP
780
+#ifndef ENABLE_STEPPER_E4
781
+  #if E_STEPPERS > 4 && HAS_E4_ENABLE
782
+    #define  ENABLE_STEPPER_E4() E4_ENABLE_WRITE( E_ENABLE_ON)
783
+  #else
784
+    #define  ENABLE_STEPPER_E4() NOOP
785
+  #endif
786
+#endif
787
+#ifndef DISABLE_STEPPER_E4
788
+  #if E_STEPPERS > 4 && HAS_E4_ENABLE
789
+    #define DISABLE_STEPPER_E4() E4_ENABLE_WRITE(!E_ENABLE_ON)
790
+  #else
791
+    #define DISABLE_STEPPER_E4() NOOP
792
+  #endif
767 793
 #endif
768 794
 
769
-#if AXIS_DRIVER_TYPE_E5(L6470)
770
-  extern L6470 stepperE5;
771
-  #define  E5_enable() NOOP
772
-  #define E5_disable() do{ stepperE5.free(); CBI(axis_known_position, E_AXIS); }while(0)
773
-#elif E_STEPPERS > 5 && HAS_E5_ENABLE
774
-  #define  E5_enable() E5_ENABLE_WRITE( E_ENABLE_ON)
775
-  #define E5_disable() E5_ENABLE_WRITE(!E_ENABLE_ON)
776
-#else
777
-  #define  E5_enable() NOOP
778
-  #define E5_disable() NOOP
795
+#ifndef ENABLE_STEPPER_E5
796
+  #if E_STEPPERS > 5 && HAS_E5_ENABLE
797
+    #define  ENABLE_STEPPER_E5() E5_ENABLE_WRITE( E_ENABLE_ON)
798
+  #else
799
+    #define  ENABLE_STEPPER_E5() NOOP
800
+  #endif
801
+#endif
802
+#ifndef DISABLE_STEPPER_E5
803
+  #if E_STEPPERS > 5 && HAS_E5_ENABLE
804
+    #define DISABLE_STEPPER_E5() E5_ENABLE_WRITE(!E_ENABLE_ON)
805
+  #else
806
+    #define DISABLE_STEPPER_E5() NOOP
807
+  #endif
779 808
 #endif
780 809
 
781
-#if AXIS_DRIVER_TYPE_E6(L6470)
782
-  extern L6470 stepperE6;
783
-  #define  E6_enable() NOOP
784
-  #define E6_disable() do{ stepperE6.free(); CBI(axis_known_position, E_AXIS); }while(0)
785
-#elif E_STEPPERS > 6 && HAS_E6_ENABLE
786
-  #define  E6_enable() E6_ENABLE_WRITE( E_ENABLE_ON)
787
-  #define E6_disable() E6_ENABLE_WRITE(!E_ENABLE_ON)
788
-#else
789
-  #define  E6_enable() NOOP
790
-  #define E6_disable() NOOP
810
+#ifndef ENABLE_STEPPER_E6
811
+  #if E_STEPPERS > 6 && HAS_E6_ENABLE
812
+    #define  ENABLE_STEPPER_E6() E6_ENABLE_WRITE( E_ENABLE_ON)
813
+  #else
814
+    #define  ENABLE_STEPPER_E6() NOOP
815
+  #endif
816
+#endif
817
+#ifndef DISABLE_STEPPER_E6
818
+  #if E_STEPPERS > 6 && HAS_E6_ENABLE
819
+    #define DISABLE_STEPPER_E6() E6_ENABLE_WRITE(!E_ENABLE_ON)
820
+  #else
821
+    #define DISABLE_STEPPER_E6() NOOP
822
+  #endif
791 823
 #endif
792 824
 
793
-#if AXIS_DRIVER_TYPE_E7(L6470)
794
-  extern L6470 stepperE7;
795
-  #define  E7_enable() NOOP
796
-  #define E7_disable() do{ stepperE7.free(); CBI(axis_known_position, E_AXIS); }while(0)
797
-#elif E_STEPPERS > 7 && HAS_E7_ENABLE
798
-  #define  E7_enable() E7_ENABLE_WRITE( E_ENABLE_ON)
799
-  #define E7_disable() E7_ENABLE_WRITE(!E_ENABLE_ON)
800
-#else
801
-  #define  E7_enable() NOOP
802
-  #define E7_disable() NOOP
825
+#ifndef ENABLE_STEPPER_E7
826
+  #if E_STEPPERS > 7 && HAS_E7_ENABLE
827
+    #define  ENABLE_STEPPER_E7() E7_ENABLE_WRITE( E_ENABLE_ON)
828
+  #else
829
+    #define  ENABLE_STEPPER_E7() NOOP
830
+  #endif
803 831
 #endif
832
+#ifndef DISABLE_STEPPER_E7
833
+  #if E_STEPPERS > 7 && HAS_E7_ENABLE
834
+    #define DISABLE_STEPPER_E7() E7_ENABLE_WRITE(!E_ENABLE_ON)
835
+  #else
836
+    #define DISABLE_STEPPER_E7() NOOP
837
+  #endif
838
+#endif
839
+
840
+//
841
+// Axis steppers enable / disable macros
842
+//
843
+
844
+#define  ENABLE_AXIS_X() do{ ENABLE_STEPPER_X(); ENABLE_STEPPER_X2(); }while(0)
845
+#define DISABLE_AXIS_X() do{ DISABLE_STEPPER_X(); DISABLE_STEPPER_X2(); CBI(axis_known_position, X_AXIS); }while(0)
846
+
847
+#define  ENABLE_AXIS_Y() do{ ENABLE_STEPPER_Y(); ENABLE_STEPPER_Y2(); }while(0)
848
+#define DISABLE_AXIS_Y() do{ DISABLE_STEPPER_Y(); DISABLE_STEPPER_Y2(); CBI(axis_known_position, Y_AXIS); }while(0)
849
+
850
+#define  ENABLE_AXIS_Z() do{ ENABLE_STEPPER_Z();  ENABLE_STEPPER_Z2();  ENABLE_STEPPER_Z3();  ENABLE_STEPPER_Z4(); }while(0)
851
+#define DISABLE_AXIS_Z() do{ DISABLE_STEPPER_Z(); DISABLE_STEPPER_Z2(); DISABLE_STEPPER_Z3(); DISABLE_STEPPER_Z4(); CBI(axis_known_position, Z_AXIS); }while(0)
852
+
853
+//
854
+// Extruder steppers enable / disable macros
855
+//
804 856
 
805 857
 #if ENABLED(MIXING_EXTRUDER)
806 858
 
807 859
   /**
808
-   * Mixing steppers synchronize their enable (and direction) together
860
+   * Mixing steppers keep all their enable (and direction) states synchronized
809 861
    */
810 862
   #if MIXING_STEPPERS > 7
811
-    #define  enable_E0() { E0_enable();  E1_enable();  E2_enable();  E3_enable();  E4_enable();  E5_enable();  E6_enable();  E7_enable(); }
812
-    #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); E6_disable(); E7_disable(); }
863
+    #define  ENABLE_AXIS_E0() { ENABLE_STEPPER_E0();  ENABLE_STEPPER_E1();  ENABLE_STEPPER_E2();  ENABLE_STEPPER_E3();  ENABLE_STEPPER_E4();  ENABLE_STEPPER_E5();  ENABLE_STEPPER_E6();  ENABLE_STEPPER_E7(); }
864
+    #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); DISABLE_STEPPER_E3(); DISABLE_STEPPER_E4(); DISABLE_STEPPER_E5(); DISABLE_STEPPER_E6(); DISABLE_STEPPER_E7(); }
813 865
   #elif MIXING_STEPPERS > 6
814
-    #define  enable_E0() { E0_enable();  E1_enable();  E2_enable();  E3_enable();  E4_enable();  E5_enable();  E6_enable(); }
815
-    #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); E6_disable(); }
866
+    #define  ENABLE_AXIS_E0() { ENABLE_STEPPER_E0();  ENABLE_STEPPER_E1();  ENABLE_STEPPER_E2();  ENABLE_STEPPER_E3();  ENABLE_STEPPER_E4();  ENABLE_STEPPER_E5();  ENABLE_STEPPER_E6(); }
867
+    #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); DISABLE_STEPPER_E3(); DISABLE_STEPPER_E4(); DISABLE_STEPPER_E5(); DISABLE_STEPPER_E6(); }
816 868
   #elif MIXING_STEPPERS > 5
817
-    #define  enable_E0() { E0_enable();  E1_enable();  E2_enable();  E3_enable();  E4_enable();  E5_enable(); }
818
-    #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); }
869
+    #define  ENABLE_AXIS_E0() { ENABLE_STEPPER_E0();  ENABLE_STEPPER_E1();  ENABLE_STEPPER_E2();  ENABLE_STEPPER_E3();  ENABLE_STEPPER_E4();  ENABLE_STEPPER_E5(); }
870
+    #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); DISABLE_STEPPER_E3(); DISABLE_STEPPER_E4(); DISABLE_STEPPER_E5(); }
819 871
   #elif MIXING_STEPPERS > 4
820
-    #define  enable_E0() { E0_enable();  E1_enable();  E2_enable();  E3_enable();  E4_enable(); }
821
-    #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); }
872
+    #define  ENABLE_AXIS_E0() { ENABLE_STEPPER_E0();  ENABLE_STEPPER_E1();  ENABLE_STEPPER_E2();  ENABLE_STEPPER_E3();  ENABLE_STEPPER_E4(); }
873
+    #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); DISABLE_STEPPER_E3(); DISABLE_STEPPER_E4(); }
822 874
   #elif MIXING_STEPPERS > 3
823
-    #define  enable_E0() { E0_enable();  E1_enable();  E2_enable();  E3_enable(); }
824
-    #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); }
875
+    #define  ENABLE_AXIS_E0() { ENABLE_STEPPER_E0();  ENABLE_STEPPER_E1();  ENABLE_STEPPER_E2();  ENABLE_STEPPER_E3(); }
876
+    #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); DISABLE_STEPPER_E3(); }
825 877
   #elif MIXING_STEPPERS > 2
826
-    #define  enable_E0() { E0_enable();  E1_enable();  E2_enable(); }
827
-    #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); }
828
-  #else
829
-    #define  enable_E0() { E0_enable();  E1_enable(); }
830
-    #define disable_E0() { E0_disable(); E1_disable(); }
831
-  #endif
832
-  #define  enable_E1() NOOP
833
-  #define disable_E1() NOOP
834
-  #define  enable_E2() NOOP
835
-  #define disable_E2() NOOP
836
-  #define  enable_E3() NOOP
837
-  #define disable_E3() NOOP
838
-  #define  enable_E4() NOOP
839
-  #define disable_E4() NOOP
840
-  #define  enable_E5() NOOP
841
-  #define disable_E5() NOOP
842
-  #define  enable_E6() NOOP
843
-  #define disable_E6() NOOP
844
-  #define  enable_E7() NOOP
845
-  #define disable_E7() NOOP
846
-
847
-#else // !MIXING_EXTRUDER
878
+    #define  ENABLE_AXIS_E0() { ENABLE_STEPPER_E0();  ENABLE_STEPPER_E1();  ENABLE_STEPPER_E2(); }
879
+    #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); DISABLE_STEPPER_E2(); }
880
+  #else
881
+    #define  ENABLE_AXIS_E0() { ENABLE_STEPPER_E0();  ENABLE_STEPPER_E1(); }
882
+    #define DISABLE_AXIS_E0() { DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); }
883
+  #endif
848 884
 
849
-  #if HAS_E0_ENABLE
850
-    #define  enable_E0() E0_enable()
851
-    #define disable_E0() E0_disable()
885
+#endif // !MIXING_EXTRUDER
886
+
887
+#ifndef ENABLE_AXIS_E0
888
+  #if E_STEPPERS > 0 && HAS_E0_ENABLE
889
+    #define  ENABLE_AXIS_E0() ENABLE_STEPPER_E0()
852 890
   #else
853
-    #define  enable_E0() NOOP
854
-    #define disable_E0() NOOP
891
+    #define  ENABLE_AXIS_E0() NOOP
855 892
   #endif
893
+#endif
894
+#ifndef DISABLE_AXIS_E0
895
+  #if E_STEPPERS > 0 && HAS_E0_DISABLE
896
+    #define DISABLE_AXIS_E0() DISABLE_STEPPER_E0()
897
+  #else
898
+    #define DISABLE_AXIS_E0() NOOP
899
+  #endif
900
+#endif
856 901
 
902
+#ifndef ENABLE_AXIS_E1
857 903
   #if E_STEPPERS > 1 && HAS_E1_ENABLE
858
-    #define  enable_E1() E1_enable()
859
-    #define disable_E1() E1_disable()
904
+    #define  ENABLE_AXIS_E1() ENABLE_STEPPER_E1()
860 905
   #else
861
-    #define  enable_E1() NOOP
862
-    #define disable_E1() NOOP
906
+    #define  ENABLE_AXIS_E1() NOOP
863 907
   #endif
908
+#endif
909
+#ifndef DISABLE_AXIS_E1
910
+  #if E_STEPPERS > 1 && HAS_E1_DISABLE
911
+    #define DISABLE_AXIS_E1() DISABLE_STEPPER_E1()
912
+  #else
913
+    #define DISABLE_AXIS_E1() NOOP
914
+  #endif
915
+#endif
864 916
 
917
+#ifndef ENABLE_AXIS_E2
865 918
   #if E_STEPPERS > 2 && HAS_E2_ENABLE
866
-    #define  enable_E2() E2_enable()
867
-    #define disable_E2() E2_disable()
919
+    #define  ENABLE_AXIS_E2() ENABLE_STEPPER_E2()
920
+  #else
921
+    #define  ENABLE_AXIS_E2() NOOP
922
+  #endif
923
+#endif
924
+#ifndef DISABLE_AXIS_E2
925
+  #if E_STEPPERS > 2 && HAS_E2_DISABLE
926
+    #define DISABLE_AXIS_E2() DISABLE_STEPPER_E2()
868 927
   #else
869
-    #define  enable_E2() NOOP
870
-    #define disable_E2() NOOP
928
+    #define DISABLE_AXIS_E2() NOOP
871 929
   #endif
930
+#endif
872 931
 
932
+#ifndef ENABLE_AXIS_E3
873 933
   #if E_STEPPERS > 3 && HAS_E3_ENABLE
874
-    #define  enable_E3() E3_enable()
875
-    #define disable_E3() E3_disable()
934
+    #define  ENABLE_AXIS_E3() ENABLE_STEPPER_E3()
876 935
   #else
877
-    #define  enable_E3() NOOP
878
-    #define disable_E3() NOOP
936
+    #define  ENABLE_AXIS_E3() NOOP
879 937
   #endif
938
+#endif
939
+#ifndef DISABLE_AXIS_E3
940
+  #if E_STEPPERS > 3 && HAS_E3_DISABLE
941
+    #define DISABLE_AXIS_E3() DISABLE_STEPPER_E3()
942
+  #else
943
+    #define DISABLE_AXIS_E3() NOOP
944
+  #endif
945
+#endif
880 946
 
947
+#ifndef ENABLE_AXIS_E4
881 948
   #if E_STEPPERS > 4 && HAS_E4_ENABLE
882
-    #define  enable_E4() E4_enable()
883
-    #define disable_E4() E4_disable()
949
+    #define  ENABLE_AXIS_E4() ENABLE_STEPPER_E4()
950
+  #else
951
+    #define  ENABLE_AXIS_E4() NOOP
952
+  #endif
953
+#endif
954
+#ifndef DISABLE_AXIS_E4
955
+  #if E_STEPPERS > 4 && HAS_E4_DISABLE
956
+    #define DISABLE_AXIS_E4() DISABLE_STEPPER_E4()
884 957
   #else
885
-    #define  enable_E4() NOOP
886
-    #define disable_E4() NOOP
958
+    #define DISABLE_AXIS_E4() NOOP
887 959
   #endif
960
+#endif
888 961
 
962
+#ifndef ENABLE_AXIS_E5
889 963
   #if E_STEPPERS > 5 && HAS_E5_ENABLE
890
-    #define  enable_E5() E5_enable()
891
-    #define disable_E5() E5_disable()
964
+    #define  ENABLE_AXIS_E5() ENABLE_STEPPER_E5()
892 965
   #else
893
-    #define  enable_E5() NOOP
894
-    #define disable_E5() NOOP
966
+    #define  ENABLE_AXIS_E5() NOOP
895 967
   #endif
968
+#endif
969
+#ifndef DISABLE_AXIS_E5
970
+  #if E_STEPPERS > 5 && HAS_E5_DISABLE
971
+    #define DISABLE_AXIS_E5() DISABLE_STEPPER_E5()
972
+  #else
973
+    #define DISABLE_AXIS_E5() NOOP
974
+  #endif
975
+#endif
896 976
 
977
+#ifndef ENABLE_AXIS_E6
897 978
   #if E_STEPPERS > 6 && HAS_E6_ENABLE
898
-    #define  enable_E6() E6_enable()
899
-    #define disable_E6() E6_disable()
979
+    #define  ENABLE_AXIS_E6() ENABLE_STEPPER_E6()
900 980
   #else
901
-    #define  enable_E6() NOOP
902
-    #define disable_E6() NOOP
981
+    #define  ENABLE_AXIS_E6() NOOP
903 982
   #endif
983
+#endif
984
+#ifndef DISABLE_AXIS_E6
985
+  #if E_STEPPERS > 6 && HAS_E6_DISABLE
986
+    #define DISABLE_AXIS_E6() DISABLE_STEPPER_E6()
987
+  #else
988
+    #define DISABLE_AXIS_E6() NOOP
989
+  #endif
990
+#endif
904 991
 
992
+#ifndef ENABLE_AXIS_E7
905 993
   #if E_STEPPERS > 7 && HAS_E7_ENABLE
906
-    #define  enable_E7() E7_enable()
907
-    #define disable_E7() E7_disable()
994
+    #define  ENABLE_AXIS_E7() ENABLE_STEPPER_E7()
908 995
   #else
909
-    #define  enable_E7() NOOP
910
-    #define disable_E7() NOOP
996
+    #define  ENABLE_AXIS_E7() NOOP
911 997
   #endif
912
-
913
-#endif // !MIXING_EXTRUDER
998
+#endif
999
+#ifndef DISABLE_AXIS_E7
1000
+  #if E_STEPPERS > 7 && HAS_E7_DISABLE
1001
+    #define DISABLE_AXIS_E7() DISABLE_STEPPER_E7()
1002
+  #else
1003
+    #define DISABLE_AXIS_E7() NOOP
1004
+  #endif
1005
+#endif

+ 37
- 24
Marlin/src/module/temperature.cpp View File

@@ -220,10 +220,10 @@ Temperature thermalManager;
220 220
 #endif // FAN_COUNT > 0
221 221
 
222 222
 #if WATCH_HOTENDS
223
-  heater_watch_t Temperature::watch_hotend[HOTENDS]; // = { { 0 } }
223
+  hotend_watch_t Temperature::watch_hotend[HOTENDS]; // = { { 0 } }
224 224
 #endif
225 225
 #if HEATER_IDLE_HANDLER
226
-  heater_idle_t Temperature::hotend_idle[HOTENDS]; // = { { 0 } }
226
+  hotend_idle_t Temperature::hotend_idle[HOTENDS]; // = { { 0 } }
227 227
 #endif
228 228
 
229 229
 #if HAS_HEATED_BED
@@ -236,13 +236,13 @@ Temperature thermalManager;
236 236
     int16_t Temperature::maxtemp_raw_BED = HEATER_BED_RAW_HI_TEMP;
237 237
   #endif
238 238
   #if WATCH_BED
239
-    heater_watch_t Temperature::watch_bed; // = { 0 }
239
+    bed_watch_t Temperature::watch_bed; // = { 0 }
240 240
   #endif
241 241
   #if DISABLED(PIDTEMPBED)
242 242
     millis_t Temperature::next_bed_check_ms;
243 243
   #endif
244 244
   #if HEATER_IDLE_HANDLER
245
-    heater_idle_t Temperature::bed_idle; // = { 0 }
245
+    hotend_idle_t Temperature::bed_idle; // = { 0 }
246 246
   #endif
247 247
 #endif // HAS_HEATED_BED
248 248
 
@@ -256,7 +256,7 @@ Temperature thermalManager;
256 256
       int16_t Temperature::maxtemp_raw_CHAMBER = HEATER_CHAMBER_RAW_HI_TEMP;
257 257
     #endif
258 258
     #if WATCH_CHAMBER
259
-      heater_watch_t Temperature::watch_chamber{0};
259
+      chamber_watch_t Temperature::watch_chamber{0};
260 260
     #endif
261 261
     millis_t Temperature::next_chamber_check_ms;
262 262
   #endif // HAS_HEATED_CHAMBER
@@ -1974,12 +1974,7 @@ void Temperature::init() {
1974 1974
    */
1975 1975
   void Temperature::start_watching_hotend(const uint8_t E_NAME) {
1976 1976
     const uint8_t ee = HOTEND_INDEX;
1977
-    if (degTargetHotend(ee) && degHotend(ee) < degTargetHotend(ee) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) {
1978
-      watch_hotend[ee].target = degHotend(ee) + WATCH_TEMP_INCREASE;
1979
-      watch_hotend[ee].next_ms = millis() + (WATCH_TEMP_PERIOD) * 1000UL;
1980
-    }
1981
-    else
1982
-      watch_hotend[ee].next_ms = 0;
1977
+    watch_hotend[ee].restart(degHotend(ee), degTargetHotend(ee));
1983 1978
   }
1984 1979
 #endif
1985 1980
 
@@ -1990,12 +1985,7 @@ void Temperature::init() {
1990 1985
    * This is called when the temperature is set. (M140, M190)
1991 1986
    */
1992 1987
   void Temperature::start_watching_bed() {
1993
-    if (degTargetBed() && degBed() < degTargetBed() - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) {
1994
-      watch_bed.target = degBed() + WATCH_BED_TEMP_INCREASE;
1995
-      watch_bed.next_ms = millis() + (WATCH_BED_TEMP_PERIOD) * 1000UL;
1996
-    }
1997
-    else
1998
-      watch_bed.next_ms = 0;
1988
+    watch_bed.restart(degBed(), degTargetBed());
1999 1989
   }
2000 1990
 #endif
2001 1991
 
@@ -2006,12 +1996,7 @@ void Temperature::init() {
2006 1996
    * This is called when the temperature is set. (M141, M191)
2007 1997
    */
2008 1998
   void Temperature::start_watching_chamber() {
2009
-    if (degChamber() < degTargetChamber() - (WATCH_CHAMBER_TEMP_INCREASE + TEMP_CHAMBER_HYSTERESIS + 1)) {
2010
-      watch_chamber.target = degChamber() + WATCH_CHAMBER_TEMP_INCREASE;
2011
-      watch_chamber.next_ms = millis() + (WATCH_CHAMBER_TEMP_PERIOD) * 1000UL;
2012
-    }
2013
-    else
2014
-      watch_chamber.next_ms = 0;
1999
+    watch_chamber.restart(degChamber(), degTargetChamber());
2015 2000
   }
2016 2001
 #endif
2017 2002
 
@@ -2154,6 +2139,34 @@ void Temperature::disable_all_heaters() {
2154 2139
   #endif
2155 2140
 }
2156 2141
 
2142
+#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
2143
+
2144
+  bool Temperature::over_autostart_threshold() {
2145
+    #if HOTENDS
2146
+      HOTEND_LOOP() if (degTargetHotend(e) < (EXTRUDE_MINTEMP) / 2) return true;
2147
+    #endif
2148
+    #if HAS_HEATED_BED
2149
+      if (degTargetBed() > BED_MINTEMP) return true;
2150
+    #endif
2151
+    #if HAS_HEATED_CHAMBER
2152
+      if (degTargetChamber() > CHAMBER_MINTEMP) return true;
2153
+    #endif
2154
+    return false;
2155
+  }
2156
+
2157
+  void Temperature::check_timer_autostart(const bool can_start, const bool can_stop) {
2158
+    if (over_autostart_threshold()) {
2159
+      if (can_start) startOrResumeJob();
2160
+    }
2161
+    else if (can_stop) {
2162
+      print_job_timer.stop();
2163
+      ui.reset_status();
2164
+    }
2165
+  }
2166
+
2167
+#endif
2168
+
2169
+
2157 2170
 #if ENABLED(PROBING_HEATERS_OFF)
2158 2171
 
2159 2172
   void Temperature::pause(const bool p) {
@@ -2166,7 +2179,7 @@ void Temperature::disable_all_heaters() {
2166 2179
         #endif
2167 2180
       }
2168 2181
       else {
2169
-        HOTEND_LOOP() reset_heater_idle_timer(e);
2182
+        HOTEND_LOOP() reset_hotend_idle_timer(e);
2170 2183
         #if HAS_HEATED_BED
2171 2184
           reset_bed_idle_timer();
2172 2185
         #endif

+ 41
- 10
Marlin/src/module/temperature.h View File

@@ -228,15 +228,38 @@ typedef struct {
228 228
   inline void start(const millis_t &ms) { timeout_ms = millis() + ms; timed_out = false; }
229 229
   inline void reset() { timeout_ms = 0; timed_out = false; }
230 230
   inline void expire() { start(0); }
231
-} heater_idle_t;
231
+} hotend_idle_t;
232 232
 
233 233
 // Heater watch handling
234
-typedef struct {
234
+template <int INCREASE, int HYSTERESIS, millis_t PERIOD>
235
+struct HeaterWatch {
235 236
   uint16_t target;
236 237
   millis_t next_ms;
237 238
   inline bool elapsed(const millis_t &ms) { return next_ms && ELAPSED(ms, next_ms); }
238 239
   inline bool elapsed() { return elapsed(millis()); }
239
-} heater_watch_t;
240
+
241
+  inline void restart(const int16_t curr, const int16_t tgt) {
242
+    if (tgt) {
243
+      const int16_t newtarget = curr + INCREASE;
244
+      if (newtarget < tgt - HYSTERESIS - 1) {
245
+        target = newtarget;
246
+        next_ms = millis() + PERIOD * 1000UL;
247
+        return;
248
+      }
249
+    }
250
+    next_ms = 0;
251
+  }
252
+};
253
+
254
+#if WATCH_HOTENDS
255
+  typedef struct HeaterWatch<WATCH_TEMP_INCREASE, TEMP_HYSTERESIS, WATCH_TEMP_PERIOD> hotend_watch_t;
256
+#endif
257
+#if WATCH_BED
258
+  typedef struct HeaterWatch<WATCH_BED_TEMP_INCREASE, TEMP_BED_HYSTERESIS, WATCH_BED_TEMP_PERIOD> bed_watch_t;
259
+#endif
260
+#if WATCH_CHAMBER
261
+  typedef struct HeaterWatch<WATCH_CHAMBER_TEMP_INCREASE, TEMP_CHAMBER_HYSTERESIS, WATCH_CHAMBER_TEMP_PERIOD> chamber_watch_t;
262
+#endif
240 263
 
241 264
 // Temperature sensor read value ranges
242 265
 typedef struct { int16_t raw_min, raw_max; } raw_range_t;
@@ -345,12 +368,12 @@ class Temperature {
345 368
     FORCE_INLINE static bool targetHotEnoughToExtrude(const uint8_t e) { return !targetTooColdToExtrude(e); }
346 369
 
347 370
     #if HEATER_IDLE_HANDLER
348
-      static heater_idle_t hotend_idle[HOTENDS];
371
+      static hotend_idle_t hotend_idle[HOTENDS];
349 372
       #if HAS_HEATED_BED
350
-        static heater_idle_t bed_idle;
373
+        static hotend_idle_t bed_idle;
351 374
       #endif
352 375
       #if HAS_HEATED_CHAMBER
353
-        static heater_idle_t chamber_idle;
376
+        static hotend_idle_t chamber_idle;
354 377
       #endif
355 378
     #endif
356 379
 
@@ -363,7 +386,7 @@ class Temperature {
363 386
     static volatile bool raw_temps_ready;
364 387
 
365 388
     #if WATCH_HOTENDS
366
-      static heater_watch_t watch_hotend[HOTENDS];
389
+      static hotend_watch_t watch_hotend[HOTENDS];
367 390
     #endif
368 391
 
369 392
     #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
@@ -382,7 +405,7 @@ class Temperature {
382 405
 
383 406
     #if HAS_HEATED_BED
384 407
       #if WATCH_BED
385
-        static heater_watch_t watch_bed;
408
+        static bed_watch_t watch_bed;
386 409
       #endif
387 410
       #if DISABLED(PIDTEMPBED)
388 411
         static millis_t next_bed_check_ms;
@@ -397,7 +420,7 @@ class Temperature {
397 420
 
398 421
     #if HAS_HEATED_CHAMBER
399 422
       #if WATCH_CHAMBER
400
-        static heater_watch_t watch_chamber;
423
+        static chamber_watch_t watch_chamber;
401 424
       #endif
402 425
       static millis_t next_chamber_check_ms;
403 426
       #ifdef CHAMBER_MINTEMP
@@ -736,6 +759,14 @@ class Temperature {
736 759
      */
737 760
     static void disable_all_heaters();
738 761
 
762
+    #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
763
+      /**
764
+       * Methods to check if heaters are enabled, indicating an active job
765
+       */
766
+      static bool over_autostart_threshold();
767
+      static void check_timer_autostart(const bool can_start, const bool can_stop);
768
+    #endif
769
+
739 770
     /**
740 771
      * Perform auto-tuning for hotend or bed in response to M303
741 772
      */
@@ -768,7 +799,7 @@ class Temperature {
768 799
 
769 800
     #if HEATER_IDLE_HANDLER
770 801
 
771
-      static void reset_heater_idle_timer(const uint8_t E_NAME) {
802
+      static void reset_hotend_idle_timer(const uint8_t E_NAME) {
772 803
         hotend_idle[HOTEND_INDEX].reset();
773 804
         start_watching_hotend(HOTEND_INDEX);
774 805
       }

+ 77
- 0
Marlin/src/module/thermistor/thermistor_21.h View File

@@ -0,0 +1,77 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#define REVERSE_TEMP_SENSOR_RANGE
25
+
26
+#undef OV_SCALE
27
+#define OV_SCALE(N) (float((N) * 5) / 3.3f)
28
+
29
+// Pt100 with INA826 amp with 3.3v excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics"
30
+const short temptable_21[][2] PROGMEM = {
31
+  { OV(  0),    0 },
32
+  { OV(227),    1 },
33
+  { OV(236),   10 },
34
+  { OV(245),   20 },
35
+  { OV(253),   30 },
36
+  { OV(262),   40 },
37
+  { OV(270),   50 },
38
+  { OV(279),   60 },
39
+  { OV(287),   70 },
40
+  { OV(295),   80 },
41
+  { OV(304),   90 },
42
+  { OV(312),  100 },
43
+  { OV(320),  110 },
44
+  { OV(329),  120 },
45
+  { OV(337),  130 },
46
+  { OV(345),  140 },
47
+  { OV(353),  150 },
48
+  { OV(361),  160 },
49
+  { OV(369),  170 },
50
+  { OV(377),  180 },
51
+  { OV(385),  190 },
52
+  { OV(393),  200 },
53
+  { OV(401),  210 },
54
+  { OV(409),  220 },
55
+  { OV(417),  230 },
56
+  { OV(424),  240 },
57
+  { OV(432),  250 },
58
+  { OV(440),  260 },
59
+  { OV(447),  270 },
60
+  { OV(455),  280 },
61
+  { OV(463),  290 },
62
+  { OV(470),  300 },
63
+  { OV(478),  310 },
64
+  { OV(485),  320 },
65
+  { OV(493),  330 },
66
+  { OV(500),  340 },
67
+  { OV(507),  350 },
68
+  { OV(515),  360 },
69
+  { OV(522),  370 },
70
+  { OV(529),  380 },
71
+  { OV(537),  390 },
72
+  { OV(544),  400 },
73
+  { OV(614),  500 }
74
+};
75
+
76
+#undef OV_SCALE
77
+#define OV_SCALE(N) (N)

+ 5
- 1
Marlin/src/module/thermistor/thermistors.h View File

@@ -37,7 +37,8 @@
37 37
   #error "MAX_RAW_THERMISTOR_VALUE is too large for int16_t. Reduce OVERSAMPLENR or HAL_ADC_RESOLUTION."
38 38
 #endif
39 39
 
40
-#define OV(N) int16_t((N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE))
40
+#define OV_SCALE(N) (N)
41
+#define OV(N) int16_t(OV_SCALE(N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE))
41 42
 
42 43
 #define ANY_THERMISTOR_IS(n) (THERMISTOR_HEATER_0 == n || THERMISTOR_HEATER_1 == n || THERMISTOR_HEATER_2 == n || THERMISTOR_HEATER_3 == n || THERMISTOR_HEATER_4 == n || THERMISTOR_HEATER_5 == n || THERMISTOR_HEATER_6 == n || THERMISTOR_HEATER_7 == n || THERMISTORBED == n || THERMISTORCHAMBER == n || THERMISTORPROBE == n)
43 44
 
@@ -105,6 +106,9 @@
105 106
 #if ANY_THERMISTOR_IS(20) // Pt100 with INA826 amp on Ultimaker v2.0 electronics
106 107
   #include "thermistor_20.h"
107 108
 #endif
109
+#if ANY_THERMISTOR_IS(21) // Pt100 with INA826 amp with 3.3v excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics"
110
+  #include "thermistor_21.h"
111
+#endif
108 112
 #if ANY_THERMISTOR_IS(51) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 1 kOhm, "EPCOS"
109 113
   #include "thermistor_51.h"
110 114
 #endif

+ 1
- 1
Marlin/src/module/tool_change.cpp View File

@@ -822,7 +822,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
822 822
     }
823 823
 
824 824
     #if HAS_LCD_MENU
825
-      ui.return_to_status();
825
+      if (!no_move) ui.return_to_status();
826 826
     #endif
827 827
 
828 828
     #if ENABLED(DUAL_X_CARRIAGE)

+ 90
- 0
Marlin/src/pins/esp32/pins_E4D.h View File

@@ -0,0 +1,90 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+/**
25
+ * E4d@Box  pin assignments
26
+ * E4d@Box is a small factor 3D printer control board based on the ESP32 microcontroller for Laser, CNC and 3d printers
27
+ * for more info check http://atbox.tech/ and join to Facebook page E4d@box.
28
+ */
29
+
30
+#ifndef ARDUINO_ARCH_ESP32
31
+  #error "Oops! Select an ESP32 board in 'Tools > Board.'"
32
+#elif EXTRUDERS > 1 || E_STEPPERS > 1
33
+  #error "E4d@box only supports one E Stepper. Comment out this line to continue."
34
+#elif HOTENDS > 2
35
+  #error "E4d@box currently supports only one hotend. Comment out this line to continue."
36
+#endif
37
+
38
+#define BOARD_INFO_NAME       "E4D@BOX"
39
+#define BOARD_WEBSITE_URL     "github.com/Exilaus/E4d@box"
40
+#define DEFAULT_MACHINE_NAME  BOARD_INFO_NAME
41
+
42
+//
43
+// Limit Switches
44
+//
45
+#define X_MIN_PIN          34
46
+#define Y_MIN_PIN          35
47
+#define Z_MIN_PIN          16   // 15
48
+
49
+//
50
+// Steppers
51
+//
52
+#define X_STEP_PIN         12   // 34//27
53
+#define X_DIR_PIN          13   // 35//26
54
+#define X_ENABLE_PIN       17   // 0//17//25 // used free pin
55
+//#define X_CS_PIN            0
56
+
57
+#define Y_STEP_PIN         32   // 33
58
+#define Y_DIR_PIN          33   // 32
59
+#define Y_ENABLE_PIN       X_ENABLE_PIN
60
+//#define Y_CS_PIN           13
61
+
62
+#define Z_STEP_PIN         25   // 14
63
+#define Z_DIR_PIN          26   // 12
64
+#define Z_ENABLE_PIN       X_ENABLE_PIN
65
+//#define Z_CS_PIN            5   // SS_PIN
66
+
67
+#define E0_STEP_PIN        27   // 16
68
+#define E0_DIR_PIN         14   // 17
69
+#define E0_ENABLE_PIN      X_ENABLE_PIN
70
+//#define E0_CS_PIN          21
71
+
72
+//
73
+// Temperature Sensors
74
+//
75
+#define TEMP_0_PIN         36   // Analog Input
76
+#define TEMP_BED_PIN       39   // Analog Input
77
+
78
+//
79
+// Heaters / Fans
80
+//
81
+#define HEATER_0_PIN        2   // 4//2//(D8)
82
+#define FAN_PIN             0   // 2//15//13 (D9)
83
+#define HEATER_BED_PIN     15   // 15//0 //(D10)
84
+
85
+// SPI
86
+#define SDSS                 5
87
+#define I2S_STEPPER_STREAM
88
+#define I2S_WS              23
89
+#define I2S_BCK             22
90
+#define I2S_DATA            21

+ 18
- 0
Marlin/src/pins/linux/pins_RAMPS_LINUX.h View File

@@ -363,6 +363,24 @@
363 363
   #ifndef E4_SERIAL_RX_PIN
364 364
     #define E4_SERIAL_RX_PIN -1
365 365
   #endif
366
+  #ifndef E5_SERIAL_TX_PIN
367
+    #define E5_SERIAL_TX_PIN -1
368
+  #endif
369
+  #ifndef E5_SERIAL_RX_PIN
370
+    #define E5_SERIAL_RX_PIN -1
371
+  #endif
372
+  #ifndef E6_SERIAL_TX_PIN
373
+    #define E6_SERIAL_TX_PIN -1
374
+  #endif
375
+  #ifndef E6_SERIAL_RX_PIN
376
+    #define E6_SERIAL_RX_PIN -1
377
+  #endif
378
+  #ifndef E7_SERIAL_TX_PIN
379
+    #define E7_SERIAL_TX_PIN -1
380
+  #endif
381
+  #ifndef E7_SERIAL_RX_PIN
382
+    #define E7_SERIAL_RX_PIN -1
383
+  #endif
366 384
 #endif
367 385
 
368 386
 //////////////////////////

+ 37
- 21
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h View File

@@ -24,32 +24,51 @@
24 24
 #define BOARD_INFO_NAME "BIGTREE SKR 1.3"
25 25
 
26 26
 /**
27
+ * Trinamic Stallguard pins
28
+ */
29
+#define X_DIAG_PIN           P1_29   // X-
30
+#define Y_DIAG_PIN           P1_27   // Y-
31
+#define Z_DIAG_PIN           P1_25   // Z-
32
+#define E0_DIAG_PIN          P1_28   // X+
33
+#define E1_DIAG_PIN          P1_26   // Y+
34
+
35
+/**
27 36
  * Limit Switches
28 37
  */
29
-#if X_HOME_DIR > 0 && X_STALL_SENSITIVITY && !defined(USE_XMAX_PLUG)
30
-  // For StallGuard homing to MAX swap the MIN / MAX pins
31
-  // so the MAX physical connectors may be used for other things.
32
-  #define X_MIN_PIN          P1_28   // X_MAX (free)
33
-  #define X_MAX_PIN          P1_29   // X_MIN
34
-#else                                // else, non-endstop is free and appears in M43 output
35
-  #define X_MIN_PIN          P1_29   // X_MIN
36
-  #define X_MAX_PIN          P1_28   // X_MAX
38
+#if X_STALL_SENSITIVITY
39
+  #define X_STOP_PIN         X_DIAG_PIN
40
+  #if X_HOME_DIR < 0
41
+    #define X_MAX_PIN        P1_28   // X+
42
+  #else
43
+    #define X_MIN_PIN        P1_28   // X+
44
+  #endif
45
+#else
46
+  #define X_MIN_PIN          P1_29   // X-
47
+  #define X_MAX_PIN          P1_28   // X+
37 48
 #endif
38 49
 
39
-#if Y_HOME_DIR > 0 && Y_STALL_SENSITIVITY && !defined(USE_YMAX_PLUG)
40
-  #define Y_MIN_PIN          P1_26   // Y_MAX (free)
41
-  #define Y_MAX_PIN          P1_27   // Y_MIN
50
+#if Y_STALL_SENSITIVITY
51
+  #define Y_STOP_PIN         Y_DIAG_PIN
52
+  #if Y_HOME_DIR < 0
53
+    #define Y_MAX_PIN        P1_26   // Y+
54
+  #else
55
+    #define Y_MIN_PIN        P1_26   // Y+
56
+  #endif
42 57
 #else
43
-  #define Y_MIN_PIN          P1_27   // Y_MIN
44
-  #define Y_MAX_PIN          P1_26   // Y_MAX
58
+  #define Y_MIN_PIN          P1_27   // Y-
59
+  #define Y_MAX_PIN          P1_26   // Y+
45 60
 #endif
46 61
 
47
-#if Z_HOME_DIR > 0 && Z_STALL_SENSITIVITY && !defined(USE_ZMAX_PLUG)
48
-  #define Z_MIN_PIN          P1_24   // Z_MAX (free)
49
-  #define Z_MAX_PIN          P1_25   // Z_MIN
62
+#if Z_STALL_SENSITIVITY
63
+  #define Z_STOP_PIN         Z_DIAG_PIN
64
+  #if Z_HOME_DIR < 0
65
+    #define Z_MAX_PIN        P1_24   // Z+
66
+  #else
67
+    #define Z_MIN_PIN        P1_24   // Z+
68
+  #endif
50 69
 #else
51
-  #define Z_MIN_PIN          P1_25   // Z_MIN
52
-  #define Z_MAX_PIN          P1_24   // Z_MAX
70
+  #define Z_MIN_PIN          P1_25   // Z-
71
+  #define Z_MAX_PIN          P1_24   // Z+
53 72
 #endif
54 73
 
55 74
 #define ONBOARD_ENDSTOPPULLUPS     // Board has built-in pullups
@@ -162,9 +181,6 @@
162 181
   #define E1_SERIAL_TX_PIN P1_04
163 182
   #define E1_SERIAL_RX_PIN P1_01
164 183
 
165
-  #define Z2_SERIAL_TX_PIN P1_04
166
-  #define Z2_SERIAL_RX_PIN P1_01
167
-
168 184
   // Reduce baud rate to improve software serial reliability
169 185
   #define TMC_BAUD_RATE 19200
170 186
 #endif

+ 45
- 7
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h View File

@@ -38,11 +38,49 @@
38 38
 #define SERVO0_PIN         P2_00
39 39
 
40 40
 //
41
+// TMC StallGuard DIAG pins
42
+//
43
+#define X_DIAG_PIN         P1_29   // X-STOP
44
+#define Y_DIAG_PIN         P1_28   // Y-STOP
45
+#define Z_DIAG_PIN         P1_27   // Z-STOP
46
+#define E0_DIAG_PIN        P1_26   // E0DET
47
+#define E1_DIAG_PIN        P1_25   // E1DET
48
+
49
+//
41 50
 // Limit Switches
42 51
 //
43
-#define X_STOP_PIN         P1_29
44
-#define Y_STOP_PIN         P1_28
45
-#define Z_STOP_PIN         P1_27
52
+#if X_STALL_SENSITIVITY
53
+  #define X_STOP_PIN       X_DIAG_PIN
54
+  #if X_HOME_DIR < 0
55
+    #define X_MAX_PIN      P1_26   // E0DET
56
+  #else
57
+    #define X_MIN_PIN      P1_26   // E0DET
58
+  #endif
59
+#else
60
+  #define X_STOP_PIN       P1_29   // X-STOP
61
+#endif
62
+
63
+#if Y_STALL_SENSITIVITY
64
+  #define Y_STOP_PIN       Y_DIAG_PIN
65
+  #if Y_HOME_DIR < 0
66
+    #define Y_MAX_PIN      P1_25   // E1DET
67
+  #else
68
+    #define Y_MIN_PIN      P1_25   // E1DET
69
+  #endif
70
+#else
71
+  #define Y_STOP_PIN       P1_28   // Y-STOP
72
+#endif
73
+
74
+#if Z_STALL_SENSITIVITY
75
+  #define Z_STOP_PIN       Z_DIAG_PIN
76
+  #if Z_HOME_DIR < 0
77
+    #define Z_MAX_PIN      P1_24   // PWRDET
78
+  #else
79
+    #define Z_MIN_PIN      P1_24   // PWRDET
80
+  #endif
81
+#else
82
+  #define Z_STOP_PIN       P1_27   // Z-STOP
83
+#endif
46 84
 
47 85
 //
48 86
 // Z Probe (when not Z_MIN_PIN)
@@ -54,21 +92,21 @@
54 92
 //
55 93
 // Filament Runout Sensor
56 94
 //
57
-#define FIL_RUNOUT_PIN     P1_26
58
-#define FIL_RUNOUT2_PIN    P1_25
95
+#define FIL_RUNOUT_PIN     P1_26   // E0DET
96
+#define FIL_RUNOUT2_PIN    P1_25   // E1DET
59 97
 
60 98
 //
61 99
 // Power Supply Control
62 100
 //
63 101
 #ifndef PS_ON_PIN
64
-  #define PS_ON_PIN        P1_00
102
+  #define PS_ON_PIN        P1_00   // PWRDET
65 103
 #endif
66 104
 
67 105
 //
68 106
 // Power Loss Detection
69 107
 //
70 108
 #ifndef POWER_LOSS_PIN
71
-  #define POWER_LOSS_PIN   P1_00
109
+  #define POWER_LOSS_PIN   P1_00   // PWRDET
72 110
 #endif
73 111
 
74 112
 //

+ 144
- 19
Marlin/src/pins/pins.h View File

@@ -571,6 +571,8 @@
571 571
   #include "esp32/pins_MRR_ESPA.h"              // ESP32                                  env:esp32
572 572
 #elif MB(MRR_ESPE)
573 573
   #include "esp32/pins_MRR_ESPE.h"              // ESP32                                  env:esp32
574
+#elif MB(E4D_BOX)
575
+  #include "esp32/pins_E4D.h"                   // ESP32                                  env:esp32
574 576
 
575 577
 //
576 578
 // Linux Native Debug board
@@ -1024,10 +1026,14 @@
1024 1026
 #ifdef X_STOP_PIN
1025 1027
   #if X_HOME_DIR < 0
1026 1028
     #define X_MIN_PIN X_STOP_PIN
1027
-    #define X_MAX_PIN -1
1029
+    #ifndef X_MAX_PIN
1030
+      #define X_MAX_PIN -1
1031
+    #endif
1028 1032
   #else
1029
-    #define X_MIN_PIN -1
1030 1033
     #define X_MAX_PIN X_STOP_PIN
1034
+    #ifndef X_MIN_PIN
1035
+      #define X_MIN_PIN -1
1036
+    #endif
1031 1037
   #endif
1032 1038
 #elif X_HOME_DIR < 0
1033 1039
   #define X_STOP_PIN X_MIN_PIN
@@ -1038,10 +1044,14 @@
1038 1044
 #ifdef Y_STOP_PIN
1039 1045
   #if Y_HOME_DIR < 0
1040 1046
     #define Y_MIN_PIN Y_STOP_PIN
1041
-    #define Y_MAX_PIN -1
1047
+    #ifndef Y_MAX_PIN
1048
+      #define Y_MAX_PIN -1
1049
+    #endif
1042 1050
   #else
1043
-    #define Y_MIN_PIN -1
1044 1051
     #define Y_MAX_PIN Y_STOP_PIN
1052
+    #ifndef Y_MIN_PIN
1053
+      #define Y_MIN_PIN -1
1054
+    #endif
1045 1055
   #endif
1046 1056
 #elif Y_HOME_DIR < 0
1047 1057
   #define Y_STOP_PIN Y_MIN_PIN
@@ -1052,10 +1062,14 @@
1052 1062
 #ifdef Z_STOP_PIN
1053 1063
   #if Z_HOME_DIR < 0
1054 1064
     #define Z_MIN_PIN Z_STOP_PIN
1055
-    #define Z_MAX_PIN -1
1065
+    #ifndef Z_MAX_PIN
1066
+      #define Z_MAX_PIN -1
1067
+    #endif
1056 1068
   #else
1057
-    #define Z_MIN_PIN -1
1058 1069
     #define Z_MAX_PIN Z_STOP_PIN
1070
+    #ifndef Z_MIN_PIN
1071
+      #define Z_MIN_PIN -1
1072
+    #endif
1059 1073
   #endif
1060 1074
 #elif Z_HOME_DIR < 0
1061 1075
   #define Z_STOP_PIN Z_MIN_PIN
@@ -1125,42 +1139,72 @@
1125 1139
  * overridden in Configuration.h or Configuration_adv.h.
1126 1140
  */
1127 1141
 
1142
+#define __PEXI(p,q) PIN_EXISTS(E##p##_##q)
1143
+#define _PEXI(p,q) __PEXI(p,q)
1128 1144
 #define __EPIN(p,q) E##p##_##q##_PIN
1129 1145
 #define _EPIN(p,q) __EPIN(p,q)
1146
+#define DIAG_REMAPPED(p,q) (PIN_EXISTS(q) && _EPIN(p##_E_INDEX, DIAG) == q##_PIN)
1130 1147
 
1131 1148
 // The X2 axis, if any, should be the next open extruder port
1149
+#define X2_E_INDEX E_STEPPERS
1150
+
1132 1151
 #if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
1133 1152
   #ifndef X2_STEP_PIN
1134
-    #define X2_STEP_PIN   _EPIN(E_STEPPERS, STEP)
1135
-    #define X2_DIR_PIN    _EPIN(E_STEPPERS, DIR)
1136
-    #define X2_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE)
1137
-    #if E_STEPPERS >= MAX_EXTRUDERS || !PIN_EXISTS(X2_STEP)
1153
+    #define X2_STEP_PIN   _EPIN(X2_E_INDEX, STEP)
1154
+    #define X2_DIR_PIN    _EPIN(X2_E_INDEX, DIR)
1155
+    #define X2_ENABLE_PIN _EPIN(X2_E_INDEX, ENABLE)
1156
+    #if X2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(X2_STEP)
1138 1157
       #error "No E stepper plug left for X2!"
1139 1158
     #endif
1140 1159
   #endif
1141 1160
   #ifndef X2_MS1_PIN
1142
-    #define X2_MS1_PIN    _EPIN(E_STEPPERS, MS1)
1161
+    #define X2_MS1_PIN    _EPIN(X2_E_INDEX, MS1)
1143 1162
   #endif
1144 1163
   #ifndef X2_MS2_PIN
1145
-    #define X2_MS2_PIN    _EPIN(E_STEPPERS, MS2)
1164
+    #define X2_MS2_PIN    _EPIN(X2_E_INDEX, MS2)
1146 1165
   #endif
1147 1166
   #ifndef X2_MS3_PIN
1148
-    #define X2_MS3_PIN    _EPIN(E_STEPPERS, MS3)
1167
+    #define X2_MS3_PIN    _EPIN(X2_E_INDEX, MS3)
1149 1168
   #endif
1150 1169
   #if AXIS_HAS_SPI(X2) && !defined(X2_CS_PIN)
1151
-    #define X2_CS_PIN     _EPIN(E_STEPPERS, CS)
1170
+    #define X2_CS_PIN     _EPIN(X2_E_INDEX, CS)
1152 1171
   #endif
1153 1172
   #if AXIS_HAS_UART(X2)
1154 1173
     #ifndef X2_SERIAL_TX_PIN
1155
-      #define X2_SERIAL_TX_PIN _EPIN(E_STEPPERS, SERIAL_TX)
1174
+      #define X2_SERIAL_TX_PIN _EPIN(X2_E_INDEX, SERIAL_TX)
1156 1175
     #endif
1157 1176
     #ifndef X2_SERIAL_RX_PIN
1158
-      #define X2_SERIAL_RX_PIN _EPIN(E_STEPPERS, SERIAL_RX)
1177
+      #define X2_SERIAL_RX_PIN _EPIN(X2_E_INDEX, SERIAL_RX)
1159 1178
     #endif
1160 1179
   #endif
1161
-  #define Y2_E_INDEX INCREMENT(E_STEPPERS)
1180
+
1181
+  //
1182
+  // Auto-assign pins for stallGuard sensorless homing
1183
+  //
1184
+  #if X2_STALL_SENSITIVITY && ENABLED(X_DUAL_ENDSTOPS) && _PEXI(X2_E_INDEX, DIAG)
1185
+    #define X2_DIAG_PIN _EPIN(X2_E_INDEX, DIAG)
1186
+    #if   DIAG_REMAPPED(X2, X_MIN)      // If already remapped in the pins file...
1187
+      #define X2_USE_ENDSTOP _XMIN_
1188
+    #elif DIAG_REMAPPED(X2, Y_MIN)
1189
+      #define X2_USE_ENDSTOP _YMIN_
1190
+    #elif DIAG_REMAPPED(X2, Z_MIN)
1191
+      #define X2_USE_ENDSTOP _ZMIN_
1192
+    #elif DIAG_REMAPPED(X2, X_MAX)
1193
+      #define X2_USE_ENDSTOP _XMAX_
1194
+    #elif DIAG_REMAPPED(X2, Y_MAX)
1195
+      #define X2_USE_ENDSTOP _YMAX_
1196
+    #elif DIAG_REMAPPED(X2, Z_MAX)
1197
+      #define X2_USE_ENDSTOP _ZMAX_
1198
+    #else                               // Otherwise use the driver DIAG_PIN directly
1199
+      #define _X2_USE_ENDSTOP(P) _E##P##_DIAG_
1200
+      #define X2_USE_ENDSTOP _X2_USE_ENDSTOP(X2_E_INDEX)
1201
+    #endif
1202
+    #undef X2_DIAG_PIN
1203
+  #endif
1204
+
1205
+  #define Y2_E_INDEX INCREMENT(X2_E_INDEX)
1162 1206
 #else
1163
-  #define Y2_E_INDEX E_STEPPERS
1207
+  #define Y2_E_INDEX X2_E_INDEX
1164 1208
 #endif
1165 1209
 
1166 1210
 #ifndef X2_CS_PIN
@@ -1206,6 +1250,26 @@
1206 1250
       #define Y2_SERIAL_RX_PIN _EPIN(Y2_E_INDEX, SERIAL_RX)
1207 1251
     #endif
1208 1252
   #endif
1253
+  #if Y2_STALL_SENSITIVITY && ENABLED(Y_DUAL_ENDSTOPS) && _PEXI(Y2_E_INDEX, DIAG)
1254
+    #define Y2_DIAG_PIN _EPIN(Y2_E_INDEX, DIAG)
1255
+    #if   DIAG_REMAPPED(Y2, X_MIN)
1256
+      #define Y2_USE_ENDSTOP _XMIN_
1257
+    #elif DIAG_REMAPPED(Y2, Y_MIN)
1258
+      #define Y2_USE_ENDSTOP _YMIN_
1259
+    #elif DIAG_REMAPPED(Y2, Z_MIN)
1260
+      #define Y2_USE_ENDSTOP _ZMIN_
1261
+    #elif DIAG_REMAPPED(Y2, X_MAX)
1262
+      #define Y2_USE_ENDSTOP _XMAX_
1263
+    #elif DIAG_REMAPPED(Y2, Y_MAX)
1264
+      #define Y2_USE_ENDSTOP _YMAX_
1265
+    #elif DIAG_REMAPPED(Y2, Z_MAX)
1266
+      #define Y2_USE_ENDSTOP _ZMAX_
1267
+    #else
1268
+      #define _Y2_USE_ENDSTOP(P) _E##P##_DIAG_
1269
+      #define Y2_USE_ENDSTOP _Y2_USE_ENDSTOP(Y2_E_INDEX)
1270
+    #endif
1271
+    #undef Y2_DIAG_PIN
1272
+  #endif
1209 1273
   #define Z2_E_INDEX INCREMENT(Y2_E_INDEX)
1210 1274
 #else
1211 1275
   #define Z2_E_INDEX Y2_E_INDEX
@@ -1254,6 +1318,26 @@
1254 1318
       #define Z2_SERIAL_RX_PIN _EPIN(Z2_E_INDEX, SERIAL_RX)
1255 1319
     #endif
1256 1320
   #endif
1321
+  #if Z2_STALL_SENSITIVITY && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 2 && _PEXI(Z2_E_INDEX, DIAG)
1322
+    #define Z2_DIAG_PIN _EPIN(Z2_E_INDEX, DIAG)
1323
+    #if   DIAG_REMAPPED(Z2, X_MIN)
1324
+      #define Z2_USE_ENDSTOP _XMIN_
1325
+    #elif DIAG_REMAPPED(Z2, Y_MIN)
1326
+      #define Z2_USE_ENDSTOP _YMIN_
1327
+    #elif DIAG_REMAPPED(Z2, Z_MIN)
1328
+      #define Z2_USE_ENDSTOP _ZMIN_
1329
+    #elif DIAG_REMAPPED(Z2, X_MAX)
1330
+      #define Z2_USE_ENDSTOP _XMAX_
1331
+    #elif DIAG_REMAPPED(Z2, Y_MAX)
1332
+      #define Z2_USE_ENDSTOP _YMAX_
1333
+    #elif DIAG_REMAPPED(Z2, Z_MAX)
1334
+      #define Z2_USE_ENDSTOP _ZMAX_
1335
+    #else
1336
+      #define _Z2_USE_ENDSTOP(P) _E##P##_DIAG_
1337
+      #define Z2_USE_ENDSTOP _Z2_USE_ENDSTOP(Z2_E_INDEX)
1338
+    #endif
1339
+    #undef Z2_DIAG_PIN
1340
+  #endif
1257 1341
   #define Z3_E_INDEX INCREMENT(Z2_E_INDEX)
1258 1342
 #else
1259 1343
   #define Z3_E_INDEX Z2_E_INDEX
@@ -1283,7 +1367,7 @@
1283 1367
   #endif
1284 1368
   #if AXIS_HAS_SPI(Z3)
1285 1369
     #ifndef Z3_CS_PIN
1286
-      #define Z3_CS_PIN     _EPIN(Z3_E_INDEX, CS)
1370
+      #define Z3_CS_PIN   _EPIN(Z3_E_INDEX, CS)
1287 1371
     #endif
1288 1372
   #endif
1289 1373
   #ifndef Z3_MS1_PIN
@@ -1303,6 +1387,26 @@
1303 1387
       #define Z3_SERIAL_RX_PIN _EPIN(Z3_E_INDEX, SERIAL_RX)
1304 1388
     #endif
1305 1389
   #endif
1390
+  #if Z3_STALL_SENSITIVITY && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 3 && _PEXI(Z3_E_INDEX, DIAG)
1391
+    #define Z3_DIAG_PIN _EPIN(Z3_E_INDEX, DIAG)
1392
+    #if   DIAG_REMAPPED(Z3, X_MIN)
1393
+      #define Z3_USE_ENDSTOP _XMIN_
1394
+    #elif DIAG_REMAPPED(Z3, Y_MIN)
1395
+      #define Z3_USE_ENDSTOP _YMIN_
1396
+    #elif DIAG_REMAPPED(Z3, Z_MIN)
1397
+      #define Z3_USE_ENDSTOP _ZMIN_
1398
+    #elif DIAG_REMAPPED(Z3, X_MAX)
1399
+      #define Z3_USE_ENDSTOP _XMAX_
1400
+    #elif DIAG_REMAPPED(Z3, Y_MAX)
1401
+      #define Z3_USE_ENDSTOP _YMAX_
1402
+    #elif DIAG_REMAPPED(Z3, Z_MAX)
1403
+      #define Z3_USE_ENDSTOP _ZMAX_
1404
+    #else
1405
+      #define _Z3_USE_ENDSTOP(P) _E##P##_DIAG_
1406
+      #define Z3_USE_ENDSTOP _Z3_USE_ENDSTOP(Z3_E_INDEX)
1407
+    #endif
1408
+    #undef Z3_DIAG_PIN
1409
+  #endif
1306 1410
   #define Z4_E_INDEX INCREMENT(Z3_E_INDEX)
1307 1411
 #endif
1308 1412
 
@@ -1350,6 +1454,26 @@
1350 1454
       #define Z4_SERIAL_RX_PIN _EPIN(Z4_E_INDEX, SERIAL_RX)
1351 1455
     #endif
1352 1456
   #endif
1457
+  #if Z4_STALL_SENSITIVITY && ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPER_DRIVERS >= 4 && _PEXI(Z4_E_INDEX, DIAG)
1458
+    #define Z4_DIAG_PIN _EPIN(Z4_E_INDEX, DIAG)
1459
+    #if   DIAG_REMAPPED(Z4, X_MIN)
1460
+      #define Z4_USE_ENDSTOP _XMIN_
1461
+    #elif DIAG_REMAPPED(Z4, Y_MIN)
1462
+      #define Z4_USE_ENDSTOP _YMIN_
1463
+    #elif DIAG_REMAPPED(Z4, Z_MIN)
1464
+      #define Z4_USE_ENDSTOP _ZMIN_
1465
+    #elif DIAG_REMAPPED(Z4, X_MAX)
1466
+      #define Z4_USE_ENDSTOP _XMAX_
1467
+    #elif DIAG_REMAPPED(Z4, Y_MAX)
1468
+      #define Z4_USE_ENDSTOP _YMAX_
1469
+    #elif DIAG_REMAPPED(Z4, Z_MAX)
1470
+      #define Z4_USE_ENDSTOP _ZMAX_
1471
+    #else
1472
+      #define _Z4_USE_ENDSTOP(P) _E##P##_DIAG_
1473
+      #define Z4_USE_ENDSTOP _Z4_USE_ENDSTOP(Z4_E_INDEX)
1474
+    #endif
1475
+    #undef Z4_DIAG_PIN
1476
+  #endif
1353 1477
 #endif
1354 1478
 
1355 1479
 #ifndef Z4_CS_PIN
@@ -1382,3 +1506,4 @@
1382 1506
 #endif
1383 1507
 
1384 1508
 #undef HAS_FREE_AUX2_PINS
1509
+#undef DIAG_REMAPPED

+ 65
- 2
Marlin/src/pins/pinsDebug_list.h View File

@@ -1323,6 +1323,9 @@
1323 1323
 #if PIN_EXISTS(X_MIN)
1324 1324
   REPORT_NAME_DIGITAL(__LINE__, X_MIN_PIN)
1325 1325
 #endif
1326
+#if PIN_EXISTS(X_DIAG)
1327
+  REPORT_NAME_DIGITAL(__LINE__, X_DIAG_PIN)
1328
+#endif
1326 1329
 #if PIN_EXISTS(X_MS1)
1327 1330
   REPORT_NAME_DIGITAL(__LINE__, X_MS1_PIN)
1328 1331
 #endif
@@ -1344,6 +1347,12 @@
1344 1347
 #if PIN_EXISTS(X2_ENABLE)
1345 1348
   REPORT_NAME_DIGITAL(__LINE__, X2_ENABLE_PIN)
1346 1349
 #endif
1350
+#if PIN_EXISTS(X2_MAX)
1351
+  REPORT_NAME_DIGITAL(__LINE__, X2_MAX_PIN)
1352
+#endif
1353
+#if PIN_EXISTS(X2_MIN)
1354
+  REPORT_NAME_DIGITAL(__LINE__, X2_MIN_PIN)
1355
+#endif
1347 1356
 #if PIN_EXISTS(X2_MS1)
1348 1357
   REPORT_NAME_DIGITAL(__LINE__, X2_MS1_PIN)
1349 1358
 #endif
@@ -1374,6 +1383,9 @@
1374 1383
 #if PIN_EXISTS(Y_MIN)
1375 1384
   REPORT_NAME_DIGITAL(__LINE__, Y_MIN_PIN)
1376 1385
 #endif
1386
+#if PIN_EXISTS(Y_DIAG)
1387
+  REPORT_NAME_DIGITAL(__LINE__, Y_DIAG_PIN)
1388
+#endif
1377 1389
 #if PIN_EXISTS(Y_MS1)
1378 1390
   REPORT_NAME_DIGITAL(__LINE__, Y_MS1_PIN)
1379 1391
 #endif
@@ -1395,6 +1407,12 @@
1395 1407
 #if PIN_EXISTS(Y2_ENABLE)
1396 1408
   REPORT_NAME_DIGITAL(__LINE__, Y2_ENABLE_PIN)
1397 1409
 #endif
1410
+#if PIN_EXISTS(Y2_MAX)
1411
+  REPORT_NAME_DIGITAL(__LINE__, Y2_MAX_PIN)
1412
+#endif
1413
+#if PIN_EXISTS(Y2_MIN)
1414
+  REPORT_NAME_DIGITAL(__LINE__, Y2_MIN_PIN)
1415
+#endif
1398 1416
 #if PIN_EXISTS(Y2_MS1)
1399 1417
   REPORT_NAME_DIGITAL(__LINE__, Y2_MS1_PIN)
1400 1418
 #endif
@@ -1425,8 +1443,8 @@
1425 1443
 #if PIN_EXISTS(Z_MIN)
1426 1444
   REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PIN)
1427 1445
 #endif
1428
-#if PIN_EXISTS(Z_MIN_PROBE)
1429
-  REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PROBE_PIN)
1446
+#if PIN_EXISTS(Z_DIAG)
1447
+  REPORT_NAME_DIGITAL(__LINE__, Z_DIAG_PIN)
1430 1448
 #endif
1431 1449
 #if PIN_EXISTS(Z_MS1)
1432 1450
   REPORT_NAME_DIGITAL(__LINE__, Z_MS1_PIN)
@@ -1452,6 +1470,12 @@
1452 1470
 #if PIN_EXISTS(Z2_ENABLE)
1453 1471
   REPORT_NAME_DIGITAL(__LINE__, Z2_ENABLE_PIN)
1454 1472
 #endif
1473
+#if PIN_EXISTS(Z2_MAX)
1474
+  REPORT_NAME_DIGITAL(__LINE__, Z2_MAX_PIN)
1475
+#endif
1476
+#if PIN_EXISTS(Z2_MIN)
1477
+  REPORT_NAME_DIGITAL(__LINE__, Z2_MIN_PIN)
1478
+#endif
1455 1479
 #if PIN_EXISTS(Z2_MS1)
1456 1480
   REPORT_NAME_DIGITAL(__LINE__, Z2_MS1_PIN)
1457 1481
 #endif
@@ -1473,6 +1497,12 @@
1473 1497
 #if PIN_EXISTS(Z3_ENABLE)
1474 1498
   REPORT_NAME_DIGITAL(__LINE__, Z3_ENABLE_PIN)
1475 1499
 #endif
1500
+#if PIN_EXISTS(Z3_MAX)
1501
+  REPORT_NAME_DIGITAL(__LINE__, Z3_MAX_PIN)
1502
+#endif
1503
+#if PIN_EXISTS(Z3_MIN)
1504
+  REPORT_NAME_DIGITAL(__LINE__, Z3_MIN_PIN)
1505
+#endif
1476 1506
 #if PIN_EXISTS(Z3_MS1)
1477 1507
   REPORT_NAME_DIGITAL(__LINE__, Z3_MS1_PIN)
1478 1508
 #endif
@@ -1494,6 +1524,12 @@
1494 1524
 #if PIN_EXISTS(Z4_ENABLE)
1495 1525
   REPORT_NAME_DIGITAL(__LINE__, Z4_ENABLE_PIN)
1496 1526
 #endif
1527
+#if PIN_EXISTS(Z4_MAX)
1528
+  REPORT_NAME_DIGITAL(__LINE__, Z4_MAX_PIN)
1529
+#endif
1530
+#if PIN_EXISTS(Z4_MIN)
1531
+  REPORT_NAME_DIGITAL(__LINE__, Z4_MIN_PIN)
1532
+#endif
1497 1533
 #if PIN_EXISTS(Z4_MS1)
1498 1534
   REPORT_NAME_DIGITAL(__LINE__, Z4_MS1_PIN)
1499 1535
 #endif
@@ -1506,6 +1542,9 @@
1506 1542
 #if PIN_EXISTS(Z4_STEP)
1507 1543
   REPORT_NAME_DIGITAL(__LINE__, Z4_STEP_PIN)
1508 1544
 #endif
1545
+#if PIN_EXISTS(Z_MIN_PROBE)
1546
+  REPORT_NAME_DIGITAL(__LINE__, Z_MIN_PROBE_PIN)
1547
+#endif
1509 1548
 #if PIN_EXISTS(ZRIB_V20_D6)
1510 1549
   REPORT_NAME_DIGITAL(__LINE__, ZRIB_V20_D6_PIN)
1511 1550
 #endif
@@ -1560,48 +1599,72 @@
1560 1599
 #if PIN_EXISTS(Z4_SERIAL_RX)
1561 1600
   REPORT_NAME_DIGITAL(__LINE__, Z4_SERIAL_RX_PIN)
1562 1601
 #endif
1602
+#if PIN_EXISTS(E0_DIAG)
1603
+  REPORT_NAME_DIGITAL(__LINE__, E0_DIAG_PIN)
1604
+#endif
1563 1605
 #if PIN_EXISTS(E0_SERIAL_TX)
1564 1606
   REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_TX_PIN)
1565 1607
 #endif
1566 1608
 #if PIN_EXISTS(E0_SERIAL_RX)
1567 1609
   REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_RX_PIN)
1568 1610
 #endif
1611
+#if PIN_EXISTS(E1_DIAG)
1612
+  REPORT_NAME_DIGITAL(__LINE__, E1_DIAG_PIN)
1613
+#endif
1569 1614
 #if PIN_EXISTS(E1_SERIAL_TX)
1570 1615
   REPORT_NAME_DIGITAL(__LINE__, E1_SERIAL_TX_PIN)
1571 1616
 #endif
1572 1617
 #if PIN_EXISTS(E1_SERIAL_RX)
1573 1618
   REPORT_NAME_DIGITAL(__LINE__, E1_SERIAL_RX_PIN)
1574 1619
 #endif
1620
+#if PIN_EXISTS(E2_DIAG)
1621
+  REPORT_NAME_DIGITAL(__LINE__, E2_DIAG_PIN)
1622
+#endif
1575 1623
 #if PIN_EXISTS(E2_SERIAL_TX)
1576 1624
   REPORT_NAME_DIGITAL(__LINE__, E2_SERIAL_TX_PIN)
1577 1625
 #endif
1578 1626
 #if PIN_EXISTS(E2_SERIAL_RX)
1579 1627
   REPORT_NAME_DIGITAL(__LINE__, E2_SERIAL_RX_PIN)
1580 1628
 #endif
1629
+#if PIN_EXISTS(E3_DIAG)
1630
+  REPORT_NAME_DIGITAL(__LINE__, E3_DIAG_PIN)
1631
+#endif
1581 1632
 #if PIN_EXISTS(E3_SERIAL_TX)
1582 1633
   REPORT_NAME_DIGITAL(__LINE__, E3_SERIAL_TX_PIN)
1583 1634
 #endif
1584 1635
 #if PIN_EXISTS(E3_SERIAL_RX)
1585 1636
   REPORT_NAME_DIGITAL(__LINE__, E3_SERIAL_RX_PIN)
1586 1637
 #endif
1638
+#if PIN_EXISTS(E4_DIAG)
1639
+  REPORT_NAME_DIGITAL(__LINE__, E4_DIAG_PIN)
1640
+#endif
1587 1641
 #if PIN_EXISTS(E4_SERIAL_TX)
1588 1642
   REPORT_NAME_DIGITAL(__LINE__, E4_SERIAL_TX_PIN)
1589 1643
 #endif
1590 1644
 #if PIN_EXISTS(E4_SERIAL_RX)
1591 1645
   REPORT_NAME_DIGITAL(__LINE__, E4_SERIAL_RX_PIN)
1592 1646
 #endif
1647
+#if PIN_EXISTS(E5_DIAG)
1648
+  REPORT_NAME_DIGITAL(__LINE__, E5_DIAG_PIN)
1649
+#endif
1593 1650
 #if PIN_EXISTS(E5_SERIAL_TX)
1594 1651
   REPORT_NAME_DIGITAL(__LINE__, E5_SERIAL_TX_PIN)
1595 1652
 #endif
1596 1653
 #if PIN_EXISTS(E5_SERIAL_RX)
1597 1654
   REPORT_NAME_DIGITAL(__LINE__, E5_SERIAL_RX_PIN)
1598 1655
 #endif
1656
+#if PIN_EXISTS(E6_DIAG)
1657
+  REPORT_NAME_DIGITAL(__LINE__, E6_DIAG_PIN)
1658
+#endif
1599 1659
 #if PIN_EXISTS(E6_SERIAL_TX)
1600 1660
   REPORT_NAME_DIGITAL(__LINE__, E6_SERIAL_TX_PIN)
1601 1661
 #endif
1602 1662
 #if PIN_EXISTS(E6_SERIAL_RX)
1603 1663
   REPORT_NAME_DIGITAL(__LINE__, E6_SERIAL_RX_PIN)
1604 1664
 #endif
1665
+#if PIN_EXISTS(E7_DIAG)
1666
+  REPORT_NAME_DIGITAL(__LINE__, E7_DIAG_PIN)
1667
+#endif
1605 1668
 #if PIN_EXISTS(E7_SERIAL_TX)
1606 1669
   REPORT_NAME_DIGITAL(__LINE__, E7_SERIAL_TX_PIN)
1607 1670
 #endif

+ 10
- 10
Marlin/src/pins/rambo/pins_EINSY_RETRO.h View File

@@ -38,7 +38,7 @@
38 38
   #error "You must set ([XYZ]|E0)_DRIVER_TYPE to TMC2130 in Configuration.h for EinsyRetro."
39 39
 #endif
40 40
 
41
-// TMC2130 Diag Pins (currently just for reference)
41
+// TMC2130 Diag Pins
42 42
 #define X_DIAG_PIN         64
43 43
 #define Y_DIAG_PIN         69
44 44
 #define Z_DIAG_PIN         68
@@ -55,27 +55,27 @@
55 55
 
56 56
 #if DISABLED(SENSORLESS_HOMING)
57 57
 
58
-  #define X_MIN_PIN        12
59
-  #define Y_MIN_PIN        11
60
-  #define Z_MIN_PIN        10
61
-  #define X_MAX_PIN        81
62
-  #define Y_MAX_PIN        57
58
+  #define X_MIN_PIN        12   // X-
59
+  #define Y_MIN_PIN        11   // Y-
60
+  #define Z_MIN_PIN        10   // Z-
61
+  #define X_MAX_PIN        81   // X+
62
+  #define Y_MAX_PIN        57   // Y+
63 63
 
64 64
 #else
65 65
 
66 66
   #if X_HOME_DIR < 0
67 67
     #define X_MIN_PIN      X_DIAG_PIN
68
-    #define X_MAX_PIN      81
68
+    #define X_MAX_PIN      81   // X+
69 69
   #else
70
-    #define X_MIN_PIN      12
70
+    #define X_MIN_PIN      12   // X-
71 71
     #define X_MAX_PIN      X_DIAG_PIN
72 72
   #endif
73 73
 
74 74
   #if Y_HOME_DIR < 0
75 75
     #define Y_MIN_PIN      Y_DIAG_PIN
76
-    #define Y_MAX_PIN      57
76
+    #define Y_MAX_PIN      57   // Y+
77 77
   #else
78
-    #define Y_MIN_PIN      11
78
+    #define Y_MIN_PIN      11   // Y-
79 79
     #define Y_MAX_PIN      Y_DIAG_PIN
80 80
   #endif
81 81
 

+ 18
- 0
Marlin/src/pins/ramps/pins_RAMPS.h View File

@@ -390,6 +390,24 @@
390 390
   #ifndef E4_SERIAL_RX_PIN
391 391
     #define E4_SERIAL_RX_PIN -1
392 392
   #endif
393
+  #ifndef E5_SERIAL_TX_PIN
394
+    #define E5_SERIAL_TX_PIN -1
395
+  #endif
396
+  #ifndef E5_SERIAL_RX_PIN
397
+    #define E5_SERIAL_RX_PIN -1
398
+  #endif
399
+  #ifndef E6_SERIAL_TX_PIN
400
+    #define E6_SERIAL_TX_PIN -1
401
+  #endif
402
+  #ifndef E6_SERIAL_RX_PIN
403
+    #define E6_SERIAL_RX_PIN -1
404
+  #endif
405
+  #ifndef E7_SERIAL_TX_PIN
406
+    #define E7_SERIAL_TX_PIN -1
407
+  #endif
408
+  #ifndef E7_SERIAL_RX_PIN
409
+    #define E7_SERIAL_RX_PIN -1
410
+  #endif
393 411
 #endif
394 412
 
395 413
 //

+ 3
- 0
Marlin/src/pins/ramps/pins_TT_OSCAR.h View File

@@ -147,6 +147,9 @@
147 147
   #define E3_SERIAL_RX_PIN -1
148 148
   #define E4_SERIAL_TX_PIN -1
149 149
   #define E4_SERIAL_RX_PIN -1
150
+  #define E5_SERIAL_RX_PIN -1
151
+  #define E6_SERIAL_RX_PIN -1
152
+  #define E7_SERIAL_RX_PIN -1
150 153
 #endif
151 154
 
152 155
 //

+ 18
- 0
Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h View File

@@ -285,4 +285,22 @@
285 285
   #ifndef E4_SERIAL_RX_PIN
286 286
     #define E4_SERIAL_RX_PIN -1
287 287
   #endif
288
+  #ifndef E5_SERIAL_TX_PIN
289
+    #define E5_SERIAL_TX_PIN -1
290
+  #endif
291
+  #ifndef E5_SERIAL_RX_PIN
292
+    #define E5_SERIAL_RX_PIN -1
293
+  #endif
294
+  #ifndef E6_SERIAL_TX_PIN
295
+    #define E6_SERIAL_TX_PIN -1
296
+  #endif
297
+  #ifndef E6_SERIAL_RX_PIN
298
+    #define E6_SERIAL_RX_PIN -1
299
+  #endif
300
+  #ifndef E7_SERIAL_TX_PIN
301
+    #define E7_SERIAL_TX_PIN -1
302
+  #endif
303
+  #ifndef E7_SERIAL_RX_PIN
304
+    #define E7_SERIAL_RX_PIN -1
305
+  #endif
288 306
 #endif

+ 10
- 0
Marlin/src/sd/SdVolume.cpp View File

@@ -291,6 +291,16 @@ int32_t SdVolume::freeClusterCount() {
291 291
       for (uint16_t i = 0; i < n; i++)
292 292
         if (cacheBuffer_.fat32[i] == 0) free++;
293 293
     }
294
+    #ifdef ESP32
295
+      // Needed to reset the idle task watchdog timer on ESP32 as reading the complete FAT may easily 
296
+      // block for 10+ seconds. yield() is insufficient since it blocks lower prio tasks (e.g., idle).
297
+      static millis_t nextTaskTime = 0;
298
+      const millis_t ms = millis();
299
+      if (ELAPSED(ms, nextTaskTime)) {
300
+        vTaskDelay(1);            // delay 1 tick (Minimum. Usually 10 or 1 ms depending on skdconfig.h)
301
+        nextTaskTime = ms + 1000; // tickle the task manager again in 1 second
302
+      }
303
+    #endif // ESP32
294 304
   }
295 305
   return free;
296 306
 }

Loading…
Cancel
Save