mirror of
https://github.com/synthetos/g2.git
synced 2026-09-21 18:56:31 +08:00
Don't request feedholds from inside spindle commands
This commit is contained in:
+13
-12
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user