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. 16
      Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h

2
Marlin/src/Marlin.cpp

@ -217,7 +217,7 @@ void setup_killpin() {
void setup_powerhold() { void setup_powerhold() {
#if HAS_SUICIDE #if HAS_SUICIDE
OUT_WRITE(SUICIDE_PIN, HIGH); OUT_WRITE(SUICIDE_PIN, !SUICIDE_PIN_INVERTING);
#endif #endif
#if ENABLED(PSU_CONTROL) #if ENABLED(PSU_CONTROL)
#if ENABLED(PS_DEFAULT_OFF) #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(); void protected_pin_err();
#if HAS_SUICIDE #if HAS_SUICIDE
inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); } inline void suicide() { OUT_WRITE(SUICIDE_PIN, SUICIDE_PIN_INVERTING); }
#endif #endif
#if ENABLED(G29_RETRY_AND_RECOVER) #if ENABLED(G29_RETRY_AND_RECOVER)

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

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

3
Marlin/src/pins/pins.h

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

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

@ -40,11 +40,23 @@
#endif #endif
#define SD_DETECT_PIN 49 // Always define onboard SD detect #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 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" #include "pins_RAMPS.h"
#define EXP1_PIN 65 // A11 #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 EXP2_PIN 66 // A12
#define EXP3_PIN 11 // SERVO0_PIN #define EXP3_PIN 11 // SERVO0_PIN
#define EXP4_PIN 12 // PS_ON_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