From 78fce9e9da02bbb8b2d67c9458a45aa61595a628 Mon Sep 17 00:00:00 2001 From: David Carley Date: Tue, 5 Oct 2021 23:09:06 -0700 Subject: [PATCH] Fix for laser zeroing - only honor "dynamic power" when running a gcode program. --- package.json | 2 +- scripts/install.sh | 1 + src/avr/src/spindle.c | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6e6ceac..f837bd1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bbctrl", - "version": "1.0.9", + "version": "1.0.9b1", "homepage": "https://onefinitycnc.com/", "repository": "https://github.com/OneFinityCNC/onefinity", "license": "GPL-3.0+", diff --git a/scripts/install.sh b/scripts/install.sh index 8983783..50986ca 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -24,6 +24,7 @@ if $UPDATE_PY; then fi if $UPDATE_AVR; then + chmod +x ./scripts/avr109-flash.py ./scripts/avr109-flash.py src/avr/bbctrl-avr-firmware.hex fi diff --git a/src/avr/src/spindle.c b/src/avr/src/spindle.c index cd39a88..2be4a3b 100644 --- a/src/avr/src/spindle.c +++ b/src/avr/src/spindle.c @@ -34,6 +34,7 @@ #include "command.h" #include "exec.h" #include "util.h" +#include "state.h" #include @@ -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; }