|
@ -41,6 +41,8 @@ extern bool wait_for_user, wait_for_heatup; |
|
|
void quickresume_stepper(); |
|
|
void quickresume_stepper(); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
void HAL_reboot(); |
|
|
|
|
|
|
|
|
class EmergencyParser { |
|
|
class EmergencyParser { |
|
|
|
|
|
|
|
|
public: |
|
|
public: |
|
@ -62,6 +64,10 @@ public: |
|
|
EP_R, EP_R0, EP_R00, EP_GRBL_RESUME, |
|
|
EP_R, EP_R0, EP_R00, EP_GRBL_RESUME, |
|
|
EP_P, EP_P0, EP_P00, EP_GRBL_PAUSE, |
|
|
EP_P, EP_P0, EP_P00, EP_GRBL_PAUSE, |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
#if ENABLED(SOFT_RESET_VIA_SERIAL) |
|
|
|
|
|
EP_ctrl, |
|
|
|
|
|
EP_K, EP_KI, EP_KIL, EP_KILL, |
|
|
|
|
|
#endif |
|
|
EP_IGNORE // to '\n'
|
|
|
EP_IGNORE // to '\n'
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -89,6 +95,10 @@ public: |
|
|
case 'P': state = EP_P; break; |
|
|
case 'P': state = EP_P; break; |
|
|
case 'R': state = EP_R; break; |
|
|
case 'R': state = EP_R; break; |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
#if ENABLED(SOFT_RESET_VIA_SERIAL) |
|
|
|
|
|
case '^': state = EP_ctrl; break; |
|
|
|
|
|
case 'K': state = EP_K; break; |
|
|
|
|
|
#endif |
|
|
default: state = EP_IGNORE; |
|
|
default: state = EP_IGNORE; |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
@ -121,6 +131,13 @@ public: |
|
|
case EP_P00: state = (c == '0') ? EP_GRBL_PAUSE : EP_IGNORE; break; |
|
|
case EP_P00: state = (c == '0') ? EP_GRBL_PAUSE : EP_IGNORE; break; |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SOFT_RESET_VIA_SERIAL) |
|
|
|
|
|
case EP_ctrl: state = (c == 'X') ? EP_KILL : EP_IGNORE; break; |
|
|
|
|
|
case EP_K: state = (c == 'I') ? EP_KI : EP_IGNORE; break; |
|
|
|
|
|
case EP_KI: state = (c == 'L') ? EP_KIL : EP_IGNORE; break; |
|
|
|
|
|
case EP_KIL: state = (c == 'L') ? EP_KILL : EP_IGNORE; break; |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
case EP_M: |
|
|
case EP_M: |
|
|
switch (c) { |
|
|
switch (c) { |
|
|
case ' ': break; |
|
|
case ' ': break; |
|
@ -189,6 +206,9 @@ public: |
|
|
case EP_GRBL_PAUSE: quickpause_stepper(); break; |
|
|
case EP_GRBL_PAUSE: quickpause_stepper(); break; |
|
|
case EP_GRBL_RESUME: quickresume_stepper(); break; |
|
|
case EP_GRBL_RESUME: quickresume_stepper(); break; |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
#if ENABLED(SOFT_RESET_VIA_SERIAL) |
|
|
|
|
|
case EP_KILL: HAL_reboot(); break; |
|
|
|
|
|
#endif |
|
|
default: break; |
|
|
default: break; |
|
|
} |
|
|
} |
|
|
state = EP_RESET; |
|
|
state = EP_RESET; |
|
|