Browse Source

For boards with only one endstop per axis, automatically set *_MIN_PIN and *_MAX_PIN according to *_HOME_DIR.

Johann Rocholl 12 years ago
parent
commit
b39f5d614a
1 changed files with 76 additions and 95 deletions
  1. 76
    95
      Marlin/pins.h

+ 76
- 95
Marlin/pins.h View File

19
 #define X_STEP_PIN          2
19
 #define X_STEP_PIN          2
20
 #define X_DIR_PIN           3
20
 #define X_DIR_PIN           3
21
 #define X_ENABLE_PIN        -1
21
 #define X_ENABLE_PIN        -1
22
-#define X_MIN_PIN           -1
23
-#define X_MAX_PIN           16
22
+#define X_STOP_PIN          16
24
 
23
 
25
 #define Y_STEP_PIN          5
24
 #define Y_STEP_PIN          5
26
 #define Y_DIR_PIN           6
25
 #define Y_DIR_PIN           6
27
 #define Y_ENABLE_PIN       -1
26
 #define Y_ENABLE_PIN       -1
28
-#define Y_MIN_PIN           67
29
-#define Y_MAX_PIN          -1
27
+#define Y_STOP_PIN          67
30
 
28
 
31
 #define Z_STEP_PIN          62
29
 #define Z_STEP_PIN          62
32
 #define Z_DIR_PIN           63
30
 #define Z_DIR_PIN           63
33
 #define Z_ENABLE_PIN       -1
31
 #define Z_ENABLE_PIN       -1
34
-#define Z_MIN_PIN           59
35
-#define Z_MAX_PIN          -1
32
+#define Z_STOP_PIN          59
36
 
33
 
37
 #define E0_STEP_PIN         65
34
 #define E0_STEP_PIN         65
38
 #define E0_DIR_PIN          66
35
 #define E0_DIR_PIN          66
83
 #define X_STEP_PIN 19
80
 #define X_STEP_PIN 19
84
 #define X_DIR_PIN 18
81
 #define X_DIR_PIN 18
85
 #define X_ENABLE_PIN 24
82
 #define X_ENABLE_PIN 24
86
-#define X_MIN_PIN 7
87
-#define X_MAX_PIN -1
83
+#define X_STOP_PIN 7
88
 
84
 
89
 //y axis pins
85
 //y axis pins
90
 #define Y_STEP_PIN 23
86
 #define Y_STEP_PIN 23
91
 #define Y_DIR_PIN 22
87
 #define Y_DIR_PIN 22
92
 #define Y_ENABLE_PIN 24
88
 #define Y_ENABLE_PIN 24
93
-#define Y_MIN_PIN 5
94
-#define Y_MAX_PIN -1
89
+#define Y_STOP_PIN 5
95
 
90
 
96
 //z axis pins
91
 //z axis pins
97
 #define Z_STEP_PIN 26
92
 #define Z_STEP_PIN 26
167
 #define X_STEP_PIN 29
162
 #define X_STEP_PIN 29
168
 #define X_DIR_PIN 28
163
 #define X_DIR_PIN 28
169
 #define X_ENABLE_PIN 25
164
 #define X_ENABLE_PIN 25
170
-#define X_MIN_PIN 0
171
-#define X_MAX_PIN -1
165
+#define X_STOP_PIN 0
172
 
166
 
173
 //y axis pins
167
 //y axis pins
174
 #define Y_STEP_PIN 27
168
 #define Y_STEP_PIN 27
175
 #define Y_DIR_PIN 26
169
 #define Y_DIR_PIN 26
176
 #define Y_ENABLE_PIN 25
170
 #define Y_ENABLE_PIN 25
177
-#define Y_MIN_PIN 1
178
-#define Y_MAX_PIN -1
171
+#define Y_STOP_PIN 1
179
 
172
 
180
 //z axis pins
173
 //z axis pins
181
 #define Z_STEP_PIN 23
174
 #define Z_STEP_PIN 23
182
 #define Z_DIR_PIN 22
175
 #define Z_DIR_PIN 22
