Browse Source

Fix init of power supply pin

Fix #13184
Scott Lahteine 6 years ago
parent
commit
89bbc30a09
2 changed files with 5 additions and 13 deletions
  1. 4
    6
      Marlin/src/Marlin.cpp
  2. 1
    7
      Marlin/src/gcode/control/M80_M81.cpp

+ 4
- 6
Marlin/src/Marlin.cpp View File

220
   #endif
220
   #endif
221
   #if HAS_POWER_SWITCH
221
   #if HAS_POWER_SWITCH
222
     #if ENABLED(PS_DEFAULT_OFF)
222
     #if ENABLED(PS_DEFAULT_OFF)
223
-      PSU_OFF();
223
+      powersupply_on = true;  PSU_OFF();
224
     #else
224
     #else
225
-      PSU_ON();
225
+      powersupply_on = false; PSU_ON();
226
     #endif
226
     #endif
227
   #endif
227
   #endif
228
 }
228
 }
231
  * Stepper Reset (RigidBoard, et.al.)
231
  * Stepper Reset (RigidBoard, et.al.)
232
  */
232
  */
233
 #if HAS_STEPPER_RESET
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
 #endif
236
 #endif
239
 
237
 
240
 #if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0
238
 #if ENABLED(EXPERIMENTAL_I2CBUS) && I2C_SLAVE_ADDRESS > 0

+ 1
- 7
Marlin/src/gcode/control/M80_M81.cpp View File

42
   #endif
42
   #endif
43
 
43
 
44
   // Could be moved to a feature, but this is all the data
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
   #if HAS_TRINAMIC
47
   #if HAS_TRINAMIC
54
     #include "../../feature/tmc_util.h"
48
     #include "../../feature/tmc_util.h"

Loading…
Cancel
Save