mirror of
https://codeberg.org/mclemens/ubitxv6.git
synced 2024-09-10 18:04:32 -04:00
Don't reset cals to fixed values when starting cal routine
This commit is contained in:
parent
6e797adc70
commit
9a205522d9
41
setup.cpp
41
setup.cpp
@ -89,9 +89,6 @@ void printCarrierFreq(unsigned long freq){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setupFreq(){
|
void setupFreq(){
|
||||||
int knob = 0;
|
|
||||||
int32_t prev_calibration;
|
|
||||||
|
|
||||||
displayDialog(F("Set Frequency"),F("Push TUNE to Save"));
|
displayDialog(F("Set Frequency"),F("Push TUNE to Save"));
|
||||||
|
|
||||||
//round off the the nearest khz
|
//round off the the nearest khz
|
||||||
@ -105,7 +102,7 @@ void setupFreq(){
|
|||||||
displayText(c, LAYOUT_SETTING_VALUE_X, LAYOUT_ITEM_Y, LAYOUT_ITEM_WIDTH, LAYOUT_ITEM_HEIGHT, COLOR_TEXT, COLOR_BACKGROUND, COLOR_BACKGROUND);
|
displayText(c, LAYOUT_SETTING_VALUE_X, LAYOUT_ITEM_Y, LAYOUT_ITEM_WIDTH, LAYOUT_ITEM_HEIGHT, COLOR_TEXT, COLOR_BACKGROUND, COLOR_BACKGROUND);
|
||||||
strcpy_P(c,(const char*)F("signal exactly at"));
|
strcpy_P(c,(const char*)F("signal exactly at"));
|
||||||
displayText(c, LAYOUT_SETTING_VALUE_X, LAYOUT_ITEM_Y + 1*LAYOUT_ITEM_PITCH_Y, LAYOUT_ITEM_WIDTH, LAYOUT_ITEM_HEIGHT, COLOR_TEXT, COLOR_BACKGROUND, COLOR_BACKGROUND);
|
displayText(c, LAYOUT_SETTING_VALUE_X, LAYOUT_ITEM_Y + 1*LAYOUT_ITEM_PITCH_Y, LAYOUT_ITEM_WIDTH, LAYOUT_ITEM_HEIGHT, COLOR_TEXT, COLOR_BACKGROUND, COLOR_BACKGROUND);
|
||||||
ltoa(GetActiveVfoFreq()/1000l, c, 10);
|
ltoa(GetActiveVfoFreq()/1000L, c, 10);
|
||||||
strcat_P(c,(const char*)F(" KHz"));
|
strcat_P(c,(const char*)F(" KHz"));
|
||||||
displayText(c, LAYOUT_SETTING_VALUE_X, LAYOUT_ITEM_Y + 2*LAYOUT_ITEM_PITCH_Y, LAYOUT_ITEM_WIDTH, LAYOUT_ITEM_HEIGHT, COLOR_TEXT, COLOR_BACKGROUND, COLOR_BACKGROUND);
|
displayText(c, LAYOUT_SETTING_VALUE_X, LAYOUT_ITEM_Y + 2*LAYOUT_ITEM_PITCH_Y, LAYOUT_ITEM_WIDTH, LAYOUT_ITEM_HEIGHT, COLOR_TEXT, COLOR_BACKGROUND, COLOR_BACKGROUND);
|
||||||
strcpy_P(c,(const char*)F("Rotate to zerobeat"));
|
strcpy_P(c,(const char*)F("Rotate to zerobeat"));
|
||||||
@ -117,21 +114,18 @@ void setupFreq(){
|
|||||||
while (btnDown())
|
while (btnDown())
|
||||||
active_delay(100);
|
active_delay(100);
|
||||||
active_delay(100);
|
active_delay(100);
|
||||||
|
|
||||||
prev_calibration = globalSettings.oscillatorCal;
|
|
||||||
globalSettings.oscillatorCal = 0;
|
|
||||||
|
|
||||||
while (!btnDown())
|
while (!btnDown())
|
||||||
{
|
{
|
||||||
knob = enc_read();
|
int knob = enc_read();
|
||||||
if (knob != 0)
|
if(knob != 0){
|
||||||
globalSettings.oscillatorCal += knob * 875;
|
globalSettings.oscillatorCal += knob * 875;
|
||||||
/* else if (knob < 0)
|
}
|
||||||
calibration -= 875; */
|
else{
|
||||||
else
|
|
||||||
continue; //don't update the frequency or the display
|
continue; //don't update the frequency or the display
|
||||||
|
}
|
||||||
si5351bx_setfreq(0, globalSettings.usbCarrierFreq); //set back the cardrier oscillator anyway, cw tx switches it off
|
|
||||||
|
si5351bx_setfreq(0, globalSettings.usbCarrierFreq); //set back the carrier oscillator anyway, cw tx switches it off
|
||||||
si5351_set_calibration(globalSettings.oscillatorCal);
|
si5351_set_calibration(globalSettings.oscillatorCal);
|
||||||
setFrequency(GetActiveVfoFreq());
|
setFrequency(GetActiveVfoFreq());
|
||||||
|
|
||||||
@ -151,24 +145,19 @@ void setupFreq(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setupBFO(){
|
void setupBFO(){
|
||||||
int knob = 0;
|
|
||||||
unsigned long prevCarrier;
|
|
||||||
|
|
||||||
prevCarrier = globalSettings.usbCarrierFreq;
|
|
||||||
|
|
||||||
displayDialog(F("Set BFO"),F("Press TUNE to Save"));
|
displayDialog(F("Set BFO"),F("Press TUNE to Save"));
|
||||||
|
|
||||||
globalSettings.usbCarrierFreq = 11053000l;
|
|
||||||
si5351bx_setfreq(0, globalSettings.usbCarrierFreq);
|
si5351bx_setfreq(0, globalSettings.usbCarrierFreq);
|
||||||
printCarrierFreq(globalSettings.usbCarrierFreq);
|
printCarrierFreq(globalSettings.usbCarrierFreq);
|
||||||
|
|
||||||
while (!btnDown()){
|
while (!btnDown()){
|
||||||
knob = enc_read();
|
int knob = enc_read();
|
||||||
|
if(knob != 0){
|
||||||
if (knob != 0)
|
|
||||||
globalSettings.usbCarrierFreq -= 50 * knob;
|
globalSettings.usbCarrierFreq -= 50 * knob;
|
||||||
else
|
}
|
||||||
|
else{
|
||||||
continue; //don't update the frequency or the display
|
continue; //don't update the frequency or the display
|
||||||
|
}
|
||||||
|
|
||||||
si5351bx_setfreq(0, globalSettings.usbCarrierFreq);
|
si5351bx_setfreq(0, globalSettings.usbCarrierFreq);
|
||||||
setFrequency(GetActiveVfoFreq());
|
setFrequency(GetActiveVfoFreq());
|
||||||
@ -180,8 +169,6 @@ void setupBFO(){
|
|||||||
SaveSettingsToEeprom();
|
SaveSettingsToEeprom();
|
||||||
si5351bx_setfreq(0, globalSettings.usbCarrierFreq);
|
si5351bx_setfreq(0, globalSettings.usbCarrierFreq);
|
||||||
setFrequency(GetActiveVfoFreq());
|
setFrequency(GetActiveVfoFreq());
|
||||||
updateDisplay();
|
|
||||||
setupExit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupCwDelay(){
|
void setupCwDelay(){
|
||||||
|
Loading…
Reference in New Issue
Block a user