- Show PI errors is fixed
- RDS error detector fixed
- Battery indicator fixed
- Regional AF's now have a leading 'r'
- Edge beep on SW bands added
- Beep on boot only when edge beep is enabled
- Added Stationlist ID, this is used for identification in Stationlist log
- Code optimalisation
This commit is contained in:
Sjef Verhoeven PE5PVB
2023-08-14 20:30:38 +02:00
parent 4c8ac2b716
commit c5350b3860
9 changed files with 134 additions and 76 deletions
+38 -30
View File
@@ -52,6 +52,8 @@ bool afscreen;
bool aftest; bool aftest;
bool artheadold; bool artheadold;
bool batterydetect = true; bool batterydetect = true;
bool beepresetstart;
bool beepresetstop;
bool BWreset; bool BWreset;
bool change2; bool change2;
bool compressedold; bool compressedold;
@@ -156,6 +158,7 @@ byte screensaverset;
byte showmodulation; byte showmodulation;
byte showSWMIBand; byte showSWMIBand;
byte submenu; byte submenu;
byte stationlistid;
byte nowToggleSWMIBand = 1; byte nowToggleSWMIBand = 1;
byte stepsize; byte stepsize;
byte StereoLevel; byte StereoLevel;
@@ -166,7 +169,7 @@ byte tunemode;
byte unit; byte unit;
char buff[16]; char buff[16];
char programTypePrevious[18]; char programTypePrevious[18];
char radioIdPrevious[6]; char radioIdPrevious[7];
const uint8_t* currentFont = nullptr; const uint8_t* currentFont = nullptr;
float vPerold; float vPerold;
int ActiveColor; int ActiveColor;
@@ -406,6 +409,7 @@ void setup() {
amcodect = EEPROM.readByte(EE_BYTE_AM_CO_DECT); amcodect = EEPROM.readByte(EE_BYTE_AM_CO_DECT);
amcodectcount = EEPROM.readByte(EE_BYTE_AM_CO_DECT_COUNT); amcodectcount = EEPROM.readByte(EE_BYTE_AM_CO_DECT_COUNT);
radio.rds.sortaf = EEPROM.readByte(EE_BYTE_SORTAF); radio.rds.sortaf = EEPROM.readByte(EE_BYTE_SORTAF);
stationlistid = EEPROM.readByte(EE_BYTE_STATIONLISTID);
LWLowEdgeSet = FREQ_LW_LOW_EDGE_MIN; // later will read from flash LWLowEdgeSet = FREQ_LW_LOW_EDGE_MIN; // later will read from flash
LWHighEdgeSet = FREQ_LW_HIGH_EDGE_MAX; // later will read from flash LWHighEdgeSet = FREQ_LW_HIGH_EDGE_MAX; // later will read from flash
@@ -654,7 +658,7 @@ void setup() {
SelectBand(); SelectBand();
setupmode = false; setupmode = false;
radio.tone(50, -5, 2000); if (edgebeep) radio.tone(50, -5, 2000);
if (screensaverset) { if (screensaverset) {
ScreensaverTimerInit(); ScreensaverTimerInit();
@@ -665,7 +669,7 @@ void setup() {
void loop() { void loop() {
if (digitalRead(BANDBUTTON) == LOW ) BANDBUTTONPress(); if (digitalRead(BANDBUTTON) == LOW ) BANDBUTTONPress();
if (power) { if (power || poweroptions == DEEP_SLEEP) {
if (millis() >= tuningtimer + 200) Communication(); if (millis() >= tuningtimer + 200) Communication();
if (!menu && !afscreen) { if (!menu && !afscreen) {
@@ -851,7 +855,9 @@ void loop() {
} }
} }
} }
} else { }
if (!power) {
if (rotary == -1) { if (rotary == -1) {
if (!touchrotating) { if (!touchrotating) {
rotary = 0; rotary = 0;
@@ -1784,6 +1790,7 @@ void ModeButtonPress() {
EEPROM.writeByte(EE_BYTE_AM_CO_DECT, amcodect); EEPROM.writeByte(EE_BYTE_AM_CO_DECT, amcodect);
EEPROM.writeByte(EE_BYTE_AM_CO_DECT_COUNT, amcodectcount); EEPROM.writeByte(EE_BYTE_AM_CO_DECT_COUNT, amcodectcount);
EEPROM.writeByte(EE_BYTE_SORTAF, radio.rds.sortaf); EEPROM.writeByte(EE_BYTE_SORTAF, radio.rds.sortaf);
EEPROM.writeByte(EE_BYTE_STATIONLISTID, stationlistid);
EEPROM.commit(); EEPROM.commit();
Serial.end(); Serial.end();
if (wifi) remoteip = IPAddress (WiFi.localIP()[0], WiFi.localIP()[1], WiFi.localIP()[2], subnetclient); if (wifi) remoteip = IPAddress (WiFi.localIP()[0], WiFi.localIP()[1], WiFi.localIP()[2], subnetclient);
@@ -2128,7 +2135,6 @@ void ShowFreq(int mode) {
DivdeSWMIBand(); DivdeSWMIBand();
updateSWMIBand(); updateSWMIBand();
} }
} else { } else {
unsigned int freq = 0; unsigned int freq = 0;
if (band == BAND_FM) freq = frequency + ConverterSet * 100; if (band == BAND_FM) freq = frequency + ConverterSet * 100;
@@ -2147,7 +2153,7 @@ void ShowFreq(int mode) {
sprite1.setTextColor(PrimaryColor, PrimaryColorSmooth, false); sprite1.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
sprite1.drawString(String(freq / 100) + "." + (freq % 100 < 10 ? "0" : "") + String(freq % 100) + " ", 218, -6); sprite1.drawString(String(freq / 100) + "." + (freq % 100 < 10 ? "0" : "") + String(freq % 100) + " ", 218, -6);
sprite1.pushSprite(46, 46); sprite1.pushSprite(46, 46);
// freqold = freq; freqold = freq;
} else if (mode == 1) { } else if (mode == 1) {
sprite1.fillSprite(BackgroundColor); sprite1.fillSprite(BackgroundColor);
sprite1.pushSprite(46, 46); sprite1.pushSprite(46, 46);
@@ -2168,21 +2174,18 @@ void ShowFreq(int mode) {
sprite.fillSprite(BackgroundColor); sprite.fillSprite(BackgroundColor);
sprite2.fillSprite(BackgroundColor); sprite2.fillSprite(BackgroundColor);
if (advancedRDS) sprite2.pushSprite(35, 220); else if (!afscreen) sprite.pushSprite(38, 220); if (advancedRDS) sprite2.pushSprite(35, 220); else if (!afscreen) sprite.pushSprite(38, 220);
}
if (wifi) { if (wifi) {
String stationprint;
stationprint = "from=TEF_tuner;RcvLevel=";
stationprint += String(SStatus / 10);
stationprint += ";bandwidth=-1;freq=";
if (band > BAND_GAP) {
stationprint += String(frequency_AM) + "000";
} else {
stationprint += String(band == BAND_FM ? frequency : frequency_OIRT) + "0000";
}
Udp.beginPacket(remoteip, 9030); Udp.beginPacket(remoteip, 9030);
Udp.print(stationprint); if (band == BAND_FM) {
Udp.endPacket(); Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RcvLevel=" + String(SStatus / 10) + ";bandwidth=-1;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");
} else {
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RcvLevel=" + String(SStatus / 10) + ";bandwidth=-1;freq=" + String(frequency_AM) + "000");
} }
Udp.endPacket();
} }
tuningtimer = millis(); tuningtimer = millis();
} }
@@ -2249,8 +2252,7 @@ void ShowSignalLevel() {
} }
if (wifi) { if (wifi) {
Udp.beginPacket(remoteip, 9030); Udp.beginPacket(remoteip, 9030);
Udp.print("from=TEF_tuner;RcvLevel="); Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RcvLevel=" + String(SStatus / 10));
Udp.print(String(SStatus / 10));
Udp.endPacket(); Udp.endPacket();
} }
} }
@@ -2400,8 +2402,7 @@ void ShowBW() {
BWreset = false; BWreset = false;
if (wifi) { if (wifi) {
Udp.beginPacket(remoteip, 9030); Udp.beginPacket(remoteip, 9030);
Udp.print("from=TEF_tuner;bandwidth="); Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";bandwidth=" + String(BW * 1000));
Udp.print(String(BW * 1000));
Udp.endPacket(); Udp.endPacket();
} }
} }
@@ -2610,12 +2611,20 @@ void updateSWMIBand() {
case SW_MI_BAND_90M: case SW_MI_BAND_90M:
case SW_MI_BAND_120M: case SW_MI_BAND_120M:
case SW_MI_BAND_160M: case SW_MI_BAND_160M:
tftReplace(-1, SWMIBandstringold, SWMIBandstring, 50, 51, SecondaryColor, SecondaryColorSmooth, 16); tftPrint(-1, SWMIBandstring, 50, 51, SecondaryColor, SecondaryColorSmooth, 16);
if (!SWMIBandstring.equals(SWMIBandstringold)) SWMIBandstringold = SWMIBandstring; beepresetstart = true;
if (edgebeep && beepresetstop) {
EdgeBeeper();
beepresetstop = false;
}
break; break;
case SW_MI_BAND_GAP: case SW_MI_BAND_GAP:
tftPrint(-1, SWMIBandstringold, 50, 51, BackgroundColor, BackgroundColor, 16); beepresetstop = true;
if (edgebeep && beepresetstart) {
EdgeBeeper();
beepresetstart = false;
}
break; break;
} }
} }
@@ -2813,15 +2822,14 @@ void ShowBattery() {
if (!wifi && batterydetect) { if (!wifi && batterydetect) {
float batteryV = constrain((((float)v / 4095.0) * 3.3 * (1100 / 1000.0) * 2.0), 0.0, 5.0); float batteryV = constrain((((float)v / 4095.0) * 3.3 * (1100 / 1000.0) * 2.0), 0.0, 5.0);
float vPer = constrain((batteryV - BATTERY_LOW_VALUE) / (BATTERY_FULL_VALUE - BATTERY_LOW_VALUE), 0.0, 1.0) * 100; float vPer = constrain((batteryV - BATTERY_LOW_VALUE) / (BATTERY_FULL_VALUE - BATTERY_LOW_VALUE), 0.0, 0.99) * 100;
if (abs(batteryV - batteryVold) > 0.05 && batteryoptions == BATTERY_VALUE) { if (abs(batteryV - batteryVold) > 0.05 && batteryoptions == BATTERY_VALUE) {
batteryVold = batteryV;
tftReplace(-1, String(batteryVold, 1) + "V", String(batteryV, 1) + "V", 279, 9, BatteryValueColor, BatteryValueColorSmooth, 16); tftReplace(-1, String(batteryVold, 1) + "V", String(batteryV, 1) + "V", 279, 9, BatteryValueColor, BatteryValueColorSmooth, 16);
batteryVold = batteryV;
} else if (int(vPer) != int(vPerold) && batteryoptions == BATTERY_PERCENT && abs(vPer - vPerold) > 0.5) { } else if (int(vPer) != int(vPerold) && batteryoptions == BATTERY_PERCENT && abs(vPer - vPerold) > 0.5) {
vPerold = vPer;
if (vPer > 99.0) vPer = 99.0;
tftReplace(-1, String(vPerold, 0) + "%", String(vPer, 0) + "%", 279, 9, BatteryValueColor, BatteryValueColorSmooth, 16); tftReplace(-1, String(vPerold, 0) + "%", String(vPer, 0) + "%", 279, 9, BatteryValueColor, BatteryValueColorSmooth, 16);
vPerold = vPer;
} }
} }
} }
@@ -2982,9 +2990,8 @@ void TuneDown() {
} }
void EdgeBeeper() { void EdgeBeeper() {
bool x = radio.mute;
radio.tone(50, -5, 2000); radio.tone(50, -5, 2000);
if (x) { if (radio.mute) {
radio.setMute(); radio.setMute();
if (!screenmute) tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor); if (!screenmute) tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor);
} else { } else {
@@ -3152,6 +3159,7 @@ void DefaultSettings(byte userhardwaremodel) {
EEPROM.writeByte(EE_BYTE_AM_CO_DECT, 100); EEPROM.writeByte(EE_BYTE_AM_CO_DECT, 100);
EEPROM.writeByte(EE_BYTE_AM_CO_DECT_COUNT, 3); EEPROM.writeByte(EE_BYTE_AM_CO_DECT_COUNT, 3);
EEPROM.writeByte(EE_BYTE_SORTAF, 1); EEPROM.writeByte(EE_BYTE_SORTAF, 1);
EEPROM.writeByte(EE_BYTE_STATIONLISTID, 1);
EEPROM.commit(); EEPROM.commit();
} }
+18 -6
View File
@@ -373,10 +373,10 @@ void TEF6686::readRDS(bool showrdserrors)
if (rds.rdsB != rdsBprevious) { if (rds.rdsB != rdsBprevious) {
rds.correct = false; rds.correct = false;
rds.rdsAerror = ((((rds.rdsErr >> 14) & 0x03) == 0x02) || (((rds.rdsErr >> 14) & 0x03) == 0x03)); rds.rdsAerror = (((rds.rdsErr >> 14) & 0x03) > 1);
rds.rdsBerror = ((((rds.rdsErr >> 12) & 0x03) == 0x02) || (((rds.rdsErr >> 12) & 0x03) == 0x03)); rds.rdsBerror = (((rds.rdsErr >> 12) & 0x03) > 1);
rds.rdsCerror = ((((rds.rdsErr >> 10) & 0x03) == 0x02) || (((rds.rdsErr >> 10) & 0x03) == 0x03)); rds.rdsCerror = (((rds.rdsErr >> 10) & 0x03) > 1);
rds.rdsDerror = ((((rds.rdsErr >> 8) & 0x03) == 0x02) || (((rds.rdsErr >> 8) & 0x03) == 0x03)); rds.rdsDerror = (((rds.rdsErr >> 8) & 0x03) > 1);
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;
@@ -405,8 +405,15 @@ void TEF6686::readRDS(bool showrdserrors)
} }
} }
if (((rds.rdsErr >> 14) & 0x02) > 2) rds.picode[5] = '?'; if (rds.correct) errorfreepi = true;
if (((rds.rdsErr >> 14) & 0x01) > 1) rds.picode[4] = '?'; else rds.picode[4] = ' '; // Not sure, add a ?
if (!errorfreepi) {
if (((rds.rdsErr >> 14) & 0x03) > 2) rds.picode[5] = '?'; else rds.picode[5] = ' ';
if (((rds.rdsErr >> 14) & 0x03) > 1) rds.picode[4] = '?'; else rds.picode[4] = ' '; // Not sure, add a ?
} else {
rds.picode[4] = ' ';
rds.picode[5] = ' ';
}
rds.picode[6] = '\0'; rds.picode[6] = '\0';
if (strncmp(rds.picode, "0000", 4) == 0) { if (strncmp(rds.picode, "0000", 4) == 0) {
if (piold != 0) { if (piold != 0) {
@@ -422,6 +429,10 @@ void TEF6686::readRDS(bool showrdserrors)
} }
} }
} else { } else {
if (rds.stationName.length() == 0) {
memset(rds.picode, 0, sizeof(rds.picode));
}
memset(rds.picode, 0, sizeof(rds.picode)); memset(rds.picode, 0, sizeof(rds.picode));
} }
} }
@@ -963,6 +974,7 @@ void TEF6686::clearRDS (bool fullsearchrds)
rds.rdsplusTag1 = 169; rds.rdsplusTag1 = 169;
rds.rdsplusTag2 = 169; rds.rdsplusTag2 = 169;
afinit = false; afinit = false;
errorfreepi = 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) {
+1
View File
@@ -288,6 +288,7 @@ class TEF6686 {
bool initrt; bool initrt;
bool initab; bool initab;
bool afinit; bool afinit;
bool errorfreepi;
}; };
#endif #endif
+1
View File
@@ -119,6 +119,7 @@
#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_SORTAF 26
#define EE_BYTE_STATIONLISTID 27
#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
+22 -1
View File
@@ -6,7 +6,7 @@
#include <EEPROM.h> #include <EEPROM.h>
byte menuitem; byte menuitem;
byte items[8] = {8, 2, 6, 9, 8, 9, 7, 4}; byte items[8] = {8, 2, 6, 9, 8, 9, 7, 5};
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) {
@@ -540,11 +540,13 @@ void BuildMenu() {
if (wifi) tftPrint(-1, String(myLanguage[language][51]) + " IP: " + String(WiFi.localIP().toString()), 8, ITEM2 + 6, ActiveColor, ActiveColorSmooth, 16); else tftPrint(-1, myLanguage[language][51], 8, ITEM2 + 6, ActiveColor, ActiveColorSmooth, 16); if (wifi) tftPrint(-1, String(myLanguage[language][51]) + " IP: " + String(WiFi.localIP().toString()), 8, ITEM2 + 6, ActiveColor, ActiveColorSmooth, 16); else tftPrint(-1, myLanguage[language][51], 8, ITEM2 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][52], 8, ITEM3 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][52], 8, ITEM3 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][58], 8, ITEM4 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][58], 8, ITEM4 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][197], 8, ITEM5 + 6, ActiveColor, ActiveColorSmooth, 16);
if (USBmode) tftPrint(1, "RDS Spy", 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, "XDRGTK", 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (USBmode) tftPrint(1, "RDS Spy", 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, "XDRGTK", 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (wifi) tftPrint(1, myLanguage[language][42], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (wifi) tftPrint(1, myLanguage[language][42], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, ">", 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); tftPrint(1, ">", 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, String(WiFi.localIP()[0]) + "." + String(WiFi.localIP()[1]) + "." + String(WiFi.localIP()[2]) + "." + String(subnetclient, DEC), 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16); tftPrint(1, String(WiFi.localIP()[0]) + "." + String(WiFi.localIP()[1]) + "." + String(WiFi.localIP()[2]) + "." + String(subnetclient, DEC), 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, String(stationlistid, DEC), 310, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16);
break; break;
} }
@@ -1254,6 +1256,13 @@ void MenuUp() {
if (subnetclient > 254) subnetclient = 1; if (subnetclient > 254) subnetclient = 1;
tftPrint(0, String(WiFi.localIP()[0]) + "." + String(WiFi.localIP()[1]) + "." + String(WiFi.localIP()[2]) + "." + String(subnetclient, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); tftPrint(0, String(WiFi.localIP()[0]) + "." + String(WiFi.localIP()[1]) + "." + String(WiFi.localIP()[2]) + "." + String(subnetclient, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break; break;
case ITEM5:
tftPrint(0, String(stationlistid, DEC), 155, 118, BackgroundColor, BackgroundColor, 28);
stationlistid ++;
if (stationlistid > 10) stationlistid = 1;
tftPrint(0, String(stationlistid, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break;
} }
break; break;
} }
@@ -1716,6 +1725,13 @@ void MenuDown() {
if (subnetclient < 1) subnetclient = 254; if (subnetclient < 1) subnetclient = 254;
tftPrint(0, String(WiFi.localIP()[0]) + "." + String(WiFi.localIP()[1]) + "." + String(WiFi.localIP()[2]) + "." + String(subnetclient, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); tftPrint(0, String(WiFi.localIP()[0]) + "." + String(WiFi.localIP()[1]) + "." + String(WiFi.localIP()[2]) + "." + String(subnetclient, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break; break;
case ITEM5:
tftPrint(0, String(stationlistid, DEC), 155, 118, BackgroundColor, BackgroundColor, 28);
stationlistid --;
if (stationlistid == 0) stationlistid = 10;
tftPrint(0, String(stationlistid, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break;
} }
break; break;
} }
@@ -2124,6 +2140,11 @@ void DoMenu() {
tftPrint(0, myLanguage[language][58], 155, 78, ActiveColor, ActiveColorSmooth, 28); tftPrint(0, myLanguage[language][58], 155, 78, ActiveColor, ActiveColorSmooth, 28);
tftPrint(0, String(WiFi.localIP()[0]) + "." + String(WiFi.localIP()[1]) + "." + String(WiFi.localIP()[2]) + "." + String(subnetclient, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); tftPrint(0, String(WiFi.localIP()[0]) + "." + String(WiFi.localIP()[1]) + "." + String(WiFi.localIP()[2]) + "." + String(subnetclient, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break; break;
case ITEM5:
tftPrint(0, myLanguage[language][197], 155, 78, ActiveColor, ActiveColorSmooth, 28);
tftPrint(0, String(stationlistid, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break;
} }
break; break;
} }
+2 -1
View File
@@ -95,6 +95,7 @@ extern byte screensaverOptions[5];
extern byte screensaverset; extern byte screensaverset;
extern byte showmodulation; extern byte showmodulation;
extern byte showSWMIBand; extern byte showSWMIBand;
extern byte stationlistid;
extern int8_t CNold; extern int8_t CNold;
extern byte StereoLevel; extern byte StereoLevel;
extern byte StereoLevel; extern byte StereoLevel;
@@ -104,7 +105,7 @@ extern byte theme;
extern byte touchrotating; extern byte touchrotating;
extern byte unit; extern byte unit;
extern char programTypePrevious[18]; extern char programTypePrevious[18];
extern char radioIdPrevious[6]; extern char radioIdPrevious[7];
extern float batteryVold; extern float batteryVold;
extern float vPerold; extern float vPerold;
extern int ActiveColor; extern int ActiveColor;
+33 -17
View File
@@ -1,6 +1,6 @@
// [number of languages][number of texts] // [number of languages][number of texts]
static const char* const myLanguage[16][197] = { static const char* const myLanguage[16][198] = {
{ "English", // English { "English", // English
"Rotary direction changed", // 1 "Rotary direction changed", // 1
"Please release button", // 2 "Please release button", // 2
@@ -197,7 +197,8 @@ static const char* const myLanguage[16][197] = {
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF" // 196 "Auto sort AF", // 196
"Stationlist ID" // 197
}, },
{ "Nederlands", // Dutch { "Nederlands", // Dutch
@@ -396,7 +397,8 @@ static const char* const myLanguage[16][197] = {
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"VERBIND", // 195 "VERBIND", // 195
"Auto AF sorteren" // 196 "Auto AF sorteren", // 196
"Stationlist ID" // 197
}, },
{ "Polski", // Polish { "Polski", // Polish
@@ -595,7 +597,8 @@ static const char* const myLanguage[16][197] = {
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"LACZNOSC", // 195 "LACZNOSC", // 195
"Auto sort AF" // 196 "Auto sort AF", // 196
"Stationlist ID" // 197
}, },
{ "Hrvatski", // Croatian { "Hrvatski", // Croatian
@@ -794,7 +797,8 @@ static const char* const myLanguage[16][197] = {
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF" // 196 "Auto sort AF", // 196
"Stationlist ID" // 197
}, },
{ "Ελληνικά", // Greek { "Ελληνικά", // Greek
@@ -993,7 +997,8 @@ static const char* const myLanguage[16][197] = {
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"ΣΥΝΔΕΣΗ", // 195 "ΣΥΝΔΕΣΗ", // 195
"Auto sort AF" // 196 "Auto sort AF", // 196
"Stationlist ID" // 197
}, },
{ "Romana", // Romanian { "Romana", // Romanian
@@ -1192,7 +1197,8 @@ static const char* const myLanguage[16][197] = {
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF" // 196 "Auto sort AF", // 196
"Stationlist ID" // 197
}, },
{ "Deutsch", // German { "Deutsch", // German
@@ -1391,7 +1397,8 @@ static const char* const myLanguage[16][197] = {
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF" // 196 "Auto sort AF", // 196
"Stationlist ID" // 197
}, },
{ "Czech", // Czech { "Czech", // Czech
@@ -1590,7 +1597,8 @@ static const char* const myLanguage[16][197] = {
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF" // 196 "Auto sort AF", // 196
"Stationlist ID" // 197
}, },
{ "Slovak", // Slovak { "Slovak", // Slovak
@@ -1789,7 +1797,8 @@ static const char* const myLanguage[16][197] = {
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF" // 196 "Auto sort AF", // 196
"Stationlist ID" // 197
}, },
{ "Français", // French { "Français", // French
@@ -1988,7 +1997,8 @@ static const char* const myLanguage[16][197] = {
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF" // 196 "Auto sort AF", // 196
"Stationlist ID" // 197
}, },
{ "Български", // Bulgarian { "Български", // Bulgarian
@@ -2187,7 +2197,8 @@ static const char* const myLanguage[16][197] = {
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF" // 196 "Auto sort AF", // 196
"Stationlist ID" // 197
}, },
{ "Русский", // Russian { "Русский", // Russian
@@ -2386,7 +2397,8 @@ static const char* const myLanguage[16][197] = {
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"ПОДКЛЮЧЕНИЕ", // 195 "ПОДКЛЮЧЕНИЕ", // 195
"Auto sort AF" // 196 "Auto sort AF", // 196
"Stationlist ID" // 197
}, },
{ "Українська", // Ukranian { "Українська", // Ukranian
@@ -2585,7 +2597,8 @@ static const char* const myLanguage[16][197] = {
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"ПІДКЛЮЧЕННЯ", // 195 "ПІДКЛЮЧЕННЯ", // 195
"Auto sort AF" // 196 "Auto sort AF", // 196
"Stationlist ID" // 197
}, },
{ "Italiano", // Italian { "Italiano", // Italian
@@ -2784,7 +2797,8 @@ static const char* const myLanguage[16][197] = {
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF" // 196 "Auto sort AF", // 196
"Stationlist ID" // 197
}, },
{ "Simplified Chinese", // Simplified Chinese { "Simplified Chinese", // Simplified Chinese
@@ -2983,7 +2997,8 @@ static const char* const myLanguage[16][197] = {
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"CONNECT", // 195 "CONNECT", // 195
"Auto sort AF" // 196 "Auto sort AF", // 196
"Stationlist ID" // 197
}, },
{ "Norsk", // Norwegian { "Norsk", // Norwegian
@@ -3182,7 +3197,8 @@ static const char* const myLanguage[16][197] = {
"FM", // 193 "FM", // 193
"AM", // 194 "AM", // 194
"TILKOBLE", // 195 "TILKOBLE", // 195
"Auto sort AF" // 196 "Auto sort AF", // 196
"Stationlist ID" // 197
} }
}; };
+3 -5
View File
@@ -777,13 +777,11 @@ void ShowAFEON() {
for (byte i = 0; i < radio.af_counter; i++) { for (byte i = 0; i < radio.af_counter; i++) {
byte x = i - (afpagenr == 2 ? 30 : 0); byte x = i - (afpagenr == 2 ? 30 : 0);
if (radio.af[i].checked) { if (radio.af[i].checked) {
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, (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);
} 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, (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);
} 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, (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 (i == 29 + (afpagenr == 2 ? 30 : 0)) i = 254; if (i == 29 + (afpagenr == 2 ? 30 : 0)) i = 254;
} }
+1 -1
View File
@@ -45,7 +45,7 @@ extern byte licold;
extern byte MSold; extern byte MSold;
extern byte rdsblockold; extern byte rdsblockold;
extern char programTypePrevious[18]; extern char programTypePrevious[18];
extern char radioIdPrevious[6]; extern char radioIdPrevious[7];
extern int ActiveColor; extern int ActiveColor;
extern int ActiveColorSmooth; extern int ActiveColorSmooth;
extern int BackgroundColor; extern int BackgroundColor;