AP_GPS: Preserve the instance number, otherwise it will get set to zero

Signed-off-by: Dr.-Ing. Amilcar Do Carmo Lucas <amilcar.lucas@iav.de>
This commit is contained in:
Dr.-Ing. Amilcar Do Carmo Lucas 2017-09-24 01:55:02 +02:00 committed by Tom Pittenger
parent 8b9fb19061
commit 09baac8f25

View File

@ -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;