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:
		@@ -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"));
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user