From 55418bc49d7c48a2abf91a180304e16ae1c9aba7 Mon Sep 17 00:00:00 2001 From: Rob Giseburt Date: Thu, 7 Nov 2019 12:12:41 -0500 Subject: [PATCH] Don't request feedholds from inside spindle commands --- g2core/spindle.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/g2core/spindle.cpp b/g2core/spindle.cpp index 2abae5c5..d10dff7a 100644 --- a/g2core/spindle.cpp +++ b/g2core/spindle.cpp @@ -194,19 +194,20 @@ static void _exec_spindle_control(float *value, bool *) bool do_spinup_delay = false; #ifdef ENABLE_INTERLOCK_AND_ESTOP - if(cm->estop_state != 0) // In E-stop, don't process any spindle commands + if(cm->estop_state != 0) { // In E-stop, don't process any spindle commands action = SPINDLE_OFF; - - // If we're paused or in interlock, or the esc is rebooting, send the spindle an "OFF" command (invisible to cm->gm), - // and issue a hold if necessary - else if(action == SPINDLE_PAUSE || cm->safety_state != 0) { - if(action != SPINDLE_PAUSE) { - action = SPINDLE_PAUSE; - cm_set_motion_state(MOTION_STOP); - cm_request_feedhold(FEEDHOLD_TYPE_ACTIONS, FEEDHOLD_EXIT_INTERLOCK); - sr_request_status_report(SR_REQUEST_IMMEDIATE); - } } + + // // If we're paused or in interlock, or the esc is rebooting, send the spindle an "OFF" command (invisible to cm->gm), + // // and issue a hold if necessary + // else if(action == SPINDLE_PAUSE || cm->safety_state != 0) { + // if(action != SPINDLE_PAUSE) { + // action = SPINDLE_PAUSE; + // cm_set_motion_state(MOTION_STOP); + // cm_request_feedhold(FEEDHOLD_TYPE_ACTIONS, FEEDHOLD_EXIT_INTERLOCK); + // sr_request_status_report(SR_REQUEST_IMMEDIATE); + // } + // } #endif switch (action) { @@ -307,7 +308,7 @@ static void _exec_spindle_speed(float *value, bool *flag) if(cm->estop_state != 0 || cm->safety_state != 0 || spindle.state == SPINDLE_PAUSE) spindle_control_immediate(SPINDLE_OFF); #endif - + spindle.speed = value[0]; pwm_set_duty(PWM_1, _get_spindle_pwm(spindle, pwm));