Browse Source

Merge pull request #350 from jcrocholl/Marlin_v1

Automatically set *_MIN_PIN and *_MAX_PIN according to *_HOME_DIR.
daid 12 years ago
parent
commit
30254e3388
1 changed files with 75 additions and 95 deletions
  1. 75
    95
      Marlin/pins.h

+ 75
- 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
976
 #define X_STEP_PIN          0
941
 #define X_STEP_PIN          0
977
 #define X_DIR_PIN           1
942
 #define X_DIR_PIN           1
978
 #define X_ENABLE_PIN       39
943
 #define X_ENABLE_PIN       39
979
-#define X_MAX_PIN          -1
980
 
944
 
981
 #define Y_STEP_PIN          2
945
 #define Y_STEP_PIN          2
982
 #define Y_DIR_PIN           3
946
 #define Y_DIR_PIN           3
983
 #define Y_ENABLE_PIN       38
947
 #define Y_ENABLE_PIN       38
984
-#define Y_MAX_PIN          -1
985
 
948
 
986
 #define Z_STEP_PIN          4
949
 #define Z_STEP_PIN          4
987
 #define Z_DIR_PIN           5
950
 #define Z_DIR_PIN           5
988
 #define Z_ENABLE_PIN       23
951
 #define Z_ENABLE_PIN       23
989
-#define Z_MAX_PIN          -1
990
 
952
 
991
 #define E0_STEP_PIN         6
953
 #define E0_STEP_PIN         6
992
 #define E0_DIR_PIN          7
954
 #define E0_DIR_PIN          7
1001
 // for the fan and Teensyduino uses a different pin mapping.
963
 // for the fan and Teensyduino uses a different pin mapping.
1002
 
964
 
1003
 #if MOTHERBOARD == 8  // Teensylu
965
 #if MOTHERBOARD == 8  // Teensylu
1004
-  #define X_MIN_PIN          13
1005
-  #define Y_MIN_PIN          14
1006
-  #define Z_MIN_PIN          15
966
+  #define X_STOP_PIN         13
967
+  #define Y_STOP_PIN         14
968
+  #define Z_STOP_PIN         15
1007
   #define TEMP_0_PIN          7  // Extruder / Analog pin numbering
969
   #define TEMP_0_PIN          7  // Extruder / Analog pin numbering
1008
   #define TEMP_BED_PIN        6  // Bed / Analog pin numbering
970
   #define TEMP_BED_PIN        6  // Bed / Analog pin numbering
1009
 #else  // Printrboard
971
 #else  // Printrboard
1010
-  #define X_MIN_PIN          35
1011
-  #define Y_MIN_PIN           8
1012
-  #define Z_MIN_PIN          36
972
+  #define X_STOP_PIN         35
973
+  #define Y_STOP_PIN          8
974
+  #define Z_STOP_PIN         36
1013
   #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
975
   #define TEMP_0_PIN          1  // Extruder / Analog pin numbering
1014
   #define TEMP_BED_PIN        0  // Bed / Analog pin numbering
976
   #define TEMP_BED_PIN        0  // Bed / Analog pin numbering
1015
 #endif
977
 #endif
1049
 #define X_STEP_PIN         27
1011
 #define X_STEP_PIN         27
1050
 #define X_DIR_PIN          29
1012
 #define X_DIR_PIN          29
1051
 #define X_ENABLE_PIN       28
1013
 #define X_ENABLE_PIN       28
1052
-#define X_MIN_PIN           7
1053
-#define X_MAX_PIN          -1
1014
+#define X_STOP_PIN          7
1054
 #define X_ATT_PIN          26
1015
 #define X_ATT_PIN          26
1055
 
1016
 
1056
 #define Y_STEP_PIN         31
1017
 #define Y_STEP_PIN         31
1057
 #define Y_DIR_PIN          33
1018
 #define Y_DIR_PIN          33
1058
 #define Y_ENABLE_PIN       32
1019
 #define Y_ENABLE_PIN       32
1059
-#define Y_MIN_PIN           6
1060
-#define Y_MAX_PIN          -1
1020
+#define Y_STOP_PIN          6
1061
 #define Y_ATT_PIN          30
