Skip to content

Commit

Permalink
Merge pull request #22 from phdlee/version1.03
Browse files Browse the repository at this point in the history
Version1.03
  • Loading branch information
phdlee authored Mar 5, 2018
2 parents c911d26 + bf68dd6 commit d926b15
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
25 changes: 24 additions & 1 deletion ubitx_20/ubitx_20.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -1087,7 +1110,7 @@ void setup()

//Serial.begin(9600);
lcd.begin(16, 2);
printLineF(1, F("CECBT v1.01"));
printLineF(1, F("CECBT v1.03"));

Init_Cat(38400, SERIAL_8N1);
initMeter(); //not used in this build
Expand Down
4 changes: 2 additions & 2 deletions ubitx_20/ubitx_menu.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions ubitx_20/ubitx_ui.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d926b15

Please sign in to comment.