Update for iMS and EQ to be compatible with FMDX Server software

This commit is contained in:
Sjef Verhoeven PE5PVB
2024-01-28 19:11:51 +01:00
parent 0dcefb8c4f
commit fbdd001955
2 changed files with 37 additions and 31 deletions
+1
View File
@@ -2216,6 +2216,7 @@ void ButtonPress() {
EEPROM.writeByte(EE_BYTE_IMSSET, iMSset); EEPROM.writeByte(EE_BYTE_IMSSET, iMSset);
EEPROM.writeByte(EE_BYTE_EQSET, EQset); EEPROM.writeByte(EE_BYTE_EQSET, EQset);
EEPROM.commit(); EEPROM.commit();
if (XDRGTKUSB || XDRGTKTCP) DataPrint("G" + String(!EQset) + String(!iMSset) + "\n");
} else { } else {
if (band == BAND_SW && tunemode != TUNE_MEM) { if (band == BAND_SW && tunemode != TUNE_MEM) {
nowToggleSWMIBand = !nowToggleSWMIBand; nowToggleSWMIBand = !nowToggleSWMIBand;
+36 -31
View File
@@ -120,6 +120,7 @@ void Communication() {
} }
XDRGTKTCP = true; XDRGTKTCP = true;
RemoteClient.print("o1,0\n"); RemoteClient.print("o1,0\n");
RemoteClient.print("G" + String(!EQset) + String(!iMSset) + "\n");
store = true; store = true;
} else { } else {
RemoteClient.print("a0\n"); RemoteClient.print("a0\n");
@@ -156,7 +157,7 @@ void Communication() {
band = BAND_FM; band = BAND_FM;
SelectBand(); SelectBand();
} }
Serial.print("OK\nT" + String(frequency * 10) + "\n"); Serial.print("OK\nT" + String(frequency * 10) + "\nG" + String(!EQset) + String(!iMSset) + "\n");
XDRGTKUSB = true; XDRGTKUSB = true;
} }
} }
@@ -278,35 +279,27 @@ void XDRGTKRoutine() {
byte offsetg; byte offsetg;
offsetg = atol(buff + 1); offsetg = atol(buff + 1);
if (offsetg == 0) { if (offsetg == 0) {
MuteScreen(0); iMSset = 1;
LowLevelSet = EEPROM.readInt(EE_BYTE_LOWLEVELSET); EQset = 1;
softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
softmutefm = EEPROM.readByte(EE_BYTE_SOFTMUTEFM);
radio.setSoftmuteFM(softmutefm);
radio.setSoftmuteAM(softmuteam);
DataPrint("G00\n"); DataPrint("G00\n");
} }
if (offsetg == 10) { if (offsetg == 10) {
MuteScreen(1); iMSset = 1;
LowLevelSet = EEPROM.readInt(EE_BYTE_LOWLEVELSET); EQset = 0;
softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
softmutefm = EEPROM.readByte(EE_BYTE_SOFTMUTEFM);
radio.setSoftmuteFM(softmutefm);
radio.setSoftmuteAM(softmuteam);
DataPrint("G10\n"); DataPrint("G10\n");
} }
if (offsetg == 1) { if (offsetg == 1) {
MuteScreen(0); iMSset = 0;
radio.setSoftmuteFM(1); EQset = 1;
radio.setSoftmuteAM(1);
DataPrint("G01\n"); DataPrint("G01\n");
} }
if (offsetg == 11) { if (offsetg == 11) {
MuteScreen(1); iMSset = 0;
radio.setSoftmuteFM(1); EQset = 0;
radio.setSoftmuteAM(1);
DataPrint("G11\n"); DataPrint("G11\n");
} }
updateiMS();
updateEQ();
break; break;
case 'M': case 'M':
@@ -532,27 +525,39 @@ void XDRGTKRoutine() {
iMSEQX = atol(buff + 1); iMSEQX = atol(buff + 1);
switch (iMSEQX) { switch (iMSEQX) {
case 0: case 0:
iMSset = 1; MuteScreen(0);
EQset = 1; LowLevelSet = EEPROM.readInt(EE_BYTE_LOWLEVELSET);
iMSEQ = 2; softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
softmutefm = EEPROM.readByte(EE_BYTE_SOFTMUTEFM);
radio.setSoftmuteFM(softmutefm);
radio.setSoftmuteAM(softmuteam);
break; break;
case 1: case 1:
iMSset = 0; MuteScreen(1);
EQset = 1; LowLevelSet = EEPROM.readInt(EE_BYTE_LOWLEVELSET);
iMSEQ = 3; softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
softmutefm = EEPROM.readByte(EE_BYTE_SOFTMUTEFM);
radio.setSoftmuteFM(softmutefm);
radio.setSoftmuteAM(softmuteam);
break; break;
case 2: case 2:
iMSset = 1; MuteScreen(0);
EQset = 0; LowLevelSet = EEPROM.readInt(EE_BYTE_LOWLEVELSET);
iMSEQ = 4; softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
softmutefm = EEPROM.readByte(EE_BYTE_SOFTMUTEFM);
radio.setSoftmuteFM(1);
radio.setSoftmuteAM(1);
break; break;
case 3: case 3:
iMSset = 0; MuteScreen(1);
EQset = 0; LowLevelSet = EEPROM.readInt(EE_BYTE_LOWLEVELSET);
iMSEQ = 1; softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
softmutefm = EEPROM.readByte(EE_BYTE_SOFTMUTEFM);
radio.setSoftmuteFM(1);
radio.setSoftmuteAM(1);
break; break;
} }
updateiMS(); updateiMS();