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 7 SPL On/Off 0 = Off, 1 = On
CAT_BUFF[0] = (isSplitOn ? 0xFF : 0x7F);
CAT_BUFF[0] = (splitOn ? 0xFF : 0x7F);
break;
case 0xB3 : //
CAT_BUFF[0] = 0x00;

View File

@ -249,7 +249,6 @@ byte saveIntervalSec = 10; //second
unsigned long saveCheckTime = 0;
unsigned long saveCheckFreq = 0;
bool isSplitOn = false;
byte cwDelayTime = 60;
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
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 isUSB = 0; //upper sideband was selected, this is reset to the default for the
//frequency when it crosses the frequency border of 10 MHz
@ -507,6 +506,21 @@ void startTx(byte txMode, byte isDisplayUpdate){
ritRxFrequency = frequency;
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){
//turn off the second local oscillator and the bfo
@ -535,6 +549,20 @@ void stopTx(){
if (ritOn)
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
setFrequency(frequency);
@ -992,7 +1020,7 @@ void setup()
//Serial.begin(9600);
lcd.begin(16, 2);
printLineF(1, F("CECBT v0.31"));
printLineF(1, F("CECBT v0.32"));
Init_Cat(38400, SERIAL_8N1);
initMeter(); //not used in this build

View File

@ -98,7 +98,7 @@ void updateLine2Buffer()
if (freqScrollPosition < 7)
{
for (int i = 11; i > 0; i--)
for (int i = 11; i >= 0; i--)
if (i - (7 - freqScrollPosition) >= 0)
line2Buffer[i] = line2Buffer[i - (7 - freqScrollPosition)];
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
void menuSetupKeyType(int btn){
@ -1025,7 +1051,7 @@ void doMenu(){
btnState = btnDown();
if (i > 0){
if (modeCalibrate && select + i < 170)
if (modeCalibrate && select + i < 180)
select += i;
if (!modeCalibrate && select + i < 80)
select += i;
@ -1067,8 +1093,10 @@ void doMenu(){
else if (select < 150 && modeCalibrate)
menuADCMonitor(btnState);
else if (select < 160 && modeCalibrate)
menuTxOnOff(btnState, 0x01); //TX OFF / ON
menuSplitOnOff(btnState); //TX OFF / ON
else if (select < 170 && modeCalibrate)
menuTxOnOff(btnState, 0x01); //TX OFF / ON
else if (select < 180 && modeCalibrate)
menuExit(btnState);
Check_Cat(0); //To prevent disconnections