1021
 #define Y_ATT_PIN          30
1062
 
1022
 
1063
 #define Z_STEP_PIN         17
1023
 #define Z_STEP_PIN         17
1064
 #define Z_DIR_PIN          19
1024
 #define Z_DIR_PIN          19
1065
 #define Z_ENABLE_PIN       18
1025
 #define Z_ENABLE_PIN       18
1066
-#define Z_MIN_PIN           5
1067
-#define Z_MAX_PIN          -1
1026
+#define Z_STOP_PIN          5
1068
 #define Z_ATT_PIN          16
1027
 #define Z_ATT_PIN          16
1069
 
1028
 
1070
 #define E0_STEP_PIN        21
1029
 #define E0_STEP_PIN        21
1114
 
1073
 
1115
 #define X_STEP_PIN         15
1074
 #define X_STEP_PIN         15
1116
 #define X_DIR_PIN          18
1075
 #define X_DIR_PIN          18
1117
-#define X_MIN_PIN          20
1118
-#define X_MAX_PIN           -1
1076
+#define X_STOP_PIN         20
1119
 
1077
 
1120
 #define Y_STEP_PIN         23
1078
 #define Y_STEP_PIN         23
1121
 #define Y_DIR_PIN          22
1079
 #define Y_DIR_PIN          22
1122
-#define Y_MIN_PIN          25
1123
-#define Y_MAX_PIN          -1
1080
+#define Y_STOP_PIN         25
1124
 
1081
 
1125
 #define Z_STEP_PIN         27
1082
 #define Z_STEP_PIN         27
1126
 #define Z_DIR_PIN          28
1083
 #define Z_DIR_PIN          28
1127
-#define Z_MIN_PIN          30
1128
-#define Z_MAX_PIN          -1
1084
+#define Z_STOP_PIN         30
1129
 
1085
 
1130
 #define E_STEP_PIN         17
1086
 #define E_STEP_PIN         17
1131
 #define E_DIR_PIN          21
1087
 #define E_DIR_PIN          21
1195
 #define X_STEP_PIN         21
1151
 #define X_STEP_PIN         21
1196
 #define X_DIR_PIN          20
1152
 #define X_DIR_PIN          20
1197
 #define X_ENABLE_PIN       24
1153
 #define X_ENABLE_PIN       24
1198
-#define X_MIN_PIN          0
1199
-#define X_MAX_PIN          -1
1154
+#define X_STOP_PIN         0
1200
 
1155
 
1201
 #define Y_STEP_PIN         23
1156
 #define Y_STEP_PIN         23
1202
 #define Y_DIR_PIN          22
1157
 #define Y_DIR_PIN          22
1203
 #define Y_ENABLE_PIN       24
1158
 #define Y_ENABLE_PIN       24
1204
-#define Y_MIN_PIN          1
1205
-#define Y_MAX_PIN          -1
1159
+#define Y_STOP_PIN         1
1206
 
1160
 
1207
 #define Z_STEP_PIN         26
1161
 #define Z_STEP_PIN         26
1208
 #define Z_DIR_PIN          25
1162
 #define Z_DIR_PIN          25
1209
 #define Z_ENABLE_PIN       24
1163
 #define Z_ENABLE_PIN       24
1210
-#define Z_MIN_PIN          2
1211
-#define Z_MAX_PIN          -1
1164
+#define Z_STOP_PIN         2
1212
 
1165
 
1213
 #define E0_STEP_PIN         28
1166
 #define E0_STEP_PIN         28
1214
 #define E0_DIR_PIN          27
1167
 #define E0_DIR_PIN          27
1252
 #define X_STEP_PIN         26
1205
 #define X_STEP_PIN         26
1253
 #define X_DIR_PIN          25
1206
 #define X_DIR_PIN          25
1254
 #define X_ENABLE_PIN       10
1207
 #define X_ENABLE_PIN       10
1255
-#define X_MIN_PIN          0
1256
-#define X_MAX_PIN          -1
1208
+#define X_STOP_PIN         0
1257
 
1209
 
1258
 #define Y_STEP_PIN         28
