default set for new users

This commit is contained in:
phdlee 2018-01-22 21:16:29 +09:00
parent 4d61cf4de9
commit bbb23bf817
2 changed files with 17 additions and 20 deletions

View File

@ -237,7 +237,7 @@ byte sideToneSub = 0;
byte isDialLock = 0; //000000[0]vfoB [0]vfoA 0Bit : A, 1Bit : B
byte isTxType = 0; //000000[0 - isSplit] [0 - isTXStop]
byte arTuneStep[5];
byte tuneStepIndex;
byte tuneStepIndex; //default Value 0, start Offset is 0 because of check new user
//Variables for auto cw mode
byte isCWAutoMode = 0; //0 : none, 1 : CW_AutoMode_Menu_Selection, 2 : CW_AutoMode Sending
@ -424,10 +424,7 @@ void setTXFilters(unsigned long freq){
*/
void setFrequency(unsigned long f){
//1 digits discarded
//byte arTuneStep[] = {10, 20, 50, 100, 200};
//byte tuneStepIndex = 2;
f = (f / arTuneStep[tuneStepIndex]) * arTuneStep[tuneStepIndex];
f = (f / arTuneStep[tuneStepIndex -1]) * arTuneStep[tuneStepIndex -1];
setTXFilters(f);
@ -605,7 +602,7 @@ void doTuning(){
prev_freq = frequency;
//incdecValue = tuningStep * s;
frequency += (arTuneStep[tuneStepIndex] * s);
frequency += (arTuneStep[tuneStepIndex -1] * s);
if (prev_freq < 10000000l && frequency > 10000000l)
isUSB = true;
@ -780,9 +777,12 @@ void initSettings(){
arTuneStep[2] = 50;
arTuneStep[3] = 100;
arTuneStep[4] = 200;
tuneStepIndex = 2;
}
if (tuneStepIndex == 0) //New User
tuneStepIndex = 3;
if (cwDelayTime < 1 || cwDelayTime > 250)
cwDelayTime = 60;

View File

@ -787,7 +787,7 @@ void doMenu(){
if (isNeedDisplay) {
strcpy(b, "Tune Step:");
itoa(arTuneStep[tuneStepIndex], c, 10);
itoa(arTuneStep[tuneStepIndex -1], c, 10);
strcat(b, c);
printLine2(b);
isNeedDisplay = 0;
@ -799,18 +799,12 @@ void doMenu(){
select += (i > 0 ? 1 : -1);
if (select * select >= 25) { //Threshold 5 * 5 = 25
if (select < 0)
{
if (tuneStepIndex == 0)
tuneStepIndex = 4;
else
if (select < 0) {
if (tuneStepIndex > 1)
tuneStepIndex--;
}
else
{
if (tuneStepIndex == 4)
tuneStepIndex = 0;
else
else {
if (tuneStepIndex < 5)
tuneStepIndex++;
}
select = 0;
@ -841,10 +835,13 @@ void doMenu(){
if (!modeCalibrate && select + i < 80)
select += i;
}
if (i < 0 && select - i >= 0)
//if (i < 0 && select - i >= 0)
if (i < 0 && select - i >= -10)
select += i; //caught ya, i is already -ve here, so you add it
if (select < 10)
if (select < -5)
menuExit(btnState);
else if (select < 10)
menuBand(btnState);
else if (select < 20)
menuRitToggle(btnState);