remove lic, pin, ms and make rt bigger

This commit is contained in:
2026-01-04 19:57:00 +01:00
parent 8f43648402
commit 6e7e684887
8 changed files with 31 additions and 312 deletions

View File

@@ -673,8 +673,6 @@ void TEF6686::readRDS(byte showrdserrors) {
if (rds.region == 0) strcpy(rds.stationType, PTY_EU[rds.stationTypeCode]); else strcpy(rds.stationType, PTY_USA[rds.stationTypeCode]);
rds.hasTA = (bitRead(rds.rdsB, 4)); // Read TA flag
if ((bitRead(rds.rdsB, 3)) == 1) rds.MS = 1; else rds.MS = 2; // Read MS flag
}
rds.hasTP = (bitRead(rds.rdsB, 10)); // Read TP flag
@@ -1154,26 +1152,9 @@ void TEF6686::readRDS(byte showrdserrors) {
}
}
}
if (((rds.rdsC >> 12) & 0x07) == 3 && rdsblock == RDS_GROUP_1A) { // LIC code readout
rds.LIC = rds.rdsC & 0xff;
rds.hasLIC = true;
if (rds.LIC > 0 && rds.LIC < 128) rds.LICtext = LICtext[rds.LIC]; else rds.LICtext = "";
}
}
if (rds.rdsC >> 12 == 1 && rdsblock == RDS_GROUP_1A) rds.hasTMC = true; // TMC flag
if (!rdsDerrorThreshold) {
if (rds.rdsD != 0) { // PIN decoder
if ((rds.rdsD & 0x3f) < 61 && ((rds.rdsD >> 6) & 0x1f) < 24) {
rds.hasPIN = true;
rds.pinMin = rds.rdsD & 0x3f;
rds.pinHour = rds.rdsD >> 6 & 0x1f;
rds.pinDay = rds.rdsD >> 11 & 0x1f;
}
}
}
} break;
case RDS_GROUP_2A: {
@@ -1704,7 +1685,6 @@ void TEF6686::clearRDS (bool fullsearchrds) {
rds.RTContent2 = "";
rds.PTYN = "";
rds.ECCtext = "";
rds.LICtext = "";
rds.stationIDtext = "";
rds.stationStatetext = "";
rds.enhancedRTtext = "";
@@ -1799,15 +1779,9 @@ void TEF6686::clearRDS (bool fullsearchrds) {
piold = 0;
rds.correctPI = 0;
rds.ECC = 254;
rds.LIC = 254;
rds.pinHour = 0;
rds.pinMin = 0;
rds.pinDay = 0;
rds.stationTypeCode = 32;
rds.dabaffreq = 0;
rds.hasPIN = false;
rds.hasECC = false;
rds.hasLIC = false;
rds.hasRT = false;
rds.hasRDS = false;
rds.hasTP = false;
@@ -1834,7 +1808,6 @@ void TEF6686::clearRDS (bool fullsearchrds) {
af_updatecounter = 0;
eon_counter = 0;
afreset = true;
rds.MS = 0;
rds.rdsAerror = true;
rds.rdsBerror = true;
rds.rdsCerror = true;

View File

@@ -339,137 +339,6 @@ static const char* const ECCtext[] {
"Bangladesh" // 227
};
static const char* const LICtext[] = {
"Unknown", // 0
"Albanian", // 1
"Breton", // 2
"Catalan", // 3
"Croatian", // 4
"Welsh", // 5
"Czech", // 6
"Danish", // 7
"German", // 8
"English", // 9
"Spanish", // 10
"Esperanto", // 11
"Estonian", // 12
"Basque", // 13
"Faroese", // 14
"French", // 15
"Frisian", // 16
"Irish", // 17
"Gaelic", // 18
"Galician", // 19
"Icelandic", // 20
"Italian", // 21
"Lappish", // 22
"Latin", // 23
"Latvian", // 24
"Luxemb.", // 25
"Lithua.", // 26
"Hungar.", // 27
"Maltese", // 28
"Dutch", // 29
"Norweg.", // 30
"Occitan", // 31
"Polish", // 32
"Portug.", // 33
"Romanian", // 34
"Romansh", // 35
"Serbian", // 36
"Slovak", // 37
"Slovene", // 38
"Finnish", // 39
"Swedish", // 40
"Turkish", // 41
"Flemish", // 42
"Walloon", // 43
"Unknown", // 44
"Unknown", // 45
"Unknown", // 46
"Unknown", // 47
"Unknown", // 48
"Unknown", // 49
"Unknown", // 50
"Unknown", // 51
"Unknown", // 52
"Unknown", // 53
"Unknown", // 54
"Unknown", // 55
"Unknown", // 56
"Unknown", // 57
"Unknown", // 58
"Unknown", // 59
"Unknown", // 60
"Unknown", // 61
"Unknown", // 62
"Unknown", // 63
"Backgr.", // 64
"Unknown", // 65
"Unknown", // 66
"Unknown", // 67
"Unknown", // 68
"Zulu", // 69
"Vietnam.", // 70
"Uzbek", // 71
"Urdu", // 72
"Ukrain.", // 73
"Thai", // 74
"Telugu", // 75
"Tatar", // 76
"Tamil", // 77
"Tadzhik", // 78
"Swahili", // 79
"SrananT.", // 80
"Somali", // 81
"Sinhalese", // 82
"Shona", // 83
"Serbo-C.", // 84
"Ruthen.", // 85
"Russian", // 86
"Quechua", // 87
"Pushtu", // 88
"Punjabi", // 89
"Persian", // 90
"Papami.", // 91
"Oriya", // 92
"Nepali", // 93
"Ndebele", // 94
"Marathi", // 95
"Moldov.", // 96
"Malays.", // 97
"Malagas.", // 98
"Macedon.", // 99
"Laotian", // 100
"Korean", // 101
"Khmer", // 102
"Kazakh", // 103
"Kannada", // 104
"Japanese", // 105
"Indones.", // 106
"Hindi", // 107
"Hebrew", // 108
"Hausa", // 109
"Gurani", // 110
"Gujurati", // 111
"Greek", // 112
"Georgian", // 113
"Fulani", // 114
"Dari", // 115
"Churash", // 116
"Chinese", // 117
"Burmese", // 118
"Bulgarian", // 119
"Bengali", // 120
"Belorus.", // 121
"Bambora", // 122
"Azerbaij.", // 123
"Assamese", // 124
"Armenian", // 125
"Arabic", // 126
"Amharic" // 127
};
static const char* const oda_app_names[] {
"None",
"Cross referencing DAB within RDS",
@@ -572,7 +441,6 @@ const DABFrequencyLabel DABfrequencyTable[] = {
typedef struct _rds_ {
byte region;
byte stationTypeCode;
byte MS;
String stationName;
String stationText;
String stationText32;
@@ -580,7 +448,6 @@ typedef struct _rds_ {
String RTContent2;
String PTYN;
String ECCtext;
String LICtext;
String stationIDtext;
String stationNameLong;
String stationStatetext;
@@ -602,10 +469,6 @@ typedef struct _rds_ {
byte aid_counter;
byte fastps;
unsigned int ECC;
unsigned int LIC;
byte pinMin;
byte pinHour;
byte pinDay;
bool rdsAerror;
bool rdsBerror;
bool rdsCerror;
@@ -615,9 +478,7 @@ typedef struct _rds_ {
bool hasDynamicPTY;
bool hasStereo;
bool hasRDS;
bool hasPIN;
bool hasECC;
bool hasLIC;
bool hasDABAF;
bool hasLongPS;
bool hasRT;

View File

@@ -2950,15 +2950,13 @@ void BuildAdvancedRDS() {
tft.drawLine(0, 126, 320, 126, FrameColor);
tft.drawLine(0, 140, 210, 140, FrameColor);
tft.drawLine(0, 166, 210, 166, FrameColor);
tft.drawLine(0, 193, 210, 193, FrameColor);
tft.drawLine(0, 217, 210, 217, FrameColor);
tft.drawLine(0, 193, 320, 193, FrameColor);
tft.drawLine(0, 217, 320, 217, FrameColor);
tft.drawLine(30, 30, 30, 0, FrameColor);
tft.drawLine(66, 30, 66, 0, FrameColor);
tft.drawLine(105, 30, 105, 0, FrameColor);
tft.drawLine(105, 30, 105, 0, FrameColor);
tft.drawLine(162, 30, 162, 0, FrameColor);
tft.drawLine(210, 30, 210, 240, FrameColor);
tft.drawLine(210, 191, 320, 191, FrameColor);
tft.drawLine(210, 30, 210, 217, FrameColor);
tft.drawLine(248, 30, 248, 0, FrameColor);
tftPrint(ALEFT, "ERRORS", 3, 34, ActiveColor, ActiveColorSmooth, 16);
@@ -2973,17 +2971,15 @@ void BuildAdvancedRDS() {
tftPrint(ALEFT, "PS", 3, 81, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ALEFT, "PTY", 3, 109, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ALEFT, "RT+", 3, 147, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ALEFT, "AF", 3, 199, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ALEFT, "EON", 3, 174, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ALEFT, "AF", 3, 199, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ALEFT, "RT", 3, 222, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ALEFT, "A:", 66, 34, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ALEFT, "B:", 104, 34, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ALEFT, "C:", 142, 34, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ALEFT, "D:", 180, 34, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ALEFT, "ECC", 214, 193, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ALEFT, "LIC", 214, 208, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ALEFT, "PIN", 214, 223, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ALEFT, "ECC", 214, 199, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ARIGHT, "Dynamic PTY", 300, 130, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ARIGHT, "Artificial head", 300, 145, ActiveColor, ActiveColorSmooth, 16);
tftPrint(ARIGHT, "Compressed", 300, 160, ActiveColor, ActiveColorSmooth, 16);
@@ -3019,8 +3015,6 @@ void BuildAdvancedRDS() {
tftPrint(ALEFT, "TMC", 88, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(ALEFT, "RT+", 123, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(ALEFT, "EON", 153, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(ALEFT, "S", 185, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(ALEFT, "M", 196, 51, GreyoutColor, BackgroundColor, 16);
RDSstatusold = !RDSstatusold;
ShowFreq(0);
@@ -3039,8 +3033,6 @@ void BuildAdvancedRDS() {
PSold = " ";
stationIDold = " ";
stationStateold = " ";
MSold = 0;
licold = 254;
af_counterold = 254;
TAold = false;
TPold = false;
@@ -3052,7 +3044,6 @@ void BuildAdvancedRDS() {
hasafold = false;
haseonold = false;
BWreset = true;
pinstringold = "";
hasrtplusold = false;
afmethodBold = false;
rds_clockold = "";
@@ -3173,7 +3164,6 @@ void BuildDisplay() {
TAold = false;
TPold = false;
haseonold = false;
MSold = 0;
rds_clockold = "";
strcpy(programTypePrevious, "");
PIold = " ";

View File

@@ -95,7 +95,6 @@ extern byte HighCutLevel;
extern byte HighCutOffset;
extern byte items[10];
extern byte language;
extern byte licold;
extern byte longbandpress;
extern byte memorypos;
extern byte memdoublepi;
@@ -104,7 +103,6 @@ extern byte memstartpos;
extern byte memstoppos;
extern byte menuitem;
extern byte menupage;
extern byte MSold;
extern byte poweroptions;
extern byte eonptyold[20];
extern byte rdsblockold;
@@ -190,7 +188,6 @@ extern int8_t NTPoffset;
extern int8_t VolSet;
extern String eonpsold[20];
extern String PIold;
extern String pinstringold;
extern String PSold;
extern String ptynold;
extern String rds_clockold;

View File

@@ -497,14 +497,6 @@ void sendUDPlog() {
ECC = String(eccBuffer);
}
// Extract and format LIC (Language Identifier Code) if available
String LIC = "";
if (radio.rds.hasLIC) {
char licBuffer[3];
snprintf(licBuffer, sizeof(licBuffer), "%02X", radio.rds.LIC);
LIC = String(licBuffer);
}
// Format the list of Alternative Frequencies (AF) if available
String AF = "";
if (radio.rds.hasAF && radio.af_counter > 0) {
@@ -556,7 +548,6 @@ void sendUDPlog() {
String(radio.rds.hasTMC) + "," +
String(radio.rds.stationTypeCode) + "," +
ECC + "," +
LIC + "," +
stationName + "," +
radioTextModified + "," +
AF + "," +

View File

@@ -51,30 +51,6 @@ void ShowAdvancedRDS() {
}
}
if (licold != radio.rds.LIC || rdsreset) {
if (!screenmute) {
if (radio.rds.hasLIC) LICString = (radio.rds.LICtext.length() == 0 ? textUI(73) : radio.rds.LICtext); else LICString = "N/A";
if (LICString != LIColdString) {
tftPrint(ALEFT, "N/A", 242, 208, BackgroundColor, BackgroundColor, 16);
tftPrint(ALEFT, LIColdString, 242, 208, BackgroundColor, BackgroundColor, 16);
}
tftPrint(ALEFT, LICString, 242, 208, RDSColor, RDSColorSmooth, 16);
LIColdString = LICString;
licold = radio.rds.LIC;
}
}
String pinstring = String(radio.rds.pinDay) + " " + String(radio.rds.pinHour) + ":" + (radio.rds.pinMin < 10 ? "0" : "") + String(radio.rds.pinMin);
if (pinstringold != pinstring) {
if (!screenmute) {
tftPrint(ALEFT, "N/A", 242, 223, BackgroundColor, BackgroundColor, 16);
tftPrint(ALEFT, pinstringold, 242, 223, BackgroundColor, BackgroundColor, 16);
if (radio.rds.hasPIN) tftPrint(ALEFT, pinstring, 242, 223, RDSColor, RDSColorSmooth, 16); else tftPrint(ALEFT, "N/A", 242, 223, RDSColor, RDSColorSmooth, 16);
pinstringold = pinstring;
}
}
String afstring;
if (radio.rds.hasAF && radio.af_counter > 0) for (byte i = 0; i < radio.af_counter; i++) afstring += String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10) + (i == radio.af_counter - 1 ? " " : " | "); else afstring = textUI(87);
if (hasafold != radio.rds.hasAF) {
@@ -219,28 +195,6 @@ void ShowAdvancedRDS() {
afmethodBold = radio.afmethodB;
}
if (MSold != radio.rds.MS) {
if (!screenmute) {
switch (radio.rds.MS) {
case 0:
tftPrint(ALEFT, "M", 196, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(ALEFT, "S", 185, 51, GreyoutColor, BackgroundColor, 16);
break;
case 1:
tftPrint(ALEFT, "M", 196, 51, RDSColor, RDSColorSmooth, 16);
tftPrint(ALEFT, "S", 185, 51, GreyoutColor, BackgroundColor, 16);
break;
case 2:
tftPrint(ALEFT, "M", 196, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(ALEFT, "S", 185, 51, RDSColor, RDSColorSmooth, 16);
break;
}
}
MSold = radio.rds.MS;
}
if (rdsblockold != radio.rdsblock) {
if (rdsblockold < 33) tft.fillCircle((6 * rdsblockold) + 10, 133, 2, SignificantColor);
if (radio.rdsblock < 33) tft.fillCircle((6 * radio.rdsblock) + 10, 133, 2, InsignificantColor);
@@ -285,10 +239,10 @@ void showECC() {
if (!screenmute) {
if (radio.rds.hasECC) ECCString = (radio.rds.ECCtext.length() == 0 ? textUI(73) : radio.rds.ECCtext); else ECCString = "N/A";
if (ECCString != ECColdString) {
tftPrint(ALEFT, "N/A", 242, 193, BackgroundColor, BackgroundColor, 16);
tftPrint(ALEFT, ECColdString, 242, 193, BackgroundColor, BackgroundColor, 16);
tftPrint(ALEFT, "N/A", 242, 199, BackgroundColor, BackgroundColor, 16);
tftPrint(ALEFT, ECColdString, 242, 199, BackgroundColor, BackgroundColor, 16);
}
tftPrint(ALEFT, ECCString, 242, 193, RDSColor, RDSColorSmooth, 16);
tftPrint(ALEFT, ECCString, 242, 199, RDSColor, RDSColorSmooth, 16);
}
ECColdString = ECCString;
}
@@ -399,13 +353,8 @@ void readRds() {
tftPrint(ALEFT, PTYold, 34, advancedRDS ? 109 : 163,
RDSColor, RDSColorSmooth, 16);
if (!advancedRDS) {
tft.fillCircle(314, 223, 2, GreyoutColor);
tft.fillCircle(314, 234, 2, GreyoutColor);
} else {
tft.fillCircle(203, 223, 2, GreyoutColor);
tft.fillCircle(203, 234, 2, GreyoutColor);
}
tft.fillCircle(314, 223, 2, GreyoutColor);
tft.fillCircle(314, 234, 2, GreyoutColor);
}
dropout = false;
memreset = false;
@@ -887,19 +836,7 @@ void showRadioText() {
if (radio.rds.hasRT &&
(radio.rds.stationText.length() > 0 || radio.rds.stationText32.length() > 0)) {
// Determine whether to use advanced RDS mode
if (advancedRDS && RDSSprite.textWidth(radio.trimTrailingSpaces(RTString)) < 165) {
xPos = 0;
RDSSprite.fillSprite(BackgroundColor);
RDSSprite.setTextDatum(TL_DATUM);
RDSSprite.setTextColor(
RDSstatus ? RDSColor : RDSDropoutColor,
RDSstatus ? RDSColorSmooth : RDSDropoutColorSmooth,
false
);
RDSSprite.drawString(RTString, xPos, 2);
RDSSprite.pushSprite(36, 220);
} else if (!advancedRDS && RDSSprite.textWidth(radio.trimTrailingSpaces(RTString)) < 270) {
if (RDSSprite.textWidth(radio.trimTrailingSpaces(RTString)) < 270) {
xPos = 0;
FullLineSprite.fillSprite(BackgroundColor);
FullLineSprite.setTextDatum(TL_DATUM);
@@ -920,7 +857,7 @@ void showRadioText() {
FullLineSprite.pushSprite(36, 220);
} else {
// Handle scrolling text
if (millis() - rtticker >= (advancedRDS ? 5 : 15)) {
if (millis() - rtticker >= 15) {
if (xPos == 0 && millis() - rttickerhold < 1000) {
// Wait for a moment before scrolling
} else {
@@ -930,52 +867,33 @@ void showRadioText() {
if (xPos < -RadiotextWidth) xPos = 0; // Reset position if scrolled off
if (advancedRDS) {
RDSSprite.fillSprite(BackgroundColor);
RDSSprite.setTextDatum(TL_DATUM);
RDSSprite.setTextColor(
RDSstatus ? RDSColor : RDSDropoutColor,
RDSstatus ? RDSColorSmooth : RDSDropoutColorSmooth,
false
);
RDSSprite.drawString(RTString, xPos, 2);
RDSSprite.drawString(RTString, xPos + RadiotextWidth, 2);
RDSSprite.pushSprite(36, 220);
} else {
FullLineSprite.fillSprite(BackgroundColor);
FullLineSprite.setTextDatum(TL_DATUM);
FullLineSprite.setTextColor(
RDSstatus ? RDSColor : RDSDropoutColor,
RDSstatus ? RDSColorSmooth : RDSDropoutColorSmooth,
false
);
FullLineSprite.drawString(RTString, xPos, 2);
FullLineSprite.drawString(RTString, xPos + RadiotextWidth, 2);
FullLineSprite.fillRect(275, 0, 8, 19, BackgroundColor);
FullLineSprite.drawLine(283, 0, 283, 19, FrameColor);
FullLineSprite.fillSprite(BackgroundColor);
FullLineSprite.setTextDatum(TL_DATUM);
FullLineSprite.setTextColor(
RDSstatus ? RDSColor : RDSDropoutColor,
RDSstatus ? RDSColorSmooth : RDSDropoutColorSmooth,
false
);
FullLineSprite.drawString(RTString, xPos, 2);
FullLineSprite.drawString(RTString, xPos + RadiotextWidth, 2);
FullLineSprite.fillRect(275, 0, 8, 19, BackgroundColor);
FullLineSprite.drawLine(283, 0, 283, 19, FrameColor);
if (radio.rds.hasRT) {
FullLineSprite.fillCircle(278, 3, 2, radio.rds.rtAB ? GreyoutColor : InsignificantColor);
FullLineSprite.fillCircle(278, 14, 2, radio.rds.rtAB ? InsignificantColor : GreyoutColor);
}
FullLineSprite.pushSprite(36, 220);
if (radio.rds.hasRT) {
FullLineSprite.fillCircle(278, 3, 2, radio.rds.rtAB ? GreyoutColor : InsignificantColor);
FullLineSprite.fillCircle(278, 14, 2, radio.rds.rtAB ? InsignificantColor : GreyoutColor);
}
FullLineSprite.pushSprite(36, 220);
rtticker = millis();
}
}
}
// Update small indicators for RT AB status
if (radio.rds.hasRT && advancedRDS) {
tft.fillCircle(203, 223, 2, radio.rds.rtAB ? GreyoutColor : InsignificantColor);
tft.fillCircle(203, 234, 2, radio.rds.rtAB ? InsignificantColor : GreyoutColor);
}
}
// Update RTold and RadiotextWidth if the string has changed
if (RTold != RTString) {
RadiotextWidth = (advancedRDS ? RDSSprite.textWidth(RTString) : FullLineSprite.textWidth(RTString));
RadiotextWidth = FullLineSprite.textWidth(RTString);
if (wifi) {
Udp.beginPacket(remoteip, 9030);

View File

@@ -53,8 +53,6 @@ extern byte charwidth;
extern byte CurrentSkin;
extern byte ECCold;
extern byte language;
extern byte licold;
extern byte MSold;
extern byte eonptyold[20];
extern byte rdsblockold;
extern byte rdsqualityold;
@@ -101,9 +99,6 @@ extern String AIDString;
extern String ECColdString;
extern String ECCString;
extern String eonpsold[20];
extern String LIColdString;
extern String LICString;
extern String pinstringold;
extern String PIold;
extern String PSold;
extern String ptynold;