瀏覽代碼

Fix init of power supply pin

Fix #13184
Scott Lahteine 6 年之前
父節點
當前提交
89bbc30a09
共有 2 個文件被更改,包括 5 次插入13 次删除
  1. 4
    6
      Marlin/src/Marlin.cpp
  2. 1
    7
      Marlin/src/gcode/control/M80_M81.cpp

+ 4
- 6
Marlin/src/Marlin.cpp 查看文件

@@ -220,9 +220,9 @@ void setup_powerhold() {
220 220
   #endif
221 221
   #if HAS_POWER_SWITCH
222 222
     #if ENABLED(PS_DEFAULT_OFF)
223
-      PSU_OFF();
223
+      powersupply_on = true;  PSU_OFF();
224 224
     #else
225
-      PSU_ON();
225
+      powersupply_on = false; PSU_ON();
226 226
     #endif
227 227
   #endif
228 228
 }
@@ -231,10 +231,8 @@ void setup_powerhold() {
231 231
  * Stepper Reset (RigidBoard, et.al.)
232 232
  */
233 233
 #if HAS_STEPPER_RESET
234
-  void disableStepperDrivers() {
235
-    OUT_WRITE(STEPPER_RESET_PIN, LOW);  // drive it down to hold in reset motor driver chips
236
-  }
237
-  void enableStepperDrivers() { SET_INPUT(STEPPER_RESET_PIN); }  // set to input, which allows it to be pulled high by pullups
234
+  void disableStepperDrivers() { OUT_WRITE(STEPPER_RESET_PIN, LOW); } // Drive down to keep motor driver chips in reset
235
+  void enableStepperDrivers()  { SET_INPUT(STEPPER_RESET_PIN); }      // Set to input, allowing pullups to pull the pin high
238 236
 #endif
239 237
 
240 238
 #if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0

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

@@ -42,13 +42,7 @@
42 42
   #endif
43 43
 
44 44
   // Could be moved to a feature, but this is all the data
45
-  bool powersupply_on = (
46
-    #if ENABLED(PS_DEFAULT_OFF)
47
-      false
48
-    #else
49
-      true
50
-    #endif
51
-  );
45
+  bool powersupply_on;
52 46
 
53 47
   #if HAS_TRINAMIC
54 48
     #include "../../feature/tmc_util.h"

Loading…
取消
儲存