diff --git a/libraries/AP_GPS/AP_GPS_NOVA.cpp b/libraries/AP_GPS/AP_GPS_NOVA.cpp index 86780bdd6b..7ca259fb05 100644 --- a/libraries/AP_GPS/AP_GPS_NOVA.cpp +++ b/libraries/AP_GPS/AP_GPS_NOVA.cpp @@ -86,8 +86,11 @@ AP_GPS_NOVA::read(void) } bool ret = false; - while (port->available() > 0) { - uint8_t temp = port->read(); + for (uint16_t i=0; i<8192; i++) { + uint8_t temp; + if (!port->read(temp)) { + break; + } #if AP_GPS_DEBUG_LOGGING_ENABLED log_data(&temp, 1); #endif