Changes to work with updated modes and such from iopcomm.h

This commit is contained in:
Rob French 2020-06-14 00:12:29 -05:00
parent 1a1e92a709
commit 5e675107c1
4 changed files with 49 additions and 60 deletions

View File

@ -56,18 +56,19 @@
*
* Send the current mode to the I/O Processor.
*/
void iopSendMode(char cw_mode, char is_usb, char digi_mode, char is_test)
void iopSendMode(char cw_mode, char is_usb, char digi_mode)
{
byte mode;
if (cw_mode > 0) {
mode = (cw_mode == 1 ? RIG_MODE_CWL : RIG_MODE_CWU);
mode = (cw_mode == 1 ? cwr : cw);
} else if (digi_mode > 0) {
mode = (is_usb ? RIG_MODE_DGU : RIG_MODE_DGL);
} else if (is_test) {
mode = (is_usb ? RIG_MODE_TTU : RIG_MODE_TTL);
//mode = (is_usb ? RIG_MODE_DGU : RIG_MODE_DGL);
mode = dig;
// } else if (is_test) {
// mode = (is_usb ? RIG_MODE_TTU : RIG_MODE_TTL);
} else {
mode = (is_usb ? RIG_MODE_USB : RIG_MODE_LSB);
mode = (is_usb ? usb : lsb);
}
sendIOPModeCommand(mode);
}
@ -282,7 +283,7 @@ void CatSetMode(byte tmpMode, byte fromType)
digiMode = 1;
isUSB = true; // DGU - but need to eventually use the FT-817 customization
}
iopSendMode(cwMode, isUSB, digiMode, isTest);
iopSendMode(cwMode, isUSB, digiMode);
setFrequency(frequency);
updateDisplay();
}
@ -902,7 +903,7 @@ void Check_Cat(byte fromType)
break;*/
case IOP_MODE_REQUEST:
iopSendMode(cwMode, isUSB, digiMode, isTest);
iopSendMode(cwMode, isUSB, digiMode);
break;
case IOP_MENU_DISPLAY_MSG:

View File

@ -193,7 +193,7 @@ char splitOn = 0; //working split, uses VFO B as the transmit freque
char keyDown = 0; //in cw mode, denotes the carrier is being transmitted
char isUSB = 0; //upper sideband was selected, this is reset to the default for the
char isTest = 0; // two-tone test mode
//char isTest = 0; // two-tone test mode
char cwMode = 0; //compatible original source, and extend mode //if cwMode == 0, mode check : isUSB, cwMode > 0, mode Check : cwMode
//iscwMode = 0 : ssbmode, 1 :cwl, 2 : cwu, 3 : cwn (none tx)
char digiMode = 0; // 0: normal uBITX behavior (transmit LSB/USB when PTT is depressed)
@ -1453,7 +1453,7 @@ void setup()
factory_alignment();
#endif
iopSendMode(cwMode, isUSB, digiMode, isTest);
iopSendMode(cwMode, isUSB, digiMode);
}

View File

@ -439,15 +439,15 @@ void updateDisplay() {
if (cwMode == 0)
{
if (digiMode == 1) {
if (isUSB)
strcpy(c, "DGU ");
else
strcpy(c, "DGL ");
} else if (isTest == 1) {
if (isUSB)
strcpy(c, "TTU ");
else
strcpy(c, "TTL ");
// if (isUSB)
strcpy(c, "DIG ");
// else
// strcpy(c, "DGL ");
// } else if (isTest == 1) {
// if (isUSB)
// strcpy(c, "TTU ");
// else
// strcpy(c, "TTL ");
} else {
if (isUSB)
strcpy(c, "USB ");
@ -457,11 +457,11 @@ void updateDisplay() {
}
else if (cwMode == 1)
{
strcpy(c, "CWL ");
strcpy(c, "CWR ");
}
else
{
strcpy(c, "CWU ");
strcpy(c, "CW ");
}
}
if (vfoActive == VFO_A) // VFO A is active

View File

@ -127,13 +127,17 @@ void menuBand(int btn){
//Convert Mode, Number by KD8CEC
//0: default, 1:not use, 2:LSB, 3:USB, 4:CWL, 5:CWU, 6:FM
byte modeToByte(){
// Updated: KC4UPR - 6: DIG
byte modeToByte() {
if (cwMode == 0)
{
if (digiMode > 0) {
return 6;
}
if (isUSB)
return 3 + (digiMode > 0 ? 3 + digiMode : 0);
return 3;
else
return 2 + (digiMode > 0 ? 3 + digiMode : 0);
return 2;
}
else if (cwMode == 1)
{
@ -149,7 +153,7 @@ byte modeToByte(){
//autoSetModebyFreq : 0
//autoSetModebyFreq : 1, if (modValue is not set, set mode by frequency)
void byteToMode(byte modeValue, byte autoSetModebyFreq){
isTest = false; // test never settable from EEPROM
//isTest = false; // test never settable from EEPROM
isUSB = false;
cwMode = 0;
digiMode = 0;
@ -174,23 +178,10 @@ void byteToMode(byte modeValue, byte autoSetModebyFreq){
cwMode = 2;
break;
case 6: // DGL
case 6: // DIG
digiMode = 1;
break;
case 7: // DGU
isUSB = true;
digiMode = 1;
break;
/*
case 8: // TTL
isUSB = false;
break;
case 9: // TTU
isUSB = true;
break;
*/
}
}
/* if (modeValue == 4) {
@ -994,16 +985,13 @@ void menuSelectMode(int btn){
}
// modify if digital mode is set
if (digiMode > 0) {
selectModeType += (3 + digiMode);
// modify if two-tone test mode is set
} else if (isTest > 0) {
selectModeType += 6;
selectModeType = 4;
}
} else if (cwMode == 1) {
selectModeType = 2; // CWL
} else if (cwMode == 2) {
selectModeType = 2; // CW
} else {
selectModeType = 3; // CWU
selectModeType = 3; // CWR
}
/*if (cwMode == 0 && isUSB == 0)
selectModeType = 0;
@ -1015,30 +1003,30 @@ void menuSelectMode(int btn){
selectModeType = 3;*/
beforeMode = selectModeType;
selectModeType = getValueByKnob(11, selectModeType, 0, 7, 1, " LSB USB CWL CWU DGL DGU TTL TTU", 4); //3 : Select Mode, targetValue, minKnobValue, maxKnobValue, stepSize
selectModeType = getValueByKnob(11, selectModeType, 0, 4, 1, " LSB USB CW CWR DIG", 4); //3 : Select Mode, targetValue, minKnobValue, maxKnobValue, stepSize
if (beforeMode != selectModeType)
{
//printLineF1(F("Changed Mode"));
if (selectModeType == 0) {
cwMode = 0; isUSB = 0; digiMode = 0; isTest = 0;
cwMode = 0; isUSB = 0; digiMode = 0; //isTest = 0;
} else if (selectModeType == 1) {
cwMode = 0; isUSB = 1; digiMode = 0; isTest = 0;
cwMode = 0; isUSB = 1; digiMode = 0; //isTest = 0;
} else if (selectModeType == 2) {
cwMode = 1; digiMode = 0; isTest = 0;
cwMode = 2; digiMode = 0; //isTest = 0;
} else if (selectModeType == 3) {
cwMode = 2; digiMode = 0; isTest = 0;
cwMode = 1; digiMode = 0; //isTest = 0;
} else if (selectModeType == 4) {
cwMode = 0; isUSB = 0; digiMode = 1; isTest = 0;
} else if (selectModeType == 5) {
cwMode = 0; isUSB = 1; digiMode = 1; isTest = 0;
} else if (selectModeType == 6) {
cwMode = 0; isUSB = 0; digiMode = 0; isTest = 1;
} else if (selectModeType == 7) {
cwMode = 0; isUSB = 1; digiMode = 0; isTest = 1;
cwMode = 0; isUSB = 1; digiMode = 1; //isTest = 0;
// } else if (selectModeType == 5) {
// cwMode = 0; isUSB = 1; digiMode = 1; isTest = 0;
// } else if (selectModeType == 6) {
// cwMode = 0; isUSB = 0; digiMode = 0; isTest = 1;
// } else if (selectModeType == 7) {
// cwMode = 0; isUSB = 1; digiMode = 0; isTest = 1;
}
// KC4UPR: sending mode to IOP
iopSendMode(cwMode, isUSB, digiMode, isTest);
iopSendMode(cwMode, isUSB, digiMode);
FrequencyToVFO(1);
}