display test and split TX/RX added

This commit is contained in:
phdlee 2018-01-30 12:13:52 +09:00
parent 3a306429ea
commit 98c26730c6
4 changed files with 63 additions and 7 deletions

View File

@ -384,7 +384,7 @@ void ReadEEPRom_FT817(byte fromType)
//7A 6 ? ? //7A 6 ? ?
//7A 7 SPL On/Off 0 = Off, 1 = On //7A 7 SPL On/Off 0 = Off, 1 = On
CAT_BUFF[0] = (isSplitOn ? 0xFF : 0x7F); CAT_BUFF[0] = (splitOn ? 0xFF : 0x7F);
break; break;
case 0xB3 : // case 0xB3 : //
CAT_BUFF[0] = 0x00; CAT_BUFF[0] = 0x00;

View File

@ -249,7 +249,6 @@ byte saveIntervalSec = 10; //second
unsigned long saveCheckTime = 0; unsigned long saveCheckTime = 0;
unsigned long saveCheckFreq = 0; unsigned long saveCheckFreq = 0;
bool isSplitOn = false;
byte cwDelayTime = 60; byte cwDelayTime = 60;
byte delayBeforeCWStartTime = 50; byte delayBeforeCWStartTime = 50;
@ -298,7 +297,7 @@ byte userCallsignLength = 0; //7 : display callsign at system startup, 6~0 :
*/ */
boolean txCAT = false; //turned on if the transmitting due to a CAT command boolean txCAT = false; //turned on if the transmitting due to a CAT command
char inTx = 0; //it is set to 1 if in transmit mode (whatever the reason : cw, ptt or cat) char inTx = 0; //it is set to 1 if in transmit mode (whatever the reason : cw, ptt or cat)
char splitOn = 0; //working split, uses VFO B as the transmit frequency, (NOT IMPLEMENTED YET) char splitOn = 0; //working split, uses VFO B as the transmit frequency
char keyDown = 0; //in cw mode, denotes the carrier is being transmitted 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 isUSB = 0; //upper sideband was selected, this is reset to the default for the
//frequency when it crosses the frequency border of 10 MHz //frequency when it crosses the frequency border of 10 MHz
@ -507,6 +506,21 @@ void startTx(byte txMode, byte isDisplayUpdate){
ritRxFrequency = frequency; ritRxFrequency = frequency;
setFrequency(ritTxFrequency); setFrequency(ritTxFrequency);
} }
else if (splitOn == 1) {
if (vfoActive == VFO_B) {
vfoActive = VFO_A;
frequency = vfoA;
byteToMode(vfoA_mode);
}
else if (vfoActive == VFO_A){
vfoActive = VFO_B;
frequency = vfoB;
byteToMode(vfoB_mode);
}
setFrequency(frequency);
} //end of else
if (txMode == TX_CW){ if (txMode == TX_CW){
//turn off the second local oscillator and the bfo //turn off the second local oscillator and the bfo
@ -535,6 +549,20 @@ void stopTx(){
if (ritOn) if (ritOn)
setFrequency(ritRxFrequency); setFrequency(ritRxFrequency);
else if (splitOn == 1) {
//vfo Change
if (vfoActive == VFO_B){
vfoActive = VFO_A;
frequency = vfoA;
byteToMode(vfoA_mode);
}
else if (vfoActive == VFO_A){
vfoActive = VFO_B;
frequency = vfoB;
byteToMode(vfoB_mode);
}
setFrequency(frequency);
} //end of else
else else
setFrequency(frequency); setFrequency(frequency);
@ -992,7 +1020,7 @@ void setup()
//Serial.begin(9600); //Serial.begin(9600);
lcd.begin(16, 2); lcd.begin(16, 2);
printLineF(1, F("CECBT v0.31")); printLineF(1, F("CECBT v0.32"));
Init_Cat(38400, SERIAL_8N1); Init_Cat(38400, SERIAL_8N1);
initMeter(); //not used in this build initMeter(); //not used in this build

View File

@ -98,7 +98,7 @@ void updateLine2Buffer()
if (freqScrollPosition < 7) if (freqScrollPosition < 7)
{ {
for (int i = 11; i > 0; i--) for (int i = 11; i >= 0; i--)
if (i - (7 - freqScrollPosition) >= 0) if (i - (7 - freqScrollPosition) >= 0)
line2Buffer[i] = line2Buffer[i - (7 - freqScrollPosition)]; line2Buffer[i] = line2Buffer[i - (7 - freqScrollPosition)];
else else

View File

@ -235,6 +235,32 @@ void menuSidebandToggle(int btn){
} }
} }
void menuSplitOnOff(int btn){
if (!btn){
if (splitOn == 0)
printLineF2(F("Split On?"));
else
printLineF2(F("Split Off?"));
}
else {
if (splitOn == 1){
splitOn = 0;
printLineF2(F("Split Off!"));
}
else {
splitOn = 1;
if (ritOn == 1)
ritOn = 0;
printLineF2(F("Split On!"));
}
delay_background(500, 0);
printLine2ClearAndUpdate();
menuOn = 0;
}
}
/* /*
//Select CW Key Type by KD8CEC //Select CW Key Type by KD8CEC
void menuSetupKeyType(int btn){ void menuSetupKeyType(int btn){
@ -1025,7 +1051,7 @@ void doMenu(){
btnState = btnDown(); btnState = btnDown();
if (i > 0){ if (i > 0){
if (modeCalibrate && select + i < 170) if (modeCalibrate && select + i < 180)
select += i; select += i;
if (!modeCalibrate && select + i < 80) if (!modeCalibrate && select + i < 80)
select += i; select += i;
@ -1067,8 +1093,10 @@ void doMenu(){
else if (select < 150 && modeCalibrate) else if (select < 150 && modeCalibrate)
menuADCMonitor(btnState); menuADCMonitor(btnState);
else if (select < 160 && modeCalibrate) else if (select < 160 && modeCalibrate)
menuTxOnOff(btnState, 0x01); //TX OFF / ON menuSplitOnOff(btnState); //TX OFF / ON
else if (select < 170 && modeCalibrate) else if (select < 170 && modeCalibrate)
menuTxOnOff(btnState, 0x01); //TX OFF / ON
else if (select < 180 && modeCalibrate)
menuExit(btnState); menuExit(btnState);
Check_Cat(0); //To prevent disconnections Check_Cat(0); //To prevent disconnections