浏览代码

Allow suicide pin inverting (#15586)

InsanityAutomation 5 年前
父节点
当前提交
82fb046013

+ 1
- 1
Marlin/src/Marlin.cpp 查看文件

217
 
217
 
218
 void setup_powerhold() {
218
 void setup_powerhold() {
219
   #if HAS_SUICIDE
219
   #if HAS_SUICIDE
220
-    OUT_WRITE(SUICIDE_PIN, HIGH);
220
+    OUT_WRITE(SUICIDE_PIN, !SUICIDE_PIN_INVERTING);
221
   #endif
221
   #endif
222
   #if ENABLED(PSU_CONTROL)
222
   #if ENABLED(PSU_CONTROL)
223
     #if ENABLED(PS_DEFAULT_OFF)
223
     #if ENABLED(PS_DEFAULT_OFF)

+ 1
- 1
Marlin/src/Marlin.h 查看文件

368
 void protected_pin_err();
368
 void protected_pin_err();
369
 
369
 
370
 #if HAS_SUICIDE
370
 #if HAS_SUICIDE
371
-  inline void suicide() { OUT_WRITE(SUICIDE_PIN, LOW); }
371
+  inline void suicide() { OUT_WRITE(SUICIDE_PIN, SUICIDE_PIN_INVERTING); }
372
 #endif
372
 #endif
373
 
373
 
374
 #if ENABLED(G29_RETRY_AND_RECOVER)
374
 #if ENABLED(G29_RETRY_AND_RECOVER)

+ 1
- 1
Marlin/src/gcode/control/M80_M81.cpp 查看文件

68
      * a print without suicide...
68
      * a print without suicide...
69
      */
69
      */
70
     #if HAS_SUICIDE
70
     #if HAS_SUICIDE
71
-      OUT_WRITE(SUICIDE_PIN, HIGH);
71
+      OUT_WRITE(SUICIDE_PIN, !SUICIDE_PIN_INVERTING);
72
     #endif
72
     #endif
73
 
73
 
74
     #if DISABLED(AUTO_POWER_CONTROL)
74
     #if DISABLED(AUTO_POWER_CONTROL)

+ 3
- 0
Marlin/src/pins/pins.h 查看文件

801
 #ifndef SUICIDE_PIN
801
 #ifndef SUICIDE_PIN
802
   #define SUICIDE_PIN -1
802
   #define SUICIDE_PIN -1
803
 #endif
803
 #endif
804
+#ifndef SUICIDE_PIN_INVERTING
805
+  #define SUICIDE_PIN_INVERTING false
806
+#endif
804
 
807
 
805
 #ifndef NUM_SERVO_PLUGS
808
 #ifndef NUM_SERVO_PLUGS
806
   #define NUM_SERVO_PLUGS 4
809
   #define NUM_SERVO_PLUGS 4

+ 19
- 7
Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h 查看文件

36
 
36
 
37
 #define FIL_RUNOUT_PIN 2
37
 #define FIL_RUNOUT_PIN 2
38
 #if NUM_RUNOUT_SENSORS > 1
38
 #if NUM_RUNOUT_SENSORS > 1
39
-  #define FIL_RUNOUT2_PIN 15 // Creality CR-X can use dual runout sensors
39
+  #define FIL_RUNOUT2_PIN  15 // Creality CR-X can use dual runout sensors
40
 #endif
40
 #endif
41
 
41
 
42
-#define SD_DETECT_PIN 49  // Always define onboard SD detect
42
+#define SD_DETECT_PIN      49  // Always define onboard SD detect
43
-#define BEEPER_PIN    37  // Always define beeper pin so Play Tone works with ExtUI
43
+
44
+#define PS_ON_PIN          40 // Used by CR2020 Industrial series
45
+
46
+#if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN)
47
+  #define CASE_LIGHT_PIN   65
48
+#endif
44
 
49
 
45
 #include "pins_RAMPS.h"
50
 #include "pins_RAMPS.h"
46
 
51
 
47
-#define EXP1_PIN 65   // A11
52
+#ifndef BEEPER_PIN
48
-#define EXP2_PIN 66   // A12
53
+  #define BEEPER_PIN       37  // Always define beeper pin so Play Tone works with ExtUI
49
-#define EXP3_PIN 11   // SERVO0_PIN
54
+#endif
50
-#define EXP4_PIN 12   // PS_ON_PIN
55
+
56
+#define EXP1_PIN           65   // A11 - Used by CR2020 Industrial series for case
57
+#define EXP2_PIN           66   // A12
58
+#define EXP3_PIN           11   // SERVO0_PIN
59
+#define EXP4_PIN           12   // PS_ON_PIN
60
+
61
+#define SUICIDE_PIN        12 // Used by CR2020 Industrial series
62
+#define SUICIDE_PIN_INVERTING true // Used by CR2020 Industrial series

正在加载...
取消
保存