From 315dc7a7a7051e2d2dae91d75cf3341a1f2f63fc Mon Sep 17 00:00:00 2001 From: bdring Date: Sat, 18 Aug 2018 19:22:32 -0500 Subject: [PATCH] Fixed spindle_get_state() It was not returning a value --- Grbl_Esp32/spindle_control.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Grbl_Esp32/spindle_control.cpp b/Grbl_Esp32/spindle_control.cpp index f256b574..d1597ec2 100644 --- a/Grbl_Esp32/spindle_control.cpp +++ b/Grbl_Esp32/spindle_control.cpp @@ -37,9 +37,12 @@ void spindle_stop() } uint8_t spindle_get_state() -{ - - +{ + // TODO Update this when direction and enable pin are added + if (ledcRead(SPINDLE_PWM_CHANNEL) == 0) // Check the PWM value + return(SPINDLE_STATE_DISABLE); + else + return(SPINDLE_STATE_CW); // only CW is supported right now. } void spindle_set_speed(uint8_t pwm_value)