don't require gps to have lock before we'll trust GPS time

1.2-legacy
Kevin Hester 2020-10-08 05:23:52 +08:00
rodzic b47c54b5b6
commit fc82e872d6
3 zmienionych plików z 19 dodań i 18 usunięć

Wyświetl plik

@ -6,6 +6,9 @@ bin/run.sh --set region 8
time only mode time only mode
./bin/run.sh --set gps_operation 3 ./bin/run.sh --set gps_operation 3
allow longer locking attempts
allow locking while cpu sleeps
test with crummy antenna
ublox parsing failure ublox parsing failure
record power measurements and update spreadsheet record power measurements and update spreadsheet

Wyświetl plik

@ -62,7 +62,7 @@ lib_deps =
1260 ; OneButton library for non-blocking button debounce 1260 ; OneButton library for non-blocking button debounce
1202 ; CRC32, explicitly needed because dependency is missing in the ble ota update lib 1202 ; CRC32, explicitly needed because dependency is missing in the ble ota update lib
https://github.com/meshtastic/arduino-fsm.git https://github.com/meshtastic/arduino-fsm.git
https://github.com/meshtastic/SparkFun_Ublox_Arduino_Library.git#cb8353dfddd1b0e205098f5e70d5f2a5f74b4838 https://github.com/meshtastic/SparkFun_Ublox_Arduino_Library.git#31015a55e630a2df77d9d714669c621a5bf355ad
https://github.com/meshtastic/RadioLib.git#1083c2e76f9906c5f80dfec726facebf8413eef0 https://github.com/meshtastic/RadioLib.git#1083c2e76f9906c5f80dfec726facebf8413eef0
https://github.com/meshtastic/TinyGPSPlus.git https://github.com/meshtastic/TinyGPSPlus.git
https://github.com/meshtastic/AXP202X_Library.git#8404abb6d4b486748636bc6ad72d2a47baaf5460 https://github.com/meshtastic/AXP202X_Library.git#8404abb6d4b486748636bc6ad72d2a47baaf5460

Wyświetl plik

@ -138,23 +138,21 @@ void UBloxGPS::whileActive()
*/ */
bool UBloxGPS::lookForTime() bool UBloxGPS::lookForTime()
{ {
if (fixType >= 2) { if (ublox.moduleQueried.gpsSecond) {
if (ublox.moduleQueried.gpsSecond) { /* Convert to unix time
/* Convert to unix time The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January
The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z).
1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z). */
*/ struct tm t;
struct tm t; t.tm_sec = ublox.getSecond(0);
t.tm_sec = ublox.getSecond(0); t.tm_min = ublox.getMinute(0);
t.tm_min = ublox.getMinute(0); t.tm_hour = ublox.getHour(0);
t.tm_hour = ublox.getHour(0); t.tm_mday = ublox.getDay(0);
t.tm_mday = ublox.getDay(0); t.tm_mon = ublox.getMonth(0) - 1;
t.tm_mon = ublox.getMonth(0) - 1; t.tm_year = ublox.getYear(0) - 1900;
t.tm_year = ublox.getYear(0) - 1900; t.tm_isdst = false;
t.tm_isdst = false; perhapsSetRTC(t);
perhapsSetRTC(t); return true;
return true;
}
} }
return false; return false;