Get build (kinda, not really) running on a NRF52

Lots of NO_ESP32 to remove later...
This commit is contained in:
geeksville
2020-04-14 20:22:27 -07:00
parent 0b62083e35
commit 0a6af936ed
22 changed files with 240 additions and 55 deletions

View File

@@ -2,9 +2,15 @@
#include "GPS.h"
#include "configuration.h"
#include "time.h"
#include <assert.h>
#include <sys/time.h>
#ifdef GPS_RX_PIN
HardwareSerial _serial_gps(GPS_SERIAL_NUM);
#else
// Assume NRF52
// Uart _serial_gps(GPS_SERIAL_NUM);
#endif
bool timeSetFromGPS; // We try to set our time from GPS each time we wake from sleep
@@ -97,7 +103,11 @@ void GPS::perhapsSetRTC(const struct timeval *tv)
if (!timeSetFromGPS) {
timeSetFromGPS = true;
DEBUG_MSG("Setting RTC %ld secs\n", tv->tv_sec);
#ifndef NO_ESP32
settimeofday(tv, NULL);
#else
assert(0);
#endif
readFromRTC();
}
}