Explorar el Código

Finish AUTO_POWER_CONTROL implementation

Followup to #9503
Scott Lahteine hace 7 años
padre
commit
73cd34b121
Se han modificado 2 ficheros con 20 adiciones y 0 borrados
  1. 7
    0
      Marlin/src/Marlin.cpp
  2. 13
    0
      Marlin/src/module/planner.cpp

+ 7
- 0
Marlin/src/Marlin.cpp Ver fichero

272
 }
272
 }
273
 
273
 
274
 void enable_all_steppers() {
274
 void enable_all_steppers() {
275
+  #if ENABLED(AUTO_POWER_CONTROL)
276
+    powerManager.power_on();
277
+  #endif
275
   enable_X();
278
   enable_X();
276
   enable_Y();
279
   enable_Y();
277
   enable_Z();
280
   enable_Z();
411
     controllerfan_update(); // Check if fan should be turned on to cool stepper drivers down
414
     controllerfan_update(); // Check if fan should be turned on to cool stepper drivers down
412
   #endif
415
   #endif
413
 
416
 
417
+  #if ENABLED(AUTO_POWER_CONTROL)
418
+    powerManager.check();
419
+  #endif
420
+
414
   #if ENABLED(EXTRUDER_RUNOUT_PREVENT)
421
   #if ENABLED(EXTRUDER_RUNOUT_PREVENT)
415
     if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP
422
     if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP
416
       && ELAPSED(ms, gcode.previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL)
423
       && ELAPSED(ms, gcode.previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL)

+ 13
- 0
Marlin/src/module/planner.cpp Ver fichero

84
   #include "../feature/mixing.h"
84
   #include "../feature/mixing.h"
85
 #endif
85
 #endif
86
 
86
 
87
+#if ENABLED(AUTO_POWER_CONTROL)
88
+  #include "../feature/power.h"
89
+#endif
90
+
87
 Planner planner;
91
 Planner planner;
88
 
92
 
89
   // public:
93
   // public:
860
 
864
 
861
   block->active_extruder = extruder;
865
   block->active_extruder = extruder;
862
 
866
 
867
+  #if ENABLED(AUTO_POWER_CONTROL)
868
+    if (block->steps[X_AXIS] || block->steps[Y_AXIS] || block->steps[Z_AXIS])
869
+        powerManager.power_on();
870
+  #endif
871
+
863
   //enable active axes
872
   //enable active axes
864
   #if CORE_IS_XY
873
   #if CORE_IS_XY
865
     if (block->steps[A_AXIS] || block->steps[B_AXIS]) {
874
     if (block->steps[A_AXIS] || block->steps[B_AXIS]) {
892
   // Enable extruder(s)
901
   // Enable extruder(s)
893
   if (esteps) {
902
   if (esteps) {
894
 
903
 
904
+    #if ENABLED(AUTO_POWER_CONTROL)
905
+      powerManager.power_on();
906
+    #endif
907
+
895
     #if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder
908
     #if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder
896
 
909
 
897
       #define DISABLE_IDLE_E(N) if (!g_uc_extruder_last_move[N]) disable_E##N();
910
       #define DISABLE_IDLE_E(N) if (!g_uc_extruder_last_move[N]) disable_E##N();

Loading…
Cancelar
Guardar