Merge branch 'PE5PVB:main' into main

This commit is contained in:
Adam Wisher
2023-09-11 08:00:59 +01:00
committed by GitHub
8 changed files with 228 additions and 91 deletions

View File

@@ -76,6 +76,7 @@ bool menu;
bool menuopen;
bool nobattery;
bool power = true;
bool rdsflagreset;
bool rdsreset;
bool RDSSPYTCP;
bool RDSSPYUSB;
@@ -87,7 +88,7 @@ bool screenmute;
bool screensavertriggered = false;
bool seek;
bool setupmode;
bool showrdserrors;
byte showrdserrors;
bool showsquelch;
bool softmuteam;
bool softmutefm;
@@ -328,6 +329,7 @@ unsigned long rtplustickerhold;
unsigned long rtticker;
unsigned long rttickerhold;
unsigned long tuningtimer;
unsigned long udptimer;
TEF6686 radio;
TFT_eSprite sprite = TFT_eSprite(&tft);
@@ -677,7 +679,10 @@ void loop() {
if (digitalRead(BANDBUTTON) == LOW ) BANDBUTTONPress();
if (power || poweroptions == LCD_OFF) {
if (millis() >= tuningtimer + 200) Communication();
if (millis() >= tuningtimer + 200) {
rdsflagreset = false;
Communication();
}
if (!menu && !afscreen) {
if (af && dropout && millis() >= aftimer + 1000) {
@@ -777,7 +782,12 @@ void loop() {
if (millis() >= lowsignaltimer + 300) {
lowsignaltimer = millis();
if (band < BAND_GAP) radio.getStatus(SStatus, USN, WAM, OStatus, BW, MStatus, CN); else radio.getStatusAM(SStatus, USN, WAM, OStatus, BW, MStatus, CN);
if (!screenmute || (screenmute && (XDRGTKTCP || XDRGTKUSB))) {
if (band < BAND_GAP)
radio.getStatus(SStatus, USN, WAM, OStatus, BW, MStatus, CN);
else
radio.getStatusAM(SStatus, USN, WAM, OStatus, BW, MStatus, CN);
}
if (screenmute) readRds();
if (!menu) {
doSquelch();
@@ -786,7 +796,12 @@ void loop() {
}
} else {
if (band < BAND_GAP) radio.getStatus(SStatus, USN, WAM, OStatus, BW, MStatus, CN); else radio.getStatusAM(SStatus, USN, WAM, OStatus, BW, MStatus, CN);
if (!screenmute || (screenmute && (XDRGTKTCP || XDRGTKUSB))) {
if (band < BAND_GAP)
radio.getStatus(SStatus, USN, WAM, OStatus, BW, MStatus, CN);
else
radio.getStatusAM(SStatus, USN, WAM, OStatus, BW, MStatus, CN);
}
if (!menu) {
doSquelch();
if (millis() >= tuningtimer + 200) readRds();
@@ -2203,15 +2218,19 @@ void ShowFreq(int mode) {
if (wifi) {
Udp.beginPacket(remoteip, 9030);
if (band == BAND_FM) {
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RcvLevel=" + String(SStatus / 10) + ";bandwidth=-1;freq=" + String(frequency) + "0000");
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";freq=" + String(frequency) + "0000");
} else if (band == BAND_OIRT) {
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RcvLevel=" + String(SStatus / 10) + ";bandwidth=-1;freq=" + String(frequency_OIRT) + "0000");
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";freq=" + String(frequency_OIRT) + "0000");
} else {
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RcvLevel=" + String(SStatus / 10) + ";bandwidth=-1;freq=" + String(frequency_AM) + "000");
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";freq=" + String(frequency_AM) + "000");
}
Udp.endPacket();
}
tuningtimer = millis();
if (!rdsflagreset) {
ShowRDSLogo(false);
rdsflagreset = true;
}
}
void ShowSignalLevel() {
@@ -2274,7 +2293,8 @@ void ShowSignalLevel() {
SStatusold = SStatusprint;
}
}
if (wifi) {
if (wifi && millis() >= udptimer + 2000) {
udptimer = millis();
Udp.beginPacket(remoteip, 9030);
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RcvLevel=" + String(SStatus / 10));
Udp.endPacket();
@@ -3105,7 +3125,6 @@ void MuteScreen(bool setting) {
setupmode = true;
tft.writecommand(0x11);
analogWrite(CONTRASTPIN, ContrastSet * 2 + 27);
radio.clearRDS(fullsearchrds);
BuildDisplay();
setupmode = false;
} else if (setting && !screenmute) {
@@ -3136,7 +3155,7 @@ void DefaultSettings(byte userhardwaremodel) {
EEPROM.writeByte(EE_BYTE_SOFTMUTEFM, 0);
EEPROM.writeUInt(EE_UINT16_FREQUENCY_AM, 828);
if (userhardwaremodel == BASE_ILI9341) EEPROM.writeByte(EE_BYTE_LANGUAGE, 0); else EEPROM.writeByte(EE_BYTE_LANGUAGE, LANGUAGE_CHS);
EEPROM.writeByte(EE_BYTE_SHOWRDSERRORS, 0);
EEPROM.writeByte(EE_BYTE_SHOWRDSERRORS, 1);
EEPROM.writeByte(EE_BYTE_TEF, 0);
if (userhardwaremodel == BASE_ILI9341) EEPROM.writeByte(EE_BYTE_DISPLAYFLIP, 0); else EEPROM.writeByte(EE_BYTE_DISPLAYFLIP, 1);
EEPROM.writeByte(EE_BYTE_ROTARYMODE, 0);

View File

@@ -343,7 +343,7 @@ bool TEF6686::getStatusAM(int16_t &level, uint16_t &noise, uint16_t &cochannel,
return snr;
}
void TEF6686::readRDS(bool showrdserrors)
void TEF6686::readRDS(byte showrdserrors)
{
uint16_t rdsStat;
uint8_t offset;
@@ -376,17 +376,22 @@ void TEF6686::readRDS(bool showrdserrors)
rds.rdsCerror = (((rds.rdsErr >> 10) & 0x03) > 0);
rds.rdsDerror = (((rds.rdsErr >> 8) & 0x03) > 0);
rdsAerrorThreshold = (((rds.rdsErr >> 14) & 0x03) > showrdserrors);
rdsBerrorThreshold = (((rds.rdsErr >> 12) & 0x03) > showrdserrors);
rdsCerrorThreshold = (((rds.rdsErr >> 10) & 0x03) > showrdserrors);
rdsDerrorThreshold = (((rds.rdsErr >> 8) & 0x03) > showrdserrors);
if ((rdsStat & (1 << 15))) rdsReady = true;
if (rdsReady) { // We have all data to decode... let's go...
//PI decoder
if (!rds.rdsAerror && afreset) {
if (!rdsAerrorThreshold && afreset) {
rds.correctPI = rds.rdsA;
afreset = false;
}
if (rds.region != 1 && ((!rds.rdsAerror && !rds.rdsBerror && !rds.rdsCerror && !rds.rdsDerror) || (rds.pierrors && !errorfreepi))) {
if (rds.region != 1 && ((!rdsAerrorThreshold && !rdsBerrorThreshold && !rdsCerrorThreshold && !rdsDerrorThreshold) || (rds.pierrors && !errorfreepi))) {
if (rds.rdsA != piold) {
piold = rds.rdsA;
rds.picode[0] = (rds.rdsA >> 12) & 0xF;
@@ -402,7 +407,7 @@ void TEF6686::readRDS(bool showrdserrors)
}
}
if (!rds.rdsAerror && !rds.rdsBerror && !rds.rdsCerror && !rds.rdsDerror) errorfreepi = true;
if (!rdsAerrorThreshold && !rdsBerrorThreshold && !rdsCerrorThreshold && !rdsDerrorThreshold) errorfreepi = true;
if (!errorfreepi) {
if (((rds.rdsErr >> 14) & 0x03) > 2) rds.picode[5] = '?'; else rds.picode[5] = ' ';
@@ -470,13 +475,13 @@ void TEF6686::readRDS(bool showrdserrors)
// TP Indicator
rds.hasTP = (bitRead(rds.rdsB, 10));
if (!rds.rdsBerror) rdsblock = rds.rdsB >> 11; else return;
if (!rdsBerrorThreshold) rdsblock = rds.rdsB >> 11; else return;
switch (rdsblock) {
case RDS_GROUP_0A:
case RDS_GROUP_0B:
{
//PS decoder
if (showrdserrors || (!rds.rdsBerror && !rds.rdsDerror)) {
if (showrdserrors == 3 || (!rdsBerrorThreshold && !rdsDerrorThreshold)) {
offset = rds.rdsB & 0x03; // Let's get the character offset for PS
ps_buffer2[(offset * 2) + 0] = ps_buffer[(offset * 2) + 0]; // Make a copy of the PS buffer
@@ -509,7 +514,7 @@ void TEF6686::readRDS(bool showrdserrors)
}
// PTY decoder
if (!rds.rdsBerror) {
if (!rdsBerrorThreshold) {
rds.stationTypeCode = (rds.rdsB >> 5) & 0x1F; // Get 5 PTY bits from Block B
if (rds.region == 0) strcpy(rds.stationType, PTY_EU[rds.stationTypeCode]);
if (rds.region == 1) strcpy(rds.stationType, PTY_USA[rds.stationTypeCode]);
@@ -519,11 +524,17 @@ void TEF6686::readRDS(bool showrdserrors)
//MS decoder
if (((bitRead(rds.rdsB, 3)) & 0x1F) == 1) rds.MS = 1; else rds.MS = 2; // Read MS flag
}
if (!rds.rdsCerror) {
}
if (!rdsCerrorThreshold) {
//AF decoder
if (rdsblock == 0) { // Only when in GROUP 0A
if ((rds.rdsC >> 8) > 224 && (rds.rdsC >> 8) < 250) {
if (afmethodcounter > 2) afmethodB = true;
afmethodcounter = 0;
}
if (((rds.rdsC >> 8) > 0 && (rds.rdsC >> 8) > 224) && ((rds.rdsC >> 8) > 0 && (rds.rdsC >> 8) < 250)) afinit = true;
if (afinit) {
if ((rds.rdsB >> 11) == 0 && af_counter < 50) {
@@ -533,6 +544,7 @@ void TEF6686::readRDS(bool showrdserrors)
if ((rds.rdsC >> 8) > 0 && (rds.rdsC >> 8) < 205) buffer0 = (rds.rdsC >> 8) * 10 + 8750; else buffer0 = 0;
if ((rds.rdsC & 0xFF) > 0 && (rds.rdsC & 0xFF) < 205) buffer1 = (rds.rdsC & 0xFF) * 10 + 8750; else buffer1 = 0;
if (buffer0 != 0 || buffer1 != 0) rds.hasAF = true;
if (buffer0 == currentfreq || buffer1 == currentfreq) afmethodcounter++;
bool isValuePresent = false;
for (int i = 0; i < 50; i++) {
@@ -591,19 +603,19 @@ void TEF6686::readRDS(bool showrdserrors)
} break;
case RDS_GROUP_1A: {
if (!rds.rdsCerror) {
if (!rdsCerrorThreshold) {
if (rds.rdsC >> 12 == 0) { // ECC code readout
rds.ECC = rds.rdsC & 0xff;
rds.hasECC = true;
}
if (rds.rdsC >> 12 == 3) { // ECC code readout
if (rds.rdsC >> 12 == 3) { // LIC code readout
rds.LIC = rds.rdsC & 0xff;
rds.hasLIC = true;
}
}
if (!rds.rdsDerror) {
}
if (!rdsDerrorThreshold) {
if (rds.rdsD != 0) { // PIN decoder
rds.hasPIN = true;
rds.pinMin = rds.rdsD & 0x3f;
@@ -614,7 +626,7 @@ void TEF6686::readRDS(bool showrdserrors)
} break;
case RDS_GROUP_2A: {
if (showrdserrors || (!rds.rdsBerror && !rds.rdsCerror && !rds.rdsDerror)) {
if (showrdserrors == 3 || (!rdsBerrorThreshold && !rdsCerrorThreshold && !rdsDerrorThreshold)) {
// RT decoder (64 characters)
rds.hasRT = true;
rds.rtAB = (bitRead(rds.rdsB, 4)); // Get AB flag
@@ -658,7 +670,7 @@ void TEF6686::readRDS(bool showrdserrors)
} break;
case RDS_GROUP_2B: {
if (showrdserrors || (!rds.rdsBerror && !rds.rdsDerror)) {
if (showrdserrors == 3 || (!rdsBerrorThreshold && !rdsDerrorThreshold)) {
// RT decoder (32 characters)
rds.hasRT = true;
rds.rtAB32 = (bitRead(rds.rdsB, 4)); // Get AB flag
@@ -683,17 +695,17 @@ void TEF6686::readRDS(bool showrdserrors)
} break;
case RDS_GROUP_3A: {
if (!rds.rdsDerror) {
// RT+ init
if (rds.rdsD == 0x4BD7) { // Check for RT+ application
rds.hasRDSplus = true; // Set flag
rtplusblock = ((rds.rdsB & 0x1F) >> 1) * 2; // Get RT+ Block
if (!rdsDerrorThreshold) {
// RT+ init
if (rds.rdsD == 0x4BD7) { // Check for RT+ application
rds.hasRDSplus = true; // Set flag
rtplusblock = ((rds.rdsB & 0x1F) >> 1) * 2; // Get RT+ Block
}
}
}
} break;
case RDS_GROUP_4A: {
if (!rds.rdsBerror && !rds.rdsCerror && !rds.rdsDerror) {
if (!rdsBerrorThreshold && !rdsCerrorThreshold && !rdsDerrorThreshold) {
// CT
uint32_t mjd;
mjd = (rds.rdsB & 0x03);
@@ -725,7 +737,7 @@ void TEF6686::readRDS(bool showrdserrors)
} break;
case RDS_GROUP_10A: {
if (!rds.rdsCerror && !rds.rdsDerror) {
if (!rdsCerrorThreshold && !rdsDerrorThreshold) {
// PTYN
offset = bitRead(rds.rdsB, 0); // Get char offset
@@ -748,7 +760,7 @@ void TEF6686::readRDS(bool showrdserrors)
case RDS_GROUP_12A:
case RDS_GROUP_13A: {
// RT+ decoding
if ((!rds.rdsBerror && !rds.rdsCerror && !rds.rdsDerror) && rtplusblock == rdsblock && rds.hasRDSplus) { // Are we in the right RT+ block and is all ok to go?
if ((!rdsBerrorThreshold && !rdsCerrorThreshold && !rdsDerrorThreshold) && rtplusblock == rdsblock && rds.hasRDSplus) { // Are we in the right RT+ block and is all ok to go?
rds.rdsplusTag1 = ((rds.rdsB & 0x07) << 3) + (rds.rdsC >> 13);
rds.rdsplusTag2 = ((rds.rdsC & 0x01) << 5) + (rds.rdsD >> 11);
uint16_t start_marker_1 = (rds.rdsC >> 7) & 0x3F;
@@ -797,13 +809,13 @@ void TEF6686::readRDS(bool showrdserrors)
rds.RTContent2 = convertToUTF8(RTtext2); // Convert RDS characterset to ASCII
rds.RTContent2 = extractUTF8Substring(rds.RTContent2, 0, 44, false); // Make sure RT does not exceed 32 characters
}
if (!rds.rdsBerror && rdsblock == 16 && (rds.rdsB & (1 << 4))) rds.hasTMC = true; // TMC flag
if (!rdsBerrorThreshold && rdsblock == 16 && (rds.rdsB & (1 << 4))) rds.hasTMC = true; // TMC flag
}
break;
case RDS_GROUP_14A: {
// EON
if (!rds.rdsDerror) {
if (!rdsDerrorThreshold) {
rds.hasEON = true; // Group is there, so we have EON
bool isValuePresent = false;
@@ -975,6 +987,8 @@ void TEF6686::clearRDS (bool fullsearchrds)
rds.rdsplusTag2 = 169;
afinit = false;
errorfreepi = false;
afmethodB = false;
afmethodcounter = 0;
}
void TEF6686::tone(uint16_t time, int16_t amplitude, uint16_t frequency) {

View File

@@ -49,7 +49,7 @@ enum RADIO_BATTERY_SELECTION {
};
enum RADIO_FM_DEEMPHASIS {
DEEMPHASIS_NONE = 0, DEEMPHASIS_50, DEEMPHASIS_75,
DEEMPHASIS_NONE = 0, DEEMPHASIS_50, DEEMPHASIS_75,
DEEMPHASIS_COUNT
};
@@ -209,7 +209,7 @@ class TEF6686 {
logbook_ logbook[22];
uint16_t TestAF();
void TestAFEON();
void readRDS(bool showrdserrors);
void readRDS(byte showrdserrors);
void SetFreq(uint16_t frequency);
void SetFreqAM(uint16_t frequency);
bool getProcessing(uint16_t &highcut, uint16_t &stereo, uint16_t &sthiblend, uint8_t &stband_1, uint8_t &stband_2, uint8_t &stband_3, uint8_t &stband_4);
@@ -256,6 +256,7 @@ class TEF6686 {
uint8_t rdsblock;
uint8_t rtplusblock;
bool mute;
bool afmethodB;
private:
void RDScharConverter(const char* input, wchar_t* output, size_t size, bool under);
@@ -293,6 +294,11 @@ class TEF6686 {
bool initab;
bool afinit;
bool errorfreepi;
bool rdsAerrorThreshold;
bool rdsBerrorThreshold;
bool rdsCerrorThreshold;
bool rdsDerrorThreshold;
byte afmethodcounter;
};
#endif

View File

@@ -458,7 +458,13 @@ void BuildMenu() {
tftPrint(-1, myLanguage[language][176], 8, ITEM7 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][196], 8, ITEM8 + 6, ActiveColor, ActiveColorSmooth, 16);
if (showrdserrors) tftPrint(1, myLanguage[language][42], 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16);
switch (showrdserrors) {
case 0: tftPrint(1, myLanguage[language][30], 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); break;
case 1: tftPrint(1, myLanguage[language][200], 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); break;
case 2: tftPrint(1, myLanguage[language][201], 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); break;
case 3: tftPrint(1, myLanguage[language][202], 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); break;
}
if (region == REGION_EU) tftPrint(1, myLanguage[language][47], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (region == REGION_US) tftPrint(1, myLanguage[language][48], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (radio.rds.underscore) tftPrint(1, myLanguage[language][42], 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16);
@@ -1016,9 +1022,21 @@ void MenuUp() {
case RDSSETTINGS:
switch (menuoption) {
case ITEM1:
if (showrdserrors) tftPrint(0, myLanguage[language][42], 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28);
if (showrdserrors) showrdserrors = false; else showrdserrors = true;
if (showrdserrors) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
switch (showrdserrors) {
case 0: tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28); break;
case 1: tftPrint(0, myLanguage[language][200], 155, 118, BackgroundColor, BackgroundColor, 28); break;
case 2: tftPrint(0, myLanguage[language][201], 155, 118, BackgroundColor, BackgroundColor, 28); break;
case 3: tftPrint(0, myLanguage[language][202], 155, 118, BackgroundColor, BackgroundColor, 28); break;
}
showrdserrors++;
if (showrdserrors > 3) showrdserrors = 0;
switch (showrdserrors) {
case 0: tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break;
case 1: tftPrint(0, myLanguage[language][200], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break;
case 2: tftPrint(0, myLanguage[language][201], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break;
case 3: tftPrint(0, myLanguage[language][202], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break;
}
break;
case ITEM2:
@@ -1028,8 +1046,14 @@ void MenuUp() {
if (region == REGION_EU) tftPrint(0, myLanguage[language][47], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
if (region == REGION_US) tftPrint(0, myLanguage[language][48], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
regionold = region;
if (region == REGION_EU) { fmdeemphasis = DEEMPHASIS_50; radio.setDeemphasis(fmdeemphasis); }
if (region == REGION_US) { fmdeemphasis = DEEMPHASIS_75; radio.setDeemphasis(fmdeemphasis); }
if (region == REGION_EU) {
fmdeemphasis = DEEMPHASIS_50;
radio.setDeemphasis(fmdeemphasis);
}
if (region == REGION_US) {
fmdeemphasis = DEEMPHASIS_75;
radio.setDeemphasis(fmdeemphasis);
}
radio.rds.region = region;
break;
@@ -1510,9 +1534,21 @@ void MenuDown() {
case RDSSETTINGS:
switch (menuoption) {
case ITEM1:
if (showrdserrors) tftPrint(0, myLanguage[language][42], 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28);
if (showrdserrors) showrdserrors = false; else showrdserrors = true;
if (showrdserrors) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
switch (showrdserrors) {
case 0: tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28); break;
case 1: tftPrint(0, myLanguage[language][200], 155, 118, BackgroundColor, BackgroundColor, 28); break;
case 2: tftPrint(0, myLanguage[language][201], 155, 118, BackgroundColor, BackgroundColor, 28); break;
case 3: tftPrint(0, myLanguage[language][202], 155, 118, BackgroundColor, BackgroundColor, 28); break;
}
showrdserrors--;
if (showrdserrors > 3) showrdserrors = 3;
switch (showrdserrors) {
case 0: tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break;
case 1: tftPrint(0, myLanguage[language][200], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break;
case 2: tftPrint(0, myLanguage[language][201], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break;
case 3: tftPrint(0, myLanguage[language][202], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break;
}
break;
case ITEM2:
@@ -1522,8 +1558,14 @@ void MenuDown() {
if (region == REGION_EU) tftPrint(0, myLanguage[language][47], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
if (region == REGION_US) tftPrint(0, myLanguage[language][48], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
regionold = region;
if (region == REGION_EU) { fmdeemphasis = DEEMPHASIS_50; radio.setDeemphasis(fmdeemphasis); }
if (region == REGION_US) { fmdeemphasis = DEEMPHASIS_75; radio.setDeemphasis(fmdeemphasis); }
if (region == REGION_EU) {
fmdeemphasis = DEEMPHASIS_50;
radio.setDeemphasis(fmdeemphasis);
}
if (region == REGION_US) {
fmdeemphasis = DEEMPHASIS_75;
radio.setDeemphasis(fmdeemphasis);
}
radio.rds.region = region;
break;
@@ -2002,7 +2044,13 @@ void DoMenu() {
switch (menuoption) {
case ITEM1:
tftPrint(0, myLanguage[language][38], 155, 78, ActiveColor, ActiveColorSmooth, 28);
if (showrdserrors) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
switch (showrdserrors) {
case 0: tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break;
case 1: tftPrint(0, myLanguage[language][200], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break;
case 2: tftPrint(0, myLanguage[language][201], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break;
case 3: tftPrint(0, myLanguage[language][202], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break;
}
break;
case ITEM2:

View File

@@ -50,7 +50,7 @@ extern bool rdsreset;
extern bool RDSstatus;
extern bool RDSstatusold;
extern bool rdsstereoold;
extern bool showrdserrors;
extern byte showrdserrors;
extern bool showsquelch;
extern bool softmuteam;
extern bool softmutefm;

View File

@@ -1,6 +1,6 @@
// [number of languages][number of texts]
static const char* const myLanguage[16][200] = {
static const char* const myLanguage[16][203] = {
{ "English", // English
"Rotary direction changed", // 1
"Please release button", // 2
@@ -200,7 +200,10 @@ static const char* const myLanguage[16][200] = {
"Auto sort AF", // 196
"Stationlist ID", // 197
"AM ATT", // 198
"FM deemphasis" // 199
"FM deemphasis", // 199
"Small", // 200
"Large", // 201
"All" // 202
},
{ "Nederlands", // Dutch
@@ -402,7 +405,10 @@ static const char* const myLanguage[16][200] = {
"Auto AF sorteren", // 196
"Stationlist ID", // 197
"AM ATT", // 198
"FM deemphasis" // 199
"FM deemphasis", // 199
"Laag", // 200
"Middel", // 201
"Alles" // 202
},
{ "Polski", // Polish
@@ -604,7 +610,10 @@ static const char* const myLanguage[16][200] = {
"Automat. sortowanie AF", // 196
"Stationlist ID", // 197
"AM ATT", // 198
"FM deemphasis" // 199
"FM deemphasis", // 199
"Small", // 200
"Large", // 201
"All" // 202
},
{ "Hrvatski", // Croatian
@@ -806,7 +815,10 @@ static const char* const myLanguage[16][200] = {
"Auto sort AF", // 196
"Stationlist ID", // 197
"AM ATT", // 198
"FM deemphasis" // 199
"FM deemphasis", // 199
"Small", // 200
"Large", // 201
"All" // 202
},
{ "Ελληνικά", // Greek
@@ -1008,7 +1020,10 @@ static const char* const myLanguage[16][200] = {
"Αυτόματη ταξινόμηση AF", // 196
"ID λίστας σταθμών", // 197
"AM εξασθένιση", // 198
"FM αποέμφαση" // 199
"FM αποέμφαση", // 199
"Small", // 200
"Large", // 201
"All" // 202
},
{ "Romana", // Romanian
@@ -1210,7 +1225,10 @@ static const char* const myLanguage[16][200] = {
"Auto sort AF", // 196
"Stationlist ID", // 197
"AM ATT", // 198
"FM deemphasis" // 199
"FM deemphasis", // 199
"Small", // 200
"Large", // 201
"All" // 202
},
{ "Deutsch", // German
@@ -1412,7 +1430,10 @@ static const char* const myLanguage[16][200] = {
"Auto sort AF", // 196
"Stationlist ID", // 197
"AM ATT", // 198
"FM deemphasis" // 199
"FM deemphasis", // 199
"Small", // 200
"Large", // 201
"All" // 202
},
{ "Czech", // Czech
@@ -1614,7 +1635,10 @@ static const char* const myLanguage[16][200] = {
"Auto sort AF", // 196
"Stationlist ID", // 197
"AM ATT", // 198
"FM deemphasis" // 199
"FM deemphasis", // 199
"Small", // 200
"Large", // 201
"All" // 202
},
{ "Slovak", // Slovak
@@ -1816,7 +1840,10 @@ static const char* const myLanguage[16][200] = {
"Auto sort AF", // 196
"Stationlist ID", // 197
"AM ATT", // 198
"FM deemphasis" // 199
"FM deemphasis", // 199
"Small", // 200
"Large", // 201
"All" // 202
},
{ "Français", // French
@@ -2018,7 +2045,10 @@ static const char* const myLanguage[16][200] = {
"Auto sort AF", // 196
"Stationlist ID", // 197
"AM ATT", // 198
"FM deemphasis" // 199
"FM deemphasis", // 199
"Small", // 200
"Large", // 201
"All" // 202
},
{ "Български", // Bulgarian
@@ -2220,7 +2250,10 @@ static const char* const myLanguage[16][200] = {
"Auto sort AF", // 196
"Stationlist ID", // 197
"AM ATT", // 198
"FM deemphasis" // 199
"FM deemphasis", // 199
"Small", // 200
"Large", // 201
"All" // 202
},
{ "Русский", // Russian
@@ -2422,7 +2455,10 @@ static const char* const myLanguage[16][200] = {
"Auto sort AF", // 196
"Stationlist ID", // 197
"AM ATT", // 198
"FM deemphasis" // 199
"FM deemphasis", // 199
"Small", // 200
"Large", // 201
"All" // 202
},
{ "Українська", // Ukranian
@@ -2624,7 +2660,10 @@ static const char* const myLanguage[16][200] = {
"Auto sort AF", // 196
"Stationlist ID", // 197
"AM ATT", // 198
"FM deemphasis" // 199
"FM deemphasis", // 199
"Small", // 200
"Large", // 201
"All" // 202
},
{ "Italiano", // Italian
@@ -2826,7 +2865,10 @@ static const char* const myLanguage[16][200] = {
"Auto sort AF", // 196
"Stationlist ID", // 197
"AM ATT", // 198
"FM deemphasis" // 199
"FM deemphasis", // 199
"Small", // 200
"Large", // 201
"All" // 202
},
{ "Simplified Chinese", // Simplified Chinese
@@ -3028,7 +3070,10 @@ static const char* const myLanguage[16][200] = {
"自动排列AF", // 196
"Stationlist ID", // 197
"AM天线衰减", // 198
"FM去加重" // 199
"FM去加重", // 199
"Small", // 200
"Large", // 201
"All" // 202
},
{ "Norsk", // Norwegian
@@ -3230,7 +3275,10 @@ static const char* const myLanguage[16][200] = {
"Auto sort AF", // 196
"Stationlist ID", // 197
"AM ATT", // 198
"FM deemphasis" // 199
"FM deemphasis", // 199
"Small", // 200
"Large", // 201
"All" // 202
}
};

View File

@@ -44,7 +44,7 @@ void ShowAdvancedRDS() {
rdsstereoold = radio.rds.hasStereo;
}
if (ptynold != radio.rds.PTYN) {
if (ptynold != radio.rds.PTYN || rdsreset) {
if (!screenmute) tftPrint(-1, "PTYN N/A", 216, 109, BackgroundColor, BackgroundColor, 16);
if (!screenmute) tftPrint(-1, ptynold, 216, 109, BackgroundColor, BackgroundColor, 16);
if (radio.rds.PTYN.length() == 0) radio.rds.PTYN = "PTYN N/A";
@@ -52,7 +52,7 @@ void ShowAdvancedRDS() {
ptynold = radio.rds.PTYN;
}
if (licold != radio.rds.LIC) {
if (licold != radio.rds.LIC || rdsreset) {
if (!screenmute) tftPrint(-1, "N/A", 242, 208, BackgroundColor, BackgroundColor, 16);
if (!screenmute) tftPrint(-1, LIColdString, 242, 208, BackgroundColor, BackgroundColor, 16);
@@ -287,11 +287,11 @@ void doAF() {
Udp.print(String((radio.af[af_scan].frequency - 8750) / 10, HEX));
}
}
af_counterold = radio.af_counter;
for (int i = 0; i < 25 - radio.af_counter; i++) Udp.print("00");
Udp.endPacket();
}
af_counterold = radio.af_counter;
}
}
@@ -587,7 +587,7 @@ void readRds() {
if (!screenmute) {
if (!afscreen) {
if (!RDSstatus) {
if (advancedRDS) tftPrint(-1, PIold, 244, 75, SecondaryColor, SecondaryColorSmooth, 28); else tftPrint(-1, PIold, 244, 187, SecondaryColor, SecondaryColorSmooth, 28);
if (advancedRDS) tftPrint(-1, PIold, 240, 75, SecondaryColor, SecondaryColorSmooth, 28); else tftPrint(-1, PIold, 240, 187, SecondaryColor, SecondaryColorSmooth, 28);
if (advancedRDS) tftPrint(-1, PSold, 38, 75, SecondaryColor, SecondaryColorSmooth, 28); else tftPrint(-1, PSold, 38, 187, SecondaryColor, SecondaryColorSmooth, 28);
if (advancedRDS) tftPrint(-1, PTYold, 38, 109, SecondaryColor, SecondaryColorSmooth, 16); else tftPrint(-1, PTYold, 38, 163, SecondaryColor, SecondaryColorSmooth, 16);
if (advancedRDS) {
@@ -599,7 +599,7 @@ void readRds() {
if (radio.rds.correctPI != 0) dropout = true;
} else {
if (dropout == true) {
if (advancedRDS) tftPrint(-1, PIold, 244, 75, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(-1, PIold, 244, 187, PrimaryColor, PrimaryColorSmooth, 28);
if (advancedRDS) tftPrint(-1, PIold, 240, 75, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(-1, PIold, 240, 187, PrimaryColor, PrimaryColorSmooth, 28);
if (advancedRDS) tftPrint(-1, PSold, 38, 75, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(-1, PSold, 38, 187, PrimaryColor, PrimaryColorSmooth, 28);
if (advancedRDS) tftPrint(-1, PTYold, 38, 109, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(-1, PTYold, 38, 163, PrimaryColor, PrimaryColorSmooth, 16);
dropout = false;
@@ -664,11 +664,11 @@ void showPI() {
if (strcmp(radio.rds.picode, radioIdPrevious)) {
if (!screenmute) {
if (advancedRDS) {
tftReplace(-1, PIold, radio.rds.picode, 244, 75, PrimaryColor, PrimaryColorSmooth, 28);
tftReplace(-1, PIold, radio.rds.picode, 240, 75, PrimaryColor, PrimaryColorSmooth, 28);
} else if (afscreen) {
tftReplace(-1, PIold, radio.rds.picode, 30, 201, BWAutoColor, BWAutoColorSmooth, 16);
} else {
tftReplace(-1, PIold, radio.rds.picode, 244, 187, PrimaryColor, PrimaryColorSmooth, 28);
tftReplace(-1, PIold, radio.rds.picode, 240, 187, PrimaryColor, PrimaryColorSmooth, 28);
}
}
PIold = radio.rds.picode;
@@ -772,17 +772,19 @@ void showRadioText() {
}
if (wifi) {
Udp.beginPacket(remoteip, 9030);
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RT1=");
char RThex[65];
radio.rds.stationText.toCharArray(RThex, 65);
for (int i = 0; i < 64; i++)
{
if (RThex[i] < 0x10) Udp.print("0");
if (RThex[i] == ' ') RThex[i] = '_';
Udp.print(String(RThex[i], HEX));
if (RTold != (radio.rds.stationText + " " + radio.rds.stationText32)) {
Udp.beginPacket(remoteip, 9030);
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RT1=");
char RThex[65];
radio.rds.stationText.toCharArray(RThex, 65);
for (int i = 0; i < 64; i++)
{
if (RThex[i] < 0x10) Udp.print("0");
if (RThex[i] == ' ') RThex[i] = '_';
Udp.print(String(RThex[i], HEX));
}
Udp.endPacket();
}
Udp.endPacket();
}
RTold = radio.rds.stationText + " " + radio.rds.stationText32;
}
@@ -809,11 +811,11 @@ void ShowAFEON() {
for (byte i = 0; i < radio.af_counter; i++) {
byte x = i - (afpagenr == 2 ? 30 : 0);
if (radio.af[i].checked) {
if (!screenmute) tftPrint(1, (radio.af[i].regional ? "R " : "") + String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10), 50 + (x > 9 ? 54 : 0) + (x > 19 ? 54 : 0), 48 + (15 * x) - (x > 9 ? 150 : 0) - (x > 19 ? 150 : 0), InsignificantColor, InsignificantColorSmooth, 16);
if (!screenmute) tftPrint(1, (radio.af[i].regional && radio.afmethodB ? "R " : "") + String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10), 50 + (x > 9 ? 54 : 0) + (x > 19 ? 54 : 0), 48 + (15 * x) - (x > 9 ? 150 : 0) - (x > 19 ? 150 : 0), InsignificantColor, InsignificantColorSmooth, 16);
} else if (!radio.af[i].afvalid) {
if (!screenmute) tftPrint(1, (radio.af[i].regional ? "R " : "") + String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10), 50 + (x > 9 ? 54 : 0) + (x > 19 ? 54 : 0), 48 + (15 * x) - (x > 9 ? 150 : 0) - (x > 19 ? 150 : 0), SignificantColor, SignificantColorSmooth, 16);
if (!screenmute) tftPrint(1, (radio.af[i].regional && radio.afmethodB ? "R " : "") + String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10), 50 + (x > 9 ? 54 : 0) + (x > 19 ? 54 : 0), 48 + (15 * x) - (x > 9 ? 150 : 0) - (x > 19 ? 150 : 0), SignificantColor, SignificantColorSmooth, 16);
} else {
if (!screenmute) tftPrint(1, (radio.af[i].regional ? "R " : "") + String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10), 50 + (x > 9 ? 54 : 0) + (x > 19 ? 54 : 0), 48 + (15 * x) - (x > 9 ? 150 : 0) - (x > 19 ? 150 : 0), PrimaryColor, PrimaryColorSmooth, 16);
if (!screenmute) tftPrint(1, (radio.af[i].regional && radio.afmethodB ? "R " : "") + String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10), 50 + (x > 9 ? 54 : 0) + (x > 19 ? 54 : 0), 48 + (15 * x) - (x > 9 ? 150 : 0) - (x > 19 ? 150 : 0), PrimaryColor, PrimaryColorSmooth, 16);
}
if (i == 29 + (afpagenr == 2 ? 30 : 0)) i = 254;
}

View File

@@ -30,7 +30,7 @@ extern bool RDSstatus;
extern bool rdsstereoold;
extern bool screenmute;
extern bool setupmode;
extern bool showrdserrors;
extern byte showrdserrors;
extern bool TAold;
extern bool TPold;
extern bool wifi;