From 09baac8f25ea62002fd61fb2c56060e2c97b3808 Mon Sep 17 00:00:00 2001 From: "Dr.-Ing. Amilcar Do Carmo Lucas" Date: Sun, 24 Sep 2017 01:55:02 +0200 Subject: [PATCH] AP_GPS: Preserve the instance number, otherwise it will get set to zero Signed-off-by: Dr.-Ing. Amilcar Do Carmo Lucas --- libraries/AP_GPS/AP_GPS.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/AP_GPS/AP_GPS.cpp b/libraries/AP_GPS/AP_GPS.cpp index cbd93776ff..6b2c24e63c 100644 --- a/libraries/AP_GPS/AP_GPS.cpp +++ b/libraries/AP_GPS/AP_GPS.cpp @@ -624,6 +624,7 @@ void AP_GPS::update_instance(uint8_t instance) delete drivers[instance]; drivers[instance] = nullptr; memset(&state[instance], 0, sizeof(state[instance])); + state[instance].instance = instance; state[instance].status = NO_GPS; state[instance].hdop = GPS_UNKNOWN_DOP; state[instance].vdop = GPS_UNKNOWN_DOP;