Browse Source

Allow suicide pin inverting (#15586)

pull/1/head
InsanityAutomation 5 years ago
committed by Scott Lahteine
parent
commit
82fb046013
  1. 2
      Marlin/src/Marlin.cpp
  2. 2
      Marlin/src/Marlin.h
  3. 2
      Marlin/src/gcode/control/M80_M81.cpp
  4. 3
      Marlin/src/pins/pins.h
  5. 26
      Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h

2
Marlin/src/Marlin.cpp

@ -217,7 +217,7 @@ void setup_killpin() {
void setup_powerhold() {
#if HAS_SUICIDE
OUT_WRITE(SUICIDE_PIN, HIGH);
OUT_WRITE(SUICIDE_PIN, !SUICIDE_PIN_INVERTING);
#endif
#if ENABLED(PSU_CONTROL)
#if ENABLED(PS_DEFAULT_OFF)

2
Marlin/src/Marlin.h

@ -368,7 +368,7 @@ bool pin_is_protected(const pin_t pin);
void protected_pin_err();
#if HAS_SUICIDE
inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
inline void suicide() { OUT_WRITE(SUICIDE_PIN, SUICIDE_PIN_INVERTING); }
#endif
#if ENABLED(G29_RETRY_AND_RECOVER)

2
Marlin/src/gcode/control/M80_M81.cpp

@ -68,7 +68,7 @@
* a print without suicide...
*/
#if HAS_SUICIDE
OUT_WRITE(SUICIDE_PIN, HIGH);
OUT_WRITE(SUICIDE_PIN, !SUICIDE_PIN_INVERTING);
#endif
#if DISABLED(AUTO_POWER_CONTROL)

3
Marlin/src/pins/pins.h

@ -801,6 +801,9 @@
#ifndef SUICIDE_PIN
#define SUICIDE_PIN -1
#endif
#ifndef SUICIDE_PIN_INVERTING
#define SUICIDE_PIN_INVERTING false
#endif
#ifndef NUM_SERVO_PLUGS
#define NUM_SERVO_PLUGS 4

26
Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h

@ -36,15 +36,27 @@
#define FIL_RUNOUT_PIN 2
#if NUM_RUNOUT_SENSORS > 1
#define FIL_RUNOUT2_PIN 15 // Creality CR-X can use dual runout sensors
#define FIL_RUNOUT2_PIN 15 // Creality CR-X can use dual runout sensors
#endif
#define SD_DETECT_PIN 49 // Always define onboard SD detect
#define BEEPER_PIN 37 // Always define beeper pin so Play Tone works with ExtUI
#define SD_DETECT_PIN 49 // Always define onboard SD detect
#define PS_ON_PIN 40 // Used by CR2020 Industrial series
#if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN)
#define CASE_LIGHT_PIN 65
#endif
#include "pins_RAMPS.h"
#define EXP1_PIN 65 // A11
#define EXP2_PIN 66 // A12
#define EXP3_PIN 11 // SERVO0_PIN
#define EXP4_PIN 12 // PS_ON_PIN
#ifndef BEEPER_PIN
#define BEEPER_PIN 37 // Always define beeper pin so Play Tone works with ExtUI
#endif
#define EXP1_PIN 65 // A11 - Used by CR2020 Industrial series for case
#define EXP2_PIN 66 // A12
#define EXP3_PIN 11 // SERVO0_PIN
#define EXP4_PIN 12 // PS_ON_PIN
#define SUICIDE_PIN 12 // Used by CR2020 Industrial series
#define SUICIDE_PIN_INVERTING true // Used by CR2020 Industrial series

Loading…
Cancel
Save