Do not read S/OVF while transmitting

This commit is contained in:
Nonoo 2020-11-09 12:07:39 +01:00
parent aca26b053a
commit e87093e69c

View file

@ -1302,15 +1302,17 @@ func (s *civControlStruct) loop() {
s.deinitFinished <- true
return
case <-time.After(statusPollInterval):
if !s.state.getS.pending && time.Since(s.state.lastSReceivedAt) >= statusPollInterval {
_ = s.getS()
}
if !s.state.getOVF.pending && time.Since(s.state.lastOVFReceivedAt) >= statusPollInterval {
_ = s.getOVF()
}
if !s.state.getSWR.pending && time.Since(s.state.lastSWRReceivedAt) >= statusPollInterval &&
(s.state.ptt || s.state.tune) {
_ = s.getSWR()
if s.state.ptt || s.state.tune {
if !s.state.getSWR.pending && time.Since(s.state.lastSWRReceivedAt) >= statusPollInterval {
_ = s.getSWR()
}
} else {
if !s.state.getS.pending && time.Since(s.state.lastSReceivedAt) >= statusPollInterval {
_ = s.getS()
}
if !s.state.getOVF.pending && time.Since(s.state.lastOVFReceivedAt) >= statusPollInterval {
_ = s.getOVF()
}
}
case <-s.resetSReadTimer:
case <-s.newPendingCmdAdded: