Browse Source

Patch up digital microstepping and SPI CS pins

Scott Lahteine 6 years ago
parent
commit
582d073de1
3 changed files with 85 additions and 20 deletions
  1. 25
    0
      Marlin/src/inc/SanityCheck.h
  2. 48
    20
      Marlin/src/pins/pins.h
  3. 12
    0
      Marlin/src/pins/pinsDebug_list.h

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

@@ -1467,6 +1467,31 @@ static_assert(1 >= 0
1467 1467
   #elif defined(AUTOMATIC_CURRENT_CONTROL)
1468 1468
     #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration."
1469 1469
   #endif
1470
+
1471
+  #if ENABLED(X_IS_TMC2130) && !PIN_EXISTS(X_CS)
1472
+    #error "X_CS_PIN is required for X_IS_TMC2130. Define X_CS_PIN in Configuration_adv.h."
1473
+  #elif ENABLED(X2_IS_TMC2130) && !PIN_EXISTS(X2_CS)
1474
+    #error "X2_CS_PIN is required for X2_IS_TMC2130. Define X2_CS_PIN in Configuration_adv.h."
1475
+  #elif ENABLED(Y_IS_TMC2130) && !PIN_EXISTS(Y_CS)
1476
+    #error "Y_CS_PIN is required for Y_IS_TMC2130. Define Y_CS_PIN in Configuration_adv.h."
1477
+  #elif ENABLED(Y2_IS_TMC2130) && !PIN_EXISTS(Y2_CS)
1478
+    #error "Y2_CS_PIN is required for Y2_IS_TMC2130. Define Y2_CS_PIN in Configuration_adv.h."
1479
+  #elif ENABLED(Z_IS_TMC2130) && !PIN_EXISTS(Z_CS)
1480
+    #error "Z_CS_PIN is required for Z_IS_TMC2130. Define Z_CS_PIN in Configuration_adv.h."
1481
+  #elif ENABLED(Z2_IS_TMC2130) && !PIN_EXISTS(Z2_CS)
1482
+    #error "Z2_CS_PIN is required for Z2_IS_TMC2130. Define Z2_CS_PIN in Configuration_adv.h."
1483
+  #elif ENABLED(E0_IS_TMC2130) && !PIN_EXISTS(E0_CS)
1484
+    #error "E0_CS_PIN is required for E0_IS_TMC2130. Define E0_CS_PIN in Configuration_adv.h."
1485
+  #elif ENABLED(E1_IS_TMC2130) && !PIN_EXISTS(E1_CS)
1486
+    #error "E1_CS_PIN is required for E1_IS_TMC2130. Define E1_CS_PIN in Configuration_adv.h."
1487
+  #elif ENABLED(E2_IS_TMC2130) && !PIN_EXISTS(E2_CS)
1488
+    #error "E2_CS_PIN is required for E2_IS_TMC2130. Define E2_CS_PIN in Configuration_adv.h."
1489
+  #elif ENABLED(E3_IS_TMC2130) && !PIN_EXISTS(E3_CS)
1490
+    #error "E3_CS_PIN is required for E3_IS_TMC2130. Define E3_CS_PIN in Configuration_adv.h."
1491
+  #elif ENABLED(E4_IS_TMC2130) && !PIN_EXISTS(E4_CS)
1492
+    #error "E4_CS_PIN is required for E4_IS_TMC2130. Define E4_CS_PIN in Configuration_adv.h."
1493
+  #endif
1494
+
1470 1495
 #endif
1471 1496
 
1472 1497
 /**

+ 48
- 20
Marlin/src/pins/pins.h View File

@@ -364,6 +364,46 @@
364 364
 #ifndef Z_MS2_PIN
365 365
   #define Z_MS2_PIN -1
366 366
 #endif
367
+#ifndef Z_MS3_PIN
368
+  #define Z_MS3_PIN -1
369
+#endif
370
+#ifndef E0_MS1_PIN
371
+  #define E0_MS1_PIN -1
372
+#endif
373
+#ifndef E0_MS2_PIN
374
+  #define E0_MS2_PIN -1
375
+#endif
376
+#ifndef E1_MS1_PIN
377
+  #define E1_MS1_PIN -1
378
+#endif
379
+#ifndef E1_MS2_PIN
380
+  #define E1_MS2_PIN -1
381
+#endif
382
+#ifndef E2_MS1_PIN
383
+  #define E2_MS1_PIN -1
384
+#endif
385
+#ifndef E2_MS2_PIN
386
+  #define E2_MS2_PIN -1
387
+#endif
388
+#ifndef E3_MS1_PIN
389
+  #define E3_MS1_PIN -1
390
+#endif
391
+#ifndef E3_MS2_PIN
392
+  #define E3_MS2_PIN -1
393
+#endif
394
+#ifndef E3_MS3_PIN
395
+  #define E3_MS3_PIN -1
396
+#endif
397
+#ifndef E4_MS1_PIN
398
+  #define E4_MS1_PIN -1
399
+#endif
400
+#ifndef E4_MS2_PIN
401
+  #define E4_MS2_PIN -1
402
+#endif
403
+#ifndef E4_MS3_PIN
404
+  #define E4_MS3_PIN -1
405
+#endif
406
+
367 407
 #ifndef E0_STEP_PIN
368 408
   #define E0_STEP_PIN -1
369 409
 #endif
@@ -373,12 +413,6 @@
373 413
 #ifndef E0_ENABLE_PIN
374 414
   #define E0_ENABLE_PIN -1
375 415
 #endif
376
-#ifndef E0_MS1_PIN
377
-  #define E0_MS1_PIN -1
378
-#endif
379
-#ifndef E0_MS2_PIN
380
-  #define E0_MS2_PIN -1
381
-#endif
382 416
 #ifndef E1_STEP_PIN
383 417
   #define E1_STEP_PIN -1
384 418
 #endif
@@ -388,12 +422,6 @@
388 422
 #ifndef E1_ENABLE_PIN
389 423
   #define E1_ENABLE_PIN -1
390 424
 #endif
391
-#ifndef E1_MS1_PIN
392
-  #define E1_MS1_PIN -1
393
-#endif
394
-#ifndef E1_MS2_PIN
395
-  #define E1_MS2_PIN -1
396
-#endif
397 425
 #ifndef E2_STEP_PIN
398 426
   #define E2_STEP_PIN -1
399 427
 #endif
@@ -539,7 +567,7 @@
539 567
     #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN,
540 568
     #if EXTRUDERS > 4 // Tools 4 and 5 use E2
541 569
       #undef _E2_PINS
542
-      #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN,
570
+      #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN,
543 571
     #endif
544 572
   #endif
545 573
 #elif EXTRUDERS > 1
@@ -547,13 +575,13 @@
547 575
   #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN,
548 576
   #if EXTRUDERS > 2
549 577
     #undef _E2_PINS
550
-    #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN,
578
+    #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN,
551 579
     #if EXTRUDERS > 3
552 580
       #undef _E3_PINS
553
-      #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN,
581
+      #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, E3_MS1_PIN, E3_MS2_PIN,
554 582
       #if EXTRUDERS > 4
555 583
         #undef _E4_PINS
556
-        #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN,
584
+        #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, E4_MS1_PIN, E4_MS2_PIN,
557 585
       #endif // EXTRUDERS > 4
558 586
     #endif // EXTRUDERS > 3
559 587
   #endif // EXTRUDERS > 2
@@ -582,16 +610,16 @@
582 610
   #endif // HOTENDS > 2
583 611
 #elif ENABLED(MIXING_EXTRUDER)
584 612
   #undef _E1_PINS
585
-  #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN,
613
+  #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN,
586 614
   #if MIXING_STEPPERS > 2
587 615
     #undef _E2_PINS
588
-    #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN,
616
+    #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN,
589 617
     #if MIXING_STEPPERS > 3
590 618
       #undef _E3_PINS
591
-      #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN,
619
+      #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, E3_MS1_PIN, E3_MS2_PIN,
592 620
       #if MIXING_STEPPERS > 4
593 621
         #undef _E4_PINS
594
-        #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN,
622
+        #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, E4_MS1_PIN, E4_MS2_PIN,
595 623
       #endif // MIXING_STEPPERS > 4
596 624
     #endif // MIXING_STEPPERS > 3
597 625
   #endif // MIXING_STEPPERS > 2

+ 12
- 0
Marlin/src/pins/pinsDebug_list.h View File

@@ -289,12 +289,24 @@
289 289
 #if PIN_EXISTS(E3_STEP)
290 290
   REPORT_NAME_DIGITAL(E3_STEP_PIN, __LINE__ )
291 291
 #endif
292
+#if PIN_EXISTS(E4_CS)
293
+  REPORT_NAME_DIGITAL(E4_CS_PIN, __LINE__ )
294
+#endif
292 295
 #if PIN_EXISTS(E4_DIR)
293 296
   REPORT_NAME_DIGITAL(E4_DIR_PIN, __LINE__ )
294 297
 #endif
295 298
 #if PIN_EXISTS(E4_ENABLE)
296 299
   REPORT_NAME_DIGITAL(E4_ENABLE_PIN, __LINE__ )
297 300
 #endif
301
+#if PIN_EXISTS(E4_MS1)
302
+  REPORT_NAME_DIGITAL(E4_MS1_PIN, __LINE__ )
303
+#endif
304
+#if PIN_EXISTS(E4_MS2)
305
+  REPORT_NAME_DIGITAL(E4_MS2_PIN, __LINE__ )
306
+#endif
307
+#if PIN_EXISTS(E4_MS3)
308
+  REPORT_NAME_DIGITAL(E4_MS3_PIN, __LINE__ )
309
+#endif
298 310
 #if PIN_EXISTS(E4_STEP)
299 311
   REPORT_NAME_DIGITAL(E4_STEP_PIN, __LINE__ )
300 312
 #endif

Loading…
Cancel
Save