Browse Source

Prevent delay when power is already on

Fix #10410
Scott Lahteine 7 years ago
parent
commit
3c826e5d05
1 changed files with 8 additions and 6 deletions
  1. 8
    6
      Marlin/src/feature/power.cpp

+ 8
- 6
Marlin/src/feature/power.cpp View File

@@ -87,16 +87,18 @@ void Power::check() {
87 87
 
88 88
 void Power::power_on() {
89 89
   lastPowerOn = millis();
90
-  PSU_PIN_ON();
90
+  if (!powersupply_on) {
91
+    PSU_PIN_ON();
91 92
 
92
-  #if HAS_TRINAMIC
93
-    delay(100); // Wait for power to settle
94
-    restore_stepper_drivers();
95
-  #endif
93
+    #if HAS_TRINAMIC
94
+      delay(100); // Wait for power to settle
95
+      restore_stepper_drivers();
96
+    #endif
97
+  }
96 98
 }
97 99
 
98 100
 void Power::power_off() {
99
-  PSU_PIN_OFF();
101
+  if (powersupply_on) PSU_PIN_OFF();
100 102
 }
101 103
 
102 104
 #endif // AUTO_POWER_CONTROL

Loading…
Cancel
Save