From 4a6909f361e3bd3afbedcf8f264b32cdceef6675 Mon Sep 17 00:00:00 2001 From: phdlee Date: Thu, 22 Feb 2018 12:26:18 +0900 Subject: [PATCH] Change BFO Cal Step(50 to 5), Change CW Frequency Method --- ubitx_20/ubitx_20.ino | 23 +++++++++++++++++++++++ ubitx_20/ubitx_menu.ino | 4 ++-- ubitx_20/ubitx_ui.ino | 9 +++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/ubitx_20/ubitx_20.ino b/ubitx_20/ubitx_20.ino index 0e66cc8..4c12b81 100644 --- a/ubitx_20/ubitx_20.ino +++ b/ubitx_20/ubitx_20.ino @@ -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_TO 357 //CW ADC Range BOTH to (Lower 8 bit) #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_OPTION2 362 //Display Option2 @@ -285,6 +289,9 @@ bool Iambic_Key = true; #define IAMBICB 0x10 // 0 for Iambic A, 1 for Iambic B unsigned char keyerControl = IAMBICB; +byte isShiftDisplayCWFreq = 1; //Display Frequency +int shiftDisplayAdjustVal = 0; // + //Variables for auto cw mode byte isCWAutoMode = 0; //0 : none, 1 : CW_AutoMode_Menu_Selection, 2 : CW_AutoMode Sending byte cwAutoTextCount = 0; //cwAutoText Count @@ -963,6 +970,22 @@ void initSettings(){ cwAdcBothFrom = EEPROM.read(CW_ADC_BOTH_FROM) | ((tmpMostBits & 0x30) << 4); 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) if (cwAdcSTFrom >= cwAdcSTTo) { diff --git a/ubitx_20/ubitx_menu.ino b/ubitx_20/ubitx_menu.ino index 4542a0c..d4011a3 100644 --- a/ubitx_20/ubitx_menu.ino +++ b/ubitx_20/ubitx_menu.ino @@ -1149,9 +1149,9 @@ void menuSetupCarrier(int btn){ knob = enc_read(); if (knob > 0) - usbCarrier -= 50; + usbCarrier -= 5; else if (knob < 0) - usbCarrier += 50; + usbCarrier += 5; else continue; //don't update the frequency or the display diff --git a/ubitx_20/ubitx_ui.ino b/ubitx_20/ubitx_ui.ino index 34fe5ad..56ccdbe 100644 --- a/ubitx_20/ubitx_ui.ino +++ b/ubitx_20/ubitx_ui.ino @@ -281,6 +281,15 @@ void updateDisplay() { 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 for (int i = 15; i >= 6; i--) { if (tmpFreq > 0) {