change tune step size and fixed bug
This commit is contained in:
parent
3d019cdd44
commit
d229a10092
@ -160,7 +160,8 @@ int count = 0; //to generally count ticks, loops, etc
|
|||||||
#define TX_TUNE_TYPE 261 //
|
#define TX_TUNE_TYPE 261 //
|
||||||
#define HAM_BAND_RANGE 262 //FROM (2BYTE) TO (2BYTE) * 10 = 40byte
|
#define HAM_BAND_RANGE 262 //FROM (2BYTE) TO (2BYTE) * 10 = 40byte
|
||||||
#define HAM_BAND_FREQS 302 //40, 1 BAND = 4Byte most bit is mode
|
#define HAM_BAND_FREQS 302 //40, 1 BAND = 4Byte most bit is mode
|
||||||
#define TUNING_STEP 342 //TUNING STEP * 6 (index 1 + STEPS 5)
|
#define TUNING_STEP 342 //TUNING STEP * 6 (index 1 + STEPS 5) //1STEP :
|
||||||
|
|
||||||
|
|
||||||
//for reduce cw key error, eeprom address
|
//for reduce cw key error, eeprom address
|
||||||
#define CW_ADC_MOST_BIT1 348 //most 2bits of DOT_TO , DOT_FROM, ST_TO, ST_FROM
|
#define CW_ADC_MOST_BIT1 348 //most 2bits of DOT_TO , DOT_FROM, ST_TO, ST_FROM
|
||||||
@ -260,7 +261,7 @@ byte sideToneSub = 0;
|
|||||||
//DialLock
|
//DialLock
|
||||||
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];
|
long arTuneStep[5];
|
||||||
byte tuneStepIndex; //default Value 0, start Offset is 0 because of check new user
|
byte tuneStepIndex; //default Value 0, start Offset is 0 because of check new user
|
||||||
|
|
||||||
byte displayOption1 = 0;
|
byte displayOption1 = 0;
|
||||||
@ -806,6 +807,21 @@ void storeFrequencyAndMode(byte saveType)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int byteToSteps(byte srcByte) {
|
||||||
|
byte powerVal = (byte)(srcByte >> 6);
|
||||||
|
unsigned int baseVal = srcByte & 0x3F;
|
||||||
|
|
||||||
|
if (powerVal == 1)
|
||||||
|
return baseVal * 10;
|
||||||
|
else if (powerVal == 2)
|
||||||
|
return baseVal * 100;
|
||||||
|
else if (powerVal == 3)
|
||||||
|
return baseVal * 1000;
|
||||||
|
else
|
||||||
|
return baseVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The settings are read from EEPROM. The first time around, the values may not be
|
* The settings are read from EEPROM. The first time around, the values may not be
|
||||||
* present or out of range, in this case, some intelligent defaults are copied into the
|
* present or out of range, in this case, some intelligent defaults are copied into the
|
||||||
@ -926,8 +942,8 @@ void initSettings(){
|
|||||||
findedValidValueCount = 0;
|
findedValidValueCount = 0;
|
||||||
EEPROM.get(TUNING_STEP, tuneStepIndex);
|
EEPROM.get(TUNING_STEP, tuneStepIndex);
|
||||||
for (byte i = 0; i < 5; i++) {
|
for (byte i = 0; i < 5; i++) {
|
||||||
arTuneStep[i] = EEPROM.read(TUNING_STEP + i + 1);
|
arTuneStep[i] = byteToSteps(EEPROM.read(TUNING_STEP + i + 1));
|
||||||
if (arTuneStep[i] >= 1 && arTuneStep[i] < 251) //Maximum 250 for check valid Value
|
if (arTuneStep[i] >= 1 && arTuneStep[i] <= 60000) //Maximum 650 for check valid Value
|
||||||
findedValidValueCount++;
|
findedValidValueCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1211,7 +1211,7 @@ void menuSetupCwTone(int btn){
|
|||||||
//save the setting
|
//save the setting
|
||||||
if (digitalRead(PTT) == LOW){
|
if (digitalRead(PTT) == LOW){
|
||||||
printLineF2(F("Sidetone set!"));
|
printLineF2(F("Sidetone set!"));
|
||||||
EEPROM.put(CW_SIDETONE, usbCarrier);
|
EEPROM.put(CW_SIDETONE, sideTone);
|
||||||
delay_background(2000, 0);
|
delay_background(2000, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user