diff --git a/src/main.rs b/src/main.rs index 60dd720..f00817f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -267,13 +267,18 @@ async fn gnss_task( ) .await; + let mut fix_drop_message = false; loop { if let Ok(Some(embassy_gps::types::GpsEvent::Fix(fix))) = gps.step().await { - // send to main thread - critical_section::with(|cs| { - let gnss_update_ref = GNSS_UPDATE.borrow(cs); - gnss_update_ref.replace(Some(fix)); - }); + // drop every second message as we always get each fix twice + fix_drop_message = !fix_drop_message; + if fix_drop_message { + // send to main thread + critical_section::with(|cs| { + let gnss_update_ref = GNSS_UPDATE.borrow(cs); + gnss_update_ref.replace(Some(fix)); + }); + } } else { // FSM will recover automatically from errors and ignore other event types }