Changes for XDRGTK

- Changed bandscanner
- Enabled Advanced RDS viewer
This commit is contained in:
Sjef Verhoeven PE5PVB
2023-07-22 00:12:36 +02:00
parent ee53dd6a46
commit 279fc96c9a
3 changed files with 29 additions and 13 deletions

View File

@@ -609,7 +609,7 @@ void setup() {
}
void loop() {
if (digitalRead(BANDBUTTON) == LOW && XDRGTKUSB == false && XDRGTKTCP == false) BANDBUTTONPress();
if (digitalRead(BANDBUTTON) == LOW ) BANDBUTTONPress();
if (power == true) {
Communication();
@@ -1409,7 +1409,7 @@ void doStereoToggle() {
tft.drawSmoothCircle(81, 15, 9, BackgroundColor, BackgroundColor);
tft.drawSmoothCircle(91, 15, 10, BackgroundColor, BackgroundColor);
tft.drawSmoothCircle(91, 15, 9, BackgroundColor, BackgroundColor);
tft.drawSmoothCircle(86, 15, 10, SecondaryColor,SecondaryColorSmooth);
tft.drawSmoothCircle(86, 15, 10, SecondaryColor, SecondaryColorSmooth);
tft.drawSmoothCircle(86, 15, 9, SecondaryColor, SecondaryColorSmooth);
}
radio.setMono(true);
@@ -4996,6 +4996,8 @@ void XDRGTKRoutine() {
radio.clearRDS(fullsearchrds);
RDSstatus = false;
store = true;
aftest = true;
aftimer = millis();
break;
case 'Q':
@@ -5020,7 +5022,6 @@ void XDRGTKRoutine() {
scanner_filter = atol(buff + 2);
} else if (scanner_start > 0 && scanner_end > 0 && scanner_step > 0 && scanner_filter >= 0) {
frequencyold = frequency;
radio.SetFreq(scanner_start);
DataPrint("U");
if (scanner_filter < 0) {
BWset = 0;
@@ -5059,26 +5060,21 @@ void XDRGTKRoutine() {
}
doBW();
if (screenmute == false) {
ShowFreq(1);
tftPrint(0, myLanguage[language][34], 140, 68, ActiveColor, ActiveColorSmooth, FONT28);
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, FONT28);
}
frequencyold = frequency;
for (freq_scan = scanner_start; freq_scan <= scanner_end; freq_scan += scanner_step) {
radio.SetFreq(freq_scan);
DataPrint(String(freq_scan * 10, DEC));
DataPrint(" = ");
delay(10);
if (band == BAND_FM) radio.getStatus(SStatus, USN, WAM, OStatus, BW, MStatus, SNR); else radio.getStatusAM(SStatus, USN, WAM, OStatus, BW, MStatus, SNR);
DataPrint(String((SStatus / 10) + 10, DEC));
DataPrint(String((radio.CheckSignal(freq_scan) / 10) + 10, DEC));
DataPrint(", ");
}
DataPrint("\n");
if (screenmute == false) {
tft.setTextColor(BackgroundColor);
tftPrint(0, myLanguage[language][34], 140, 68, InsignificantColor, InsignificantColorSmooth, FONT28);
}
radio.SetFreq(frequencyold);
ShowFreq(0);
BuildDisplay();
radio.setFMABandw();
BWset = 0;
}

View File

@@ -50,6 +50,25 @@ void TEF6686::TestAFEON() {
if (!mute) devTEF_Audio_Set_Mute(0);
}
uint16_t TEF6686::CheckSignal(uint16_t frequency) {
uint16_t status;
uint16_t rdsStat;
uint16_t dummy1;
uint16_t dummy2;
uint8_t dummy3;
int16_t level;
uint16_t usn;
uint16_t wam;
int16_t offset;
byte timing = 0;
devTEF_Set_Cmd(TEF_FM, Cmd_Tune_To, 7, 3, frequency);
while (timing == 0 && !bitRead(timing, 15)) {
devTEF_Radio_Get_Quality_Status(&status, &level, &usn, &wam, &offset, &dummy1, &dummy2, &dummy3);
timing = lowByte(status);
}
return level;
}
uint16_t TEF6686::TestAF() {
if (af_counter != 0) {
uint16_t status;

View File

@@ -175,6 +175,7 @@ class TEF6686 {
eon_ eon[20];
rds_ rds;
logbook_ logbook[22];
uint16_t CheckSignal(uint16_t frequency);
uint16_t TestAF();
void TestAFEON();
void readRDS(bool showrdserrors);