sforkowany z mirror/meshtastic-firmware
GPS sleep mode WIP - alas this thread will have to be back burner for a
while because my TX wire on my ONLY T-BEAM broke while I was soldering a jtag connector - so I can only RX from the GPS. My other 5 boards are still delayed due to corona virus. So I'll work on other features for now1.2-legacy
rodzic
6eba792537
commit
635e189007
2
TODO.md
2
TODO.md
|
@ -2,6 +2,8 @@
|
|||
|
||||
Items to complete before the first alpha release.
|
||||
|
||||
* turn on gps https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library/blob/master/examples/Example18_PowerSaveMode/Example18_PowerSaveMode.ino
|
||||
* switch gps to 38400 baud https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library/blob/master/examples/Example11_ResetModule/Example2_FactoryDefaultsviaSerial/Example2_FactoryDefaultsviaSerial.ino
|
||||
* have state machine properly enter deep sleep based on loss of mesh and phone comms
|
||||
* have gps implement canSleep(), print nmea for debugging and discard buffers on the way into sleep
|
||||
* implement CustomRF95::canSleep
|
||||
|
|
|
@ -27,6 +27,7 @@ void GPS::setup()
|
|||
_serial_gps.begin(GPS_BAUDRATE, SERIAL_8N1, GPS_RX_PIN, GPS_TX_PIN);
|
||||
ublox.enableDebugging(Serial);
|
||||
|
||||
#if 0
|
||||
// note: the lib's implementation has the wrong docs for what the return val is
|
||||
// it is not a bool, it returns zero for success
|
||||
bool errCode = ublox.begin(_serial_gps);
|
||||
|
@ -41,6 +42,7 @@ void GPS::setup()
|
|||
// ublox.saveConfiguration();
|
||||
assert(ok);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void GPS::readFromRTC()
|
||||
|
@ -97,7 +99,6 @@ bool GPS::canSleep()
|
|||
void GPS::prepareSleep()
|
||||
{
|
||||
// discard all rx serial bytes so we don't try to parse them when we come back
|
||||
|
||||
}
|
||||
|
||||
void GPS::doTask()
|
||||
|
@ -105,6 +106,7 @@ void GPS::doTask()
|
|||
#ifdef GPS_RX_PIN
|
||||
// Consume all characters that have arrived
|
||||
|
||||
#if 0
|
||||
ublox.checkUblox(); //See if new data is available. Process bytes as they come in.
|
||||
|
||||
if (ublox.getPVT())
|
||||
|
@ -144,6 +146,7 @@ void GPS::doTask()
|
|||
}
|
||||
else // we didn't get a location update, go back to sleep and hope the characters show up
|
||||
wantNewLocation = true;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Once we have sent a location once we only poll the GPS rarely, otherwise check back every 100ms until we have something over the serial
|
||||
|
@ -156,4 +159,3 @@ void GPS::startLock()
|
|||
wantNewLocation = true;
|
||||
setPeriod(1);
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue