add air530 gps sleep support

This commit is contained in:
geeksville
2020-09-28 17:04:19 -07:00
parent bc50b39a3b
commit fec7a6bf17
10 changed files with 176 additions and 58 deletions

View File

@@ -85,3 +85,20 @@ uint32_t getValidTime()
{
return timeSetFromGPS ? getTime() : 0;
}
/**
* Switch the GPS into a mode where we are actively looking for a lock, or alternatively switch GPS into a low power mode
*
* calls sleep/wake
*/
void GPS::setWantLocation(bool on)
{
if (wantNewLocation != on) {
wantNewLocation = on;
DEBUG_MSG("WANT GPS=%d\n", on);
if (on)
wake();
else
sleep();
}
}