feat(icom): the ATU can be taken out of line
TUNE (1C 01 02) started a cycle; nothing sent the 0 that puts the tuner back through. An ATU chip beside SPLIT now toggles it, and the tuner state is read on the slow front-panel beat so the radio's own TUNER button stays in sync.
This commit is contained in:
@@ -530,6 +530,13 @@ func (b *IcomSerial) refreshFrontPanel() {
|
||||
b.dsp.Filter = int(f)
|
||||
b.dspMu.Unlock()
|
||||
}
|
||||
case 2:
|
||||
// Tuner in/out — the radio's own TUNER button changes it mid-session.
|
||||
if v, ok := b.readSwitchSub(civ.CmdATU, civ.SubATU); ok {
|
||||
b.dspMu.Lock()
|
||||
b.dsp.ATUOn = v == 1
|
||||
b.dspMu.Unlock()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2041,6 +2048,17 @@ func (b *IcomSerial) TuneATU() error {
|
||||
return b.exec(civ.CmdATU, civ.SubATU, 0x02)
|
||||
}
|
||||
|
||||
// SetATU engages or DISENGAGES the internal tuner (0x1C 0x01: 1 = in line,
|
||||
// 0 = through). Tune existed without this, which meant a tuner once engaged
|
||||
// could not be taken out of line again from the console.
|
||||
func (b *IcomSerial) SetATU(on bool) error {
|
||||
if err := b.exec(civ.CmdATU, civ.SubATU, boolByte(on)); err != nil {
|
||||
return err
|
||||
}
|
||||
b.setCache(func(s *IcomTXState) { s.ATUOn = on })
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *IcomSerial) setCache(fn func(*IcomTXState)) {
|
||||
b.dspMu.Lock()
|
||||
fn(&b.dsp)
|
||||
|
||||
Reference in New Issue
Block a user