From b189470495be7a7d262f945c3b65847293a59859 Mon Sep 17 00:00:00 2001 From: Nunu Date: Wed, 17 Jan 2024 13:35:10 +0100 Subject: [PATCH] ctcss scanner display results on 1st hit instead of 3rd --- app/scanner.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/app/scanner.c b/app/scanner.c index a8b5e96..09f48f4 100644 --- a/app/scanner.c +++ b/app/scanner.c @@ -462,19 +462,17 @@ void SCANNER_TimeSlice10ms(void) else if (scanResult == BK4819_CSS_RESULT_CTCSS) { const uint8_t Code = DCS_GetCtcssCode(ctcssFreq); if (Code != 0xFF) { - if (Code == gScanCssResultCode && gScanCssResultType == CODE_TYPE_CONTINUOUS_TONE) { - if (++scanHitCount >= 2) { - gScanCssState = SCAN_CSS_STATE_FOUND; - gScanUseCssResult = true; - gUpdateStatus = true; - } - } - else - scanHitCount = 0; - + + ++scanHitCount; + gScanCssState = SCAN_CSS_STATE_FOUND; + gScanUseCssResult = true; + gUpdateStatus = true; gScanCssResultType = CODE_TYPE_CONTINUOUS_TONE; gScanCssResultCode = Code; } + else { + scanHitCount = 0; + } } if (gScanCssState < SCAN_CSS_STATE_FOUND) { // scanning or off