Improved tuning speed on XDRGTK connection

Use screensaver for extra speed.
Removed the screenmute/softmute options to make room for antenna selector.
This commit is contained in:
Sjef Verhoeven PE5PVB
2024-02-04 15:52:45 +01:00
parent 892cb28860
commit 4915ce8b4f
2 changed files with 38 additions and 51 deletions

View File

@@ -742,6 +742,8 @@ void setup() {
}
void loop() {
Communication();
if (tot != 0) {
unsigned long totprobe = tot * 60000;
if (millis() >= tottimer + totprobe) deepSleep();
@@ -757,9 +759,7 @@ void loop() {
attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A), read_encoder, CHANGE);
attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_B), read_encoder, CHANGE);
}
rdsflagreset = false;
Communication();
}
if (!menu && !afscreen) {
@@ -2454,31 +2454,41 @@ void ShowFreq(int mode) {
detachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A));
detachInterrupt(digitalPinToInterrupt(ROTARY_PIN_B));
if (band > BAND_GAP) {
switch (band) {
case BAND_LW: frequency_AM = frequency_LW; break;
case BAND_MW: frequency_AM = frequency_MW; break;
case BAND_SW: frequency_AM = frequency_SW; break;
}
FrequencySprite.fillSprite(BackgroundColor);
FrequencySprite.setTextColor(FreqColor, FreqColorSmooth, false);
FrequencySprite.drawString(String(frequency_AM) + " ", 218, -6);
FrequencySprite.setTextColor(SecondaryColor, SecondaryColorSmooth, false);
FrequencySprite.setTextDatum(TL_DATUM);
FrequencySprite.loadFont(FONT16);
if (!screenmute) {
FrequencySprite.fillSprite(BackgroundColor);
FrequencySprite.setTextColor(FreqColor, FreqColorSmooth, false);
FrequencySprite.drawString(String(frequency_AM) + " ", 218, -6);
FrequencySprite.setTextColor(SecondaryColor, SecondaryColorSmooth, false);
FrequencySprite.setTextDatum(TL_DATUM);
FrequencySprite.loadFont(FONT16);
}
if (band == BAND_SW && showSWMIBand) {
DivdeSWMIBand();
updateSWMIBand();
}
if (!screenmute) FrequencySprite.pushSprite(46, 46);
FrequencySprite.setTextDatum(TR_DATUM);
switch (freqfont) {
case 0: FrequencySprite.loadFont(FREQFONT0); break;
case 1: FrequencySprite.loadFont(FREQFONT1); break;
case 2: FrequencySprite.loadFont(FREQFONT2); break;
case 3: FrequencySprite.loadFont(FREQFONT3); break;
case 4: FrequencySprite.loadFont(FREQFONT4); break;
if (!screenmute) {
FrequencySprite.pushSprite(46, 46);
FrequencySprite.setTextDatum(TR_DATUM);
switch (freqfont) {
case 0: FrequencySprite.loadFont(FREQFONT0); break;
case 1: FrequencySprite.loadFont(FREQFONT1); break;
case 2: FrequencySprite.loadFont(FREQFONT2); break;
case 3: FrequencySprite.loadFont(FREQFONT3); break;
case 4: FrequencySprite.loadFont(FREQFONT4); break;
}
}
freqold = frequency_AM;
} else {
unsigned int freq = 0;

View File

@@ -354,9 +354,9 @@ void XDRGTKRoutine() {
if (band != BAND_LW) {
band = BAND_LW;
SelectBand();
DataPrint("M1\n");
}
radio.SetFreqAM(frequency_LW);
DataPrint("M1\n");
}
if (freqtemp >= MWLowEdgeSet && freqtemp <= MWHighEdgeSet) {
frequency_AM = freqtemp;
@@ -365,9 +365,9 @@ void XDRGTKRoutine() {
if (band != BAND_MW) {
band = BAND_MW;
SelectBand();
DataPrint("M1\n");
}
radio.SetFreqAM(frequency_MW);
DataPrint("M1\n");
}
if (freqtemp >= SWLowEdgeSet && freqtemp <= SWHighEdgeSet) {
frequency_SW = freqtemp;
@@ -376,9 +376,9 @@ void XDRGTKRoutine() {
if (band != BAND_SW) {
band = BAND_SW;
SelectBand();
DataPrint("M1\n");
}
radio.SetFreqAM(frequency_SW);
DataPrint("M1\n");
}
if (freqtemp >= FREQ_FM_START && freqtemp <= FREQ_FM_END) {
frequency = freqtemp / 10;
@@ -386,9 +386,9 @@ void XDRGTKRoutine() {
if (band != BAND_FM) {
band = BAND_FM;
SelectBand();
DataPrint("M0\n");
}
radio.SetFreq(frequency);
DataPrint("M0\n");
}
if (band == BAND_FM) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n"); else DataPrint("T" + String(frequency_AM) + "\n");
@@ -516,53 +516,30 @@ void XDRGTKRoutine() {
radio.setVolume(VolSet);
radio.setSoftmuteFM(softmutefm);
radio.setSoftmuteAM(softmuteam);
if (screenmute) MuteScreen(0);
if (!usesquelch) radio.setUnMute();
break;
case 'Z':
byte iMSEQX;
iMSEQX = atol(buff + 1);
switch (iMSEQX) {
byte ANT;
ANT = atol(buff + 1);
switch (ANT) {
case 0:
MuteScreen(0);
LowLevelSet = EEPROM.readInt(EE_BYTE_LOWLEVELSET);
softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
softmutefm = EEPROM.readByte(EE_BYTE_SOFTMUTEFM);
radio.setSoftmuteFM(softmutefm);
radio.setSoftmuteAM(softmuteam);
// Antenna A
break;
case 1:
MuteScreen(1);
LowLevelSet = EEPROM.readInt(EE_BYTE_LOWLEVELSET);
softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
softmutefm = EEPROM.readByte(EE_BYTE_SOFTMUTEFM);
radio.setSoftmuteFM(softmutefm);
radio.setSoftmuteAM(softmuteam);
// Antenna B
break;
case 2:
MuteScreen(0);
LowLevelSet = EEPROM.readInt(EE_BYTE_LOWLEVELSET);
softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
softmutefm = EEPROM.readByte(EE_BYTE_SOFTMUTEFM);
radio.setSoftmuteFM(1);
radio.setSoftmuteAM(1);
// Antenna C
break;
case 3:
MuteScreen(1);
LowLevelSet = EEPROM.readInt(EE_BYTE_LOWLEVELSET);
softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
softmutefm = EEPROM.readByte(EE_BYTE_SOFTMUTEFM);
radio.setSoftmuteFM(1);
radio.setSoftmuteAM(1);
// Antenna D
break;
}
updateiMS();
updateEQ();
DataPrint("Z" + String(iMSEQX) + "\n");
DataPrint("Z" + String(ANT) + "\n");
break;
}
XDRGTKdata = false;