From ed3fd0bd422bfdad669c5a331e30847dc0dfe58b Mon Sep 17 00:00:00 2001 From: Paciente8159 Date: Sun, 3 Mar 2024 11:58:30 +0000 Subject: [PATCH] fix spindle relay tool --- uCNC/src/hal/tools/tools/spindle_relay.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/uCNC/src/hal/tools/tools/spindle_relay.c b/uCNC/src/hal/tools/tools/spindle_relay.c index 3432fed71..909aafdbf 100644 --- a/uCNC/src/hal/tools/tools/spindle_relay.c +++ b/uCNC/src/hal/tools/tools/spindle_relay.c @@ -81,11 +81,18 @@ void set_coolant(uint8_t value) #endif } +static int16_t range_speed(int16_t value, uint8_t conv) +{ + // binary output + value = (value) ? 1 : 0; + return value; +} + const tool_t spindle_relay = { .startup_code = NULL, .shutdown_code = NULL, .pid_update = NULL, - .range_speed = NULL, + .range_speed = &range_speed, .get_speed = NULL, .set_speed = &set_speed, .set_coolant = &set_coolant};