Browse Source

Fix CALIBRATION_GCODE pin handling

pull/1/head
Scott Lahteine 4 years ago
parent
commit
7bf2190f03
  1. 4
      Marlin/Configuration_adv.h
  2. 21
      Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp
  3. 16
      Marlin/src/gcode/calibrate/G425.cpp
  4. 1
      Marlin/src/inc/Conditionals_post.h
  5. 2
      Marlin/src/lcd/language/language_tr.h
  6. 2
      Marlin/src/module/endstops.cpp
  7. 28
      Marlin/src/pins/sam/pins_CNCONTROLS_15D.h

4
Marlin/Configuration_adv.h

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

21
Marlin/src/HAL/HAL_DUE/EepromEmulation.cpp

@ -1,3 +1,24 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* EEPROM emulation over flash with reduced wear
*

16
Marlin/src/gcode/calibrate/G425.cpp

@ -128,13 +128,15 @@ inline void park_above_object(measurements_t &m, const float uncertainty) {
#endif
inline bool read_calibration_pin() {
#if HAS_CALIBRATION_PIN
return (READ(CALIBRATION_PIN) != CALIBRATION_PIN_INVERTING);
#elif ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
return (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING);
#else
return (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING);
#endif
return (
#if PIN_EXISTS(CALIBRATION)
READ(CALIBRATION_PIN) != CALIBRATION_PIN_INVERTING
#elif HAS_CUSTOM_PROBE_PIN
READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING
#else
READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING
#endif
);
}
/**

1
Marlin/src/inc/Conditionals_post.h

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

2
Marlin/src/lcd/language/language_tr.h

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

2
Marlin/src/module/endstops.cpp

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

28
Marlin/src/pins/sam/pins_CNCONTROLS_15D.h

@ -1,3 +1,25 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* CNControls V15 for HMS434 with DUE pin assignments
*/
@ -92,6 +114,10 @@
//#define PWM_2_PIN 13
//#define SPARE_IO 17
#define BEEPER_PIN 13
#define CALIBRATION_PIN 66
#define STAT_LED_BLUE_PIN -1
#define STAT_LED_RED_PIN 31
// G425 CALIBRATION_GCODE default pin
#ifndef CALIBRATION_PIN
#define CALIBRATION_PIN 66
#endif

Loading…
Cancel
Save