mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-03 03:09:59 +00:00
Merge branch 'gps-coordinate-formats' of https://github.com/srichs/Meshtastic-device into gps-coordinate-formats
This commit is contained in:
commit
030d09740c
@ -5,6 +5,11 @@
|
|||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
// if gps_update_interval below this value, do not powercycle the GPS
|
||||||
|
#define UBLOX_POWEROFF_THRESHOLD 90
|
||||||
|
|
||||||
|
extern RadioConfig radioConfig;
|
||||||
|
|
||||||
UBloxGPS::UBloxGPS() {}
|
UBloxGPS::UBloxGPS() {}
|
||||||
|
|
||||||
bool UBloxGPS::tryConnect()
|
bool UBloxGPS::tryConnect()
|
||||||
@ -201,15 +206,20 @@ bool UBloxGPS::whileIdle()
|
|||||||
/// Note: ublox doesn't need a wake method, because as soon as we send chars to the GPS it will wake up
|
/// Note: ublox doesn't need a wake method, because as soon as we send chars to the GPS it will wake up
|
||||||
void UBloxGPS::sleep()
|
void UBloxGPS::sleep()
|
||||||
{
|
{
|
||||||
// Tell GPS to power down until we send it characters on serial port (we leave vcc connected)
|
if (radioConfig.preferences.gps_update_interval > UBLOX_POWEROFF_THRESHOLD) {
|
||||||
ublox.powerOff();
|
// Tell GPS to power down until we send it characters on serial port (we leave vcc connected)
|
||||||
// setGPSPower(false);
|
ublox.powerOff();
|
||||||
|
// setGPSPower(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UBloxGPS::wake()
|
void UBloxGPS::wake()
|
||||||
{
|
{
|
||||||
fixType = 0; // assume we hace no fix yet
|
if (radioConfig.preferences.gps_update_interval > UBLOX_POWEROFF_THRESHOLD) {
|
||||||
|
fixType = 0; // assume we have no fix yet
|
||||||
|
}
|
||||||
|
|
||||||
|
// this is idempotent
|
||||||
setGPSPower(true);
|
setGPSPower(true);
|
||||||
|
|
||||||
// Note: no delay needed because now we leave gps power on always and instead use ublox.powerOff()
|
// Note: no delay needed because now we leave gps power on always and instead use ublox.powerOff()
|
||||||
|
Loading…
Reference in New Issue
Block a user