Several updates

- New font for frequency
- Added auto AF sort on/off
- Mask regional AF frequencies
- Some changes that make tuning a bit faster
- Small bugfixes
- Code cleanup
This commit is contained in:
Sjef Verhoeven PE5PVB
2023-08-13 20:52:11 +02:00
parent 383a6c1b6b
commit ab94e952dd
9 changed files with 1947 additions and 434 deletions
+176 -343
View File
File diff suppressed because it is too large Load Diff
+1625
View File
File diff suppressed because it is too large Load Diff
+20 -6
View File
@@ -373,10 +373,11 @@ void TEF6686::readRDS(bool showrdserrors)
if (rds.rdsB != rdsBprevious) { if (rds.rdsB != rdsBprevious) {
rds.correct = false; rds.correct = false;
rds.rdsAerror = (((rds.rdsErr >> 14) & 0x02) == 0x02); rds.rdsAerror = ((((rds.rdsErr >> 14) & 0x03) == 0x02) || (((rds.rdsErr >> 14) & 0x03) == 0x03));
rds.rdsBerror = (((rds.rdsErr >> 12) & 0x02) == 0x02); rds.rdsBerror = ((((rds.rdsErr >> 12) & 0x03) == 0x02) || (((rds.rdsErr >> 12) & 0x03) == 0x03));
rds.rdsCerror = (((rds.rdsErr >> 10) & 0x02) == 0x02); rds.rdsCerror = ((((rds.rdsErr >> 10) & 0x03) == 0x02) || (((rds.rdsErr >> 10) & 0x03) == 0x03));
rds.rdsDerror = (((rds.rdsErr >> 8) & 0x02) == 0x02); rds.rdsDerror = ((((rds.rdsErr >> 8) & 0x03) == 0x02) || (((rds.rdsErr >> 8) & 0x03) == 0x03));
if (!rds.rdsAerror && !rds.rdsBerror && !rds.rdsCerror && !rds.rdsDerror) rds.correct = true; // Any errors in all blocks? if (!rds.rdsAerror && !rds.rdsBerror && !rds.rdsCerror && !rds.rdsDerror) rds.correct = true; // Any errors in all blocks?
if ((rdsStat & (1 << 15))) rdsReady = true; if ((rdsStat & (1 << 15))) rdsReady = true;
@@ -477,7 +478,7 @@ void TEF6686::readRDS(bool showrdserrors)
ps_buffer[(offset * 2) + 1] = rds.rdsD & 0xFF; // Second character of segment ps_buffer[(offset * 2) + 1] = rds.rdsD & 0xFF; // Second character of segment
ps_buffer[(offset * 2) + 2] = '\0'; // Endmarker of segment ps_buffer[(offset * 2) + 2] = '\0'; // Endmarker of segment
if (offset == 3 && ps_process == true) { // Last chars are received if (offset == 3 && ps_process) { // Last chars are received
if (ps_buffer != ps_buffer2) { // When difference between old and new, let's go... if (ps_buffer != ps_buffer2) { // When difference between old and new, let's go...
RDScharConverter(ps_buffer, PStext, sizeof(PStext) / sizeof(wchar_t), true); // Convert 8 bit ASCII to 16 bit ASCII RDScharConverter(ps_buffer, PStext, sizeof(PStext) / sizeof(wchar_t), true); // Convert 8 bit ASCII to 16 bit ASCII
String utf8String = convertToUTF8(PStext); // Convert RDS characterset to ASCII String utf8String = convertToUTF8(PStext); // Convert RDS characterset to ASCII
@@ -485,7 +486,7 @@ void TEF6686::readRDS(bool showrdserrors)
} }
} }
if (ps_process == false) { // Let's get 2 runs of 8 PS characters fast and without refresh if (!ps_process) { // Let's get 2 runs of 8 PS characters fast and without refresh
ps_counter ++; // Let's count each run ps_counter ++; // Let's count each run
RDScharConverter(ps_buffer, PStext, sizeof(PStext) / sizeof(wchar_t), true); // Convert 8 bit ASCII to 16 bit ASCII RDScharConverter(ps_buffer, PStext, sizeof(PStext) / sizeof(wchar_t), true); // Convert 8 bit ASCII to 16 bit ASCII
String utf8String = convertToUTF8(PStext); // Convert RDS characterset to ASCII String utf8String = convertToUTF8(PStext); // Convert RDS characterset to ASCII
@@ -515,6 +516,8 @@ void TEF6686::readRDS(bool showrdserrors)
//AF decoder //AF decoder
if (rdsblock == 0) { // Only when in GROUP 0A if (rdsblock == 0) { // Only when in GROUP 0A
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) { if ((rds.rdsB >> 11) == 0 && af_counter < 50) {
uint16_t buffer0; uint16_t buffer0;
uint16_t buffer1; uint16_t buffer1;
@@ -544,11 +547,15 @@ void TEF6686::readRDS(bool showrdserrors)
} }
} }
if (buffer0 == currentfreq && buffer0 < buffer1) af[af_counter].regional = true;
if (buffer1 == currentfreq && buffer0 > buffer1) af[af_counter].regional = true;
if (!isValuePresent) { if (!isValuePresent) {
af[af_counter].frequency = buffer1; af[af_counter].frequency = buffer1;
if (af_counter < 50) af_counter++; if (af_counter < 50) af_counter++;
} }
if (rds.sortaf) {
for (int i = 0; i < 50; i++) { for (int i = 0; i < 50; i++) {
for (int j = 0; j < 50 - i; j++) { for (int j = 0; j < 50 - i; j++) {
if (af[j].frequency == 0) continue; if (af[j].frequency == 0) continue;
@@ -557,12 +564,17 @@ void TEF6686::readRDS(bool showrdserrors)
uint16_t temp = af[j].frequency; uint16_t temp = af[j].frequency;
bool temp3 = af[j].afvalid; bool temp3 = af[j].afvalid;
bool temp4 = af[j].checked; bool temp4 = af[j].checked;
bool temp5 = af[j].regional;
af[j].frequency = af[j + 1].frequency; af[j].frequency = af[j + 1].frequency;
af[j].afvalid = af[j + 1].afvalid; af[j].afvalid = af[j + 1].afvalid;
af[j].checked = af[j + 1].checked; af[j].checked = af[j + 1].checked;
af[j].regional = af[j + 1].regional;
af[j + 1].frequency = temp; af[j + 1].frequency = temp;
af[j + 1].afvalid = temp3; af[j + 1].afvalid = temp3;
af[j + 1].checked = temp4; af[j + 1].checked = temp4;
af[j + 1].regional = temp5;
}
}
} }
} }
} }
@@ -885,6 +897,7 @@ void TEF6686::clearRDS (bool fullsearchrds)
af[i].score = -32767; af[i].score = -32767;
af[i].afvalid = true; af[i].afvalid = true;
af[i].checked = false; af[i].checked = false;
af[i].regional = false;
} }
for (i = 0; i < 20; i++) { for (i = 0; i < 20; i++) {
@@ -950,6 +963,7 @@ void TEF6686::clearRDS (bool fullsearchrds)
initab = true; initab = true;
rds.rdsplusTag1 = 169; rds.rdsplusTag1 = 169;
rds.rdsplusTag2 = 169; rds.rdsplusTag2 = 169;
afinit = false;
} }
void TEF6686::tone(uint16_t time, int16_t amplitude, uint16_t frequency) { void TEF6686::tone(uint16_t time, int16_t amplitude, uint16_t frequency) {
+3
View File
@@ -166,6 +166,7 @@ typedef struct _rds_ {
bool underscore; bool underscore;
bool rdsreset; bool rdsreset;
bool pierrors; bool pierrors;
bool sortaf;
bool rtbuffer = true; bool rtbuffer = true;
} rds_; } rds_;
@@ -174,6 +175,7 @@ typedef struct _af_ {
int16_t score; int16_t score;
bool afvalid; bool afvalid;
bool checked; bool checked;
bool regional;
} af_; } af_;
typedef struct _eon_ { typedef struct _eon_ {
@@ -285,6 +287,7 @@ class TEF6686 {
bool runningbit; bool runningbit;
bool initrt; bool initrt;
bool initab; bool initab;
bool afinit;
}; };
#endif #endif
+2 -2
View File
@@ -73,7 +73,7 @@ bool devTEF_Radio_Set_AMLevelOffset(int16_t offset) {
} }
bool devTEF_Radio_Set_RDS(bool fullsearchrds) { bool devTEF_Radio_Set_RDS(bool fullsearchrds) {
if (fullsearchrds == true) return devTEF_Set_Cmd(TEF_FM, Cmd_Set_RDS, 9, 3, 1, 0); else return devTEF_Set_Cmd(TEF_FM, Cmd_Set_RDS, 9, 1, 1, 0); if (fullsearchrds) return devTEF_Set_Cmd(TEF_FM, Cmd_Set_RDS, 9, 3, 1, 0); else return devTEF_Set_Cmd(TEF_FM, Cmd_Set_RDS, 9, 1, 1, 0);
} }
bool devTEF_Radio_Set_Highcut_Level(uint8_t mode, uint16_t start, uint16_t slope) { bool devTEF_Radio_Set_Highcut_Level(uint8_t mode, uint16_t start, uint16_t slope) {
@@ -282,7 +282,7 @@ bool devTEF_Radio_Get_Identification (uint16_t *device, uint16_t *hw_version, ui
} }
bool devTEF_Radio_Set_Wavegen(bool mode, int16_t amplitude, uint16_t freq) { bool devTEF_Radio_Set_Wavegen(bool mode, int16_t amplitude, uint16_t freq) {
if (mode == true) { if (mode) {
devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_Input, 5, 240); devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_Input, 5, 240);
return devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_WaveGen, 15, 5, 0, amplitude * 10, freq, amplitude * 10 , freq); return devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_WaveGen, 15, 5, 0, amplitude * 10, freq, amplitude * 10 , freq);
} else { } else {
+1
View File
@@ -118,6 +118,7 @@
#define EE_BYTE_HIGHCUTOFFSET 23 #define EE_BYTE_HIGHCUTOFFSET 23
#define EE_BYTE_LEVELOFFSET 24 #define EE_BYTE_LEVELOFFSET 24
#define EE_BYTE_RTBUFFER 25 #define EE_BYTE_RTBUFFER 25
#define EE_BYTE_SORTAF 26
#define EE_BYTE_EDGEBEEP 28 #define EE_BYTE_EDGEBEEP 28
#define EE_BYTE_SOFTMUTEAM 29 #define EE_BYTE_SOFTMUTEAM 29
#define EE_BYTE_SOFTMUTEFM 30 #define EE_BYTE_SOFTMUTEFM 30
+34 -15
View File
@@ -6,7 +6,7 @@
#include <EEPROM.h> #include <EEPROM.h>
byte menuitem; byte menuitem;
byte items[8] = {8, 2, 6, 9, 7, 9, 7, 4}; byte items[8] = {8, 2, 6, 9, 8, 9, 7, 4};
void doTheme() { // Use this to put your own colors in: http://www.barth-dev.de/online/rgb565-color-picker/ void doTheme() { // Use this to put your own colors in: http://www.barth-dev.de/online/rgb565-color-picker/
switch (CurrentTheme) { switch (CurrentTheme) {
@@ -347,8 +347,8 @@ void BuildAFScreen() {
batteryVold = 0; batteryVold = 0;
vPerold = 0; vPerold = 0;
af_counterold = 254; af_counterold = 254;
strcpy(radioIdPrevious, "0"); strcpy(radioIdPrevious, "");
programServicePrevious = "0"; programServicePrevious = "";
for (byte i = 0; i < 11; i++) eonpsold[i] = ""; for (byte i = 0; i < 11; i++) eonpsold[i] = "";
} }
@@ -456,6 +456,7 @@ void BuildMenu() {
tftPrint(-1, myLanguage[language][61], 8, ITEM5 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][61], 8, ITEM5 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][99], 8, ITEM6 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][99], 8, ITEM6 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][176], 8, ITEM7 + 6, ActiveColor, ActiveColorSmooth, 16); 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); 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);
if (region == 0) tftPrint(1, myLanguage[language][47], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (region == 0) tftPrint(1, myLanguage[language][47], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16);
@@ -465,6 +466,7 @@ void BuildMenu() {
if (radio.rds.pierrors) tftPrint(1, myLanguage[language][42], 310, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (radio.rds.pierrors) tftPrint(1, myLanguage[language][42], 310, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (af) tftPrint(1, myLanguage[language][42], 310, ITEM6 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM6 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (af) tftPrint(1, myLanguage[language][42], 310, ITEM6 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM6 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (radio.rds.rtbuffer) tftPrint(1, myLanguage[language][42], 310, ITEM7 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM7 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (radio.rds.rtbuffer) tftPrint(1, myLanguage[language][42], 310, ITEM7 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM7 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (radio.rds.sortaf) tftPrint(1, myLanguage[language][42], 310, ITEM8 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM8 + 6, PrimaryColor, PrimaryColorSmooth, 16);
break; break;
case FMSETTINGS: case FMSETTINGS:
@@ -620,7 +622,7 @@ void BuildAdvancedRDS() {
tft.drawCircle(76, 15, 9, GreyoutColor); tft.drawCircle(76, 15, 9, GreyoutColor);
tft.drawBitmap(122, 5, RDSLogo, 35, 22, GreyoutColor); tft.drawBitmap(122, 5, RDSLogo, 35, 22, GreyoutColor);
if (StereoToggle == false) { if (!StereoToggle) {
tft.drawCircle(71, 15, 10, SecondaryColor); tft.drawCircle(71, 15, 10, SecondaryColor);
tft.drawCircle(71, 15, 9, SecondaryColor); tft.drawCircle(71, 15, 9, SecondaryColor);
} }
@@ -648,9 +650,9 @@ void BuildAdvancedRDS() {
batteryVold = 0; batteryVold = 0;
vPerold = 0; vPerold = 0;
strcpy(programTypePrevious, "0"); strcpy(programTypePrevious, "");
strcpy(radioIdPrevious, "0"); strcpy(radioIdPrevious, "");
programServicePrevious = "0"; programServicePrevious = "";
ptynold = " "; ptynold = " ";
MSold = 0; MSold = 0;
ECCold = 254; ECCold = 254;
@@ -756,7 +758,7 @@ void BuildDisplay() {
tft.drawCircle(76, 15, 10, GreyoutColor); tft.drawCircle(76, 15, 10, GreyoutColor);
tft.drawCircle(76, 15, 9, GreyoutColor); tft.drawCircle(76, 15, 9, GreyoutColor);
tft.drawBitmap(122, 5, RDSLogo, 35, 22, GreyoutColor); tft.drawBitmap(122, 5, RDSLogo, 35, 22, GreyoutColor);
if (StereoToggle == false) { if (!StereoToggle) {
tft.drawCircle(71, 15, 10, SecondaryColor); tft.drawCircle(71, 15, 10, SecondaryColor);
tft.drawCircle(71, 15, 9, SecondaryColor); tft.drawCircle(71, 15, 9, SecondaryColor);
} }
@@ -789,15 +791,15 @@ void BuildDisplay() {
batteryold = 6; batteryold = 6;
batteryVold = 0; batteryVold = 0;
vPerold = 0; vPerold = 0;
strcpy(programTypePrevious, "0"); strcpy(programTypePrevious, "");
strcpy(radioIdPrevious, "0"); strcpy(radioIdPrevious, "");
programServicePrevious = "0"; programServicePrevious = "";
BWreset = true; BWreset = true;
if (band < BAND_GAP) tftPrint(-1, "MHz", 258, ITEM3 + 6, ActiveColor, ActiveColorSmooth, 28); else tftPrint(-1, "kHz", 258, ITEM3 + 6, ActiveColor, ActiveColorSmooth, 28); if (band < BAND_GAP) tftPrint(-1, "MHz", 258, ITEM3 + 6, ActiveColor, ActiveColorSmooth, 28); else tftPrint(-1, "kHz", 258, ITEM3 + 6, ActiveColor, ActiveColorSmooth, 28);
} }
void MenuUp() { void MenuUp() {
if (menuopen == false) { if (!menuopen) {
tft.drawRoundRect(3, menuoption + 3, 315, 21, 5, BackgroundColor); tft.drawRoundRect(3, menuoption + 3, 315, 21, 5, BackgroundColor);
if (hardwaremodel == BASE_ILI9341) { if (hardwaremodel == BASE_ILI9341) {
menuoption += ITEM_GAP; menuoption += ITEM_GAP;
@@ -1051,6 +1053,12 @@ void MenuUp() {
if (radio.rds.rtbuffer) tftPrint(0, myLanguage[language][42], 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28); if (radio.rds.rtbuffer) tftPrint(0, myLanguage[language][42], 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28);
if (radio.rds.rtbuffer) radio.rds.rtbuffer = false; else radio.rds.rtbuffer = true; if (radio.rds.rtbuffer) radio.rds.rtbuffer = false; else radio.rds.rtbuffer = true;
if (radio.rds.rtbuffer) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); if (radio.rds.rtbuffer) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break;
case ITEM8:
if (radio.rds.sortaf) tftPrint(0, myLanguage[language][42], 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28);
if (radio.rds.sortaf) radio.rds.sortaf = false; else radio.rds.sortaf = true;
if (radio.rds.sortaf) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break; break;
} }
break; break;
@@ -1253,7 +1261,7 @@ void MenuUp() {
} }
void MenuDown() { void MenuDown() {
if (menuopen == false) { if (!menuopen) {
tft.drawRoundRect(3, menuoption + 3, 315, 21, 5, BackgroundColor); tft.drawRoundRect(3, menuoption + 3, 315, 21, 5, BackgroundColor);
if (hardwaremodel == BASE_ILI9341) { if (hardwaremodel == BASE_ILI9341) {
menuoption -= ITEM_GAP; menuoption -= ITEM_GAP;
@@ -1509,6 +1517,12 @@ void MenuDown() {
if (radio.rds.rtbuffer) radio.rds.rtbuffer = false; else radio.rds.rtbuffer = true; if (radio.rds.rtbuffer) radio.rds.rtbuffer = false; else radio.rds.rtbuffer = true;
if (radio.rds.rtbuffer) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); if (radio.rds.rtbuffer) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break; break;
case ITEM8:
if (radio.rds.sortaf) tftPrint(0, myLanguage[language][42], 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28);
if (radio.rds.sortaf) radio.rds.sortaf = false; else radio.rds.sortaf = true;
if (radio.rds.sortaf) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break;
} }
break; break;
@@ -1709,7 +1723,7 @@ void MenuDown() {
} }
void DoMenu() { void DoMenu() {
if (menuopen == false) { if (!menuopen) {
if (menupage != INDEX) { if (menupage != INDEX) {
menuopen = true; menuopen = true;
tft.drawRoundRect(10, 30, 300, 170, 5, ActiveColor); tft.drawRoundRect(10, 30, 300, 170, 5, ActiveColor);
@@ -1952,6 +1966,11 @@ void DoMenu() {
tftPrint(0, myLanguage[language][176], 155, 78, ActiveColor, ActiveColorSmooth, 28); tftPrint(0, myLanguage[language][176], 155, 78, ActiveColor, ActiveColorSmooth, 28);
if (radio.rds.rtbuffer) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); if (radio.rds.rtbuffer) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break; break;
case ITEM8:
tftPrint(0, myLanguage[language][196], 155, 78, ActiveColor, ActiveColorSmooth, 28);
if (radio.rds.sortaf) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break;
} }
break; break;
@@ -2109,7 +2128,7 @@ void DoMenu() {
break; break;
} }
} else { } else {
if (menupage == CONNECTIVITY && menuoption == ITEM2 && wifi == true) { if (menupage == CONNECTIVITY && menuoption == ITEM2 && wifi) {
tryWiFi(); tryWiFi();
delay(2000); delay(2000);
} }
+34 -18
View File
@@ -1,6 +1,6 @@
// [number of languages][number of texts][max. length of text] // [number of languages][number of texts]
static const char* const myLanguage[16][196] = { static const char* const myLanguage[16][197] = {
{ "English", // English { "English", // English
"Rotary direction changed", // 1 "Rotary direction changed", // 1
"Please release button", // 2 "Please release button", // 2
@@ -196,7 +196,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192 "RDS", // 192
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT" // 195 "CONNECT", // 195
"Auto sort AF" // 196
}, },
{ "Nederlands", // Dutch { "Nederlands", // Dutch
@@ -394,7 +395,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192 "RDS", // 192
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"VERBIND" // 195 "VERBIND", // 195
"Auto AF sorteren" // 196
}, },
{ "Polski", // Polish { "Polski", // Polish
@@ -592,7 +594,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192 "RDS", // 192
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT" // 195 "CONNECT", // 195
"Auto sort AF" // 196
}, },
{ "Hrvatski", // Croatian { "Hrvatski", // Croatian
@@ -790,7 +793,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192 "RDS", // 192
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT" // 195 "CONNECT", // 195
"Auto sort AF" // 196
}, },
{ "Ελληνικά", // Greek { "Ελληνικά", // Greek
@@ -988,7 +992,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192 "RDS", // 192
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"ΣΥΝΔΕΣΗ" // 195 "ΣΥΝΔΕΣΗ", // 195
"Auto sort AF" // 196
}, },
{ "Romana", // Romanian { "Romana", // Romanian
@@ -1186,7 +1191,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192 "RDS", // 192
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT" // 195 "CONNECT", // 195
"Auto sort AF" // 196
}, },
{ "Deutsch", // German { "Deutsch", // German
@@ -1384,7 +1390,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192 "RDS", // 192
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT" // 195 "CONNECT", // 195
"Auto sort AF" // 196
}, },
{ "Czech", // Czech { "Czech", // Czech
@@ -1582,7 +1589,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192 "RDS", // 192
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT" // 195 "CONNECT", // 195
"Auto sort AF" // 196
}, },
{ "Slovak", // Slovak { "Slovak", // Slovak
@@ -1780,7 +1788,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192 "RDS", // 192
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT" // 195 "CONNECT", // 195
"Auto sort AF" // 196
}, },
{ "Français", // French { "Français", // French
@@ -1978,7 +1987,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192 "RDS", // 192
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT" // 195 "CONNECT", // 195
"Auto sort AF" // 196
}, },
{ "Български", // Bulgarian { "Български", // Bulgarian
@@ -2176,7 +2186,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192 "RDS", // 192
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT" // 195 "CONNECT", // 195
"Auto sort AF" // 196
}, },
{ "Русский", // Russian { "Русский", // Russian
@@ -2374,7 +2385,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192 "RDS", // 192
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"ПОДКЛЮЧЕНИЕ" // 195 "ПОДКЛЮЧЕНИЕ", // 195
"Auto sort AF" // 196
}, },
{ "Українська", // Ukranian { "Українська", // Ukranian
@@ -2572,7 +2584,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192 "RDS", // 192
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"ПІДКЛЮЧЕННЯ" // 195 "ПІДКЛЮЧЕННЯ", // 195
"Auto sort AF" // 196
}, },
{ "Italiano", // Italian { "Italiano", // Italian
@@ -2770,7 +2783,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192 "RDS", // 192
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT" // 195 "CONNECT", // 195
"Auto sort AF" // 196
}, },
{ "Simplified Chinese", // Simplified Chinese { "Simplified Chinese", // Simplified Chinese
@@ -2968,7 +2982,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192 "RDS", // 192
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT" // 195 "CONNECT", // 195
"Auto sort AF" // 196
}, },
{ "Norsk", // Norwegian { "Norsk", // Norwegian
@@ -3166,7 +3181,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192 "RDS", // 192
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"TILKOBLE" // 195 "TILKOBLE", // 195
"Auto sort AF" // 196
} }
}; };
+2
View File
@@ -780,6 +780,8 @@ void ShowAFEON() {
tftPrint(1, 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); tftPrint(1, 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) { } else if (!radio.af[i].afvalid) {
tftPrint(1, 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); tftPrint(1, 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 (radio.af[i].regional) {
tftPrint(1, 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), SecondaryColor, SecondaryColorSmooth, 16);
} else { } else {
tftPrint(1, 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); tftPrint(1, 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);
} }