|
@ -49,7 +49,7 @@ class EmergencyParser { |
|
|
|
|
|
|
|
|
public: |
|
|
public: |
|
|
|
|
|
|
|
|
// Currently looking for: M108, M112, M410, M876 S[0-9], S000, P000, R000
|
|
|
// Currently looking for: M108, M112, M410, M524, M876 S[0-9], S000, P000, R000
|
|
|
enum State : uint8_t { |
|
|
enum State : uint8_t { |
|
|
EP_RESET, |
|
|
EP_RESET, |
|
|
EP_N, |
|
|
EP_N, |
|
@ -58,6 +58,9 @@ public: |
|
|
EP_M10, EP_M108, |
|
|
EP_M10, EP_M108, |
|
|
EP_M11, EP_M112, |
|
|
EP_M11, EP_M112, |
|
|
EP_M4, EP_M41, EP_M410, |
|
|
EP_M4, EP_M41, EP_M410, |
|
|
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
|
|
|
EP_M5, EP_M52, EP_M524, |
|
|
|
|
|
#endif |
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
EP_M8, EP_M87, EP_M876, EP_M876S, EP_M876SN, |
|
|
EP_M8, EP_M87, EP_M876, EP_M876S, EP_M876SN, |
|
|
#endif |
|
|
#endif |
|
@ -76,6 +79,10 @@ public: |
|
|
static bool killed_by_M112; |
|
|
static bool killed_by_M112; |
|
|
static bool quickstop_by_M410; |
|
|
static bool quickstop_by_M410; |
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
|
|
|
static bool sd_abort_by_M524; |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
static uint8_t M876_reason; |
|
|
static uint8_t M876_reason; |
|
|
#endif |
|
|
#endif |
|
@ -145,6 +152,9 @@ public: |
|
|
case ' ': break; |
|
|
case ' ': break; |
|
|
case '1': state = EP_M1; break; |
|
|
case '1': state = EP_M1; break; |
|
|
case '4': state = EP_M4; break; |
|
|
case '4': state = EP_M4; break; |
|
|
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
|
|
|
case '5': state = EP_M5; break; |
|
|
|
|
|
#endif |
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
case '8': state = EP_M8; break; |
|
|
case '8': state = EP_M8; break; |
|
|
#endif |
|
|
#endif |
|
@ -165,6 +175,11 @@ public: |
|
|
case EP_M4: state = (c == '1') ? EP_M41 : EP_IGNORE; break; |
|
|
case EP_M4: state = (c == '1') ? EP_M41 : EP_IGNORE; break; |
|
|
case EP_M41: state = (c == '0') ? EP_M410 : EP_IGNORE; break; |
|
|
case EP_M41: state = (c == '0') ? EP_M410 : EP_IGNORE; break; |
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
|
|
|
case EP_M5: state = (c == '2') ? EP_M52 : EP_IGNORE; break; |
|
|
|
|
|
case EP_M52: state = (c == '4') ? EP_M524 : EP_IGNORE; break; |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
|
|
|
|
|
|
case EP_M8: state = (c == '7') ? EP_M87 : EP_IGNORE; break; |
|
|
case EP_M8: state = (c == '7') ? EP_M87 : EP_IGNORE; break; |
|
@ -200,6 +215,9 @@ public: |
|
|
case EP_M108: wait_for_user = wait_for_heatup = false; break; |
|
|
case EP_M108: wait_for_user = wait_for_heatup = false; break; |
|
|
case EP_M112: killed_by_M112 = true; break; |
|
|
case EP_M112: killed_by_M112 = true; break; |
|
|
case EP_M410: quickstop_by_M410 = true; break; |
|
|
case EP_M410: quickstop_by_M410 = true; break; |
|
|
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
|
|
|
case EP_M524: sd_abort_by_M524 = true; break; |
|
|
|
|
|
#endif |
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
#if ENABLED(HOST_PROMPT_SUPPORT) |
|
|
case EP_M876SN: hostui.handle_response(M876_reason); break; |
|
|
case EP_M876SN: hostui.handle_response(M876_reason); break; |
|
|
#endif |
|
|
#endif |
|
|