183
 #define Z_ENABLE_PIN 25
176
 #define Z_ENABLE_PIN 25
184
-#define Z_MIN_PIN 2
185
-#define Z_MAX_PIN -1
177
+#define Z_STOP_PIN 2
186
 
178
 
187
 //extruder pins
179
 //extruder pins
188
 #define E0_STEP_PIN 19
180
 #define E0_STEP_PIN 19
238
     #define X_STEP_PIN      21                  //different from stanard GEN7
230
     #define X_STEP_PIN      21                  //different from stanard GEN7
239
     #define X_DIR_PIN       20				    //different from stanard GEN7
231
     #define X_DIR_PIN       20				    //different from stanard GEN7
240
     #define X_ENABLE_PIN    24
232
     #define X_ENABLE_PIN    24
241
-    #define X_MIN_PIN       0
242
-    #define X_MAX_PIN       -1
233
+    #define X_STOP_PIN      0
243
 
234
 
244
     //y axis pins
235
     //y axis pins
245
     #define Y_STEP_PIN      23
236
     #define Y_STEP_PIN      23
246
     #define Y_DIR_PIN       22
237
     #define Y_DIR_PIN       22
247
     #define Y_ENABLE_PIN    24
238
     #define Y_ENABLE_PIN    24
248
-    #define Y_MIN_PIN       1
249
-    #define Y_MAX_PIN       -1
239
+    #define Y_STOP_PIN      1
250
 
240
 
251
     //z axis pins
241
     //z axis pins
252
     #define Z_STEP_PIN      26
242
     #define Z_STEP_PIN      26
253
     #define Z_DIR_PIN       25
243
     #define Z_DIR_PIN       25
254
     #define Z_ENABLE_PIN    24
244
     #define Z_ENABLE_PIN    24
255
-    #define Z_MIN_PIN       2
256
-    #define Z_MAX_PIN       -1
245
+    #define Z_STOP_PIN      2
257
 
246
 
258
     //extruder pins
247
     //extruder pins
259
     #define E0_STEP_PIN      28
248
     #define E0_STEP_PIN      28
336
 #define X_DIR_PIN          55
325
 #define X_DIR_PIN          55
337
 #define X_ENABLE_PIN       38
326
 #define X_ENABLE_PIN       38
338
 #define X_MIN_PIN           3
327
 #define X_MIN_PIN           3
339
-#define X_MAX_PIN           2   //2 //Max endstops default to disabled "-1", set to commented value to enable.
328
+#define X_MAX_PIN           2
340
 
329
 
341
 #define Y_STEP_PIN         60
330
 #define Y_STEP_PIN         60
342
 #define Y_DIR_PIN          61
331
 #define Y_DIR_PIN          61
343
 #define Y_ENABLE_PIN       56
332
 #define Y_ENABLE_PIN       56
344
 #define Y_MIN_PIN          14
333
 #define Y_MIN_PIN          14
345
-#define Y_MAX_PIN          15   //15
334
+#define Y_MAX_PIN          15
346
 
335
 
347
 #define Z_STEP_PIN         46
336
 #define Z_STEP_PIN         46
348
 #define Z_DIR_PIN          48
337
 #define Z_DIR_PIN          48
546
 #define X_STEP_PIN         19
535
 #define X_STEP_PIN         19
547
 #define X_DIR_PIN          18
536
 #define X_DIR_PIN          18
548
 #define X_ENABLE_PIN       -1
537
 #define X_ENABLE_PIN       -1
549
-#define X_MIN_PIN          17
550
-#define X_MAX_PIN          -1
538
+#define X_STOP_PIN         17
551
 
539
 
552
 #define Y_STEP_PIN         10
540
 #define Y_STEP_PIN         10
553
 #define Y_DIR_PIN           7
541
 #define Y_DIR_PIN           7
554
 #define Y_ENABLE_PIN       -1
542
 #define Y_ENABLE_PIN       -1
555
-#define Y_MIN_PIN           8
556
-#define Y_MAX_PIN          -1
543
+#define Y_STOP_PIN          8
557
 
544
 
558
 #define Z_STEP_PIN         13
545
 #define Z_STEP_PIN         13
559
 #define Z_DIR_PIN           3
546
 #define Z_DIR_PIN           3
560
 #define Z_ENABLE_PIN        2
547
 #define Z_ENABLE_PIN        2
561
-#define Z_MIN_PIN           4
562
-#define Z_MAX_PIN          -1
548
+#define Z_STOP_PIN          4
563
 
549
 
564
 #define E0_STEP_PIN         11
550
 #define E0_STEP_PIN         11
565
 #define E0_DIR_PIN          12
551
 #define E0_DIR_PIN          12
600
     #define X_STEP_PIN      15
586
     #define X_STEP_PIN      15
601
     #define X_DIR_PIN       18
587
     #define X_DIR_PIN       18
602
     #define X_ENABLE_PIN    19
588
     #define X_ENABLE_PIN    19
603
-    #define X_MIN_PIN       20
604
-    #define X_MAX_PIN       -1
605
-    
589
+    #define X_STOP_PIN      20
590
+
606
     //y axis pins
591
     //y axis pins
607
     #define Y_STEP_PIN      23
592
     #define Y_STEP_PIN      23
608
     #define Y_DIR_PIN       22
593
     #define Y_DIR_PIN       22
609
     #define Y_ENABLE_PIN    24
594
     #define Y_ENABLE_PIN    24
610
-    #define Y_MIN_PIN       25
611
-    #define Y_MAX_PIN       -1
612
-    
595
+    #define Y_STOP_PIN      25
596
+
613
     //z axis pins
597
     //z axis pins
614
     #define Z_STEP_PIN      27
598
     #define Z_STEP_PIN      27
615
     #define Z_DIR_PIN       28
599
     #define Z_DIR_PIN       28
616
     #define Z_ENABLE_PIN    29
600
     #define Z_ENABLE_PIN    29
617
-    #define Z_MIN_PIN       30
618
-    #define Z_MAX_PIN       -1
619
-    
601
+    #define Z_STOP_PIN      30
602
+
620
     //extruder pins
603
     //extruder pins
621
     #define E0_STEP_PIN      4    //Edited @ EJE Electronics 20100715
604
     #define E0_STEP_PIN      4    //Edited @ EJE Electronics 20100715
622
     #define E0_DIR_PIN       2    //Edited @ EJE Electronics 20100715
605
     #define E0_DIR_PIN       2    //Edited @ EJE Electronics 20100715
675
 
658
 
676
 #define X_STEP_PIN         15
659
 #define X_STEP_PIN         15
677
 #define X_DIR_PIN          21
660
 #define X_DIR_PIN          21
678
-#if X_HOME_DIR < 0
679
-# define X_MIN_PIN          18 
680
-# define X_MAX_PIN          -1
681
-#else
682
-# define X_MIN_PIN          -1
683
-# define X_MAX_PIN          18
684
-#endif
661
+#define X_STOP_PIN         18
685
 
662
 
686
 #define Y_STEP_PIN         22
663
 #define Y_STEP_PIN         22
687
 #define Y_DIR_PIN          23
664
 #define Y_DIR_PIN          23
688
-#if Y_HOME_DIR < 0
689
-# define Y_MIN_PIN          19 
690
-# define Y_MAX_PIN          -1
691
-#else
692
-# define Y_MIN_PIN          -1
693
-# define Y_MAX_PIN          19
694
-#endif
665
+#define Y_STOP_PIN         19
695
 
666
 
696
 #define Z_STEP_PIN         3
667
 #define Z_STEP_PIN         3
697
 #define Z_DIR_PIN          2
668
 #define Z_DIR_PIN          2
698
-#if Z_HOME_DIR < 0
699
-# define Z_MIN_PIN          20 
700
-# define Z_MAX_PIN          -1
701
-#else
702
-# define Z_MIN_PIN          -1
703
-# define Z_MAX_PIN          20
704
-#endif
669
+#define Z_STOP_PIN         20
705
 
670
 
706
 #define E0_STEP_PIN         1
671
 #define E0_STEP_PIN         1
707
 #define E0_DIR_PIN          0
672
 #define E0_DIR_PIN          0
973
 #define X_STEP_PIN          0
938
 #define X_STEP_PIN          0
974
 #define X_DIR_PIN           1
939
 #define X_DIR_PIN           1
975
 #define X_ENABLE_PIN       39
940
 #define X_ENABLE_PIN       39
976
-#define X_MAX_PIN          -1
977
 
941
 
978
 #define Y_STEP_PIN          2
942
 #define Y_STEP_PIN          2
979
 #define Y_DIR_PIN           3
943
 #define Y_DIR_PIN           3
980
 #define Y_ENABLE_PIN       38
944
 #define Y_ENABLE_PIN       38
981
-#define Y_MAX_PIN          -1
982
 
945
 
983
 #define Z_STEP_PIN          4
946
 #define Z_STEP_PIN          4
984
 #define Z_DIR_PIN           5
947
 #define Z_DIR_PIN           5
985
 #define Z_ENABLE_PIN       23
948
 #define Z_ENABLE_PIN       23
986
-#define Z_MAX_PIN          -1
987
 
949
 
988
 #define E0_STEP_PIN         6
950
 #define E0_STEP_PIN         6
989
 #define E0_DIR_PIN          7
951
 #define E0_DIR_PIN          7
998
 // for the fan and Teensyduino uses a different pin mapping.
960
 // for the fan and Teensyduino uses a different pin mapping.
999
 
961
 
1000
 #if MOTHERBOARD == 8  // Teensylu
962
 #if MOTHERBOARD == 8  // Teensylu
1001
-  #define X_MIN_PIN          13
1002
-  #define Y_MIN_PIN          14
1003
-  #define Z_MIN_PIN          15
963
+  #define X_STOP_PIN         13
964
+  #define Y_STOP_PIN         14
965
+  #define Z_STOP_PIN         15
1004
   #define TEMP_0_PIN          7  // Extruder / Analog pin numbering
966
   #define TEMP_0_PIN          7  // Extruder / Analog pin numbering
1005
   #define TEMP_BED_PIN        6  // Bed / Analog pin numbering
967
   #define TEMP_BED_PIN        6  // Bed / Analog pin numbering
1006
 #else  // Printrboard
968
 #else  // Printrboard
1007
-  #define X_MIN_PIN          35
1008
-  #define Y_MIN_PIN           8
1009
-  #define Z_MIN_PIN          36
969
+  #define X_STOP_PIN         35
970
+  #define Y_STOP_PIN          8
971
+  #define Z_STOP_PIN         36
1010
   #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
972
   #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
1011
   #define TEMP_BED_PIN        0  // Bed / Analog pin numbering
973
   #define TEMP_BED_PIN        0  // Bed / Analog pin numbering
1012
 #endif
974
 #endif
1046
 #define X_STEP_PIN         27
1008
 #define X_STEP_PIN         27
1047
 #define X_DIR_PIN          29
1009
 #define X_DIR_PIN          29
1048
 #define X_ENABLE_PIN       28
1010
 #define X_ENABLE_PIN       28
1049
-#define X_MIN_PIN           7
1050
-#define X_MAX_PIN          -1
1011
+#define X_STOP_PIN          7
1051
 #define X_ATT_PIN          26
1012
 #define X_ATT_PIN          26
1052
 
1013
 
1053
 #define Y_STEP_PIN         31
1014
 #define Y_STEP_PIN         31
1054
 #define Y_DIR_PIN          33
1015
 #define Y_DIR_PIN          33
1055
 #define Y_ENABLE_PIN       32
1016
 #define Y_ENABLE_PIN       32
1056
-#define Y_MIN_PIN           6
1057
-#define Y_MAX_PIN          -1
1017
+#define Y_STOP_PIN          6
1058
 #define Y_ATT_PIN          30
1018
 #define Y_ATT_PIN          30
1059
 
1019
 
1020
+
1060
 #define Z_STEP_PIN         17
