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

File diff suppressed because it is too large Load Diff

1625
src/FREQFONT.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -373,10 +373,11 @@ void TEF6686::readRDS(bool showrdserrors)
if (rds.rdsB != rdsBprevious) {
rds.correct = false;
rds.rdsAerror = (((rds.rdsErr >> 14) & 0x02) == 0x02);
rds.rdsBerror = (((rds.rdsErr >> 12) & 0x02) == 0x02);
rds.rdsCerror = (((rds.rdsErr >> 10) & 0x02) == 0x02);
rds.rdsDerror = (((rds.rdsErr >> 8) & 0x02) == 0x02);
rds.rdsAerror = ((((rds.rdsErr >> 14) & 0x03) == 0x02) || (((rds.rdsErr >> 14) & 0x03) == 0x03));
rds.rdsBerror = ((((rds.rdsErr >> 12) & 0x03) == 0x02) || (((rds.rdsErr >> 12) & 0x03) == 0x03));
rds.rdsCerror = ((((rds.rdsErr >> 10) & 0x03) == 0x02) || (((rds.rdsErr >> 10) & 0x03) == 0x03));
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 ((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) + 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...
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
@@ -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
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
@@ -515,54 +516,65 @@ void TEF6686::readRDS(bool showrdserrors)
//AF decoder
if (rdsblock == 0) { // Only when in GROUP 0A
if ((rds.rdsB >> 11) == 0 && af_counter < 50) {
uint16_t buffer0;
uint16_t buffer1;
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) {
uint16_t buffer0;
uint16_t buffer1;
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 ((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;
bool isValuePresent = false;
for (int i = 0; i < 50; i++) {
if (buffer0 == currentfreq || buffer0 == 0 || af[i].frequency == buffer0) {
isValuePresent = true;
break;
bool isValuePresent = false;
for (int i = 0; i < 50; i++) {
if (buffer0 == currentfreq || buffer0 == 0 || af[i].frequency == buffer0) {
isValuePresent = true;
break;
}
}
}
if (!isValuePresent) {
af[af_counter].frequency = buffer0;
af_counter++;
}
isValuePresent = false;
for (int i = 0; i < 50; i++) {
if (buffer1 == currentfreq || buffer1 == 0 || af[i].frequency == buffer1) {
isValuePresent = true;
break;
if (!isValuePresent) {
af[af_counter].frequency = buffer0;
af_counter++;
}
}
if (!isValuePresent) {
af[af_counter].frequency = buffer1;
if (af_counter < 50) af_counter++;
}
isValuePresent = false;
for (int i = 0; i < 50; i++) {
if (buffer1 == currentfreq || buffer1 == 0 || af[i].frequency == buffer1) {
isValuePresent = true;
break;
}
}
for (int i = 0; i < 50; i++) {
for (int j = 0; j < 50 - i; j++) {
if (af[j].frequency == 0) continue;
if (buffer0 == currentfreq && buffer0 < buffer1) af[af_counter].regional = true;
if (buffer1 == currentfreq && buffer0 > buffer1) af[af_counter].regional = true;
if (af[j].frequency > af[j + 1].frequency && af[j + 1].frequency != 0) {
uint16_t temp = af[j].frequency;
bool temp3 = af[j].afvalid;
bool temp4 = af[j].checked;
af[j].frequency = af[j + 1].frequency;
af[j].afvalid = af[j + 1].afvalid;
af[j].checked = af[j + 1].checked;
af[j + 1].frequency = temp;
af[j + 1].afvalid = temp3;
af[j + 1].checked = temp4;
if (!isValuePresent) {
af[af_counter].frequency = buffer1;
if (af_counter < 50) af_counter++;
}
if (rds.sortaf) {
for (int i = 0; i < 50; i++) {
for (int j = 0; j < 50 - i; j++) {
if (af[j].frequency == 0) continue;
if (af[j].frequency > af[j + 1].frequency && af[j + 1].frequency != 0) {
uint16_t temp = af[j].frequency;
bool temp3 = af[j].afvalid;
bool temp4 = af[j].checked;
bool temp5 = af[j].regional;
af[j].frequency = af[j + 1].frequency;
af[j].afvalid = af[j + 1].afvalid;
af[j].checked = af[j + 1].checked;
af[j].regional = af[j + 1].regional;
af[j + 1].frequency = temp;
af[j + 1].afvalid = temp3;
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].afvalid = true;
af[i].checked = false;
af[i].regional = false;
}
for (i = 0; i < 20; i++) {
@@ -950,6 +963,7 @@ void TEF6686::clearRDS (bool fullsearchrds)
initab = true;
rds.rdsplusTag1 = 169;
rds.rdsplusTag2 = 169;
afinit = false;
}
void TEF6686::tone(uint16_t time, int16_t amplitude, uint16_t frequency) {

View File

@@ -166,6 +166,7 @@ typedef struct _rds_ {
bool underscore;
bool rdsreset;
bool pierrors;
bool sortaf;
bool rtbuffer = true;
} rds_;
@@ -174,6 +175,7 @@ typedef struct _af_ {
int16_t score;
bool afvalid;
bool checked;
bool regional;
} af_;
typedef struct _eon_ {
@@ -285,6 +287,7 @@ class TEF6686 {
bool runningbit;
bool initrt;
bool initab;
bool afinit;
};
#endif

View File

@@ -73,7 +73,7 @@ bool devTEF_Radio_Set_AMLevelOffset(int16_t offset) {
}
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) {
@@ -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) {
if (mode == true) {
if (mode) {
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);
} else {

View File

@@ -118,6 +118,7 @@
#define EE_BYTE_HIGHCUTOFFSET 23
#define EE_BYTE_LEVELOFFSET 24
#define EE_BYTE_RTBUFFER 25
#define EE_BYTE_SORTAF 26
#define EE_BYTE_EDGEBEEP 28
#define EE_BYTE_SOFTMUTEAM 29
#define EE_BYTE_SOFTMUTEFM 30

View File

@@ -6,7 +6,7 @@
#include <EEPROM.h>
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/
switch (CurrentTheme) {
@@ -347,8 +347,8 @@ void BuildAFScreen() {
batteryVold = 0;
vPerold = 0;
af_counterold = 254;
strcpy(radioIdPrevious, "0");
programServicePrevious = "0";
strcpy(radioIdPrevious, "");
programServicePrevious = "";
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][99], 8, ITEM6 + 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 (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 (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.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;
case FMSETTINGS:
@@ -620,7 +622,7 @@ void BuildAdvancedRDS() {
tft.drawCircle(76, 15, 9, GreyoutColor);
tft.drawBitmap(122, 5, RDSLogo, 35, 22, GreyoutColor);
if (StereoToggle == false) {
if (!StereoToggle) {
tft.drawCircle(71, 15, 10, SecondaryColor);
tft.drawCircle(71, 15, 9, SecondaryColor);
}
@@ -648,9 +650,9 @@ void BuildAdvancedRDS() {
batteryVold = 0;
vPerold = 0;
strcpy(programTypePrevious, "0");
strcpy(radioIdPrevious, "0");
programServicePrevious = "0";
strcpy(programTypePrevious, "");
strcpy(radioIdPrevious, "");
programServicePrevious = "";
ptynold = " ";
MSold = 0;
ECCold = 254;
@@ -756,7 +758,7 @@ void BuildDisplay() {
tft.drawCircle(76, 15, 10, GreyoutColor);
tft.drawCircle(76, 15, 9, GreyoutColor);
tft.drawBitmap(122, 5, RDSLogo, 35, 22, GreyoutColor);
if (StereoToggle == false) {
if (!StereoToggle) {
tft.drawCircle(71, 15, 10, SecondaryColor);
tft.drawCircle(71, 15, 9, SecondaryColor);
}
@@ -789,15 +791,15 @@ void BuildDisplay() {
batteryold = 6;
batteryVold = 0;
vPerold = 0;
strcpy(programTypePrevious, "0");
strcpy(radioIdPrevious, "0");
programServicePrevious = "0";
strcpy(programTypePrevious, "");
strcpy(radioIdPrevious, "");
programServicePrevious = "";
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);
}
void MenuUp() {
if (menuopen == false) {
if (!menuopen) {
tft.drawRoundRect(3, menuoption + 3, 315, 21, 5, BackgroundColor);
if (hardwaremodel == BASE_ILI9341) {
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) 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);
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;
@@ -1253,7 +1261,7 @@ void MenuUp() {
}
void MenuDown() {
if (menuopen == false) {
if (!menuopen) {
tft.drawRoundRect(3, menuoption + 3, 315, 21, 5, BackgroundColor);
if (hardwaremodel == BASE_ILI9341) {
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) 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;
@@ -1709,7 +1723,7 @@ void MenuDown() {
}
void DoMenu() {
if (menuopen == false) {
if (!menuopen) {
if (menupage != INDEX) {
menuopen = true;
tft.drawRoundRect(10, 30, 300, 170, 5, ActiveColor);
@@ -1952,6 +1966,11 @@ void DoMenu() {
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);
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;
@@ -2109,7 +2128,7 @@ void DoMenu() {
break;
}
} else {
if (menupage == CONNECTIVITY && menuoption == ITEM2 && wifi == true) {
if (menupage == CONNECTIVITY && menuoption == ITEM2 && wifi) {
tryWiFi();
delay(2000);
}

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
"Rotary direction changed", // 1
"Please release button", // 2
@@ -196,7 +196,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192
"FM", // 193
"AM", // 194
"CONNECT" // 195
"CONNECT", // 195
"Auto sort AF" // 196
},
{ "Nederlands", // Dutch
@@ -394,7 +395,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192
"FM", // 193
"AM", // 194
"VERBIND" // 195
"VERBIND", // 195
"Auto AF sorteren" // 196
},
{ "Polski", // Polish
@@ -592,7 +594,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192
"FM", // 193
"AM", // 194
"CONNECT" // 195
"CONNECT", // 195
"Auto sort AF" // 196
},
{ "Hrvatski", // Croatian
@@ -790,7 +793,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192
"FM", // 193
"AM", // 194
"CONNECT" // 195
"CONNECT", // 195
"Auto sort AF" // 196
},
{ "Ελληνικά", // Greek
@@ -988,7 +992,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192
"FM", // 193
"AM", // 194
"ΣΥΝΔΕΣΗ" // 195
"ΣΥΝΔΕΣΗ", // 195
"Auto sort AF" // 196
},
{ "Romana", // Romanian
@@ -1186,7 +1191,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192
"FM", // 193
"AM", // 194
"CONNECT" // 195
"CONNECT", // 195
"Auto sort AF" // 196
},
{ "Deutsch", // German
@@ -1384,7 +1390,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192
"FM", // 193
"AM", // 194
"CONNECT" // 195
"CONNECT", // 195
"Auto sort AF" // 196
},
{ "Czech", // Czech
@@ -1582,7 +1589,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192
"FM", // 193
"AM", // 194
"CONNECT" // 195
"CONNECT", // 195
"Auto sort AF" // 196
},
{ "Slovak", // Slovak
@@ -1780,7 +1788,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192
"FM", // 193
"AM", // 194
"CONNECT" // 195
"CONNECT", // 195
"Auto sort AF" // 196
},
{ "Français", // French
@@ -1978,7 +1987,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192
"FM", // 193
"AM", // 194
"CONNECT" // 195
"CONNECT", // 195
"Auto sort AF" // 196
},
{ "Български", // Bulgarian
@@ -2176,7 +2186,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192
"FM", // 193
"AM", // 194
"CONNECT" // 195
"CONNECT", // 195
"Auto sort AF" // 196
},
{ "Русский", // Russian
@@ -2374,7 +2385,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192
"FM", // 193
"AM", // 194
"ПОДКЛЮЧЕНИЕ" // 195
"ПОДКЛЮЧЕНИЕ", // 195
"Auto sort AF" // 196
},
{ "Українська", // Ukranian
@@ -2572,7 +2584,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192
"FM", // 193
"AM", // 194
"ПІДКЛЮЧЕННЯ" // 195
"ПІДКЛЮЧЕННЯ", // 195
"Auto sort AF" // 196
},
{ "Italiano", // Italian
@@ -2770,7 +2783,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192
"FM", // 193
"AM", // 194
"CONNECT" // 195
"CONNECT", // 195
"Auto sort AF" // 196
},
{ "Simplified Chinese", // Simplified Chinese
@@ -2968,7 +2982,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192
"FM", // 193
"AM", // 194
"CONNECT" // 195
"CONNECT", // 195
"Auto sort AF" // 196
},
{ "Norsk", // Norwegian
@@ -3166,7 +3181,8 @@ static const char* const myLanguage[16][196] = {
"RDS", // 192
"FM", // 193
"AM", // 194
"TILKOBLE" // 195
"TILKOBLE", // 195
"Auto sort AF" // 196
}
};

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);
} 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);
} 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 {
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);
}