1210
 #define Y_STEP_PIN         28
1259
 #define Y_DIR_PIN          27
1211
 #define Y_DIR_PIN          27
1260
 #define Y_ENABLE_PIN       10
1212
 #define Y_ENABLE_PIN       10
1261
-#define Y_MIN_PIN          1
1262
-#define Y_MAX_PIN          -1
1213
+#define Y_STOP_PIN         1
1263
 
1214
 
1264
 #define Z_STEP_PIN         23
1215
 #define Z_STEP_PIN         23
1265
 #define Z_DIR_PIN          22
1216
 #define Z_DIR_PIN          22
1266
 #define Z_ENABLE_PIN       10
1217
 #define Z_ENABLE_PIN       10
1267
-#define Z_MIN_PIN          2
1268
-#define Z_MAX_PIN          -1
1218
+#define Z_STOP_PIN         2
1269
 
1219
 
1270
 #define E0_STEP_PIN         24
1220
 #define E0_STEP_PIN         24
1271
 #define E0_DIR_PIN          21
1221
 #define E0_DIR_PIN          21
1402
 #define X_DIR_PIN          28
1352
 #define X_DIR_PIN          28
1403
 #define X_ENABLE_PIN       24
1353
 #define X_ENABLE_PIN       24
1404
 #define X_MIN_PIN          41
1354
 #define X_MIN_PIN          41
1405
-#define X_MAX_PIN          37   //2 //Max endstops default to disabled "-1", set to commented value to enable.
1355
+#define X_MAX_PIN          37
1406
 
1356
 
1407
 #define Y_STEP_PIN         60 // A6
1357
 #define Y_STEP_PIN         60 // A6
1408
 #define Y_DIR_PIN          61 // A7
1358
 #define Y_DIR_PIN          61 // A7
1409
 #define Y_ENABLE_PIN       22
1359
 #define Y_ENABLE_PIN       22
1410
 #define Y_MIN_PIN          14
1360
 #define Y_MIN_PIN          14
1411
-#define Y_MAX_PIN          15   //15
1361
+#define Y_MAX_PIN          15
1412
 
1362
 
1413
 #define Z_STEP_PIN         54 // A0
1363
 #define Z_STEP_PIN         54 // A0
1414
 #define Z_DIR_PIN          55 // A1
1364
 #define Z_DIR_PIN          55 // A1
1502
   #define _E2_PINS
1452
   #define _E2_PINS
1503
 #endif
1453
 #endif
1504
 
1454
 
1455
+#ifdef X_STOP_PIN
1456
+  #if X_HOME_DIR < 0
1457
+    #define X_MIN_PIN X_STOP_PIN
1458
+    #define X_MAX_PIN -1
1459
+  #else
1460
+    #define X_MIN_PIN -1
1461
+    #define X_MAX_PIN X_STOP_PIN
1462
+  #endif
1463
+#endif
1464
+
1465
+#ifdef Y_STOP_PIN
1466
+  #if Y_HOME_DIR < 0
1467
+    #define Y_MIN_PIN Y_STOP_PIN
1468
+    #define Y_MAX_PIN -1
1469
+  #else
1470
+    #define Y_MIN_PIN -1
1471
+    #define Y_MAX_PIN Y_STOP_PIN
1472
+  #endif
1473
+#endif
1474
+
1475
+#ifdef Z_STOP_PIN
1476
+  #if Z_HOME_DIR < 0
1477
+    #define Z_MIN_PIN Z_STOP_PIN
1478
+    #define Z_MAX_PIN -1
1479
+  #else
1480
+    #define Z_MIN_PIN -1
1481
+    #define Z_MAX_PIN Z_STOP_PIN
1482
+  #endif
1483
+#endif
1484
+
1505
 #ifdef DISABLE_MAX_ENDSTOPS
1485
 #ifdef DISABLE_MAX_ENDSTOPS
1506
 #define X_MAX_PIN          -1
1486
 #define X_MAX_PIN          -1
1507
 #define Y_MAX_PIN          -1
1487
 #define Y_MAX_PIN          -1

Loading…
Cancel
Save