fix(icom): the SUB dial is always shown, and split aligns the TX mode

The unselected VFO was read only when split was on, so a dual-receiver rig's
second dial sat blank on the console. It is now read on the same slow beat
regardless. And engaging split copies the main's mode (and data flag) onto
the TX VFO with 0x26 01 — a split whose TX VFO still speaks yesterday's mode
transmits FM into a CW pileup; rigs that predate 0x26 NAK it harmlessly.
This commit is contained in:
2026-08-29 21:53:16 +02:00
parent e8b5444fc2
commit da8f60a7b3
5 changed files with 36 additions and 9 deletions
+18 -2
View File
@@ -414,8 +414,13 @@ func (b *IcomSerial) ReadState() (RigState, error) {
// all, for the user's Set* commands.
if b.pollN%4 == 1 {
b.splitOn, b.splitTXFreq = false, 0
if on, ok := b.readSplit(); ok && on {
if txHz, ok2 := b.readTXFreq(); ok2 && txHz > 0 {
on, okSplit := b.readSplit()
// The unselected VFO is read split or NOT: on a dual-receiver rig it is
// the sub receiver's dial, and the console showed it blank until split
// was engaged.
if txHz, ok2 := b.readTXFreq(); ok2 && txHz > 0 {
b.setCache(func(st *IcomTXState) { st.SubHz = txHz })
if okSplit && on {
b.splitOn, b.splitTXFreq = true, txHz
}
}
@@ -1872,6 +1877,17 @@ func (b *IcomSerial) SetIcomSplit(on bool) error {
}
_ = b.exec(append([]byte{civ.CmdVfoFreq, civ.SubVfoUnselected}, civ.FreqToBCD(rx+offset)...)...)
}
// And the MODE crosses with it: a split where the TX VFO is still on
// yesterday's mode transmits FM into a CW pileup. 0x26 0x01 sets the
// unselected VFO's mode + data flag in one frame; rigs that predate
// 0x26 NAK it harmlessly and behave as they always did.
if b.curModeByte != 0 {
dataByte := byte(0)
if got := b.readDataMode(); got {
dataByte = 1
}
_ = b.exec(civ.CmdModeDataFil, 0x01, b.curModeByte, dataByte, 0x01)
}
}
if err := b.exec(civ.CmdSplit, boolByte(on)); err != nil {
return err