Expire such information after about 1.5s.
let mut gps = gps::Gps::new();
+ let mut gps_has_fix = false;
+ let mut gps_has_fix_ticks = 0;
+
let mut heart_icon_timer = Timer::new(1000);
loop {
let mut tap = gps::TimeAndPos::new();
while gps.update(&mut tap) {
+ gps_has_fix = true;
+ gps_has_fix_ticks = systick::now();
+ }
+
+ // Did GPS fix information expire?
+ if gps_has_fix && systick::has_timeout_ms(gps_has_fix_ticks, 1500) {
+ gps_has_fix = false;
}
heart_icon_timer.update(|state| {