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