diff --git a/apps/system/ubgps/ubgps.c b/apps/system/ubgps/ubgps.c index 675d9d34650c12115630279b5f31d4e9c89fe702..6491d446511fd15cf8cac6f798bbbc656a9b67aa 100644 --- a/apps/system/ubgps/ubgps.c +++ b/apps/system/ubgps/ubgps.c @@ -464,7 +464,7 @@ int ubgps_config(gps_config_t const config, void const * const value) gps->state.current_state == GPS_STATE_FIX_ACQUIRED) { #ifdef CONFIG_UBGPS_PSM_MODE - if (gps->state.navigation_rate >= CONFIG_UBGPS_PSM_MODE_THRESHOLD) + if (gps->state.navigation_rate >= CONFIG_UBGPS_PSM_MODE_THRESHOLD * 1000) { /* Use default navigation rate for SW controlled PSM */ diff --git a/apps/system/ubgps/ubgps_state.c b/apps/system/ubgps/ubgps_state.c index 1a95b01e6772d08cacd840b29135b6959eb28971..6b87662cce0e4f1f83bdbe65cb456acc3e014c38 100644 --- a/apps/system/ubgps/ubgps_state.c +++ b/apps/system/ubgps/ubgps_state.c @@ -450,7 +450,7 @@ static int ubgps_sm_global(struct ubgps_s * const gps, struct sm_event_s const * /* Construct power save mode event */ - if (gps->state.navigation_rate >= CONFIG_UBGPS_PSM_MODE_THRESHOLD) + if (gps->state.navigation_rate >= CONFIG_UBGPS_PSM_MODE_THRESHOLD * 1000) { struct sm_event_psm_event_s psm; @@ -577,12 +577,12 @@ static int ubgps_sm_global(struct ubgps_s * const gps, struct sm_event_s const * { /* Start SW controlled power save mode (PSM). */ - if (gps->state.navigation_rate >= CONFIG_UBGPS_PSM_MODE_THRESHOLD) + if (gps->state.navigation_rate >= CONFIG_UBGPS_PSM_MODE_THRESHOLD * 1000) { struct timespec ts = {}; clock_gettime(CLOCK_MONOTONIC, &ts); - ts.tv_sec += gps->state.navigation_rate/1000; + ts.tv_sec += gps->state.navigation_rate / 1000; gps->state.psm_timer_id = ts_core_timer_setup_date(&ts, ubgps_psm_timer_cb, gps); @@ -999,7 +999,7 @@ static int ubgps_init_process_phase(struct ubgps_s * const gps, bool next) /* Set GPS navigation rate */ #ifdef CONFIG_UBGPS_PSM_MODE - if (gps->state.navigation_rate >= CONFIG_UBGPS_PSM_MODE_THRESHOLD*1000) + if (gps->state.navigation_rate >= CONFIG_UBGPS_PSM_MODE_THRESHOLD * 1000) { /* Use default navigation rate for SW controlled PSM */