From d4d852456f2434165dbb47d688accc29d858b8b2 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Mar 2026 09:14:33 +0000 Subject: [PATCH] [fix](trx-rds): stay locked between groups to prevent decoder freeze After completing a group (Block D), the decoder dropped lock and reverted to search mode which only uses hard CRC. On weak signals, Block A frequently has bit errors that OSD could correct but hard decode cannot, causing the decoder to freeze after 2-3 successful groups. Stay locked with ExpectBlock::A so the next Block A benefits from OSD soft decoding. https://claude.ai/code/session_015Ds9dxpeyFimYHySBuzbFw Signed-off-by: Claude --- src/decoders/trx-rds/src/lib.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/decoders/trx-rds/src/lib.rs b/src/decoders/trx-rds/src/lib.rs index 7b8a3be..b14c395 100644 --- a/src/decoders/trx-rds/src/lib.rs +++ b/src/decoders/trx-rds/src/lib.rs @@ -268,6 +268,7 @@ enum BlockKind { #[derive(Debug, Clone, Copy, PartialEq, Eq)] enum ExpectBlock { + A, B, C, D, @@ -549,9 +550,15 @@ impl Candidate { None } (ExpectBlock::D, BlockKind::D) => { - self.locked = false; - self.search_bits = 0; - self.search_reg = 0; + // Stay locked and expect Block A next so the next group's + // Block A can benefit from OSD soft decoding. Previously + // the decoder dropped lock here and fell back to search mode + // (hard CRC only), which caused it to freeze after 2-3 + // groups on weak signals because Block A could not be + // re-acquired without OSD. + self.expect = ExpectBlock::A; + self.block_reg = 0; + self.block_bits = 0; self.process_group( self.block_a, self.block_b,