Memory channels were not working correct in LW/MW/OIRT

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-10-15 13:11:52 +02:00
parent 829d5427cf
commit 6ae0cac264
+34 -5
View File
@@ -2009,10 +2009,30 @@ void ButtonPress() {
} else { } else {
memorystore = false; memorystore = false;
EEPROM.writeByte(memorypos + EE_PRESETS_BAND_START, band); EEPROM.writeByte(memorypos + EE_PRESETS_BAND_START, band);
if (band == BAND_FM) EEPROM.writeUInt((memorypos * 4) + EE_PRESETS_START, frequency); else EEPROM.writeUInt((memorypos * 4) + EE_PRESETS_START, frequency_AM); if (band == BAND_FM) {
EEPROM.writeUInt((memorypos * 4) + EE_PRESETS_START, frequency);
} else if (band == BAND_OIRT) {
EEPROM.writeUInt((memorypos * 4) + EE_PRESETS_START, frequency_OIRT);
} else if (band == BAND_LW) {
EEPROM.writeUInt((memorypos * 4) + EE_PRESETS_START, frequency_LW);
} else if (band == BAND_MW) {
EEPROM.writeUInt((memorypos * 4) + EE_PRESETS_START, frequency_MW);
} else {
EEPROM.writeUInt((memorypos * 4) + EE_PRESETS_START, frequency_SW);
}
EEPROM.commit(); EEPROM.commit();
memoryband[memorypos] = band; memoryband[memorypos] = band;
if (band == BAND_FM) memory[memorypos] = frequency; else memory[memorypos] = frequency_AM; if (band == BAND_FM) {
memory[memorypos] = frequency;
} else if (band == BAND_OIRT) {
memory[memorypos] = frequency_OIRT;
} else if (band == BAND_LW) {
memory[memorypos] = frequency_LW;
} else if (band == BAND_MW) {
memory[memorypos] = frequency_MW;
} else {
memory[memorypos] = frequency_SW;
}
ShowTuneMode(); ShowTuneMode();
} }
} else { } else {
@@ -2210,12 +2230,21 @@ void DoMemoryPosTune() {
band = memoryband[memorypos]; band = memoryband[memorypos];
} }
if (band == BAND_FM || band == BAND_OIRT) { if (band == BAND_FM) {
frequency = memory[memorypos]; frequency = memory[memorypos];
radio.SetFreq(frequency); radio.SetFreq(frequency);
} else if (band == BAND_OIRT) {
frequency_OIRT = memory[memorypos];
radio.SetFreq(frequency_OIRT);
} else if (band == BAND_LW) {
frequency_LW = memory[memorypos];
radio.SetFreqAM(frequency_LW);
} else if (band == BAND_MW) {
frequency_MW = memory[memorypos];
radio.SetFreqAM(frequency_MW);
} else { } else {
frequency_AM = memory[memorypos]; frequency_SW = memory[memorypos];
radio.SetFreqAM(frequency_AM); radio.SetFreqAM(frequency_SW);
} }
ShowFreq(0); ShowFreq(0);
} }