Merge pull request #22 from phdlee/version1.03

Version1.03
This commit is contained in:
phdlee 2018-03-05 12:55:41 +09:00 committed by GitHub
commit d926b15e3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 3 deletions

View File

@ -176,6 +176,10 @@ int count = 0; //to generally count ticks, loops, etc
#define CW_ADC_BOTH_FROM 356 //CW ADC Range BOTH from (Lower 8 bit) #define CW_ADC_BOTH_FROM 356 //CW ADC Range BOTH from (Lower 8 bit)
#define CW_ADC_BOTH_TO 357 //CW ADC Range BOTH to (Lower 8 bit) #define CW_ADC_BOTH_TO 357 //CW ADC Range BOTH to (Lower 8 bit)
#define CW_KEY_TYPE 358 #define CW_KEY_TYPE 358
#define CW_DISPLAY_SHIFT 359 //Transmits on CWL, CWU Mode, LCD Frequency shifts Sidetone Frequency.
//(7:Enable / Disable //0: enable, 1:disable, (default is applied shift)
//6 : 0 : Adjust Pulus, 1 : Adjust Minus
//0~5: Adjust Value : * 10 = Adjust Value (0~300)
#define DISPLAY_OPTION1 361 //Display Option1 #define DISPLAY_OPTION1 361 //Display Option1
#define DISPLAY_OPTION2 362 //Display Option2 #define DISPLAY_OPTION2 362 //Display Option2
@ -285,6 +289,9 @@ bool Iambic_Key = true;
#define IAMBICB 0x10 // 0 for Iambic A, 1 for Iambic B #define IAMBICB 0x10 // 0 for Iambic A, 1 for Iambic B
unsigned char keyerControl = IAMBICB; unsigned char keyerControl = IAMBICB;
byte isShiftDisplayCWFreq = 1; //Display Frequency
int shiftDisplayAdjustVal = 0; //
//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
byte cwAutoTextCount = 0; //cwAutoText Count byte cwAutoTextCount = 0; //cwAutoText Count
@ -963,6 +970,22 @@ void initSettings(){
cwAdcBothFrom = EEPROM.read(CW_ADC_BOTH_FROM) | ((tmpMostBits & 0x30) << 4); cwAdcBothFrom = EEPROM.read(CW_ADC_BOTH_FROM) | ((tmpMostBits & 0x30) << 4);
cwAdcBothTo = EEPROM.read(CW_ADC_BOTH_TO) | ((tmpMostBits & 0xC0) << 2); cwAdcBothTo = EEPROM.read(CW_ADC_BOTH_TO) | ((tmpMostBits & 0xC0) << 2);
//Display Type for CW mode
isShiftDisplayCWFreq = EEPROM.read(CW_DISPLAY_SHIFT);
//Adjust CW Mode Freq
shiftDisplayAdjustVal = (isShiftDisplayCWFreq & 0x3F) * 10;
//check Minus
if ((isShiftDisplayCWFreq & 0x40) == 0x40)
shiftDisplayAdjustVal = shiftDisplayAdjustVal * -1;
//Shift Display Check (Default : 0)
if ((isShiftDisplayCWFreq & 0x80) == 0) //Enabled
isShiftDisplayCWFreq = 1;
else //Disabled
isShiftDisplayCWFreq = 0;
//default Value (for original hardware) //default Value (for original hardware)
if (cwAdcSTFrom >= cwAdcSTTo) if (cwAdcSTFrom >= cwAdcSTTo)
{ {
@ -1087,7 +1110,7 @@ void setup()
//Serial.begin(9600); //Serial.begin(9600);
lcd.begin(16, 2); lcd.begin(16, 2);
printLineF(1, F("CECBT v1.01")); printLineF(1, F("CECBT v1.03"));
Init_Cat(38400, SERIAL_8N1); Init_Cat(38400, SERIAL_8N1);
initMeter(); //not used in this build initMeter(); //not used in this build

View File

@ -1149,9 +1149,9 @@ void menuSetupCarrier(int btn){
knob = enc_read(); knob = enc_read();
if (knob > 0) if (knob > 0)
usbCarrier -= 50; usbCarrier -= 5;
else if (knob < 0) else if (knob < 0)
usbCarrier += 50; usbCarrier += 5;
else else
continue; //don't update the frequency or the display continue; //don't update the frequency or the display

View File

@ -281,6 +281,15 @@ void updateDisplay() {
strcat(c, "B:"); strcat(c, "B:");
} }
//Fixed by Mitani Massaru (JE4SMQ)
if (isShiftDisplayCWFreq == 1)
{
if (cwMode == 1) //CWL
tmpFreq = tmpFreq - sideTone + shiftDisplayAdjustVal;
else if (cwMode == 2) //CWU
tmpFreq = tmpFreq + sideTone + shiftDisplayAdjustVal;
}
//display frequency //display frequency
for (int i = 15; i >= 6; i--) { for (int i = 15; i >= 6; i--) {
if (tmpFreq > 0) { if (tmpFreq > 0) {