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:
+26
-16
@@ -742,6 +742,8 @@ void setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
Communication();
|
||||||
|
|
||||||
if (tot != 0) {
|
if (tot != 0) {
|
||||||
unsigned long totprobe = tot * 60000;
|
unsigned long totprobe = tot * 60000;
|
||||||
if (millis() >= tottimer + totprobe) deepSleep();
|
if (millis() >= tottimer + totprobe) deepSleep();
|
||||||
@@ -757,9 +759,7 @@ void loop() {
|
|||||||
attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A), read_encoder, CHANGE);
|
attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A), read_encoder, CHANGE);
|
||||||
attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_B), read_encoder, CHANGE);
|
attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_B), read_encoder, CHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
rdsflagreset = false;
|
rdsflagreset = false;
|
||||||
Communication();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!menu && !afscreen) {
|
if (!menu && !afscreen) {
|
||||||
@@ -2454,31 +2454,41 @@ void ShowFreq(int mode) {
|
|||||||
|
|
||||||
detachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A));
|
detachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A));
|
||||||
detachInterrupt(digitalPinToInterrupt(ROTARY_PIN_B));
|
detachInterrupt(digitalPinToInterrupt(ROTARY_PIN_B));
|
||||||
|
|
||||||
if (band > BAND_GAP) {
|
if (band > BAND_GAP) {
|
||||||
switch (band) {
|
switch (band) {
|
||||||
case BAND_LW: frequency_AM = frequency_LW; break;
|
case BAND_LW: frequency_AM = frequency_LW; break;
|
||||||
case BAND_MW: frequency_AM = frequency_MW; break;
|
case BAND_MW: frequency_AM = frequency_MW; break;
|
||||||
case BAND_SW: frequency_AM = frequency_SW; break;
|
case BAND_SW: frequency_AM = frequency_SW; break;
|
||||||
}
|
}
|
||||||
FrequencySprite.fillSprite(BackgroundColor);
|
|
||||||
FrequencySprite.setTextColor(FreqColor, FreqColorSmooth, false);
|
if (!screenmute) {
|
||||||
FrequencySprite.drawString(String(frequency_AM) + " ", 218, -6);
|
FrequencySprite.fillSprite(BackgroundColor);
|
||||||
FrequencySprite.setTextColor(SecondaryColor, SecondaryColorSmooth, false);
|
FrequencySprite.setTextColor(FreqColor, FreqColorSmooth, false);
|
||||||
FrequencySprite.setTextDatum(TL_DATUM);
|
FrequencySprite.drawString(String(frequency_AM) + " ", 218, -6);
|
||||||
FrequencySprite.loadFont(FONT16);
|
FrequencySprite.setTextColor(SecondaryColor, SecondaryColorSmooth, false);
|
||||||
|
FrequencySprite.setTextDatum(TL_DATUM);
|
||||||
|
FrequencySprite.loadFont(FONT16);
|
||||||
|
}
|
||||||
|
|
||||||
if (band == BAND_SW && showSWMIBand) {
|
if (band == BAND_SW && showSWMIBand) {
|
||||||
DivdeSWMIBand();
|
DivdeSWMIBand();
|
||||||
updateSWMIBand();
|
updateSWMIBand();
|
||||||
}
|
}
|
||||||
if (!screenmute) FrequencySprite.pushSprite(46, 46);
|
|
||||||
FrequencySprite.setTextDatum(TR_DATUM);
|
if (!screenmute) {
|
||||||
switch (freqfont) {
|
FrequencySprite.pushSprite(46, 46);
|
||||||
case 0: FrequencySprite.loadFont(FREQFONT0); break;
|
FrequencySprite.setTextDatum(TR_DATUM);
|
||||||
case 1: FrequencySprite.loadFont(FREQFONT1); break;
|
|
||||||
case 2: FrequencySprite.loadFont(FREQFONT2); break;
|
switch (freqfont) {
|
||||||
case 3: FrequencySprite.loadFont(FREQFONT3); break;
|
case 0: FrequencySprite.loadFont(FREQFONT0); break;
|
||||||
case 4: FrequencySprite.loadFont(FREQFONT4); 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;
|
freqold = frequency_AM;
|
||||||
} else {
|
} else {
|
||||||
unsigned int freq = 0;
|
unsigned int freq = 0;
|
||||||
|
|||||||
+12
-35
@@ -354,9 +354,9 @@ void XDRGTKRoutine() {
|
|||||||
if (band != BAND_LW) {
|
if (band != BAND_LW) {
|
||||||
band = BAND_LW;
|
band = BAND_LW;
|
||||||
SelectBand();
|
SelectBand();
|
||||||
|
DataPrint("M1\n");
|
||||||
}
|
}
|
||||||
radio.SetFreqAM(frequency_LW);
|
radio.SetFreqAM(frequency_LW);
|
||||||
DataPrint("M1\n");
|
|
||||||
}
|
}
|
||||||
if (freqtemp >= MWLowEdgeSet && freqtemp <= MWHighEdgeSet) {
|
if (freqtemp >= MWLowEdgeSet && freqtemp <= MWHighEdgeSet) {
|
||||||
frequency_AM = freqtemp;
|
frequency_AM = freqtemp;
|
||||||
@@ -365,9 +365,9 @@ void XDRGTKRoutine() {
|
|||||||
if (band != BAND_MW) {
|
if (band != BAND_MW) {
|
||||||
band = BAND_MW;
|
band = BAND_MW;
|
||||||
SelectBand();
|
SelectBand();
|
||||||
|
DataPrint("M1\n");
|
||||||
}
|
}
|
||||||
radio.SetFreqAM(frequency_MW);
|
radio.SetFreqAM(frequency_MW);
|
||||||
DataPrint("M1\n");
|
|
||||||
}
|
}
|
||||||
if (freqtemp >= SWLowEdgeSet && freqtemp <= SWHighEdgeSet) {
|
if (freqtemp >= SWLowEdgeSet && freqtemp <= SWHighEdgeSet) {
|
||||||
frequency_SW = freqtemp;
|
frequency_SW = freqtemp;
|
||||||
@@ -376,9 +376,9 @@ void XDRGTKRoutine() {
|
|||||||
if (band != BAND_SW) {
|
if (band != BAND_SW) {
|
||||||
band = BAND_SW;
|
band = BAND_SW;
|
||||||
SelectBand();
|
SelectBand();
|
||||||
|
DataPrint("M1\n");
|
||||||
}
|
}
|
||||||
radio.SetFreqAM(frequency_SW);
|
radio.SetFreqAM(frequency_SW);
|
||||||
DataPrint("M1\n");
|
|
||||||
}
|
}
|
||||||
if (freqtemp >= FREQ_FM_START && freqtemp <= FREQ_FM_END) {
|
if (freqtemp >= FREQ_FM_START && freqtemp <= FREQ_FM_END) {
|
||||||
frequency = freqtemp / 10;
|
frequency = freqtemp / 10;
|
||||||
@@ -386,9 +386,9 @@ void XDRGTKRoutine() {
|
|||||||
if (band != BAND_FM) {
|
if (band != BAND_FM) {
|
||||||
band = BAND_FM;
|
band = BAND_FM;
|
||||||
SelectBand();
|
SelectBand();
|
||||||
|
DataPrint("M0\n");
|
||||||
}
|
}
|
||||||
radio.SetFreq(frequency);
|
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");
|
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.setVolume(VolSet);
|
||||||
radio.setSoftmuteFM(softmutefm);
|
radio.setSoftmuteFM(softmutefm);
|
||||||
radio.setSoftmuteAM(softmuteam);
|
radio.setSoftmuteAM(softmuteam);
|
||||||
if (screenmute) MuteScreen(0);
|
|
||||||
if (!usesquelch) radio.setUnMute();
|
if (!usesquelch) radio.setUnMute();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Z':
|
case 'Z':
|
||||||
byte iMSEQX;
|
byte ANT;
|
||||||
iMSEQX = atol(buff + 1);
|
ANT = atol(buff + 1);
|
||||||
switch (iMSEQX) {
|
switch (ANT) {
|
||||||
case 0:
|
case 0:
|
||||||
MuteScreen(0);
|
// Antenna A
|
||||||
LowLevelSet = EEPROM.readInt(EE_BYTE_LOWLEVELSET);
|
|
||||||
softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
|
|
||||||
softmutefm = EEPROM.readByte(EE_BYTE_SOFTMUTEFM);
|
|
||||||
radio.setSoftmuteFM(softmutefm);
|
|
||||||
radio.setSoftmuteAM(softmuteam);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
MuteScreen(1);
|
// Antenna B
|
||||||
LowLevelSet = EEPROM.readInt(EE_BYTE_LOWLEVELSET);
|
|
||||||
softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
|
|
||||||
softmutefm = EEPROM.readByte(EE_BYTE_SOFTMUTEFM);
|
|
||||||
radio.setSoftmuteFM(softmutefm);
|
|
||||||
radio.setSoftmuteAM(softmuteam);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
MuteScreen(0);
|
// Antenna C
|
||||||
LowLevelSet = EEPROM.readInt(EE_BYTE_LOWLEVELSET);
|
|
||||||
softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
|
|
||||||
softmutefm = EEPROM.readByte(EE_BYTE_SOFTMUTEFM);
|
|
||||||
radio.setSoftmuteFM(1);
|
|
||||||
radio.setSoftmuteAM(1);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
MuteScreen(1);
|
// Antenna D
|
||||||
LowLevelSet = EEPROM.readInt(EE_BYTE_LOWLEVELSET);
|
|
||||||
softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
|
|
||||||
softmutefm = EEPROM.readByte(EE_BYTE_SOFTMUTEFM);
|
|
||||||
radio.setSoftmuteFM(1);
|
|
||||||
radio.setSoftmuteAM(1);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
updateiMS();
|
DataPrint("Z" + String(ANT) + "\n");
|
||||||
updateEQ();
|
|
||||||
DataPrint("Z" + String(iMSEQX) + "\n");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
XDRGTKdata = false;
|
XDRGTKdata = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user