Finish AUTO_POWER_CONTROL implementation

Followup to #9503
This commit is contained in:
Scott Lahteine
2018-02-19 16:12:04 -06:00
parent fc460fff94
commit 73cd34b121
2 changed files with 20 additions and 0 deletions

View File

@ -84,6 +84,10 @@
#include "../feature/mixing.h"
#endif
#if ENABLED(AUTO_POWER_CONTROL)
#include "../feature/power.h"
#endif
Planner planner;
// public:
@ -860,6 +864,11 @@ void Planner::_buffer_steps(const int32_t (&target)[ABCE], float fr_mm_s, const
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
#if CORE_IS_XY
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)
if (esteps) {
#if ENABLED(AUTO_POWER_CONTROL)
powerManager.power_on();
#endif
#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();