Fixed Homing state bug

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).
pull/790/head
JTS 2020-01-07 17:57:21 -05:00
rodzic eefe2bb95b
commit 1fa5c5c720
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -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
if (line[2] == 0) {
sys.state = STATE_HOMING; // Set system state variable
mc_homing_cycle(HOMING_CYCLE_ALL);
#ifdef HOMING_SINGLE_AXIS_COMMANDS
} else if (line[3] == 0) {
switch (line[2]) {
sys.state = STATE_HOMING; // Set system state variable
case 'X': mc_homing_cycle(HOMING_CYCLE_X); break;
case 'Y': mc_homing_cycle(HOMING_CYCLE_Y); break;
case 'Z': mc_homing_cycle(HOMING_CYCLE_Z); break;