From 5d8c3dcbd70d9109bccf6cc0eb618bd0e577e10d Mon Sep 17 00:00:00 2001 From: Sonny Jeon Date: Sun, 21 Oct 2012 19:29:18 -0600 Subject: [PATCH] Added misc message to indicate how to exit ALARM mode. --- protocol.c | 9 ++++++--- protocol.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/protocol.c b/protocol.c index 942b22c..e78f4af 100755 --- a/protocol.c +++ b/protocol.c @@ -60,7 +60,7 @@ void protocol_status_message(uint8_t status_code) case STATUS_INVALID_STATEMENT: printPgmString(PSTR("Invalid statement")); break; case STATUS_HARD_LIMIT: - printPgmString(PSTR(" Limit triggered")); break; + printPgmString(PSTR("Limit triggered")); break; case STATUS_SETTING_DISABLED: printPgmString(PSTR("Grbl setting disabled")); break; case STATUS_SETTING_STEPS_NEG: @@ -77,13 +77,15 @@ void protocol_status_message(uint8_t status_code) // Prints miscellaneous messages. This serves as a centralized method to provide additional // user feedback for things that do not pass through the protocol_execute_line() function -// and are not errors or confirmations, such as setup warnings. +// and are not errors or confirmations, such as setup warnings and how to exit alarms. void protocol_misc_message(uint8_t message_code) { // TODO: Install silence misc messages option in settings switch(message_code) { + case MESSAGE_SYSTEM_ALARM: + printPgmString(PSTR("")); break; case MESSAGE_HOMING_ENABLE: - printPgmString(PSTR("warning: Install all axes limit switches before use")); break; + printPgmString(PSTR("warning: Install all axes limit switches before use")); break; } printPgmString(PSTR("\r\n")); } @@ -167,6 +169,7 @@ void protocol_execute_runtime() // System alarm. Something has gone wrong. Disable everything until system reset. if (rt_exec & EXEC_ALARM) { + if (bit_isfalse(sys.execute,EXEC_RESET)) { protocol_misc_message(MESSAGE_SYSTEM_ALARM); } while (bit_isfalse(sys.execute,EXEC_RESET)) { sleep_mode(); } bit_false(sys.execute,EXEC_ALARM); } diff --git a/protocol.h b/protocol.h index bed6092..95fc285 100755 --- a/protocol.h +++ b/protocol.h @@ -44,6 +44,7 @@ #define STATUS_SETTING_READ_FAIL 11 // Define Grbl misc message codes +#define MESSAGE_SYSTEM_ALARM 0 #define MESSAGE_HOMING_ENABLE 1