Fix for laser zeroing - only honor "dynamic power" when running a gcode program.

This commit is contained in:
David Carley
2021-10-05 23:09:06 -07:00
parent bcdcda73af
commit 78fce9e9da
3 changed files with 4 additions and 2 deletions

View File

@@ -34,6 +34,7 @@
#include "command.h"
#include "exec.h"
#include "util.h"
#include "state.h"
#include <math.h>
@@ -147,7 +148,7 @@ static power_update_t _get_power_update() {
float power = _speed_to_power(spindle.speed);
// Handle dynamic power
if (spindle.dynamic_power && spindle.inv_feed) {
if (state_get() == STATE_RUNNING && spindle.dynamic_power && spindle.inv_feed) {
float scale = spindle.inv_feed * exec_get_velocity();
if (scale < 1) power *= scale;
}