mirror of
https://github.com/meshtastic/firmware.git
synced 2025-05-01 11:42:45 +00:00
Only check threshold if GPS softsleep is supported
This commit is contained in:
parent
ef223b1195
commit
48fa9f2242
@ -916,6 +916,7 @@ void GPS::down()
|
|||||||
softsleepSupported = true;
|
softsleepSupported = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (softsleepSupported) {
|
||||||
// How long does gps_update_interval need to be, for GPS_HARDSLEEP to become more efficient than GPS_SOFTSLEEP?
|
// How long does gps_update_interval need to be, for GPS_HARDSLEEP to become more efficient than GPS_SOFTSLEEP?
|
||||||
// Heuristic equation. A compromise manually fitted to power observations from U-blox NEO-6M and M10050
|
// Heuristic equation. A compromise manually fitted to power observations from U-blox NEO-6M and M10050
|
||||||
// https://www.desmos.com/calculator/6gvjghoumr
|
// https://www.desmos.com/calculator/6gvjghoumr
|
||||||
@ -924,11 +925,12 @@ void GPS::down()
|
|||||||
LOG_DEBUG("gps_update_interval >= %us needed to justify hardsleep\n", hardsleepThreshold / 1000);
|
LOG_DEBUG("gps_update_interval >= %us needed to justify hardsleep\n", hardsleepThreshold / 1000);
|
||||||
|
|
||||||
// If update interval too short: softsleep (if supported by hardware)
|
// If update interval too short: softsleep (if supported by hardware)
|
||||||
if (softsleepSupported && updateInterval < hardsleepThreshold)
|
if (updateInterval < hardsleepThreshold) {
|
||||||
setPowerState(GPS_SOFTSLEEP, sleepTime);
|
setPowerState(GPS_SOFTSLEEP, sleepTime);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
// If update interval long enough (or softsleep unsupported): hardsleep instead
|
// If update interval long enough (or softsleep unsupported): hardsleep instead
|
||||||
else
|
|
||||||
setPowerState(GPS_HARDSLEEP, sleepTime);
|
setPowerState(GPS_HARDSLEEP, sleepTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user