Merge pull request #640 from oseiler2/master

Fix: issue #639, if no LORA time source available and GPS time in fir…
This commit is contained in:
Verkehrsrot authored and GitHub committed 2020-09-27 12:03:24 +02:00
commit c1095f0c82
2 files changed
+6 -5

No files matched your search

+2 -2
View File
@@ -39,8 +39,8 @@ void setABPParameters() {
// devices' ping slots. LMIC does not have an easy way to define set this
// frequency and support for class B is spotty and untested, so this
// frequency is not configured here.
#elif defined(CFG_us915)
// NA-US channels 0-71 are configured automatically
#elif defined(CFG_us915) || defined(CFG_au915)
// NA-US and AU channels 0-71 are configured automatically
// but only one group of 8 should (a subband) should be active
// TTN recommends the second sub band, 1 in a zero based count.
// https://github.com/TheThingsNetwork/gateway-conf/blob/master/US-global_conf.json
+4 -3
View File
@@ -35,8 +35,10 @@ void calibrateTime(void) {
timesync_request();
#endif
// (only!) if we lost time, we try to fallback to local time source RTS or GPS
if (timeSource == _unsynced) {
// if no LORA timesource is available, or if we lost time, then fallback to
// local time source RTS or GPS
if (((!TIME_SYNC_LORASERVER) && (!TIME_SYNC_LORAWAN)) ||
(timeSource == _unsynced)) {
// has RTC -> fallback to RTC time
#ifdef HAS_RTC
@@ -50,7 +52,6 @@ void calibrateTime(void) {
timeSource = _gps;
#endif
if (t)
setMyTime((uint32_t)t, t_msec, timeSource); // set time
} // fallback