change IF Shift setup type
This commit is contained in:
parent
5eca64d2a9
commit
4830db78cb
@ -755,6 +755,7 @@ void doRIT(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void doIFShift(){
|
void doIFShift(){
|
||||||
int knob = enc_read();
|
int knob = enc_read();
|
||||||
unsigned long old_freq = frequency;
|
unsigned long old_freq = frequency;
|
||||||
@ -770,6 +771,7 @@ void doIFShift(){
|
|||||||
setFrequency(frequency);
|
setFrequency(frequency);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
save Frequency and mode to eeprom
|
save Frequency and mode to eeprom
|
||||||
@ -1169,8 +1171,8 @@ void loop(){
|
|||||||
if (!inTx){
|
if (!inTx){
|
||||||
if (ritOn)
|
if (ritOn)
|
||||||
doRIT();
|
doRIT();
|
||||||
else if (isIFShift)
|
//else if (isIFShift)
|
||||||
doIFShift();
|
// doIFShift();
|
||||||
else
|
else
|
||||||
doTuningWithThresHold();
|
doTuningWithThresHold();
|
||||||
|
|
||||||
|
@ -122,22 +122,34 @@ void updateLine2Buffer(char isDirectCall)
|
|||||||
|
|
||||||
if (isIFShift)
|
if (isIFShift)
|
||||||
{
|
{
|
||||||
|
if (isDirectCall == 1)
|
||||||
|
for (int i = 0; i < 16; i++)
|
||||||
|
line2Buffer[i] = ' ';
|
||||||
|
|
||||||
//IFShift Offset Value
|
//IFShift Offset Value
|
||||||
line2Buffer[8] = 'I';
|
line2Buffer[8] = 'I';
|
||||||
line2Buffer[9] = 'F';
|
line2Buffer[9] = 'F';
|
||||||
|
|
||||||
line2Buffer[10] = ifShiftValue >= 0 ? '+' : 0;
|
|
||||||
line2Buffer[11] = 0;
|
|
||||||
line2Buffer[12] = ' ';
|
|
||||||
line2Buffer[13] = ' ';
|
|
||||||
line2Buffer[14] = ' ';
|
|
||||||
line2Buffer[15] = ' ';
|
|
||||||
|
|
||||||
//11, 12, 13, 14, 15
|
|
||||||
memset(b, 0, sizeof(b));
|
|
||||||
ltoa(ifShiftValue, b, DEC);
|
|
||||||
strncat(line2Buffer, b, 5);
|
|
||||||
|
|
||||||
|
if (ifShiftValue == 0)
|
||||||
|
{
|
||||||
|
line2Buffer[10] = 'S';
|
||||||
|
line2Buffer[11] = ':';
|
||||||
|
line2Buffer[12] = 'O';
|
||||||
|
line2Buffer[13] = 'F';
|
||||||
|
line2Buffer[14] = 'F';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
line2Buffer[10] = ifShiftValue >= 0 ? '+' : 0;
|
||||||
|
line2Buffer[11] = 0;
|
||||||
|
line2Buffer[12] = ' ';
|
||||||
|
|
||||||
|
//11, 12, 13, 14, 15
|
||||||
|
memset(b, 0, sizeof(b));
|
||||||
|
ltoa(ifShiftValue, b, DEC);
|
||||||
|
strncat(line2Buffer, b, 5);
|
||||||
|
}
|
||||||
|
|
||||||
if (isDirectCall == 1) //if call by encoder (not scheduler), immediate print value
|
if (isDirectCall == 1) //if call by encoder (not scheduler), immediate print value
|
||||||
printLine2(line2Buffer);
|
printLine2(line2Buffer);
|
||||||
}
|
}
|
||||||
|
@ -239,6 +239,7 @@ void menuRitToggle(int btn){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void menuIFSToggle(int btn){
|
void menuIFSToggle(int btn){
|
||||||
if (!btn){
|
if (!btn){
|
||||||
if (isIFShift == 1)
|
if (isIFShift == 1)
|
||||||
@ -260,6 +261,69 @@ void menuIFSToggle(int btn){
|
|||||||
printLine2ClearAndUpdate();
|
printLine2ClearAndUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
void menuIFSToggle(int btn){
|
||||||
|
int knob = 0;
|
||||||
|
char needApplyChangeValue = 1;
|
||||||
|
|
||||||
|
if (!btn){
|
||||||
|
if (isIFShift == 1)
|
||||||
|
printLineF2(F("IF Shift Change?"));
|
||||||
|
else
|
||||||
|
printLineF2(F("IF Shift:Off, On?"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (isIFShift == 0){
|
||||||
|
printLineF2(F("IF Shift is ON"));
|
||||||
|
delay_background(500, 0);
|
||||||
|
isIFShift = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
delay_background(500, 0);
|
||||||
|
updateLine2Buffer(1);
|
||||||
|
setFrequency(frequency);
|
||||||
|
|
||||||
|
//Off or Change Value
|
||||||
|
while(!btnDown() && digitalRead(PTT) == HIGH){
|
||||||
|
if (needApplyChangeValue ==1)
|
||||||
|
{
|
||||||
|
updateLine2Buffer(1);
|
||||||
|
setFrequency(frequency);
|
||||||
|
|
||||||
|
if (cwMode == 0)
|
||||||
|
si5351bx_setfreq(0, usbCarrier + (isIFShift ? ifShiftValue : 0)); //set back the carrier oscillator anyway, cw tx switches it off
|
||||||
|
else
|
||||||
|
si5351bx_setfreq(0, cwmCarrier + (isIFShift ? ifShiftValue : 0)); //set back the carrier oscillator anyway, cw tx switches it off
|
||||||
|
|
||||||
|
needApplyChangeValue = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
knob = enc_read();
|
||||||
|
if (knob != 0){
|
||||||
|
if (knob < 0)
|
||||||
|
ifShiftValue -= 1l;
|
||||||
|
else if (knob > 0)
|
||||||
|
ifShiftValue += 1;
|
||||||
|
|
||||||
|
needApplyChangeValue = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delay_background(500, 0); //for check Long Press function key
|
||||||
|
|
||||||
|
if (btnDown() || digitalRead(PTT) == LOW || ifShiftValue == 0)
|
||||||
|
{
|
||||||
|
isIFShift = 0;
|
||||||
|
printLineF2(F("IF Shift is OFF"));
|
||||||
|
setFrequency(frequency);
|
||||||
|
delay_background(500, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
menuOn = 0;
|
||||||
|
//delay_background(500, 0);
|
||||||
|
printLine2ClearAndUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -377,9 +441,9 @@ void menuSelectMode(int btn){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cwMode == 0)
|
if (cwMode == 0)
|
||||||
si5351bx_setfreq(0, usbCarrier); //set back the carrier oscillator anyway, cw tx switches it off
|
si5351bx_setfreq(0, usbCarrier + (isIFShift ? ifShiftValue : 0)); //set back the carrier oscillator anyway, cw tx switches it off
|
||||||
else
|
else
|
||||||
si5351bx_setfreq(0, cwmCarrier); //set back the carrier oscillator anyway, cw tx switches it off
|
si5351bx_setfreq(0, cwmCarrier + (isIFShift ? ifShiftValue : 0)); //set back the carrier oscillator anyway, cw tx switches it off
|
||||||
|
|
||||||
setFrequency(frequency);
|
setFrequency(frequency);
|
||||||
delay_background(500, 0);
|
delay_background(500, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user