corrected the handling of status codes so that 'ok' will not be default response in the event of an undefined error code (untested)
This commit is contained in:
parent
33f014aa74
commit
dce597be45
@ -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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user