This commit is contained in:
Sjef Verhoeven PE5PVB
2023-07-29 15:52:33 +02:00
parent 6490cabfd2
commit 4cf3877b39
4 changed files with 70 additions and 73 deletions
+16 -23
View File
@@ -50,7 +50,6 @@ bool artheadold;
bool batterydetect = true; bool batterydetect = true;
bool BWreset; bool BWreset;
bool change2; bool change2;
bool cleanup;
bool compressedold; bool compressedold;
bool direction; bool direction;
bool dropout; bool dropout;
@@ -3160,10 +3159,7 @@ void readRds() {
if (advancedRDS) tftPrint(-1, PIold, 244, 75, SecondaryColor, SecondaryColorSmooth, FONT28); else tftPrint(-1, PIold, 244, 187, SecondaryColor, SecondaryColorSmooth, FONT28); if (advancedRDS) tftPrint(-1, PIold, 244, 75, SecondaryColor, SecondaryColorSmooth, FONT28); else tftPrint(-1, PIold, 244, 187, SecondaryColor, SecondaryColorSmooth, FONT28);
if (advancedRDS) tftPrint(-1, PSold, 38, 75, SecondaryColor, SecondaryColorSmooth, FONT28); else tftPrint(-1, PSold, 38, 187, SecondaryColor, SecondaryColorSmooth, FONT28); if (advancedRDS) tftPrint(-1, PSold, 38, 75, SecondaryColor, SecondaryColorSmooth, FONT28); else tftPrint(-1, PSold, 38, 187, SecondaryColor, SecondaryColorSmooth, FONT28);
if (advancedRDS) tftPrint(-1, PTYold, 38, 109, SecondaryColor, SecondaryColorSmooth, FONT16); else tftPrint(-1, PTYold, 38, 163, SecondaryColor, SecondaryColorSmooth, FONT16); if (advancedRDS) tftPrint(-1, PTYold, 38, 109, SecondaryColor, SecondaryColorSmooth, FONT16); else tftPrint(-1, PTYold, 38, 163, SecondaryColor, SecondaryColorSmooth, FONT16);
if (!advancedRDS) { if (advancedRDS) {
sprite.fillSprite(BackgroundColor);
sprite.pushSprite(38, 220);
} else {
tft.fillCircle(86, 41, 5, SignificantColor); tft.fillCircle(86, 41, 5, SignificantColor);
tft.fillCircle(124, 41, 5, SignificantColor); tft.fillCircle(124, 41, 5, SignificantColor);
tft.fillCircle(162, 41, 5, SignificantColor); tft.fillCircle(162, 41, 5, SignificantColor);
@@ -3324,7 +3320,7 @@ void ShowAdvancedRDS() {
} }
String afstring; String afstring;
if (radio.rds.hasAF) for (byte i = 0; i < radio.af_counter; i++) afstring += String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10) + (radio.af[i].filler ? "(f)" : "") + (i == radio.af_counter - 1 ? " " : " | "); else afstring = myLanguage[language][87]; if (radio.rds.hasAF) for (byte i = 0; i < radio.af_counter; i++) afstring += String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10) + (radio.af[i].filler ? "(f)" : "") + (i == radio.af_counter - 1 ? " " : " | "); else afstring = myLanguage[language][87];
if (hasafold != radio.rds.hasAF) { if (hasafold != radio.rds.hasAF) {
if (radio.rds.hasAF) tftPrint(-1, "AF", 50, 51, SecondaryColor, SecondaryColorSmooth, FONT16); else tftPrint(-1, "AF", 50, 51, GreyoutColor, BackgroundColor, FONT16); if (radio.rds.hasAF) tftPrint(-1, "AF", 50, 51, SecondaryColor, SecondaryColorSmooth, FONT16); else tftPrint(-1, "AF", 50, 51, GreyoutColor, BackgroundColor, FONT16);
hasafold = radio.rds.hasAF; hasafold = radio.rds.hasAF;
@@ -3362,7 +3358,7 @@ void ShowAdvancedRDS() {
afstringold = afstring; afstringold = afstring;
String eonstring; String eonstring;
if (radio.rds.hasEON) for (byte i = 0; i < radio.eon_counter; i++) eonstring += String(radio.eon[i].picode) + (radio.eon[i].ps.length() > 0 ? String(": " + String(radio.eon[i].ps)) : "") + (radio.eon[i].mappedfreq > 0 ? String(" " + String(radio.eon[i].mappedfreq / 100) + "." + String((radio.eon[i].mappedfreq % 100) / 10)) : "") + (radio.eon[i].mappedfreq2 > 0 ? String(" / " + String(radio.eon[i].mappedfreq2 / 100) + "." + String((radio.eon[i].mappedfreq2 % 100) / 10)) : "") + (radio.eon[i].mappedfreq3 > 0 ? String(" / " + String(radio.eon[i].mappedfreq3 / 100) + "." + String((radio.eon[i].mappedfreq3 % 100) / 10)) : "") + (i == radio.eon_counter - 1 ? " " : " | "); else eonstring = myLanguage[language][88]; if (radio.rds.hasEON) for (byte i = 0; i < radio.eon_counter; i++) eonstring += String(radio.eon[i].picode) + (radio.eon[i].ps.length() > 0 ? String(": " + String(radio.eon[i].ps)) : "") + (radio.eon[i].mappedfreq > 0 ? String(" " + String(radio.eon[i].mappedfreq / 100) + "." + String((radio.eon[i].mappedfreq % 100) / 10)) : "") + (radio.eon[i].mappedfreq2 > 0 ? String(" / " + String(radio.eon[i].mappedfreq2 / 100) + "." + String((radio.eon[i].mappedfreq2 % 100) / 10)) : "") + (radio.eon[i].mappedfreq3 > 0 ? String(" / " + String(radio.eon[i].mappedfreq3 / 100) + "." + String((radio.eon[i].mappedfreq3 % 100) / 10)) : "") + (i == radio.eon_counter - 1 ? " " : " | "); else eonstring = myLanguage[language][88];
if (haseonold != radio.rds.hasEON) { if (haseonold != radio.rds.hasEON) {
if (radio.rds.hasEON) tftPrint(-1, "EON", 153, 51, SecondaryColor, SecondaryColorSmooth, FONT16); else tftPrint(-1, "EON", 153, 51, GreyoutColor, BackgroundColor, FONT16); if (radio.rds.hasEON) tftPrint(-1, "EON", 153, 51, SecondaryColor, SecondaryColorSmooth, FONT16); else tftPrint(-1, "EON", 153, 51, GreyoutColor, BackgroundColor, FONT16);
haseonold = radio.rds.hasEON; haseonold = radio.rds.hasEON;
@@ -3671,12 +3667,12 @@ void showPS() {
} }
void showRadioText() { void showRadioText() {
if (radio.rds.hasRT && RDSstatus) { if (radio.rds.hasRT && radio.rds.stationText.length() > 0) {
if (advancedRDS && radio.rds.stationText.length() < 20) { if (advancedRDS && radio.rds.stationText.length() < 20) {
xPos = 0; xPos = 0;
sprite2.fillSprite(BackgroundColor); sprite2.fillSprite(BackgroundColor);
sprite2.loadFont(FONT16); sprite2.loadFont(FONT16);
sprite2.setTextColor(PrimaryColor, PrimaryColorSmooth, false); if (RDSstatus) sprite2.setTextColor(PrimaryColor, PrimaryColorSmooth, false); else sprite2.setTextColor(SecondaryColor, SecondaryColorSmooth, false);
sprite2.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2); sprite2.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
sprite2.pushSprite(35, 220); sprite2.pushSprite(35, 220);
} else if (!advancedRDS && radio.rds.stationText.length() < 29) { } else if (!advancedRDS && radio.rds.stationText.length() < 29) {
@@ -3684,7 +3680,7 @@ void showRadioText() {
xPos = 0; xPos = 0;
sprite.fillSprite(BackgroundColor); sprite.fillSprite(BackgroundColor);
sprite.loadFont(FONT16); sprite.loadFont(FONT16);
sprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false); if (RDSstatus) sprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false); else sprite.setTextColor(SecondaryColor, SecondaryColorSmooth, false);
sprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2); sprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
sprite.pushSprite(38, 220); sprite.pushSprite(38, 220);
} }
@@ -3703,26 +3699,20 @@ void showRadioText() {
if (xPos < -tft.textWidth(radio.rds.stationText + " " + radio.rds.stationText32) + (charWidth * 16)) xPos = 0; if (xPos < -tft.textWidth(radio.rds.stationText + " " + radio.rds.stationText32) + (charWidth * 16)) xPos = 0;
sprite2.fillSprite(BackgroundColor); sprite2.fillSprite(BackgroundColor);
sprite2.loadFont(FONT16); sprite2.loadFont(FONT16);
sprite2.setTextColor(PrimaryColor, PrimaryColorSmooth, false); if (RDSstatus) sprite2.setTextColor(PrimaryColor, PrimaryColorSmooth, false); else sprite2.setTextColor(SecondaryColor, SecondaryColorSmooth, false);
sprite2.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2); sprite2.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
sprite2.pushSprite(35, 220); sprite2.pushSprite(35, 220);
} else { } else {
if (xPos < -tft.textWidth(radio.rds.stationText + " " + radio.rds.stationText32) + (charWidth * 26)) xPos = 0; if (xPos < -tft.textWidth(radio.rds.stationText + " " + radio.rds.stationText32) + (charWidth * 26)) xPos = 0;
sprite.fillSprite(BackgroundColor); sprite.fillSprite(BackgroundColor);
sprite.loadFont(FONT16); sprite.loadFont(FONT16);
sprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false); if (RDSstatus) sprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false); else sprite.setTextColor(SecondaryColor, SecondaryColorSmooth, false);
sprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2); sprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
sprite.pushSprite(38, 220); sprite.pushSprite(38, 220);
} }
rtticker = millis(); rtticker = millis();
cleanup = true;
} }
} }
} else if (cleanup == true) {
sprite.fillSprite(BackgroundColor);
sprite2.fillSprite(BackgroundColor);
if (advancedRDS) sprite2.pushSprite(35, 220); else sprite.pushSprite(38, 220);
cleanup = false;
} }
if (wifi) { if (wifi) {
@@ -3939,7 +3929,7 @@ void ShowAFEON() {
if (radio.rds.hasEON) { if (radio.rds.hasEON) {
if (haseonold == false) { if (haseonold == false) {
tftPrint(-1, myLanguage[language][88], 184, 54, BackgroundColor, BackgroundColor, FONT16); tftPrint(-1, myLanguage[language][88], 184, 48, BackgroundColor, BackgroundColor, FONT16);
tftPrint(-1, "PI:", 170, 32, ActiveColor, ActiveColorSmooth, FONT16); tftPrint(-1, "PI:", 170, 32, ActiveColor, ActiveColorSmooth, FONT16);
} }
haseonold = true; haseonold = true;
@@ -4164,7 +4154,7 @@ void BuildDisplay() {
} }
} }
if (showsquelch) tftPrint(-1, "SQ:", 212, 145, ActiveColor, ActiveColorSmooth, FONT16); if (showsquelch) tftPrint(-1, "SQ:", 212, 145, ActiveColor, ActiveColorSmooth, FONT16);
tftPrint(-1, "S/N", 246, 163, ActiveColor, ActiveColorSmooth, FONT16); tftPrint(1, "C/N", 275, 163, ActiveColor, ActiveColorSmooth, FONT16);
tftPrint(-1, "dB", 300, 163, ActiveColor, ActiveColorSmooth, FONT16); tftPrint(-1, "dB", 300, 163, ActiveColor, ActiveColorSmooth, FONT16);
if (region == 0) tftPrint(-1, "PI:", 216, 193, ActiveColor, ActiveColorSmooth, FONT16); if (region == 0) tftPrint(-1, "PI:", 216, 193, ActiveColor, ActiveColorSmooth, FONT16);
if (region == 1) tftPrint(-1, "ID:", 216, 193, ActiveColor, ActiveColorSmooth, FONT16); if (region == 1) tftPrint(-1, "ID:", 216, 193, ActiveColor, ActiveColorSmooth, FONT16);
@@ -4344,6 +4334,9 @@ void ShowFreq(int mode) {
eonstringold = ""; eonstringold = "";
afstringold = ""; afstringold = "";
rds_clockold = ""; rds_clockold = "";
sprite.fillSprite(BackgroundColor);
sprite2.fillSprite(BackgroundColor);
if (advancedRDS) sprite2.pushSprite(35, 220); else sprite.pushSprite(38, 220);
if (wifi) { if (wifi) {
Udp.beginPacket(remoteip, 9030); Udp.beginPacket(remoteip, 9030);
@@ -4361,12 +4354,12 @@ void ShowSignalLevel() {
snrupdatetimer = millis(); snrupdatetimer = millis();
if (!advancedRDS) { if (!advancedRDS) {
if (SNR > (SNRold + 1) || SNR < (SNRold - 1)) { if (SNR > (SNRold + 1) || SNR < (SNRold - 1)) {
if (SNRold == 0) tftPrint(1, "--", 294, 163, BackgroundColor, BackgroundColor, FONT16); else tftPrint(1, String(SNRold), 294, 163, BackgroundColor, BackgroundColor, FONT16); if (SNRold == 0) tftPrint(1, "--", 298, 163, BackgroundColor, BackgroundColor, FONT16); else tftPrint(1, String(SNRold), 298, 163, BackgroundColor, BackgroundColor, FONT16);
if (tuned == true) { if (tuned == true) {
if (SNR == 0) tftPrint(1, "--", 294, 163, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(1, String(SNR), 294, 163, PrimaryColor, PrimaryColorSmooth, FONT16); if (SNR == 0) tftPrint(1, "--", 298, 163, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(1, String(SNR), 298, 163, PrimaryColor, PrimaryColorSmooth, FONT16);
SNRold = SNR; SNRold = SNR;
} else { } else {
tftPrint(1, "--", 294, 163, PrimaryColor, PrimaryColorSmooth, FONT16); tftPrint(1, "--", 298, 163, PrimaryColor, PrimaryColorSmooth, FONT16);
SNRold = 0; SNRold = 0;
} }
} }
+6 -2
View File
@@ -402,9 +402,12 @@ void TEF6686::readRDS(bool showrdserrors)
if (rdsReady) { // We have all data to decode... let's go... if (rdsReady) { // We have all data to decode... let's go...
//PI decoder //PI decoder
if (rds.correct) rds.correctPI = rds.rdsA; if (rds.correct && afreset) {
rds.correctPI = rds.rdsA;
afreset = false;
}
if (rds.region != 1 && (!rds.rdsAerror || rds.pierrors)) { if (rds.region != 1 && (rds.correct || rds.pierrors)) {
if (rds.rdsA != piold) { if (rds.rdsA != piold) {
piold = rds.rdsA; piold = rds.rdsA;
rds.picode[0] = (rds.rdsA >> 12) & 0xF; rds.picode[0] = (rds.rdsA >> 12) & 0xF;
@@ -923,6 +926,7 @@ void TEF6686::clearRDS (bool fullsearchrds)
ps_counter = 0; ps_counter = 0;
af_counter = 0; af_counter = 0;
eon_counter = 0; eon_counter = 0;
afreset = true;
rds.MS = 0; rds.MS = 0;
} }
+1
View File
@@ -260,6 +260,7 @@ class TEF6686 {
char rt_buffer32[33]; char rt_buffer32[33];
bool useRTPlus = true; bool useRTPlus = true;
bool ABold; bool ABold;
bool afreset;
char stationTextBuffer[65]; char stationTextBuffer[65];
uint16_t rdsBprevious; uint16_t rdsBprevious;
uint16_t rdsCprevious; uint16_t rdsCprevious;
+47 -48
View File
@@ -162,8 +162,8 @@
#define EE_BYTE_SCREENSAVERSET 262 #define EE_BYTE_SCREENSAVERSET 262
#define EE_INT16_AMLEVELOFFSET 263 #define EE_INT16_AMLEVELOFFSET 263
#define EE_BYTE_UNIT 267 #define EE_BYTE_UNIT 267
#define EE_BYTE_AF 268 #define EE_BYTE_AF 268
#define EE_UINT16_FREQUENCY_OIRT 269 #define EE_UINT16_FREQUENCY_OIRT 269
// End of EEPROM index defines // End of EEPROM index defines
static const char* const unitString[] = {"dBμV", "dBf", "dBm"}; static const char* const unitString[] = {"dBμV", "dBf", "dBm"};
@@ -255,10 +255,10 @@ static const uint8_t WiFi1[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00,
0x00, 0x3c, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x18, 0x00, 0x00 0x00, 0x1c, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00
}; };
static const uint8_t WiFi2[] PROGMEM = { static const uint8_t WiFi2[] PROGMEM = {
@@ -276,17 +276,17 @@ static const uint8_t WiFi2[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x38, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00,
0x01, 0xff, 0x80, 0x00,
0x03, 0xff, 0x80, 0x00,
0x03, 0xe7, 0x80, 0x00,
0x01, 0x83, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x18, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x3c, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00,
0x00, 0x3c, 0x00, 0x00, 0x00, 0xff, 0x80, 0x00,
0x00, 0x18, 0x00, 0x00 0x00, 0x41, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00
}; };
static const uint8_t WiFi3[] PROGMEM = { static const uint8_t WiFi3[] PROGMEM = {
@@ -297,50 +297,49 @@ static const uint8_t WiFi3[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x7f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00,
0x01, 0x80, 0xc0, 0x00, 0x01, 0xff, 0xc0, 0x00,
0x02, 0x00, 0x20, 0x00, 0x03, 0xff, 0xe0, 0x00,
0x04, 0x7e, 0x10, 0x00, 0x07, 0x80, 0xf0, 0x00,
0x09, 0x80, 0x88, 0x00, 0x0e, 0x00, 0x38, 0x00,
0x03, 0x00, 0x48, 0x00, 0x04, 0x00, 0x10, 0x00,
0x0c, 0x00, 0x20, 0x00,
0x04, 0x3e, 0x10, 0x00,
0x00, 0xc1, 0x00, 0x00,
0x01, 0x00, 0xc0, 0x00,
0x01, 0x36, 0x40, 0x00,
0x01, 0x43, 0x80, 0x00,
0x00, 0x80, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00,
0x00, 0x10, 0x00, 0x00, 0x00, 0xff, 0x80, 0x00,
0x00, 0x41, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00 0x00, 0x08, 0x00, 0x00
}; };
static const uint8_t WiFi4[] PROGMEM = { static const uint8_t WiFi4[] PROGMEM = {
0x00, 0xff, 0x80, 0x00, 0x01, 0xff, 0xc0, 0x00,
0x03, 0xff, 0xe0, 0x00,
0x0f, 0xff, 0xf8, 0x00,
0x1f, 0xff, 0xfc, 0x00,
0x3f, 0xc1, 0xfe, 0x00,
0x7e, 0x00, 0x3f, 0x80,
0xfc, 0x00, 0x0f, 0x80,
0xf0, 0x7f, 0x07, 0x80,
0x61, 0xff, 0xc3, 0x80,
0x63, 0xff, 0xe1, 0x00,
0x07, 0xff, 0xf0, 0x00, 0x07, 0xff, 0xf0, 0x00,
0x0f, 0xc0, 0xf8, 0x00, 0x1f, 0xc1, 0xfc, 0x00,
0x0f, 0x00, 0x7c, 0x00, 0x3e, 0x00, 0x3e, 0x00,
0x78, 0x00, 0x0f, 0x00,
0x70, 0x00, 0x07, 0x00,
0x60, 0x00, 0x03, 0x00,
0x00, 0x7f, 0x00, 0x00,
0x01, 0xff, 0xc0, 0x00,
0x03, 0xff, 0xe0, 0x00,
0x07, 0x80, 0xf0, 0x00,
0x0e, 0x00, 0x38, 0x00, 0x0e, 0x00, 0x38, 0x00,
0x04, 0x3e, 0x08, 0x00, 0x04, 0x00, 0x10, 0x00,
0x00, 0x7f, 0x80, 0x00,
0x01, 0xff, 0xc0, 0x00,
0x01, 0xff, 0xc0, 0x00,
0x00, 0xe1, 0xc0, 0x00,
0x00, 0x80, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x1e, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00,
0x00, 0xff, 0x80, 0x00,
0x00, 0x41, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00 0x00, 0x08, 0x00, 0x00
}; };