Browse Source

Fix CALIBRATION_GCODE pin handling

Scott Lahteine 4 years ago
parent
commit
7bf2190f03

+ 2
- 2
Marlin/Configuration_adv.h View File

@@ -840,8 +840,8 @@
840 840
 
841 841
   // Define the pin to read during calibration
842 842
   #ifndef CALIBRATION_PIN
843
-    #define CALIBRATION_PIN -1 // Override in pins.h or set to -1 to use your Z endstop
844
-    #define CALIBRATION_PIN_INVERTING false // Set to true to invert the pin
843
+    //#define CALIBRATION_PIN -1            // Define here to override the default pin
844
+    #define CALIBRATION_PIN_INVERTING false // Set to true to invert the custom pin
845 845
     //#define CALIBRATION_PIN_PULLDOWN
846 846
     #define CALIBRATION_PIN_PULLUP
847 847
   #endif

+ 21
- 0
Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp View File

@@ -1,3 +1,24 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 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
+ */
1 22
 
2 23
 /* EEPROM emulation over flash with reduced wear
3 24
  *

+ 9
- 7
Marlin/src/gcode/calibrate/G425.cpp View File

@@ -128,13 +128,15 @@ inline void park_above_object(measurements_t &m, const float uncertainty) {
128 128
 #endif
129 129
 
130 130
 inline bool read_calibration_pin() {
131
-  #if HAS_CALIBRATION_PIN
132
-    return (READ(CALIBRATION_PIN) != CALIBRATION_PIN_INVERTING);
133
-  #elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
134
-    return (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
135
-  #else
136
-    return (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING);
137
-  #endif
131
+  return (
132
+    #if PIN_EXISTS(CALIBRATION)
133
+      READ(CALIBRATION_PIN) != CALIBRATION_PIN_INVERTING
134
+    #elif HAS_CUSTOM_PROBE_PIN
135
+      READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING
136
+    #else
137
+      READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING
138
+    #endif
139
+  );
138 140
 }
139 141
 
140 142
 /**

+ 0
- 1
Marlin/src/inc/Conditionals_post.h View File

@@ -1443,7 +1443,6 @@
1443 1443
 #define HAS_Z4_MIN (PIN_EXISTS(Z4_MIN))
1444 1444
 #define HAS_Z4_MAX (PIN_EXISTS(Z4_MAX))
1445 1445
 #define HAS_Z_MIN_PROBE_PIN (HAS_CUSTOM_PROBE_PIN && PIN_EXISTS(Z_MIN_PROBE))
1446
-#define HAS_CALIBRATION_PIN (PIN_EXISTS(CALIBRATION))
1447 1446
 
1448 1447
 //
1449 1448
 // ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface)

+ 1
- 1
Marlin/src/lcd/language/language_tr.h View File

@@ -1,4 +1,4 @@
1
- /**
1
+/**
2 2
  * Marlin 3D Printer Firmware
3 3
  * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 4
  *

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

@@ -256,7 +256,7 @@ void Endstops::init() {
256 256
     #endif
257 257
   #endif
258 258
 
259
-  #if HAS_CALIBRATION_PIN
259
+  #if PIN_EXISTS(CALIBRATION)
260 260
     #if ENABLED(CALIBRATION_PIN_PULLUP)
261 261
       SET_INPUT_PULLUP(CALIBRATION_PIN);
262 262
     #elif ENABLED(CALIBRATION_PIN_PULLDOWN)

+ 27
- 1
Marlin/src/pins/sam/pins_CNCONTROLS_15D.h View File

@@ -1,4 +1,26 @@
1 1
 /**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 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
+
23
+/**
2 24
  * CNControls V15 for HMS434 with DUE pin assignments
3 25
  */
4 26
 
@@ -92,6 +114,10 @@
92 114
 //#define PWM_2_PIN          13
93 115
 //#define SPARE_IO           17
94 116
 #define BEEPER_PIN         13
95
-#define CALIBRATION_PIN    66
96 117
 #define STAT_LED_BLUE_PIN  -1
97 118
 #define STAT_LED_RED_PIN   31
119
+
120
+// G425 CALIBRATION_GCODE default pin
121
+#ifndef CALIBRATION_PIN
122
+  #define CALIBRATION_PIN  66
123
+#endif

Loading…
Cancel
Save