Merge branch 'main' into New_Model_DP_666

This commit is contained in:
Leon
2024-06-28 13:52:55 +08:00
11 changed files with 185 additions and 91 deletions
+101 -28
View File
@@ -4,9 +4,9 @@
#include <EEPROM.h> #include <EEPROM.h>
#include <Wire.h> #include <Wire.h>
#include <math.h> #include <math.h>
#include <ESP32Time.h> // https://github.com/fbiego/ESP32Time #include <ESP32Time.h> // https://github.com/fbiego/ESP32Time/archive/refs/heads/main.zip
#include <TFT_eSPI.h> // https://github.com/ohmytime/TFT_eSPI_DynamicSpeed (Modified version) #include <TFT_eSPI.h> // https://github.com/ohmytime/TFT_eSPI_DynamicSpeed/archive/refs/heads/master.zip (please then edit the User_Setup.h as described in the Wiki)
#include <Hash.h> // https://github.com/bbx10/Hash_tng #include <Hash.h> // https://github.com/bbx10/Hash_tng/archive/refs/heads/master.zip
#include "src/WiFiConnect.h" #include "src/WiFiConnect.h"
#include "src/WiFiConnectParam.h" #include "src/WiFiConnectParam.h"
#include "src/FONT16.h" #include "src/FONT16.h"
@@ -79,6 +79,7 @@ bool dropout;
bool dynamicPTYold; bool dynamicPTYold;
bool edgebeep; bool edgebeep;
bool externaltune; bool externaltune;
bool findMemoryAF;
bool flashing; bool flashing;
bool fmsi; bool fmsi;
bool fullsearchrds; bool fullsearchrds;
@@ -115,6 +116,7 @@ bool scanmute;
bool screenmute; bool screenmute;
bool screensavertriggered = false; bool screensavertriggered = false;
bool seek; bool seek;
bool seekinit;
bool setupmode; bool setupmode;
bool showclock; bool showclock;
bool usesquelch; bool usesquelch;
@@ -613,6 +615,7 @@ void setup() {
#endif #endif
} }
pinMode(BANDBUTTON, INPUT);
pinMode(MODEBUTTON, INPUT); pinMode(MODEBUTTON, INPUT);
pinMode(BWBUTTON, INPUT); pinMode(BWBUTTON, INPUT);
pinMode(ROTARY_BUTTON, INPUT); pinMode(ROTARY_BUTTON, INPUT);
@@ -917,7 +920,51 @@ void loop() {
if (!menu && !afscreen && !scandxmode) { if (!menu && !afscreen && !scandxmode) {
if (af != 0 && dropout && millis() >= aftimer + 1000) { if (af != 0 && dropout && millis() >= aftimer + 1000) {
aftimer = millis(); aftimer = millis();
if (radio.af_counter == 0) {
if (findMemoryAF && radio.rds.correctPI != 0) {
radio.setMute();
tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor);
SQ = true;
if (!screenmute) {
if (advancedRDS) {
tft.drawRoundRect(10, 30, 300, 170, 5, ActiveColor);
tft.fillRoundRect(12, 32, 296, 166, 5, BackgroundColor);
tftPrint(0, myLanguage[language][34], 160, 100, ActiveColor, ActiveColorSmooth, 28);
} else {
ShowFreq(1);
}
}
for (int x = 8750; x <= 10800; x += 10) {
if (rotary != 0 || digitalRead(BANDBUTTON) == LOW || digitalRead(MODEBUTTON) == LOW || digitalRead(BWBUTTON) == LOW || digitalRead(ROTARY_BUTTON) == LOW) break;
radio.SetFreq(x);
unsigned long millisold = millis();
while (millis() - millisold < 187) {
if (!screenmute && !advancedRDS) ShowModLevel();
}
if (radio.rds.correctPI == radio.getBlockA()) {
frequency = x;
break;
}
}
if (!screenmute) {
if (advancedRDS) {
leave = true;
BuildAdvancedRDS();
} else {
ShowFreq(0);
}
}
radio.setUnMute();
SQ = false;
tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor);
}
findMemoryAF = false;
} else {
frequency = radio.TestAF(); frequency = radio.TestAF();
}
if (freqold != frequency) { if (freqold != frequency) {
ShowFreq(0); ShowFreq(0);
dropout = true; dropout = true;
@@ -925,9 +972,13 @@ void loop() {
afmethodBold = true; afmethodBold = true;
radio.clearRDS(fullsearchrds); radio.clearRDS(fullsearchrds);
} }
if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n");
store = true;
} }
if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n");
if (screenmute) {
freqold = frequency;
dropout = false;
}
store = true;
} }
if (band == BAND_FM && af != 0 && radio.rds.correctPI != 0) { if (band == BAND_FM && af != 0 && radio.rds.correctPI != 0) {
@@ -943,6 +994,10 @@ void loop() {
radio.clearRDS(fullsearchrds); radio.clearRDS(fullsearchrds);
} }
if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n"); if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n");
if (screenmute) {
freqold = frequency;
dropout = false;
}
store = true; store = true;
} }
} }
@@ -960,6 +1015,10 @@ void loop() {
} }
if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n"); if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n");
store = true; store = true;
if (screenmute) {
freqold = frequency;
dropout = false;
}
} }
} }
} }
@@ -1655,6 +1714,8 @@ void ToggleBand(byte nowBand) {
} }
void BANDBUTTONPress() { void BANDBUTTONPress() {
if (seek) radio.setUnMute();
seek = false;
if (scandxmode) { if (scandxmode) {
cancelDXScan(); cancelDXScan();
} else { } else {
@@ -2125,7 +2186,6 @@ void SelectBand() {
if (afscreen || advancedRDS) BuildDisplay(); if (afscreen || advancedRDS) BuildDisplay();
if (band > BAND_GAP) { if (band > BAND_GAP) {
seek = false;
if (!screenmute) tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); if (!screenmute) tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor);
if (tunemode == TUNE_MI_BAND && band != BAND_SW) tunemode = TUNE_MAN; if (tunemode == TUNE_MI_BAND && band != BAND_SW) tunemode = TUNE_MAN;
BWreset = true; BWreset = true;
@@ -2239,12 +2299,13 @@ void SelectBand() {
} }
void BWButtonPress() { void BWButtonPress() {
if (seek) radio.setUnMute();
seek = false;
if (scandxmode) { if (scandxmode) {
cancelDXScan(); cancelDXScan();
} else { } else {
if (!usesquelch) radio.setUnMute(); if (!usesquelch) radio.setUnMute();
if (!menu) { if (!menu) {
seek = false;
if (!screenmute) tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); if (!screenmute) tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor);
unsigned long counterold = millis(); unsigned long counterold = millis();
unsigned long counter = millis(); unsigned long counter = millis();
@@ -2298,6 +2359,8 @@ void doStereoToggle() {
} }
void ModeButtonPress() { void ModeButtonPress() {
if (seek) radio.setUnMute();
seek = false;
if (scandxmode) { if (scandxmode) {
cancelDXScan(); cancelDXScan();
} else { } else {
@@ -2311,7 +2374,6 @@ void ModeButtonPress() {
BuildAFScreen(); BuildAFScreen();
} else { } else {
if (!menu) { if (!menu) {
seek = false;
if (!screenmute) { if (!screenmute) {
tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor);
} }
@@ -2481,6 +2543,8 @@ void RoundStep() {//todo air
} }
void ButtonPress() { void ButtonPress() {
if (seek) radio.setUnMute();
seek = false;
if (scandxmode) { if (scandxmode) {
cancelDXScan(); cancelDXScan();
} else { } else {
@@ -2555,7 +2619,6 @@ void ButtonPress() {
} }
} }
} else { } else {
seek = false;
if (!screenmute) tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); if (!screenmute) tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor);
unsigned long counterold = millis(); unsigned long counterold = millis();
unsigned long counter = millis(); unsigned long counter = millis();
@@ -2656,6 +2719,7 @@ void KeyUp() {
case TUNE_AUTO: case TUNE_AUTO:
direction = true; direction = true;
seek = true; seek = true;
seekinit = true;
Seek(direction); Seek(direction);
break; break;
@@ -2722,6 +2786,7 @@ void KeyDown() {
case TUNE_AUTO: case TUNE_AUTO:
direction = false; direction = false;
seek = true; seek = true;
seekinit = true;
Seek(direction); Seek(direction);
break; break;
@@ -2931,6 +2996,7 @@ void DoMemoryPosTune() {
memtune = true; memtune = true;
memreset = true; memreset = true;
rdsflagreset = false; rdsflagreset = false;
findMemoryAF = true;
ShowFreq(0); ShowFreq(0);
} }
@@ -3023,6 +3089,7 @@ void ShowFreq(int mode) {
} else if (mode == 1) { } else if (mode == 1) {
FrequencySprite.fillSprite(BackgroundColor); FrequencySprite.fillSprite(BackgroundColor);
FrequencySprite.pushSprite(46, 46); FrequencySprite.pushSprite(46, 46);
tftPrint(0, myLanguage[language][34], 146, 58, ActiveColor, ActiveColorSmooth, 28);
} }
FrequencySprite.unloadFont(); FrequencySprite.unloadFont();
} }
@@ -3042,11 +3109,11 @@ void ShowFreq(int mode) {
if (wifi) { if (wifi) {
Udp.beginPacket(remoteip, 9030); Udp.beginPacket(remoteip, 9030);
if (band == BAND_FM) { if (band == BAND_FM) {
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";freq=" + String(frequency) + "0000"); Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";freq=" + String(frequency) + "0000");
} else if (band == BAND_OIRT) { } else if (band == BAND_OIRT) {
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";freq=" + String(frequency_OIRT) + "0000"); Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";freq=" + String(frequency_OIRT) + "0000");
} else { } else {
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";freq=" + String(frequency_AM) + "000"); Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";freq=" + String(frequency_AM) + "000");
} }
Udp.endPacket(); Udp.endPacket();
} }
@@ -3132,7 +3199,7 @@ void ShowSignalLevel() {
if (wifi && millis() >= udptimer + 2000) { if (wifi && millis() >= udptimer + 2000) {
udptimer = millis(); udptimer = millis();
Udp.beginPacket(remoteip, 9030); Udp.beginPacket(remoteip, 9030);
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RcvLevel=" + String(SStatus / 10)); Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";RcvLevel=" + String(SStatus / 10));
Udp.endPacket(); Udp.endPacket();
} }
} }
@@ -3286,7 +3353,7 @@ void ShowBW() {
BWreset = false; BWreset = false;
if (wifi) { if (wifi) {
Udp.beginPacket(remoteip, 9030); Udp.beginPacket(remoteip, 9030);
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";bandwidth=" + String(BW * 1000)); Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";bandwidth=" + String(BW * 1000));
Udp.endPacket(); Udp.endPacket();
} }
} }
@@ -3323,12 +3390,12 @@ void ShowModLevel() {
} }
} }
tft.fillRect(16, 133, 2 * constrain(DisplayedSegments, 0, 53), 6, ModBarInsignificantColor); tft.fillRect(16, 133, 2 * constrain(DisplayedSegments, 0, 54), 6, ModBarInsignificantColor);
if (DisplayedSegments > 53) tft.fillRect(16 + 2 * 53, 133, 2 * (DisplayedSegments - 53), 6, ModBarSignificantColor); if (DisplayedSegments > 54) tft.fillRect(16 + 2 * 54, 133, 2 * (DisplayedSegments - 54), 6, ModBarSignificantColor);
int greyStart = 16 + 2 * DisplayedSegments; int greyStart = 16 + 2 * DisplayedSegments;
int greyWidth = 2 * (94 - DisplayedSegments); // Calculate the remaining width correctly int greyWidth = 2 * (94 - DisplayedSegments);
tft.fillRect(greyStart, 133, greyWidth, 6, GreyoutColor); tft.fillRect(greyStart, 133, greyWidth, 6, GreyoutColor);
int peakHoldPosition = 16 + 2 * constrain(peakholdold, 0, 93); int peakHoldPosition = 16 + 2 * constrain(peakholdold, 0, 93);
@@ -3507,14 +3574,14 @@ void doSquelch() {
void updateBW() {//todo air void updateBW() {//todo air
if (BWset == 0) { if (BWset == 0) {
if (!screenmute && !advancedRDS && !afscreen) { if (!screenmute && !advancedRDS && !afscreen) {
tft.drawRoundRect(248, 35, 71, 20, 5, ActiveColor); tft.drawRoundRect(247, 35, 71, 20, 5, ActiveColor);
tftPrint(0, "AUTO BW", 283, 38, ActiveColor, ActiveColorSmooth, 16); tftPrint(0, "AUTO BW", 282, 38, ActiveColor, ActiveColorSmooth, 16);
} }
radio.setFMABandw(); radio.setFMABandw();
} else { } else {
if (!screenmute && !advancedRDS && !afscreen) { if (!screenmute && !advancedRDS && !afscreen) {
tft.drawRoundRect(248, 35, 71, 20, 5, GreyoutColor); tft.drawRoundRect(247, 35, 71, 20, 5, GreyoutColor);
tftPrint(0, "AUTO BW", 283, 38, GreyoutColor, BackgroundColor, 16); tftPrint(0, "AUTO BW", 282, 38, GreyoutColor, BackgroundColor, 16);
} }
} }
} }
@@ -3678,11 +3745,6 @@ void doTuneMode() {
} else { } else {
tunemode = TUNE_AUTO; tunemode = TUNE_AUTO;
} }
if (stepsize != 0) {
stepsize = 0;
RoundStep();
ShowStepSize();
}
break; break;
case TUNE_MI_BAND: case TUNE_MI_BAND:
@@ -4065,6 +4127,15 @@ void EdgeBeeper() {
void Seek(bool mode) { void Seek(bool mode) {
radio.setMute(); radio.setMute();
if (seekinit) {
if (stepsize != 0) {
stepsize = 0;
RoundStep();
ShowStepSize();
}
seekinit = false;
}
if (!screenmute) { if (!screenmute) {
tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor);
} }
@@ -4161,6 +4232,7 @@ void MuteScreen(bool setting) {
if (!setting && screenmute) { if (!setting && screenmute) {
screenmute = false; screenmute = false;
setupmode = true; setupmode = true;
leave = true;
tft.writecommand(0x11); tft.writecommand(0x11);
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255)); analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
if (band < BAND_GAP) { if (band < BAND_GAP) {
@@ -4530,6 +4602,8 @@ void endMenu() {
void startFMDXScan() { void startFMDXScan() {
initdxscan = true; initdxscan = true;
if (menu) endMenu();
if (afscreen || advancedRDS) BuildDisplay(); if (afscreen || advancedRDS) BuildDisplay();
if (memorypos > scanstop || memorypos < scanstart) memorypos = scanstart; if (memorypos > scanstop || memorypos < scanstart) memorypos = scanstart;
@@ -4541,7 +4615,6 @@ void startFMDXScan() {
band = presets[memorypos].band; band = presets[memorypos].band;
SelectBand(); SelectBand();
} }
if (menu) endMenu();
DoMemoryPosTune(); DoMemoryPosTune();
} else { } else {
tunemode = TUNE_MAN; tunemode = TUNE_MAN;
@@ -4549,7 +4622,6 @@ void startFMDXScan() {
band = presets[memorypos].band; band = presets[memorypos].band;
SelectBand(); SelectBand();
} }
if (menu) endMenu();
TuneUp(); TuneUp();
ShowFreq(0); ShowFreq(0);
} }
@@ -4561,6 +4633,7 @@ void startFMDXScan() {
} }
scantimer = millis(); scantimer = millis();
scandxmode = true; scandxmode = true;
ShowTuneMode();
if (XDRGTKUSB || XDRGTKTCP) DataPrint("J1\n"); if (XDRGTKUSB || XDRGTKTCP) DataPrint("J1\n");
} }
+1 -1
View File
@@ -1707,7 +1707,7 @@
20235;9130;KXWT;TX 20235;9130;KXWT;TX
21043;9130;KZBV;CA 21043;9130;KZBV;CA
21118;9130;KZES;TX 21118;9130;KZES;TX
21303;9130;KZLV;TX 12103;9130;KZLV;TX
21941;9130;WAKJ;FL 21941;9130;WAKJ;FL
22080;9130;WAPS;OH 22080;9130;WAPS;OH
22127;9130;WARN;VA 22127;9130;WARN;VA
1 4432 9010 KAMY TX
1707 20235 9130 KXWT TX
1708 21043 9130 KZBV CA
1709 21118 9130 KZES TX
1710 21303 12103 9130 KZLV TX
1711 21941 9130 WAKJ FL
1712 22080 9130 WAPS OH
1713 22127 9130 WARN VA
+2 -2
View File
@@ -983,7 +983,7 @@
6870;9490;KECS;LA 6870;9490;KECS;LA
6911;9490;K235CP;ID 6911;9490;K235CP;ID
7163;9490;KENZ;UT 7163;9490;KENZ;UT
7177;9490;KEON;TX 17523;9490;KEON;TX
7288;9490;KESU;HI 7288;9490;KESU;HI
9165;9490;KHMZ;TX 9165;9490;KHMZ;TX
9286;9490;KHRQ;CA 9286;9490;KHRQ;CA
@@ -1938,7 +1938,7 @@
8489;9570;KGMZ;CA 8489;9570;KGMZ;CA
10285;9570;KJEB;WA 10285;9570;KJEB;WA
10333;9570;KJFX;CA 10333;9570;KJFX;CA
10865;9570;KKAJ;OK 61576;9570;KKAJ;OK
11045;9570;KKHH;TX 11045;9570;KKHH;TX
11230;9570;KKOK;MN 11230;9570;KKOK;MN
11341;9570;KKSR;WA 11341;9570;KKSR;WA
1 4543 9410 K231BH OK
983 6870 9490 KECS LA
984 6911 9490 K235CP ID
985 7163 9490 KENZ UT
986 7177 17523 9490 KEON TX
987 7288 9490 KESU HI
988 9165 9490 KHMZ TX
989 9286 9490 KHRQ CA
1938 8489 9570 KGMZ CA
1939 10285 9570 KJEB WA
1940 10333 9570 KJFX CA
1941 10865 61576 9570 KKAJ OK
1942 11045 9570 KKHH TX
1943 11230 9570 KKOK MN
1944 11341 9570 KKSR WA
+1 -1
View File
@@ -8,7 +8,7 @@
5282;9610;KBTQ;TX 5282;9610;KBTQ;TX
5316;9610;KSME;CO 5316;9610;KSME;CO
5453;9610;KIBT;CO 5453;9610;KIBT;CO
5531;9610;KCDF;TX 53712;9610;KCDF;TX
5563;9610;KCEL;CA 5563;9610;KCEL;CA
5628;9610;WSRS;MA 5628;9610;WSRS;MA
5890;9610;KISO;NE 5890;9610;KISO;NE
1 4452 9610 KANS KS
8 5282 9610 KBTQ TX
9 5316 9610 KSME CO
10 5453 9610 KIBT CO
11 5531 53712 9610 KCDF TX
12 5563 9610 KCEL CA
13 5628 9610 WSRS MA
14 5890 9610 KISO NE
+10 -3
View File
@@ -9,6 +9,13 @@ unsigned long rdstimer = 0;
unsigned long bitStartTime = 0; unsigned long bitStartTime = 0;
bool lastBitState = false; bool lastBitState = false;
uint16_t TEF6686::getBlockA(void) {
uint16_t blockA, dummy;
devTEF_Radio_Get_RDS_Status(&dummy, &blockA, &dummy, &dummy, &dummy, &dummy);
return blockA;
}
void TEF6686::TestAFEON() { void TEF6686::TestAFEON() {
uint16_t status; uint16_t status;
uint16_t dummy1; uint16_t dummy1;
@@ -31,7 +38,7 @@ void TEF6686::TestAFEON() {
} }
if (afoffset > -125 || afoffset < 125) { if (afoffset > -125 || afoffset < 125) {
devTEF_Set_Cmd(TEF_FM, Cmd_Tune_To, 7, 4, af[x].frequency); devTEF_Set_Cmd(TEF_FM, Cmd_Tune_To, 7, 4, af[x].frequency);
delay(200); delay(187);
devTEF_Radio_Get_RDS_Status(&rds.rdsStat, &rds.rdsA, &rds.rdsB, &rds.rdsC, &rds.rdsD, &rds.rdsErr); devTEF_Radio_Get_RDS_Status(&rds.rdsStat, &rds.rdsA, &rds.rdsB, &rds.rdsC, &rds.rdsD, &rds.rdsErr);
if (rds.rdsStat & (1 << 9)) { if (rds.rdsStat & (1 << 9)) {
@@ -49,7 +56,7 @@ void TEF6686::TestAFEON() {
} }
} }
devTEF_Set_Cmd(TEF_FM, Cmd_Tune_To, 7, 4, currentfreq); devTEF_Set_Cmd(TEF_FM, Cmd_Tune_To, 7, 4, currentfreq);
if (!mute) setUnMute(); setUnMute();
} }
uint16_t TEF6686::TestAF() { uint16_t TEF6686::TestAF() {
@@ -97,7 +104,7 @@ uint16_t TEF6686::TestAF() {
if (af_counter != 0 && af[highestIndex].afvalid && af[highestIndex].score > (currentlevel - currentusn - currentwam) && (af[highestIndex].score - (currentlevel - currentusn - currentwam)) >= 70) { if (af_counter != 0 && af[highestIndex].afvalid && af[highestIndex].score > (currentlevel - currentusn - currentwam) && (af[highestIndex].score - (currentlevel - currentusn - currentwam)) >= 70) {
devTEF_Set_Cmd(TEF_FM, Cmd_Tune_To, 7, 4, af[highestIndex].frequency); devTEF_Set_Cmd(TEF_FM, Cmd_Tune_To, 7, 4, af[highestIndex].frequency);
delay(200); delay(187);
devTEF_Radio_Get_RDS_Status(&rds.rdsStat, &rds.rdsA, &rds.rdsB, &rds.rdsC, &rds.rdsD, &rds.rdsErr); devTEF_Radio_Get_RDS_Status(&rds.rdsStat, &rds.rdsA, &rds.rdsB, &rds.rdsC, &rds.rdsD, &rds.rdsErr);
if (rds.rdsStat & (1 << 9)) { if (rds.rdsStat & (1 << 9)) {
if ((afmethodB && rds.afreg ? (((rds.rdsA >> 8) & 0xF) > 2 && ((rds.correctPI >> 8) & 0xF) > 2 && ((rds.rdsA >> 12) & 0xF) == ((rds.correctPI >> 12) & 0xF) && (rds.rdsA & 0xFF) == (rds.correctPI & 0xFF)) || rds.rdsA == rds.correctPI : rds.rdsA == rds.correctPI)) { if ((afmethodB && rds.afreg ? (((rds.rdsA >> 8) & 0xF) > 2 && ((rds.correctPI >> 8) & 0xF) > 2 && ((rds.rdsA >> 12) & 0xF) == ((rds.correctPI >> 12) & 0xF) && (rds.rdsA & 0xFF) == (rds.correctPI & 0xFF)) || rds.rdsA == rds.correctPI : rds.rdsA == rds.correctPI)) {
+1
View File
@@ -708,6 +708,7 @@ class TEF6686 {
void setUnMute(); void setUnMute();
void setVolume(int8_t volume); void setVolume(int8_t volume);
void tone(uint16_t time, int16_t amplitude, uint16_t frequency); void tone(uint16_t time, int16_t amplitude, uint16_t frequency);
uint16_t getBlockA(void);
String trimTrailingSpaces(String str); String trimTrailingSpaces(String str);
uint8_t af_counter; uint8_t af_counter;
uint8_t eon_counter; uint8_t eon_counter;
+11
View File
@@ -515,6 +515,17 @@ void XDRGTKRoutine() {
DataPrint("J" + String(scandxtemp) + "\n"); DataPrint("J" + String(scandxtemp) + "\n");
break; break;
case 'K':
byte scanholdtemp;
scanholdtemp = atol(buff + 1);
if (scanholdtemp < 31) {
scanhold = scanholdtemp;
EEPROM.writeByte(EE_BYTE_SCANHOLD, scanhold);
EEPROM.commit();
}
DataPrint("K" + String(scanhold) + "\n");
break;
case 'M': case 'M':
byte XDRband; byte XDRband;
XDRband = atol(buff + 1); XDRband = atol(buff + 1);
+1
View File
@@ -47,6 +47,7 @@ extern byte iMSEQ;
extern byte iMSset; extern byte iMSset;
extern byte language; extern byte language;
extern byte memorypos; extern byte memorypos;
extern byte scanhold;
extern byte stepsize; extern byte stepsize;
extern byte subnetclient; extern byte subnetclient;
extern byte TEF; extern byte TEF;
+9 -8
View File
@@ -422,7 +422,7 @@ static const uint8_t TEFLogo[] PROGMEM = {
static const uint8_t RDSLogo[] PROGMEM = { static const uint8_t RDSLogo[] PROGMEM = {
0x01, 0xf8, 0x0f, 0xe0, 0x00, 0x01, 0xf8, 0x0f, 0xe0, 0x00,
0x02, 0x00, 0x30, 0x18, 0x00, 0x07, 0x80, 0x30, 0x18, 0x00,
0x0c, 0x30, 0x43, 0xc6, 0x00, 0x0c, 0x30, 0x43, 0xc6, 0x00,
0x11, 0xc0, 0x8c, 0x31, 0x00, 0x11, 0xc0, 0x8c, 0x31, 0x00,
0x26, 0x01, 0x31, 0x8c, 0x80, 0x26, 0x01, 0x31, 0x8c, 0x80,
@@ -491,11 +491,11 @@ static const uint8_t WiFi1[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00 0x00, 0x08, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
}; };
static const uint8_t WiFi2[] PROGMEM = { static const uint8_t WiFi2[] PROGMEM = {
@@ -513,7 +513,6 @@ static const uint8_t WiFi2[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x7f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00,
0x00, 0xff, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00,
@@ -523,7 +522,8 @@ static const uint8_t WiFi2[] PROGMEM = {
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00 0x00, 0x08, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
}; };
static const uint8_t WiFi3[] PROGMEM = { static const uint8_t WiFi3[] PROGMEM = {
@@ -534,7 +534,6 @@ static const uint8_t WiFi3[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x7f, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00,
0x01, 0xff, 0xc0, 0x00, 0x01, 0xff, 0xc0, 0x00,
0x03, 0xff, 0xe0, 0x00, 0x03, 0xff, 0xe0, 0x00,
@@ -551,7 +550,8 @@ static const uint8_t WiFi3[] PROGMEM = {
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00 0x00, 0x08, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
}; };
static const uint8_t WiFi4[] PROGMEM = { static const uint8_t WiFi4[] PROGMEM = {
@@ -578,7 +578,8 @@ static const uint8_t WiFi4[] PROGMEM = {
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00 0x00, 0x08, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
}; };
static const uint16_t openradiologo[] PROGMEM = { static const uint16_t openradiologo[] PROGMEM = {
+38 -38
View File
@@ -1,7 +1,7 @@
#ifndef LANGUAGE_H #ifndef LANGUAGE_H
#define LANGUAGE_H #define LANGUAGE_H
#define VERSION "v2.10 RC14" #define VERSION "v2.11"
// [number of languages][number of texts] // [number of languages][number of texts]
@@ -1374,8 +1374,8 @@ static const char* const myLanguage[18][263] PROGMEM = {
"Alegeți Limba", // 40 "Alegeți Limba", // 40
"Apasați MODE ptr MEMORARE și ieșire", // 41 "Apasați MODE ptr MEMORARE și ieșire", // 41
"Pornit", // 42 "Pornit", // 42
"lipsă zgomot FM", // 43 "Lipsă zgomot FM", // 43
"lipsă zgomot AM", // 44 "Lipsă zgomot AM", // 44
"Beep la capătul benzii", // 45 "Beep la capătul benzii", // 45
"Regiune", // 46 "Regiune", // 46
"Europa", // 47 "Europa", // 47
@@ -1385,7 +1385,7 @@ static const char* const myLanguage[18][263] PROGMEM = {
"Wi-Fi activ", // 51 "Wi-Fi activ", // 51
"Configurare Wi-Fi", // 52 "Configurare Wi-Fi", // 52
"Conectare la: ", // 53 "Conectare la: ", // 53
"ptr configurare Wi-Fi", // 54 "Ptr configurare Wi-Fi", // 54
"Incerc conectarea la Wi-Fi", // 55 "Incerc conectarea la Wi-Fi", // 55
"Fară succes!", // 56 "Fară succes!", // 56
"Conectat!", // 57 "Conectat!", // 57
@@ -1393,16 +1393,16 @@ static const char* const myLanguage[18][263] PROGMEM = {
"Arată lungimea de undă SW", // 59 "Arată lungimea de undă SW", // 59
"Filtru RDS", // 60 "Filtru RDS", // 60
"Arată erorile PI", // 61 "Arată erorile PI", // 61
"folosește squelch", // 62 "Folosește squelch", // 62
"Contor modulație", // 63 "Contor modulație", // 63
"Eliminator de zgomot AM", // 64 "Eliminator de zgomot AM", // 64
"Eliminator de zgomot FM", // 65 "Eliminator de zgomot FM", // 65
"Revenire la setările de fabrică", // 66 "Revenire la setările de fabrică", // 66
"ieșire Audio", // 67 "Ieșire Audio", // 67
"Permite reglarea in timp ce ecranul este oprit", // 68 "Permite reglarea in timp ce ecranul este oprit", // 68
"Ecran inversat", // 69 "Ecran inversat", // 69
"Despre software", // 70 "Despre software", // 70
"cod principal:", // 71 "Cod principal:", // 71
"Contribuitori:", // 72 "Contribuitori:", // 72
"Necunoscut", // 73 "Necunoscut", // 73
"Opțiuni economizor ecran", // 74 "Opțiuni economizor ecran", // 74
@@ -1415,7 +1415,7 @@ static const char* const myLanguage[18][263] PROGMEM = {
"Viteză SPI dinamică", // 81 "Viteză SPI dinamică", // 81
"Sensibilitatea scanării", // 82 "Sensibilitatea scanării", // 82
"NICI UNUL", // 83 "NICI UNUL", // 83
" versiune Software", // 84 "Versiune Software", // 84
"Font Frecvență", // 85 "Font Frecvență", // 85
"Auto", // 86 "Auto", // 86
"AF nu este disponibil", // 87 "AF nu este disponibil", // 87
@@ -1425,12 +1425,12 @@ static const char* const myLanguage[18][263] PROGMEM = {
"Screensaver", // 91 "Screensaver", // 91
"Sec", // 92 "Sec", // 92
"Apăsați BAND pentru inchidere", // 93 "Apăsați BAND pentru inchidere", // 93
"luminozitate 1%", // 94 "Luminozitate 1%", // 94
"luminozitate 25%", // 95 "Luminozitate 25%", // 95
"luminozitate 50%", // 96 "Luminozitate 50%", // 96
"Decalaj de nivel AM RF", // 97 "Decalaj de nivel AM RF", // 97
"unitați S-metru", // 98 "Unitați S-metru", // 98
"folosești AF", // 99 "Folosești AF", // 99
"Selectare banda FM", // 100 "Selectare banda FM", // 100
"Selectare banda AM", // 101 "Selectare banda AM", // 101
"LW", // 102 "LW", // 102
@@ -1439,7 +1439,7 @@ static const char* const myLanguage[18][263] PROGMEM = {
"FM", // 105 "FM", // 105
"OIRT", // 106 "OIRT", // 106
"Rotire când ecranul este oprit", // 107 "Rotire când ecranul este oprit", // 107
"selectare Model", // 108 "Selectare Model", // 108
"Bază (ILI9341)", // 109 "Bază (ILI9341)", // 109
"Portabil (ILI9341)", // 110 "Portabil (ILI9341)", // 110
"Portabil touch (ILI9341)", // 111 "Portabil touch (ILI9341)", // 111
@@ -1500,14 +1500,14 @@ static const char* const myLanguage[18][263] PROGMEM = {
"Identificare", // 166 "Identificare", // 166
"Cumpără", // 167 "Cumpără", // 167
"Preiau date", // 168 "Preiau date", // 168
"pași MW impliciți", // 169 "Pași MW impliciți", // 169
"Tangerine", // 170 "Tangerine", // 170
"Ocean", // 171 "Ocean", // 171
"Indigo", // 172 "Indigo", // 172
"Opțiuni Baterie", // 173 "Opțiuni Baterie", // 173
"Arată tensiunea", // 174 "Arată tensiunea", // 174
"Arată procente", // 175 "Arată procente", // 175
"porțiune RT", // 176 "Porțiune RT", // 176
"Setări de bază", // 177 "Setări de bază", // 177
"Setări Audio", // 178 "Setări Audio", // 178
"Setări ecran", // 179 "Setări ecran", // 179
@@ -2090,34 +2090,34 @@ static const char* const myLanguage[18][263] PROGMEM = {
"Vypnout displej", // 226 "Vypnout displej", // 226
"Zakázáno", // 227 "Zakázáno", // 227
"Nedefinovaný pr.", // 228 "Nedefinovaný pr.", // 228
"Zpravy", // 229 "Zprávy", // 229
"Publicistika", // 230 "Publicistika", // 230
"Informace", // 231 "Informace", // 231
"Sport", // 232 "Sport", // 232
"Vzdelani", // 233 "Vzdělání", // 233
"Drama", // 234 "Drama", // 234
"Kultura", // 235 "Kultura", // 235
"Veda", // 236 "Věda", // 236
"Ruzne Zanry", // 237 "Různé žánry", // 237
"Popova Hudba", // 238 "Popová hudba", // 238
"Rockova Hudba", // 239 "Rocková hudba", // 239
"Oddychova Hudba", // 240 "Oddychová hudba", // 240
"Klasicka Hudba", // 241 "Klasická hudba", // 241
"Vazna Hudba", // 242 "Vážná hudba", // 242
"Jina Hudba", // 243 "Jiná hudba", // 243
"Pocasi", // 244 "Počasí", // 244
"Finance", // 245 "Finance", // 245
"Detsky Program", // 246 "Dětský program", // 246
"Spolecenska Tem.", // 247 "Společenská tém.", // 247
"Nabozens. Temata", // 248 "Naboženství", // 248
"Telefonaty", // 249 "Telefonáty", // 249
"Cestovani", // 250 "Cestování", // 250
"Zabava", // 251 "Zábava", // 251
"Jazzova Hudba", // 252 "Jazzová hudba", // 252
"Country Hudba", // 253 "Country hudba", // 253
"Narodni Hudba", // 254 "Národní hudba", // 254
"Oldies Hudba", // 255 "Oldies hudba", // 255
"Folkova Hudba", // 256 "Folková hudba", // 256
"Dokumenty", // 257 "Dokumenty", // 257
"Alarm Test", // 258 "Alarm Test", // 258
"Alarm Alarm !", // 259 "Alarm Alarm !", // 259
+7 -7
View File
@@ -269,7 +269,7 @@ void doAF() {
if (radio.af_counter != af_counterold && radio.rds.hasAF) { if (radio.af_counter != af_counterold && radio.rds.hasAF) {
if (wifi) { if (wifi) {
Udp.beginPacket(remoteip, 9030); Udp.beginPacket(remoteip, 9030);
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";AF="); Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";AF=");
for (byte af_scan = 0; af_scan < radio.af_counter; af_scan++) { for (byte af_scan = 0; af_scan < radio.af_counter; af_scan++) {
if (wifi) { if (wifi) {
@@ -303,7 +303,7 @@ void showECC() {
if (wifi) { if (wifi) {
Udp.beginPacket(remoteip, 9030); Udp.beginPacket(remoteip, 9030);
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";ECC="); Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";ECC=");
if (radio.rds.ECC < 0x10) Udp.print("0"); if (radio.rds.ECC < 0x10) Udp.print("0");
Udp.print(String(radio.rds.ECC, HEX)); Udp.print(String(radio.rds.ECC, HEX));
Udp.endPacket(); Udp.endPacket();
@@ -629,7 +629,7 @@ void showPI() {
if (wifi) { if (wifi) {
Udp.beginPacket(remoteip, 9030); Udp.beginPacket(remoteip, 9030);
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";PI=" + String(radio.rds.picode, 4)); Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";PI=" + String(radio.rds.picode, 4));
Udp.endPacket(); Udp.endPacket();
} }
} }
@@ -659,7 +659,7 @@ void showPTY() {
if (wifi) { if (wifi) {
Udp.beginPacket(remoteip, 9030); Udp.beginPacket(remoteip, 9030);
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";PTY="); Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";PTY=");
Udp.print(String(radio.rds.stationTypeCode, HEX)); Udp.print(String(radio.rds.stationTypeCode, HEX));
Udp.endPacket(); Udp.endPacket();
} }
@@ -719,7 +719,7 @@ void showPS() {
if (wifi && radio.rds.stationName.length() > 0 && PSold != radio.rds.stationName) { if (wifi && radio.rds.stationName.length() > 0 && PSold != radio.rds.stationName) {
Udp.beginPacket(remoteip, 9030); Udp.beginPacket(remoteip, 9030);
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";PS="); Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";PS=");
char PShex[9]; char PShex[9];
radio.rds.stationName.toCharArray(PShex, 9); radio.rds.stationName.toCharArray(PShex, 9);
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
@@ -730,8 +730,8 @@ void showPS() {
} }
Udp.endPacket(); Udp.endPacket();
} }
PSold = radio.rds.stationName;
} }
PSold = radio.rds.stationName;
} }
} }
@@ -857,7 +857,7 @@ void showRadioText() {
if (wifi) { if (wifi) {
Udp.beginPacket(remoteip, 9030); Udp.beginPacket(remoteip, 9030);
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RT1="); Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";RT1=");
char RThex[65]; char RThex[65];
radio.rds.stationText.toCharArray(RThex, 65); radio.rds.stationText.toCharArray(RThex, 65);
for (int i = 0; i < 64; i++) { for (int i = 0; i < 64; i++) {