Compare commits

...

20 Commits
v0.25 ... v0.28

Author SHA1 Message Date
phdlee
ebbc5aae5e Merge pull request #9 from phdlee/version0.28
change delaytimes via cat
2018-01-18 11:47:21 +09:00
phdlee
587d4854c3 change delaytimes via cat 2018-01-17 14:05:20 +09:00
phdlee
95e5c1dfe5 Update README.md 2018-01-14 14:53:28 +09:00
phdlee
45a8479061 Update README.md 2018-01-14 14:52:58 +09:00
phdlee
a6ad381c24 Update README.md 2018-01-14 14:52:22 +09:00
phdlee
bcf80f851d Update README.md 2018-01-14 14:51:46 +09:00
phdlee
16304efacd Update README.md 2018-01-14 14:51:23 +09:00
phdlee
968024ab73 Merge pull request #7 from phdlee/beta0.26
Beta0.26
2018-01-14 14:19:53 +09:00
phdlee
3e60728727 Update README.md 2018-01-13 22:27:23 +09:00
phdlee
924db221f4 bug fix 0.26_2 2018-01-13 19:42:39 +09:00
phdlee
b9b8f4b46f bug fix 0.26 2018-01-13 16:19:23 +09:00
phdlee
9781ef086b Update README.md 2018-01-13 10:58:47 +09:00
phdlee
f27f504ea4 Merge pull request #6 from phdlee/beta0.26
Beta0.26
2018-01-12 20:19:09 +09:00
phdlee
b2d3e3a6f8 cat 38400 to 9600 2018-01-12 19:58:20 +09:00
phdlee
2b08a76fbf Update README.md 2018-01-12 10:16:59 +09:00
phdlee
f9050ebb11 for 0.26version commit1 2018-01-12 09:54:38 +09:00
phdlee
90655e03b8 Update README.md
add status of project
2018-01-12 09:51:58 +09:00
phdlee
8551ff1b68 Update README.md 2018-01-11 17:40:00 +09:00
phdlee
5ce94e8e49 Merge pull request #5 from qiwenmin/master
Fix the delay condition bug when overflow
2018-01-10 13:51:59 +09:00
Qi Wenmin
7ef9c29fa8 Fix the delay condition bug when overflow
The original expression will cause bug when overflow.
2018-01-10 12:00:53 +08:00
5 changed files with 304 additions and 144 deletions

View File

@@ -1,11 +1,67 @@
#IMPORTANT INFORMATION
----------------------------------------------------------------------------
- Beta 0.26 and Beta 0.261, Beta 0.262, Beta 0.27 is complete test
- You can download and use it.
#NOTICE
----------------------------------------------------------------------------
I received uBITX a month ago and found that many features are required, and began coding with the idea of implementing minimal functionality as a general hf transceiver rather than an experimental device.
- fixed bugs...
- Diallock for uBITX's sensitive encoders
- built in softare Memory keyer and cw options control for CW communication
- Implementation of CAT communication protocol for Digital Communication (as FT8, JT65, etc)
- Delay Options for external Linear.
- and more...
Most of the basic functions of the HF transceiver I thought were implemented.
The minimum basic specification for uBITX to operate as a radio, I think it is finished.
So I will release the 0.27 version and if I do not see the bug anymore, I will try to change the version name to 1.0.
Now uBITX is an HF radio and will be able to join you in your happy hams life.
Based on this source, you can use it by adding functions.
I am going to do a new project based on this source, linking with WSPR, WSJT-X and so on.
Of course, this repository is still running. If you have any bugs or ideas, please feel free to email me.
http://www.hamskey.com
DE KD8CEC
kd8cec@gmail.com
#uBITX
uBITX firmware, written for the Raduino/Arduino control of uBITX transceivers
This project is based on https://github.com/afarhan/ubitx and all copyright is inherited.
The copyright information of the original is below.
KD8CEC
----------------------------------------------------------------------------
Prepared or finished tasks for the next version
- Most of them are implemented and included in version 0.27.
- User Interface on LCD -> Option by user (not need)
- Include WSPR Beacone function - (implement other new repository)
complete experiment
need solve : Big code size (over 100%, then remove some functions for experment)
need replace Si5351 Library (increase risk and need more beta tester)
W3PM sent me his wonderful source - using BITX, GPS
----------------------------------------------------------------------------
## REVISION RECORD
0.27
(First alpha test version, This will be renamed to the major version 1.0)
- Dual VFO Dial Lock (vfoA Dial lock)
- Support Ham band on uBITX
default Hamband is regeion1 but customize by uBITX Manager Software
- Advanced ham band options (Tx control) for use in all countries. You can adjust it yourself.
- Convenience of band movement
0.26
- only Beta tester released & source code share
- find a bug on none initial eeprom uBITX - Fixed (Check -> initialized & compatible original source code)
- change the version number 0.26 -> 0.27
- Prevent overflow bugs
- bug with linux based Hamlib (raspberry pi), It was perfect for the 0.224 version, but there was a problem for the 0.25 version.
On Windows, ham deluxe, wsjt-x, jt65-hf, and fldigi were successfully run. Problem with Raspberry pi.
0.25
- Beta Version Released
http://www.hamskey.com/2018/01/release-beta-version-of-cat-support.html

