diff --git a/libraries/AP_GPS/AP_GPS.cpp b/libraries/AP_GPS/AP_GPS.cpp index bbcd0f1ffb..f10e2cb7ee 100644 --- a/libraries/AP_GPS/AP_GPS.cpp +++ b/libraries/AP_GPS/AP_GPS.cpp @@ -301,14 +301,33 @@ AP_GPS::AP_GPS() _singleton = this; } +// return true if a specific type of GPS uses a UART +bool AP_GPS::needs_uart(GPS_Type type) const +{ + switch (type) { + case GPS_TYPE_NONE: + case GPS_TYPE_HIL: + case GPS_TYPE_UAVCAN: + case GPS_TYPE_MAV: + return false; + default: + break; + } + return true; +} + /// Startup initialisation. void AP_GPS::init(const AP_SerialManager& serial_manager) { primary_instance = 0; // search for serial ports with gps protocol + uint8_t uart_idx = 0; for (uint8_t i=0; i