1021
 #define Z_STEP_PIN         17
1061
 #define Z_DIR_PIN          19
1022
 #define Z_DIR_PIN          19
1062
 #define Z_ENABLE_PIN       18
1023
 #define Z_ENABLE_PIN       18
1063
-#define Z_MIN_PIN           5
1064
-#define Z_MAX_PIN          -1
1024
+#define Z_STOP_PIN          5
1065
 #define Z_ATT_PIN          16
1025
 #define Z_ATT_PIN          16
1066
 
1026
 
1067
 #define E0_STEP_PIN        21
1027
 #define E0_STEP_PIN        21
1111
 
1071
 
1112
 #define X_STEP_PIN         15
1072
 #define X_STEP_PIN         15
1113
 #define X_DIR_PIN          18
1073
 #define X_DIR_PIN          18
1114
-#define X_MIN_PIN          20
1115
-#define X_MAX_PIN           -1
1074
+#define X_STOP_PIN         20
1116
 
1075
 
1117
 #define Y_STEP_PIN         23
1076
 #define Y_STEP_PIN         23
1118
 #define Y_DIR_PIN          22
1077
 #define Y_DIR_PIN          22
1119
-#define Y_MIN_PIN          25
1120
-#define Y_MAX_PIN          -1
1078
+#define Y_STOP_PIN         25
1121
 
1079
 
1122
 #define Z_STEP_PIN         27
1080
 #define Z_STEP_PIN         27
1123
 #define Z_DIR_PIN          28
1081
 #define Z_DIR_PIN          28
1124
-#define Z_MIN_PIN          30
1125
-#define Z_MAX_PIN          -1
1082
+#define Z_STOP_PIN         30
1126
 
1083
 
1127
 #define E_STEP_PIN         17
1084
 #define E_STEP_PIN         17
1128
 #define E_DIR_PIN          21
1085
 #define E_DIR_PIN          21
1192
 #define X_STEP_PIN         21
1149
 #define X_STEP_PIN         21
1193
 #define X_DIR_PIN          20
1150
 #define X_DIR_PIN          20
1194
 #define X_ENABLE_PIN       24
1151
 #define X_ENABLE_PIN       24
1195
-#define X_MIN_PIN          0
1196
-#define X_MAX_PIN          -1
1152
+#define X_STOP_PIN         0
1197
 
1153
 
1198
 #define Y_STEP_PIN         23
1154
 #define Y_STEP_PIN         23
1199
 #define Y_DIR_PIN          22
1155
 #define Y_DIR_PIN          22
1200
 #define Y_ENABLE_PIN       24
1156
 #define Y_ENABLE_PIN       24
1201
-#define Y_MIN_PIN          1
1202
-#define Y_MAX_PIN          -1
1157
+#define Y_STOP_PIN         1
1203
 
1158
 
1204
 #define Z_STEP_PIN         26
1159
 #define Z_STEP_PIN         26
1205
 #define Z_DIR_PIN          25
1160
 #define Z_DIR_PIN          25
1206
 #define Z_ENABLE_PIN       24
1161
 #define Z_ENABLE_PIN       24
1207
-#define Z_MIN_PIN          2
1208
-#define Z_MAX_PIN          -1
1162
+#define Z_STOP_PIN         2
1209
 
1163
 
1210
 #define E0_STEP_PIN         28
1164
 #define E0_STEP_PIN         28
1211
 #define E0_DIR_PIN          27
1165
 #define E0_DIR_PIN          27
1249
 #define X_STEP_PIN         26
1203
 #define X_STEP_PIN         26
1250
 #define X_DIR_PIN          25
1204
 #define X_DIR_PIN          25
1251
 #define X_ENABLE_PIN       10
1205
 #define X_ENABLE_PIN       10
1252
-#define X_MIN_PIN          0
1253
-#define X_MAX_PIN          -1
1206
+#define X_STOP_PIN         0
1254
 
1207
 
1255
 #define Y_STEP_PIN         28
1208
 #define Y_STEP_PIN         28
