diff --git a/src/main.c b/src/main.c --- a/src/main.c +++ b/src/main.c @@ -49,6 +49,16 @@ int main(void) while (1) { + + // Update fix status every 2 seconds + if(HAL_GetTick() - fixinfo_timer > 2000) + { + gps_update_data(); + fixinfo_timer = HAL_GetTick(); + } + + + switch(state) { @@ -75,14 +85,8 @@ int main(void) // HAL_Delay(100); // gps_update_position(); - // Update fix status every 2 seconds - if(HAL_GetTick() - fixinfo_timer > 2000) - { - gps_check_lock(&fix_ok, &numsats); - fixinfo_timer = HAL_GetTick(); - } - if(fix_ok > 0) + if(gps_getdata()->fixtype > 0) { // Disable GPS module //gps_poweroff();