kopia lustrzana https://github.com/cyoung/stratux
sdr: capture state locally prior to processing
rodzic
529b453ba2
commit
c5aacf0fbd
12
main/sdr.go
12
main/sdr.go
|
@ -486,6 +486,9 @@ func sdrWatcher() {
|
||||||
shutdownES = false
|
shutdownES = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// capture current state
|
||||||
|
esEnabled := esEnabled
|
||||||
|
uatEnabled := uatEnabled
|
||||||
count := rtl.GetDeviceCount()
|
count := rtl.GetDeviceCount()
|
||||||
atomic.StoreUint32(&globalStatus.Devices, uint32(count))
|
atomic.StoreUint32(&globalStatus.Devices, uint32(count))
|
||||||
|
|
||||||
|
@ -494,8 +497,7 @@ func sdrWatcher() {
|
||||||
count = 2
|
count = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
if count == prevCount && prevESEnabled == globalSettings.ES_Enabled &&
|
if count == prevCount && prevESEnabled == esEnabled && prevUATEnabled == uatEnabled {
|
||||||
prevUATEnabled == globalSettings.UAT_Enabled {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -508,11 +510,11 @@ func sdrWatcher() {
|
||||||
ESDev.shutdown()
|
ESDev.shutdown()
|
||||||
ESDev = nil
|
ESDev = nil
|
||||||
}
|
}
|
||||||
configDevices(count, globalSettings.ES_Enabled, globalSettings.UAT_Enabled)
|
configDevices(count, esEnabled, uatEnabled)
|
||||||
|
|
||||||
prevCount = count
|
prevCount = count
|
||||||
prevUATEnabled = globalSettings.UAT_Enabled
|
prevUATEnabled = uatEnabled
|
||||||
prevESEnabled = globalSettings.ES_Enabled
|
prevESEnabled = esEnabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue