From dce597be45b0cb054159055aeb9d9919e4785b82 Mon Sep 17 00:00:00 2001 From: Simen Svale Skogsrud Date: Fri, 11 Feb 2011 23:04:03 +0100 Subject: [PATCH] corrected the handling of status codes so that 'ok' will not be default response in the event of an undefined error code (untested) --- serial_protocol.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/serial_protocol.c b/serial_protocol.c index b4db13a..78b7493 100644 --- a/serial_protocol.c +++ b/serial_protocol.c @@ -35,6 +35,8 @@ static uint8_t char_counter; void status_message(int status_code) { if (status_code) { switch(status_code) { + case GCSTATUS_OK: + printPgmString(PSTR("ok\r\n")); break; case GCSTATUS_BAD_NUMBER_FORMAT: printPgmString(PSTR("error: Bad number format\n\r")); break; case GCSTATUS_EXPECTED_COMMAND_LETTER: @@ -44,7 +46,9 @@ void status_message(int status_code) { case GCSTATUS_FLOATING_POINT_ERROR: printPgmString(PSTR("error: Floating point error\n\r")); break; default: - printPgmString(PSTR("ok\r\n")); + printPgmString(PSTR("error: ")); + printInteger(status_code); + printPgmString(PSTR("\n\r")); } } }