diff --git a/internal/cat/icomserial.go b/internal/cat/icomserial.go index e2500cb..f10e01e 100644 --- a/internal/cat/icomserial.go +++ b/internal/cat/icomserial.go @@ -1935,12 +1935,25 @@ func (b *IcomSerial) SetIcomSplitOffset(on bool, offsetHz int64) error { // 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 { + // A fresh session may not have read the mode yet — ask, or the copy + // below would send mode 0 (LSB) whatever the main is on. + if m, ok := b.readMode(); ok { + b.curModeByte = m + } + } if b.curModeByte != 0 { dataByte := byte(0) if got := b.readDataMode(); got { dataByte = 1 } - _ = b.exec(civ.CmdModeDataFil, 0x01, b.curModeByte, dataByte, 0x01) + // Logged, not discarded: the first version swallowed the error and a + // real 7760's sub VFO kept yesterday's mode with nothing to show why. + if err := b.exec(civ.CmdModeDataFil, 0x01, b.curModeByte, dataByte, 0x01); err != nil { + applog.Printf("icom: split mode-align (26 01 %02X %d) refused: %v", b.curModeByte, dataByte, err) + } else { + applog.Printf("icom: split mode-align OK (26 01 %02X %d)", b.curModeByte, dataByte) + } } } if err := b.exec(civ.CmdSplit, boolByte(on)); err != nil {