1256
 #define Y_DIR_PIN          27
1209
 #define Y_DIR_PIN          27
1257
 #define Y_ENABLE_PIN       10
1210
 #define Y_ENABLE_PIN       10
1258
-#define Y_MIN_PIN          1
1259
-#define Y_MAX_PIN          -1
1211
+#define Y_STOP_PIN         1
1260
 
1212
 
1261
 #define Z_STEP_PIN         23
1213
 #define Z_STEP_PIN         23
1262
 #define Z_DIR_PIN          22
1214
 #define Z_DIR_PIN          22
1263
 #define Z_ENABLE_PIN       10
1215
 #define Z_ENABLE_PIN       10
1264
-#define Z_MIN_PIN          2
1265
-#define Z_MAX_PIN          -1
1216
+#define Z_STOP_PIN         2
1266
 
1217
 
1267
 #define E0_STEP_PIN         24
1218
 #define E0_STEP_PIN         24
1268
 #define E0_DIR_PIN          21
1219
 #define E0_DIR_PIN          21
1399
 #define X_DIR_PIN          28
1350
 #define X_DIR_PIN          28
1400
 #define X_ENABLE_PIN       24
1351
 #define X_ENABLE_PIN       24
1401
 #define X_MIN_PIN          41
1352
 #define X_MIN_PIN          41
1402
-#define X_MAX_PIN          37   //2 //Max endstops default to disabled "-1", set to commented value to enable.
1353
+#define X_MAX_PIN          37
1403
 
1354
 
1404
 #define Y_STEP_PIN         60 // A6
1355
 #define Y_STEP_PIN         60 // A6
1405
 #define Y_DIR_PIN          61 // A7
1356
 #define Y_DIR_PIN          61 // A7
1406
 #define Y_ENABLE_PIN       22
1357
 #define Y_ENABLE_PIN       22
1407
 #define Y_MIN_PIN          14
1358
 #define Y_MIN_PIN          14
1408
-#define Y_MAX_PIN          15   //15
1359
+#define Y_MAX_PIN          15
1409
 
1360
 
1410
 #define Z_STEP_PIN         54 // A0
1361
 #define Z_STEP_PIN         54 // A0
1411
 #define Z_DIR_PIN          55 // A1
1362
 #define Z_DIR_PIN          55 // A1
1499
   #define _E2_PINS
1450
   #define _E2_PINS
1500
 #endif
1451
 #endif
1501
 
1452
 
1453
+#ifdef X_STOP_PIN
1454
+  #if X_HOME_DIR < 0
1455
+    #define X_MIN_PIN X_STOP_PIN
1456
+    #define X_MAX_PIN -1
1457
+  #else
1458
+    #define X_MIN_PIN -1
1459
+    #define X_MAX_PIN X_STOP_PIN
1460
+  #endif
1461
+#endif
1462
+
1463
+#ifdef Y_STOP_PIN
1464
+  #if Y_HOME_DIR < 0
1465
+    #define Y_MIN_PIN Y_STOP_PIN
1466
+    #define Y_MAX_PIN -1
1467
+  #else
1468
+    #define Y_MIN_PIN -1
1469
+    #define Y_MAX_PIN Y_STOP_PIN
1470
+  #endif
1471
+#endif
1472
+
1473
+#ifdef Z_STOP_PIN
1474
+  #if Z_HOME_DIR < 0
1475
+    #define Z_MIN_PIN Z_STOP_PIN
1476
+    #define Z_MAX_PIN -1
1477
+  #else
1478
+    #define Z_MIN_PIN -1
1479
+    #define Z_MAX_PIN Z_STOP_PIN
1480
+  #endif
1481
+#endif
1482
+
1502
 #ifdef DISABLE_MAX_ENDSTOPS
1483
 #ifdef DISABLE_MAX_ENDSTOPS
1503
 #define X_MAX_PIN          -1
1484
 #define X_MAX_PIN          -1
1504
 #define Y_MAX_PIN          -1
1485
 #define Y_MAX_PIN          -1

Loading…
Cancel
Save