Improvement AF method B detector

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-11-23 21:57:30 +01:00
parent cb3edeb9d0
commit 3ca589788b

View File

@@ -629,6 +629,18 @@ void TEF6686::readRDS(byte showrdserrors)
}
if (afinit) {
/* Debug info
if ((rds.rdsC >> 8) > 224 && (rds.rdsC >> 8) < 250) {
Serial.print("#");
Serial.print((rds.rdsC >> 8) - 224);
Serial.print("\t");
Serial.println((rds.rdsC & 0xFF) * 10 + 8750);
} else {
Serial.print((rds.rdsC >> 8) * 10 + 8750);
Serial.print("\t");
Serial.println((rds.rdsC & 0xFF) * 10 + 8750);
}
*/
if ((rds.rdsC >> 8) > 224 && (rds.rdsC >> 8) < 250 && ((rds.rdsC & 0xFF) * 10 + 8750) == currentfreq && rds.hasAF) {
if (afmethodBtrigger) afmethodB = true; // Check for AF method B
afmethodBprobe = true;
@@ -660,7 +672,7 @@ void TEF6686::readRDS(byte showrdserrors)
if ((rds.rdsC & 0xFF) > 0 && (rds.rdsC & 0xFF) < 205) buffer1 = (rds.rdsC & 0xFF) * 10 + 8750; else buffer1 = 0;
if (((rds.rdsC >> 8) > 0 && (rds.rdsC >> 8) < 205) && (buffer0 == doubletestfreq || buffer1 == doubletestfreq)) doublecounter++;
if (doublecounter > (af_number / 2 - 2)) afmethodB = true; // If signed frequency also appears more than once in the AF list, AF Method B detected
if (doublecounter > (af_number / 2)) afmethodB = true; // If signed frequency also appears more than once in the AF list, AF Method B detected
if (afmethodBprobe && af_counterbcheck > af_counterb) afmethodBprobe = false; // If more than counter received disable probe flag