ctcss scanner display results on 1st hit instead of 3rd

This commit is contained in:
Nunu 2024-01-17 13:35:10 +01:00
parent c4d68ab5dd
commit b189470495

View File

@ -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