Fix remaining Si4684 ARG-offset bugs: seek, DAB services, RSQ/RDS/DIGRAD acks
writeCommand() had no way to send a non-zero ARG1, since it always hardcoded ARG1=0x00 before the caller's payload. Every command whose real ARG1 needed to carry a flag (STCACK, INTACK, SERTYPE, DIGRAD/EVENT ack) or whose payload needed to start at ARG1 instead of ARG2 was silently broken: - seekFm(): SEEKUP/WRAP never reached the chip (always ARG2=0x00), so hardware seek always searched down/no-wrap; masked by the existing 100 kHz software-step fallback in Si4684Tuner. - startDabService()/stopDabService(): SERVICE_ID/COMPONENT_ID shifted one byte right of their real ARG4-11 positions, with SERTYPE landing where the spec requires a fixed 0x00. - readDabServiceData(): same shift, plus STATUS_ONLY was bit3 (0x08) instead of the correct bit4 (0x10). - clearFmStc(), readFmRsq(), readFmRds(), fetchDabServiceList(), readDabDigRadStatus(), readDabEventStatus(): these AN649 commands have only ARG1 and no ARG2 at all, so the old two-argument writeCommand() could never carry their ack/status flags — clearFmStc()'s STCACK never fired in this driver's history (masked by FM_TUNE_FREQ/FM_SEEK_START auto-clearing STC per their own spec). writeCommand() gains a fourth parameter, arg1 (default 0x00, preserving every already-correct call site); each caller above now passes its flag through arg1 instead of the payload array. Confirmed live: first locked:true and first genuine hardware seek (not software-fallback) in this driver's history — 87.5 -> 98.3 MHz, RSSI +12 dBuV, SNR +14 dB. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0178rASQ6ZETPMUamvpoR2KR
This commit is contained in:
@@ -408,7 +408,8 @@ private:
|
||||
[[nodiscard]] std::expected<void, Si4684Error> readRaw(
|
||||
std::span<std::uint8_t> buffer);
|
||||
[[nodiscard]] std::expected<void, Si4684Error> writeCommand(
|
||||
Command cmd, const std::uint8_t* payload, std::size_t length);
|
||||
Command cmd, const std::uint8_t* payload, std::size_t length,
|
||||
std::uint8_t arg1 = 0x00U);
|
||||
[[nodiscard]] std::expected<void, Si4684Error> hostLoadBlob(
|
||||
const core::IFirmwareBlobReader& blob, std::size_t chunkPayload);
|
||||
[[nodiscard]] std::expected<void, Si4684Error> configureAfterBoot(
|
||||
|
||||
Reference in New Issue
Block a user