Browse Source

Finish AUTO_POWER_CONTROL implementation

Followup to #9503
pull/1/head
Scott Lahteine 7 years ago
parent
commit
73cd34b121
  1. 7
      Marlin/src/Marlin.cpp
  2. 13
      Marlin/src/module/planner.cpp

7
Marlin/src/Marlin.cpp

@ -272,6 +272,9 @@ void quickstop_stepper() {
} }
void enable_all_steppers() { void enable_all_steppers() {
#if ENABLED(AUTO_POWER_CONTROL)
powerManager.power_on();
#endif
enable_X(); enable_X();
enable_Y(); enable_Y();
enable_Z(); enable_Z();
@ -411,6 +414,10 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
controllerfan_update(); // Check if fan should be turned on to cool stepper drivers down controllerfan_update(); // Check if fan should be turned on to cool stepper drivers down
#endif #endif
#if ENABLED(AUTO_POWER_CONTROL)
powerManager.check();
#endif
#if ENABLED(EXTRUDER_RUNOUT_PREVENT) #if ENABLED(EXTRUDER_RUNOUT_PREVENT)
if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP
&& ELAPSED(ms, gcode.previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL) && ELAPSED(ms, gcode.previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL)

13
Marlin/src/module/planner.cpp

@ -84,6 +84,10 @@
#include "../feature/mixing.h" #include "../feature/mixing.h"
#endif #endif
#if ENABLED(AUTO_POWER_CONTROL)
#include "../feature/power.h"
#endif
Planner planner; Planner planner;
// public: // public:
@ -860,6 +864,11 @@ void Planner::_buffer_steps(const int32_t (&target)[ABCE], float fr_mm_s, const
block->active_extruder = extruder; block->active_extruder = extruder;
#if ENABLED(AUTO_POWER_CONTROL)
if (block->steps[X_AXIS] || block->steps[Y_AXIS] || block->steps[Z_AXIS])
powerManager.power_on();
#endif
//enable active axes //enable active axes
#if CORE_IS_XY #if CORE_IS_XY
if (block->steps[A_AXIS] || block->steps[B_AXIS]) { if (block->steps[A_AXIS] || block->steps[B_AXIS]) {
@ -892,6 +901,10 @@ void Planner::_buffer_steps(const int32_t (&target)[ABCE], float fr_mm_s, const
// Enable extruder(s) // Enable extruder(s)
if (esteps) { if (esteps) {
#if ENABLED(AUTO_POWER_CONTROL)
powerManager.power_on();
#endif
#if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder #if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder
#define DISABLE_IDLE_E(N) if (!g_uc_extruder_last_move[N]) disable_E##N(); #define DISABLE_IDLE_E(N) if (!g_uc_extruder_last_move[N]) disable_E##N();

Loading…
Cancel
Save