Skip to content

Conversation

@doppelhub
Copy link

Fixed an issue where grbl's state machine gets corrupted. For example, if "$H0abc" is sent, existing grbl sets sys.state=STATE_HOMING, but then bails out without actually homing. Subsequent "$H" commands are then not executed, because grbl isn't idle (it still thinks it's homing).

Moving sys.state=STATE_HOMING to after the conditional prevents grbl from getting stuck in homing state.

Fixed an issue where grbl's state machine gets corrupted.  For example, if "$H0abc" is sent, existing grbl sets sys.state=STATE_HOMING, but then bails out without actually homing.  Subsequent "$H" commands are then not executed, because grbl isn't idle (it still thinks it's homing).
case 'H' : // Perform homing cycle [IDLE/ALARM]
if (bit_isfalse(settings.flags,BITFLAG_HOMING_ENABLE)) {return(STATUS_SETTING_DISABLED); }
if (system_check_safety_door_ajar()) { return(STATUS_CHECK_DOOR); } // Block if safety door is ajar.
sys.state = STATE_HOMING; // Set system state variable
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sys.state set to homing before actually checking if entire line is valid

if (system_check_safety_door_ajar()) { return(STATUS_CHECK_DOOR); } // Block if safety door is ajar.
sys.state = STATE_HOMING; // Set system state variable
if (line[2] == 0) {
sys.state = STATE_HOMING; // Set system state variable
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here sys.state is not set until after syntax is checked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant