From ed767f2e3485d2c039c7049eaadf6cf7db0deb8a Mon Sep 17 00:00:00 2001 From: phdlee Date: Sat, 10 Feb 2018 13:29:30 +0900 Subject: [PATCH 1/3] CW Start Delay applied New CW Logic --- ubitx_20/ubitx_keyer.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ubitx_20/ubitx_keyer.ino b/ubitx_20/ubitx_keyer.ino index 9aed3d3..be8c2f6 100644 --- a/ubitx_20/ubitx_keyer.ino +++ b/ubitx_20/ubitx_keyer.ino @@ -172,6 +172,9 @@ void cwKeyer(void){ keyerControl &= ~(DIT_L + DAH_L); // clear both paddle latch bits keyerState = KEYED; // next state if (!inTx){ + //DelayTime Option + delay_background(delayBeforeCWStartTime * 2, 2); + keyDown = 0; cwTimeout = millis() + cwDelayTime * 10; //+ CW_TIMEOUT; startTx(TX_CW, 1); @@ -212,6 +215,9 @@ void cwKeyer(void){ if (update_PaddleLatch(0) == DIT_L) { // if we are here, it is only because the key is pressed if (!inTx){ + //DelayTime Option + delay_background(delayBeforeCWStartTime * 2, 2); + keyDown = 0; cwTimeout = millis() + cwDelayTime * 10; //+ CW_TIMEOUT; startTx(TX_CW, 1); From 81333e7af4fd85a9b01f2b81b5c2b81ca5178a1a Mon Sep 17 00:00:00 2001 From: phdlee Date: Sat, 10 Feb 2018 15:07:56 +0900 Subject: [PATCH 2/3] modified CW Key Logic for AutoKey and reduce cpu use rate, reduce program memory --- ubitx_20/ubitx_20.ino | 22 ++-------------------- ubitx_20/ubitx_keyer.ino | 9 +++++---- ubitx_20/ubitx_menu.ino | 4 ++-- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/ubitx_20/ubitx_20.ino b/ubitx_20/ubitx_20.ino index c0768e6..6f81cb2 100644 --- a/ubitx_20/ubitx_20.ino +++ b/ubitx_20/ubitx_20.ino @@ -1116,11 +1116,6 @@ void setup() factory_alignment(); } - -//for debug -int dbgCnt = 0; -byte flasher = 0; - //Auto save Frequency and Mode with Protected eeprom life by KD8CEC void checkAutoSaveFreqMode() { @@ -1139,21 +1134,8 @@ void checkAutoSaveFreqMode() //check time for Frequency auto save if (millis() - saveCheckTime > saveIntervalSec * 1000) { - /* - if (vfoActive == VFO_A) - { - vfoA = frequency; - vfoA_mode = modeToByte(); - storeFrequencyAndMode(1); - } - else - { - vfoB = frequency; - vfoB_mode = modeToByte(); - storeFrequencyAndMode(2); - } - */ FrequencyToVFO(1); + saveCheckTime = 0; //for reduce cpu use rate } } } @@ -1180,11 +1162,11 @@ void loop(){ if (isCWAutoMode == 0 && beforeIdle_ProcessTime < millis() - 250) { idle_process(); + checkAutoSaveFreqMode(); //move here form out scope for reduce cpu use rate beforeIdle_ProcessTime = millis(); } } //end of check TX Status //we check CAT after the encoder as it might put the radio into TX Check_Cat(inTx? 1 : 0); - checkAutoSaveFreqMode(); } diff --git a/ubitx_20/ubitx_keyer.ino b/ubitx_20/ubitx_keyer.ino index be8c2f6..308bf7d 100644 --- a/ubitx_20/ubitx_keyer.ino +++ b/ubitx_20/ubitx_keyer.ino @@ -235,13 +235,14 @@ void cwKeyer(void){ keyDown = 0; stopTx(); } - if (!cwTimeout) - return; + //if (!cwTimeout) //removed by KD8CEC + // return; // got back to the beginning of the loop, if no further activity happens on straight key // we will time out, and return out of this routine //delay(5); - delay_background(5, 3); - continue; + //delay_background(5, 3); //removed by KD8CEC + //continue; //removed by KD8CEC + return; //Tx stop control by Main Loop } Check_Cat(2); diff --git a/ubitx_20/ubitx_menu.ino b/ubitx_20/ubitx_menu.ino index 8ae6e53..4542a0c 100644 --- a/ubitx_20/ubitx_menu.ino +++ b/ubitx_20/ubitx_menu.ino @@ -1345,7 +1345,7 @@ void doMenu(){ //ADJUST TUNE STEP if (btnDownTimeCount > PRESS_ADJUST_TUNE) { - printLineF1(F("Press to set step")); + printLineF1(F("Press to set")); isNeedDisplay = 1; //check to need display for display current value while (!btnDown()) @@ -1382,7 +1382,7 @@ void doMenu(){ } } //end of while - printLineF2(F("Changed Step!")); + //printLineF2(F("Changed Step!")); //remarked for reduce program memory by KD8CEC //SAVE EEPROM EEPROM.put(TUNING_STEP, tuneStepIndex); delay_background(500, 0); From e0f91489727a27187044e241dc286a6227749962 Mon Sep 17 00:00:00 2001 From: phdlee Date: Tue, 13 Feb 2018 19:54:19 +0900 Subject: [PATCH 3/3] Change RIT tune step (freq tune step) --- ubitx_20/ubitx_20.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ubitx_20/ubitx_20.ino b/ubitx_20/ubitx_20.ino index 6f81cb2..0e66cc8 100644 --- a/ubitx_20/ubitx_20.ino +++ b/ubitx_20/ubitx_20.ino @@ -749,9 +749,11 @@ void doRIT(){ unsigned long old_freq = frequency; if (knob < 0) - frequency -= 100l; + frequency -= (arTuneStep[tuneStepIndex -1]); // + //frequency -= 100l; else if (knob > 0) - frequency += 100; + frequency += (arTuneStep[tuneStepIndex -1]); // + //frequency += 100; if (old_freq != frequency){ setFrequency(frequency);