mirror of
https://codeberg.org/mclemens/ubitxv6.git
synced 2024-09-10 13:54:21 -04:00
Move tone down to keep the menus in a somewhat orderly fashion
This commit is contained in:
parent
b99e13eff4
commit
58bfe55620
72
setup.cpp
72
setup.cpp
@ -141,42 +141,6 @@ void runSetting(const SettingScreen_t* const p_screen)
|
|||||||
|
|
||||||
#define LIMIT(val,min,max) ((val) < (min)) ? (min) : (((max) < (val)) ? (max) : (val))
|
#define LIMIT(val,min,max) ((val) < (min)) ? (min) : (((max) < (val)) ? (max) : (val))
|
||||||
|
|
||||||
//CW Tone
|
|
||||||
ssCwToneInitialize(long int* start_value_out)
|
|
||||||
{
|
|
||||||
*start_value_out = globalSettings.cwSideToneFreq;
|
|
||||||
}
|
|
||||||
ssCwToneValidate(const long int candidate_value_in, long int* validated_value_out)
|
|
||||||
{
|
|
||||||
*validated_value_out = LIMIT(candidate_value_in,100,2000);
|
|
||||||
}
|
|
||||||
ssCwToneChange(const long int new_value, char* buff_out, const size_t buff_out_size)
|
|
||||||
{
|
|
||||||
globalSettings.cwSideToneFreq = new_value;
|
|
||||||
tone(CW_TONE, globalSettings.cwSideToneFreq);
|
|
||||||
ltoa(globalSettings.cwSideToneFreq,buff_out,10);
|
|
||||||
strncat_P(buff_out,(const char*)F("Hz"),buff_out_size - strlen(buff_out));
|
|
||||||
}
|
|
||||||
ssCwToneFinalize(const long int final_value)
|
|
||||||
{
|
|
||||||
noTone(CW_TONE);
|
|
||||||
globalSettings.cwSideToneFreq = final_value;
|
|
||||||
SaveSettingsToEeprom();
|
|
||||||
}
|
|
||||||
const char SS_CW_TONE_T [] PROGMEM = "Set CW Tone";
|
|
||||||
const char SS_CW_TONE_A [] PROGMEM = "Select a frequency that\nCW mode to tune for";
|
|
||||||
const SettingScreen_t ssTone PROGMEM = {
|
|
||||||
SS_CW_TONE_T,
|
|
||||||
SS_CW_TONE_A,
|
|
||||||
1,
|
|
||||||
10,
|
|
||||||
ssCwToneInitialize,
|
|
||||||
ssCwToneValidate,
|
|
||||||
ssCwToneChange,
|
|
||||||
ssCwToneFinalize
|
|
||||||
};
|
|
||||||
void runToneSetting(){runSetting(&ssTone);}
|
|
||||||
|
|
||||||
//Local Oscillator
|
//Local Oscillator
|
||||||
void ssLocalOscInitialize(long int* start_value_out){
|
void ssLocalOscInitialize(long int* start_value_out){
|
||||||
{
|
{
|
||||||
@ -261,6 +225,42 @@ const SettingScreen_t ssBfo PROGMEM = {
|
|||||||
};
|
};
|
||||||
void runBfoSetting(){runSetting(&ssBfo);}
|
void runBfoSetting(){runSetting(&ssBfo);}
|
||||||
|
|
||||||
|
//CW Tone
|
||||||
|
ssCwToneInitialize(long int* start_value_out)
|
||||||
|
{
|
||||||
|
*start_value_out = globalSettings.cwSideToneFreq;
|
||||||
|
}
|
||||||
|
ssCwToneValidate(const long int candidate_value_in, long int* validated_value_out)
|
||||||
|
{
|
||||||
|
*validated_value_out = LIMIT(candidate_value_in,100,2000);
|
||||||
|
}
|
||||||
|
ssCwToneChange(const long int new_value, char* buff_out, const size_t buff_out_size)
|
||||||
|
{
|
||||||
|
globalSettings.cwSideToneFreq = new_value;
|
||||||
|
tone(CW_TONE, globalSettings.cwSideToneFreq);
|
||||||
|
ltoa(globalSettings.cwSideToneFreq,buff_out,10);
|
||||||
|
strncat_P(buff_out,(const char*)F("Hz"),buff_out_size - strlen(buff_out));
|
||||||
|
}
|
||||||
|
ssCwToneFinalize(const long int final_value)
|
||||||
|
{
|
||||||
|
noTone(CW_TONE);
|
||||||
|
globalSettings.cwSideToneFreq = final_value;
|
||||||
|
SaveSettingsToEeprom();
|
||||||
|
}
|
||||||
|
const char SS_CW_TONE_T [] PROGMEM = "Set CW Tone";
|
||||||
|
const char SS_CW_TONE_A [] PROGMEM = "Select a frequency that\nCW mode to tune for";
|
||||||
|
const SettingScreen_t ssTone PROGMEM = {
|
||||||
|
SS_CW_TONE_T,
|
||||||
|
SS_CW_TONE_A,
|
||||||
|
1,
|
||||||
|
10,
|
||||||
|
ssCwToneInitialize,
|
||||||
|
ssCwToneValidate,
|
||||||
|
ssCwToneChange,
|
||||||
|
ssCwToneFinalize
|
||||||
|
};
|
||||||
|
void runToneSetting(){runSetting(&ssTone);}
|
||||||
|
|
||||||
void setupCwDelay(){
|
void setupCwDelay(){
|
||||||
int knob = 0;
|
int knob = 0;
|
||||||
int prev_cw_delay;
|
int prev_cw_delay;
|
||||||
|
Loading…
Reference in New Issue
Block a user