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

@@ -1,6 +1,6 @@
{ {
"name": "bbctrl", "name": "bbctrl",
"version": "1.0.9", "version": "1.0.9b1",
"homepage": "https://onefinitycnc.com/", "homepage": "https://onefinitycnc.com/",
"repository": "https://github.com/OneFinityCNC/onefinity", "repository": "https://github.com/OneFinityCNC/onefinity",
"license": "GPL-3.0+", "license": "GPL-3.0+",

View File

@@ -24,6 +24,7 @@ if $UPDATE_PY; then
fi fi
if $UPDATE_AVR; then if $UPDATE_AVR; then
chmod +x ./scripts/avr109-flash.py
./scripts/avr109-flash.py src/avr/bbctrl-avr-firmware.hex ./scripts/avr109-flash.py src/avr/bbctrl-avr-firmware.hex
fi fi

View File

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