diff --git a/src/TEF6686.cpp b/src/TEF6686.cpp index 9474b30..11db1fd 100644 --- a/src/TEF6686.cpp +++ b/src/TEF6686.cpp @@ -3,7 +3,6 @@ #include #include // https://github.com/PaulStoffregen/Time #include "SPIFFS.h" -//#include "callsigns_usa.h" unsigned long rdstimer = 0; unsigned long bitStartTime = 0; @@ -34,7 +33,7 @@ void TEF6686::TestAFEON() { delay(200); devTEF_Radio_Get_RDS_Status(&rds.rdsStat, &rds.rdsA, &rds.rdsB, &rds.rdsC, &rds.rdsD, &rds.rdsErr); if (rds.rdsStat & (1 << 9)) { - if (rds.rdsA == rds.correctPI && (((rds.rdsErr >> 14) & 0x03) == 0)) { + if (((afmethodB && rds.afreg && ((rds.rdsA >> 8) & 0x0F) == (rds.correctPI & 0x0F)) || (!afmethodB && rds.rdsA == rds.correctPI)) && (((rds.rdsErr >> 14) & 0x03) == 0)) { af[x].checked = true; af[x].afvalid = true; } else { @@ -486,8 +485,8 @@ void TEF6686::readRDS(byte showrdserrors) char *token = strtok(buffer, ";"); - int firstColumnValue; - uint16_t frequencyValue; + int firstColumnValue = 0; + uint16_t frequencyValue = 0; char stationID[8]; char stationState[8]; @@ -1431,8 +1430,8 @@ void TEF6686::clearRDS (bool fullsearchrds) rds.stationID[8] = 0; - for (i = 0; i < 3; i++) rds.stationState[i] = 0x20; - rds.stationState[3] = 0; + for (i = 0; i < 2; i++) rds.stationState[i] = 0x20; + rds.stationState[2] = 0; for (i = 0; i < 50; i++) { af[i].frequency = 0; diff --git a/src/TEF6686.h b/src/TEF6686.h index 65d6c51..15366b0 100644 --- a/src/TEF6686.h +++ b/src/TEF6686.h @@ -541,7 +541,7 @@ typedef struct _rds_ { String stationStatetext; char stationType[18]; char picode[7]; - char stationID[8]; + char stationID[9]; char stationState[3]; uint16_t hour, minute, day, month, year, rdsA, rdsB, rdsC, rdsD, rdsErr, rdsStat, correctPI, rdsplusTag1, rdsplusTag2; uint16_t aid[10]; diff --git a/src/rds.cpp b/src/rds.cpp index 27ec82d..eeaa12a 100644 --- a/src/rds.cpp +++ b/src/rds.cpp @@ -1,3 +1,5 @@ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wbool-compare" #include "rds.h" #include "language.h" #include "constants.h" @@ -711,4 +713,5 @@ void ShowAFEON() { RadiotextSprite.pushSprite(5, 220); } } -} \ No newline at end of file +} +#pragma GCC diagnostic pop \ No newline at end of file