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

View File

@ -787,7 +787,7 @@ void doMenu(){
if (isNeedDisplay) { if (isNeedDisplay) {
strcpy(b, "Tune Step:"); strcpy(b, "Tune Step:");
itoa(arTuneStep[tuneStepIndex], c, 10); itoa(arTuneStep[tuneStepIndex -1], c, 10);
strcat(b, c); strcat(b, c);
printLine2(b); printLine2(b);
isNeedDisplay = 0; isNeedDisplay = 0;
@ -799,18 +799,12 @@ void doMenu(){
select += (i > 0 ? 1 : -1); select += (i > 0 ? 1 : -1);
if (select * select >= 25) { //Threshold 5 * 5 = 25 if (select * select >= 25) { //Threshold 5 * 5 = 25
if (select < 0) if (select < 0) {
{ if (tuneStepIndex > 1)
if (tuneStepIndex == 0)
tuneStepIndex = 4;
else
tuneStepIndex--; tuneStepIndex--;
} }
else else {
{ if (tuneStepIndex < 5)
if (tuneStepIndex == 4)
tuneStepIndex = 0;
else
tuneStepIndex++; tuneStepIndex++;
} }
select = 0; select = 0;
@ -841,10 +835,13 @@ void doMenu(){
if (!modeCalibrate && select + i < 80) if (!modeCalibrate && select + i < 80)
select += i; 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 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); menuBand(btnState);
else if (select < 20) else if (select < 20)
menuRitToggle(btnState); menuRitToggle(btnState);