Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Homing state bug #790

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fixed Homing state bug #790

wants to merge 1 commit into from

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).
@@ -179,12 +179,13 @@ uint8_t system_execute_line(char *line)
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 (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