From 6108b31e6a60cadb32176bda0b0deaf337a763ec Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 3 May 2023 12:08:26 +1200 Subject: [PATCH] gps: reset RTCM instance We need to reset the instance after looping through all instances. Otherwise, we are left with the last instance if none is valid but have not updated the _selected_rtcm_instance which is what is logged. Therefore, this change fixes the logged RTCM instance. Signed-off-by: Julian Oes --- src/drivers/gps/gps.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/drivers/gps/gps.cpp b/src/drivers/gps/gps.cpp index 4c02646633..cd7fb5ab76 100644 --- a/src/drivers/gps/gps.cpp +++ b/src/drivers/gps/gps.cpp @@ -540,6 +540,9 @@ void GPS::handleInjectDataTopic() } } + // Reset instance in case we didn't actually want to switch + _orb_inject_data_sub.ChangeInstance(_selected_rtcm_instance); + bool updated = false; // Limit maximum number of GPS injections to 8 since usually