View File

@@ -181,7 +181,7 @@ void CatSetPTT(boolean isPTTOn, byte fromType)
void CatVFOToggle(boolean isSendACK, byte fromType)
{
if (fromType != 2 && fromType != 3) {
menuVfoToggle(1);
menuVfoToggle(1, 0);
}
if (isSendACK)
@@ -470,8 +470,8 @@ void WriteEEPRom_FT817(byte fromType)
sideTone = (sideTonePitch * 50 + 300) + sideToneSub;
printLineF2(F("Sidetone set! CAT"));
EEPROM.put(CW_SIDETONE, sideTone);
delay(500);
printLine2("");
delay(300); //If timeout errors occur in the calling software, remove them
printLine2(""); //Ham radio deluxe is the only one that supports this feature yet. and ham radio deluxe has wait time as greater than 500ms
}
break;
@@ -482,8 +482,8 @@ void WriteEEPRom_FT817(byte fromType)
sideTone = (sideTonePitch * 50 + 300) + sideToneSub;
printLineF2(F("Sidetone set! CAT"));
EEPROM.put(CW_SIDETONE, sideTone);
delay(500);
printLine2("");
delay(300); //If timeout errors occur in the calling software, remove them
printLine2(""); //Ham radio deluxe is the only one that supports this feature yet. and ham radio deluxe has wait time as greater than 500ms
}
break;
@@ -502,7 +502,7 @@ void WriteEEPRom_FT817(byte fromType)
cwDelayTime = CAT_BUFF[2];
printLineF2(F("CW Speed set!"));
EEPROM.put(CW_DELAY, cwDelayTime);
delay(500);
delay(300);
printLine2("");
break;
case 0x62 : //
@@ -511,7 +511,7 @@ void WriteEEPRom_FT817(byte fromType)
cwSpeed = 1200 / ((CAT_BUFF[2] & 0x3F) + 4);
printLineF2(F("CW Speed set!"));
EEPROM.put(CW_SPEED, cwSpeed);
delay(500);
delay(300);
printLine2("");
break;
@@ -648,7 +648,6 @@ void Check_Cat(byte fromType)
rxBufferCheckCount = Serial.available();
rxBufferArriveTime = millis() + CAT_RECEIVE_TIMEOUT; //Set time for timeout
}
return;
}

View File

@@ -148,8 +148,13 @@ int count = 0; //to generally count ticks, loops, etc
#define VFO_B_MODE 257
#define CW_DELAY 258
#define CW_START 259
#define HAM_BAND_COUNT 260 //
#define TX_TUNE_TYPE 261 //
#define HAM_BAND_RANGE 262 //FROM (2BYTE) TO (2BYTE) * 10 = 40byte
#define HAM_BAND_FREQS 302 //40, 1 BAND = 4Byte most bit is mode
//
//Check Firmware type and version
#define FIRMWAR_ID_ADDR 776 //776 : 0x59, 777 :0x58, 778 : 0x68 : Id Number, if not found id, erase eeprom(32~1023) for prevent system error.
#define VERSION_ADDRESS 779 //check Firmware version
//USER INFORMATION
#define USER_CALLSIGN_KEY 780 //0x59
@@ -228,8 +233,9 @@ byte sideTonePitch=0;
byte sideToneSub = 0;
//DialLock
byte isDialLock = 0;
byte isTxOff = 0;
byte isDialLock = 0; //000000[0]vfoB [0]vfoA 0Bit : A, 1Bit : B
byte isTxType = 0; //000000[0 - isSplit] [0 - isTXStop]
//Variables for auto cw mode
byte isCWAutoMode = 0; //0 : none, 1 : CW_AutoMode_Menu_Selection, 2 : CW_AutoMode Sending
@@ -264,6 +270,69 @@ boolean modeCalibrate = false;//this mode of menus shows extended menus to calib
* you start hacking around
*/
//Ham Band
#define MAX_LIMIT_RANGE 10 //because limited eeprom size
byte useHamBandCount = 0; //0 use full range frequency
byte tuneTXType = 0; //0 : use full range, 1 : just Change Dial speed, 2 : just ham band change, but can general band by tune, 3 : only ham band (just support 0, 2 (0.26 version))
//100 : use full range but not TX on general band, 101 : just change dial speed but.. 2 : jut... but.. 3 : only ham band (just support 100, 102 (0.26 version))
unsigned int hamBandRange[MAX_LIMIT_RANGE][2]; // = //Khz because reduce use memory
//-1 : not found, 0 ~ 9 : Hamband index
char getIndexHambanBbyFreq(unsigned long f)
{
f = f / 1000;
for (byte i = 0; i < useHamBandCount; i++)
if (hamBandRange[i][0] <= f && f < hamBandRange[i][1])
return i;
return -1;
}
//when Band change step = just hamband
//moveDirection : 1 = next, -1 : prior
void setNextHamBandFreq(unsigned long f, char moveDirection)
{
unsigned long resultFreq = 0;
byte loadMode = 0;
char findedIndex = getIndexHambanBbyFreq(f);
if (findedIndex == -1) { //out of hamband
f = f / 1000;
for (byte i = 0; i < useHamBandCount -1; i++) {
if (hamBandRange[i][1] <= f && f < hamBandRange[i + 1][0]) {
findedIndex = i + moveDirection;
//return (unsigned long)(hamBandRange[i + 1][0]) * 1000;
}
} //end of for
}
else if (((moveDirection == 1) && (findedIndex < useHamBandCount -1)) || //Next
((moveDirection == -1) && (findedIndex > 0)) ) { //Prior
findedIndex += moveDirection;
}
else
findedIndex = -1;
if (findedIndex == -1)
findedIndex = (moveDirection == 1 ? 0 : useHamBandCount -1);
EEPROM.get(HAM_BAND_FREQS + 4 * findedIndex, resultFreq);
loadMode = (byte)(resultFreq >> 30);
resultFreq = resultFreq & 0x3FFFFFFF;
if ((resultFreq / 1000) < hamBandRange[findedIndex][0] || (resultFreq / 1000) > hamBandRange[findedIndex][1])
resultFreq = (unsigned long)(hamBandRange[findedIndex][0]) * 1000;
setFrequency(resultFreq);
byteWithFreqToMode(loadMode);
}
void saveBandFreqByIndex(unsigned long f, unsigned long mode, char bandIndex) {
if (bandIndex >= 0)
EEPROM.put(HAM_BAND_FREQS + 4 * bandIndex, (f & 0x3FFFFFFF) | (mode << 30) );
}
/*
KD8CEC
When using the basic delay of the Arduino, the program freezes.
@@ -275,7 +344,7 @@ unsigned long delayBeforeTime = 0;
byte delay_background(unsigned delayTime, byte fromType){ //fromType : 4 autoCWKey -> Check Paddle
delayBeforeTime = millis();
while (millis() <= delayBeforeTime + delayTime) {
while (millis() - delayBeforeTime <= delayTime) {
if (fromType == 4)
{
@@ -381,9 +450,15 @@ void setFrequency(unsigned long f){
void startTx(byte txMode, byte isDisplayUpdate){
unsigned long tx_freq = 0;
if (isTxOff != 1)
//Check Hamband only TX //Not found Hamband index by now frequency
if (tuneTXType >= 100 && getIndexHambanBbyFreq(ritOn ? ritTxFrequency : frequency) == -1) {
//no message
return;
}
if ((isTxType & 0x01) != 0x01)
digitalWrite(TX_RX, 1);
inTx = 1;
if (ritOn){
@@ -502,7 +577,8 @@ void doTuning(){
unsigned long prev_freq;
int incdecValue = 0;
if (isDialLock == 1)
if ((vfoActive == VFO_A && ((isDialLock & 0x01) == 0x01)) ||
(vfoActive == VFO_B && ((isDialLock & 0x02) == 0x02)))
return;
if (isCWAutoMode == 0 || cwAutoDialType == 1)
@@ -611,6 +687,7 @@ void storeFrequencyAndMode(byte saveType)
void initSettings(){
//read the settings from the eeprom and restore them
//if the readings are off, then set defaults
//for original source Section ===========================
EEPROM.get(MASTER_CAL, calibration);
EEPROM.get(USB_CAL, usbCarrier);
EEPROM.get(VFO_A, vfoA);
@@ -618,6 +695,30 @@ void initSettings(){
EEPROM.get(CW_SIDETONE, sideTone);
EEPROM.get(CW_SPEED, cwSpeed);
//for custom source Section =============================
//ID & Version Check from EEProm
//if found different firmware, erase eeprom (32
#define FIRMWAR_ID_ADDR 776 //776 : 0x59, 777 :0x58, 778 : 0x68 : Id Number, if not found id, erase eeprom(32~1023) for prevent system error.
if (EEPROM.read(FIRMWAR_ID_ADDR) != 0x59 ||
EEPROM.read(FIRMWAR_ID_ADDR + 1) != 0x58 ||
EEPROM.read(FIRMWAR_ID_ADDR + 2) != 0x68 ) {
printLineF(1, F("Init EEProm..."));
//initial all eeprom
for (unsigned int i = 32; i < 1024; i++) //protect Master_cal, usb_cal
EEPROM.write(i, 0);
//Write Firmware ID
EEPROM.write(FIRMWAR_ID_ADDR, 0x59);
EEPROM.write(FIRMWAR_ID_ADDR + 1, 0x58);
EEPROM.write(FIRMWAR_ID_ADDR + 2, 0x68);
}
//Version Write for Memory Management Software
if (EEPROM.read(VERSION_ADDRESS) != VERSION_NUM)
EEPROM.write(VERSION_ADDRESS, VERSION_NUM);
//for Save VFO_A_MODE to eeprom
//0: default, 1:not use, 2:LSB, 3:USB, 4:CW, 5:AM, 6:FM
EEPROM.get(VFO_A_MODE, vfoA_mode);
@@ -633,9 +734,22 @@ void initSettings(){
if (EEPROM.read(USER_CALLSIGN_KEY) == 0x59)
userCallsignLength = EEPROM.read(USER_CALLSIGN_LEN); //MAXIMUM 18 LENGTH
//Version Write for Memory Management Software
if (EEPROM.read(VERSION_ADDRESS) != VERSION_NUM)
EEPROM.write(VERSION_ADDRESS, VERSION_NUM);
//Ham Band Count
EEPROM.get(HAM_BAND_COUNT, useHamBandCount);
EEPROM.get(TX_TUNE_TYPE, tuneTXType);
if ((3 < tuneTXType && tuneTXType < 100) || 103 < tuneTXType || useHamBandCount < 1)
tuneTXType = 0;
//Read band Information
for (byte i = 0; i < useHamBandCount; i++) {
unsigned int tmpReadValue = 0;
EEPROM.get(HAM_BAND_RANGE + 4 * i, tmpReadValue);
hamBandRange[i][0] = tmpReadValue;
EEPROM.get(HAM_BAND_RANGE + 4 * i + 2, tmpReadValue);
hamBandRange[i][1] = tmpReadValue;
}
if (cwDelayTime < 1 || cwDelayTime > 250)
cwDelayTime = 60;
@@ -715,28 +829,35 @@ void initPorts(){
void setup()
{
//Init EEProm for Fault EEProm TEST and Factory Reset
/*
for (int i = 0; i < 1024; i++)
EEPROM.write(i, 0);
//Init EEProm for Fault EEProm TEST and Factory Reset
//please remove remark for others.
//for (int i = 0; i < 1024; i++)
for (int i = 16; i < 1024; i++) //protect Master_cal, usb_cal
EEPROM.write(i, 0xFF);
lcd.begin(16, 2);
printLineF(1, F("Complete Erase"));
sleep(1000);
//while(1);
//end section of test
*/
//Serial.begin(9600);
lcd.begin(16, 2);
printLineF(1, F("CECBT v0.27"));
Init_Cat(38400, SERIAL_8N1);
initMeter(); //not used in this build
initSettings();
printLineF(1, F("CECBT v0.25"));
if (userCallsignLength > 0 && ((userCallsignLength & 0x80) == 0x80))
{
if (userCallsignLength > 0 && ((userCallsignLength & 0x80) == 0x80)) {
userCallsignLength = userCallsignLength & 0x7F;
printLineFromEEPRom(0, 0, 0, userCallsignLength -1); //eeprom to lcd use offset (USER_CALLSIGN_DAT)
delay(500);
}
else
{
else {
printLineF(0, F("uBITX v0.20"));
delay_background(500, 0);
delay(500);
printLine2("");
}
@@ -751,95 +872,6 @@ void setup()
if (btnDown())
factory_alignment();
/*
//This is for auto key test
EEPROM.put(CW_AUTO_MAGIC_KEY, 0x73); //MAGIC KEY
EEPROM.put(CW_AUTO_COUNT, 3); //WORD COUNT
EEPROM.put(CW_AUTO_DATA + 0, 6); // 0 word begin postion / CQCQ TEST K
EEPROM.put(CW_AUTO_DATA + 1, 33); // 0 word end postion / CQCQ TEST K
EEPROM.put(CW_AUTO_DATA + 2, 34); //1 word begin position / LOL LOL
EEPROM.put(CW_AUTO_DATA + 3, 40); //1 word end position / LOL LOL
EEPROM.put(CW_AUTO_DATA + 4, 41); //2 word begin position / /?![]789
EEPROM.put(CW_AUTO_DATA + 5, 48); //2 word end position / /?![]789
EEPROM.put(CW_AUTO_DATA + 6, 'C'); //
EEPROM.put(CW_AUTO_DATA + 7, 'Q'); //
EEPROM.put(CW_AUTO_DATA + 8, 'C'); //
EEPROM.put(CW_AUTO_DATA + 9, 'Q'); //
EEPROM.put(CW_AUTO_DATA + 10, ' '); //
EEPROM.put(CW_AUTO_DATA + 11, 'D'); //
EEPROM.put(CW_AUTO_DATA + 12, 'E'); //
EEPROM.put(CW_AUTO_DATA + 13, ' '); //
EEPROM.put(CW_AUTO_DATA + 14, 'K'); //
EEPROM.put(CW_AUTO_DATA + 15, 'D'); //
EEPROM.put(CW_AUTO_DATA + 16, '8'); //
EEPROM.put(CW_AUTO_DATA + 17, 'C'); //
EEPROM.put(CW_AUTO_DATA + 18, 'E'); //
EEPROM.put(CW_AUTO_DATA + 19, 'C'); //
EEPROM.put(CW_AUTO_DATA + 20, ' '); //
EEPROM.put(CW_AUTO_DATA + 21, 'E'); //
EEPROM.put(CW_AUTO_DATA + 22, 'M'); //
EEPROM.put(CW_AUTO_DATA + 23, '3'); //
EEPROM.put(CW_AUTO_DATA + 24, '7'); //
EEPROM.put(CW_AUTO_DATA + 25, ' '); //
EEPROM.put(CW_AUTO_DATA + 26, 'D'); //
EEPROM.put(CW_AUTO_DATA + 27, 'E'); //
EEPROM.put(CW_AUTO_DATA + 28, ' '); //
EEPROM.put(CW_AUTO_DATA + 29, 'C'); //
EEPROM.put(CW_AUTO_DATA + 30, 'E'); //
EEPROM.put(CW_AUTO_DATA + 31, 'C'); //
EEPROM.put(CW_AUTO_DATA + 32, ' '); //
EEPROM.put(CW_AUTO_DATA + 33, 'K'); //
*/
/*
EEPROM.put(CW_AUTO_DATA + 34, '<'); //
EEPROM.put(CW_AUTO_DATA + 35, ' '); //
EEPROM.put(CW_AUTO_DATA + 36, '>'); //
EEPROM.put(CW_AUTO_DATA + 37, ' '); //
EEPROM.put(CW_AUTO_DATA + 38, '7'); //
EEPROM.put(CW_AUTO_DATA + 39, '3'); //
EEPROM.put(CW_AUTO_DATA + 40, 'K'); //
EEPROM.put(CW_AUTO_DATA + 41, 'C'); //
EEPROM.put(CW_AUTO_DATA + 42, 'Q'); //
EEPROM.put(CW_AUTO_DATA + 43, ' '); //
EEPROM.put(CW_AUTO_DATA + 44, '>'); // start "
EEPROM.put(CW_AUTO_DATA + 45, ' '); // end "
EEPROM.put(CW_AUTO_DATA + 46, '>'); //
EEPROM.put(CW_AUTO_DATA + 47, ' '); //
EEPROM.put(CW_AUTO_DATA + 48, 'K'); //
*/
/*
//This is for auto key test2
//USER CALL SIGN
EEPROM.put(USER_CALLSIGN_KEY, 0x59); //MAGIC KEY
//EEPROM.put(USER_CALLSIGN_LEN, 10); //WORD COUNT
EEPROM.put(USER_CALLSIGN_LEN, 10 + 0x80); //WORD COUNT
EEPROM.put(USER_CALLSIGN_DAT + 1, 'K'); //
EEPROM.put(USER_CALLSIGN_DAT + 2, 'D'); //
EEPROM.put(USER_CALLSIGN_DAT + 3, '8'); //
EEPROM.put(USER_CALLSIGN_DAT + 4, 'C'); //
EEPROM.put(USER_CALLSIGN_DAT + 5, 'E'); //
EEPROM.put(USER_CALLSIGN_DAT + 6, 'C'); //
EEPROM.put(USER_CALLSIGN_DAT + 7, '/'); //
EEPROM.put(USER_CALLSIGN_DAT + 8, 'A'); //
EEPROM.put(USER_CALLSIGN_DAT + 9, 'B'); //
EEPROM.put(USER_CALLSIGN_DAT + 10, 'C'); //
//CW QSO CALLSIGN
EEPROM.put(CW_STATION_LEN, 6); //
EEPROM.put(CW_STATION_LEN - 6 + 0 , 'A'); //
EEPROM.put(CW_STATION_LEN - 6 + 1 , 'B'); //
EEPROM.put(CW_STATION_LEN - 6 + 2 , '1'); //
EEPROM.put(CW_STATION_LEN - 6 + 3 , 'C'); //
EEPROM.put(CW_STATION_LEN - 6 + 4 , 'D'); //
EEPROM.put(CW_STATION_LEN - 6 + 5 , 'E'); //
*/
}

View File

@@ -15,12 +15,9 @@
int menuBand(int btn){
int knob = 0;
int band;
unsigned long offset;
int stepChangeCount = 0;
byte btnPressCount = 0;
// band = frequency/1000000l;
// offset = frequency % 1000000l;
if (!btn){
printLineF2(F("Band Select?"));
return;
@@ -31,6 +28,47 @@ int menuBand(int btn){
while (btnDown()) {
delay(50);
Check_Cat(0); //To prevent disconnections
if (btnPressCount++ > 20) {
btnPressCount = 0;
if (tuneTXType > 0) { //Just toggle 0 <-> 2, if tuneTXType is 100, 100 -> 0 -> 2
tuneTXType = 0;
printLineF2(F("Full range mode"));
}
else {
tuneTXType = 2;
//if empty band Information, auto insert default region 1 frequency range
//This part is made temporary for people who have difficulty setting up, so can remove it when you run out of memory.
if (useHamBandCount < 1) {
useHamBandCount = 10;
hamBandRange[0][0] = 1810; hamBandRange[0][1] = 2000;
hamBandRange[1][0] = 3500; hamBandRange[1][1] = 3800;
hamBandRange[2][0] = 5351; hamBandRange[2][1] = 5367;
hamBandRange[3][0] = 7000; hamBandRange[3][1] = 7200;
hamBandRange[4][0] = 10100; hamBandRange[4][1] = 10150;
hamBandRange[5][0] = 14000; hamBandRange[5][1] = 14350;
hamBandRange[6][0] = 18068; hamBandRange[6][1] = 18168;
hamBandRange[7][0] = 21000; hamBandRange[7][1] = 21450;
hamBandRange[8][0] = 24890; hamBandRange[8][1] = 24990;
hamBandRange[9][0] = 28000; hamBandRange[9][1] = 29700;
}
printLineF2(F("Ham band mode"));
}
delay_background(1000, 0);
printLine2ClearAndUpdate();
printLineF2(F("Press to confirm"));
}
}
char currentBandIndex = -1;
//Save Band Information
if (tuneTXType == 2 || tuneTXType == 3 || tuneTXType == 102 || tuneTXType == 103) { //only ham band move
//Get Now Band Index
currentBandIndex = getIndexHambanBbyFreq(frequency);
if (currentBandIndex >= 0) {
//Save Frequency to Band Frequncy Record
saveBandFreqByIndex(frequency, modeToByte(), currentBandIndex);
}
}
delay(50);
@@ -50,16 +88,35 @@ int menuBand(int btn){
else
isUSB = false;
setFrequency(((unsigned long)band * 1000000l) + offset); */
if (knob < 0 && frequency > 3000000l)
setFrequency(frequency - 200000l);
if (knob > 0 && frequency < 30000000l)
setFrequency(frequency + 200000l);
if (frequency > 10000000l)
isUSB = true;
else
isUSB = false;
if (tuneTXType == 2 || tuneTXType == 3 || tuneTXType == 102 || tuneTXType == 103) { //only ham band move
if (knob < 0) {
if (stepChangeCount-- < -3) {
setNextHamBandFreq(frequency, -1); //Prior Band
stepChangeCount = 0;
}
}
else if (knob > 0) {
if (stepChangeCount++ > 3) {
setNextHamBandFreq(frequency, 1); //Next Band
stepChangeCount = 0;
}
}
}
else { //original source
if (knob < 0 && frequency > 3000000l)
setFrequency(frequency - 200000l);
if (knob > 0 && frequency < 30000000l)
setFrequency(frequency + 200000l);
if (frequency > 10000000l)
isUSB = true;
else
isUSB = false;
}
updateDisplay();
}
delay(20);
Check_Cat(0); //To prevent disconnections
}
@@ -89,8 +146,16 @@ void byteToMode(byte modeValue){
else
isUSB = 0;
}
void byteWithFreqToMode(byte modeValue){
if (modeValue == 3)
isUSB = 1;
else if (modeValue == 0) //Not Set
isUSB = (frequency > 10000000l) ? true : false;
else
isUSB = 0;
}
void menuVfoToggle(int btn)
void menuVfoToggle(int btn, char isUseDelayTime)
{
if (!btn){
if (vfoActive == VFO_A)
@@ -124,8 +189,9 @@ void menuVfoToggle(int btn)
ritDisable();
//updateDisplay();
delay_background(500, 0);
if (isUseDelayTime == 1) //Found Issue in wsjt-x Linux 32bit
delay_background(500, 0);
printLine2ClearAndUpdate();
//exit the menu
menuOn = 0;
@@ -178,20 +244,20 @@ void menuSidebandToggle(int btn){
}
}
void menuTxOnOff(int btn){
void menuTxOnOff(int btn, byte optionType){
if (!btn){
if (isTxOff == 0)
if ((isTxType & optionType) == 0)
printLineF2(F("TX OFF?"));
else
printLineF2(F("TX ON?"));
}
else {
if (isTxOff == 0){
isTxOff = 1;
if ((isTxType & optionType) == 0){
isTxType |= optionType;
printLineF2(F("TX OFF!"));
}
else {
isTxOff = 0;
isTxType &= ~(optionType);
printLineF2(F("TX ON!"));
}
delay_background(500, 0);
@@ -677,11 +743,14 @@ void menuSetupCwTone(int btn){
}
void setDialLock(byte tmpLock, byte fromMode) {
isDialLock = tmpLock;
if (tmpLock == 1)
isDialLock |= (vfoActive == VFO_A ? 0x01 : 0x02);
else
isDialLock &= ~(vfoActive == VFO_A ? 0x01 : 0x02);
if (fromMode == 2 || fromMode == 3) return;
if (isDialLock == 1)
if (tmpLock == 1)
printLineF2(F("Dial Lock ON"));
else
printLineF2(F("Dial Lock OFF"));
@@ -706,7 +775,10 @@ void doMenu(){
//btnDownTimeCount++;
//check long time Down Button -> 3 Second
if (btnDownTimeCount++ > (2000 / 50)) {
setDialLock(isDialLock == 1 ? 0 : 1, 0); //Reverse Dialo lock
if (vfoActive == VFO_A)
setDialLock((isDialLock & 0x01) == 0x01 ? 0 : 1, 0); //Reverse Dial lock
else
setDialLock((isDialLock & 0x02) == 0x02 ? 0 : 1, 0); //Reverse Dial lock
return;
}
}
@@ -732,7 +804,7 @@ void doMenu(){
else if (select < 20)
menuRitToggle(btnState);
else if (select < 30)
menuVfoToggle(btnState);
menuVfoToggle(btnState, 1);
else if (select < 40)
menuSidebandToggle(btnState);
else if (select < 50)
@@ -754,7 +826,7 @@ void doMenu(){
else if (select < 130 && modeCalibrate)
menuSetupTXCWInterval(btnState);
else if (select < 140 && modeCalibrate)
menuTxOnOff(btnState);
menuTxOnOff(btnState, 0x01); //TX OFF / ON
else if (select < 150 && modeCalibrate)
menuExit(btnState);

View File

@@ -251,7 +251,8 @@ void updateDisplay() {
// strcat(c, " TX");
printLine(1, c);
if (isDialLock == 1) {
if ((vfoActive == VFO_A && ((isDialLock & 0x01) == 0x01)) ||
(vfoActive == VFO_B && ((isDialLock & 0x02) == 0x02))) {
lcd.setCursor(5,1);
lcd.write((uint8_t)0);
}