Compare commits
2 Commits
keyer
...
keyer-simp
Author | SHA1 | Date | |
---|---|---|---|
4fd35aea4f | |||
295b158662 |
@@ -61,6 +61,7 @@ extern byte I2C_LCD_SECOND_ADDRESS; //only using Dual LCD Mode
|
|||||||
//==============================================================================
|
//==============================================================================
|
||||||
// User Select feather list
|
// User Select feather list
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
/*
|
||||||
//Enable all features
|
//Enable all features
|
||||||
#define FN_BAND 1 //592
|
#define FN_BAND 1 //592
|
||||||
#define FN_VFO_TOGGLE 1 //78
|
#define FN_VFO_TOGGLE 1 //78
|
||||||
@@ -84,7 +85,7 @@ extern byte I2C_LCD_SECOND_ADDRESS; //only using Dual LCD Mode
|
|||||||
#define FN_KEYTYPE 1 //168
|
#define FN_KEYTYPE 1 //168
|
||||||
#define FN_ADCMONITOR 1 //516
|
#define FN_ADCMONITOR 1 //516
|
||||||
#define FN_TXONOFF 1 //58
|
#define FN_TXONOFF 1 //58
|
||||||
|
*/
|
||||||
/*
|
/*
|
||||||
//Test Configuration (88%)
|
//Test Configuration (88%)
|
||||||
#define FN_BAND 0 //592
|
#define FN_BAND 0 //592
|
||||||
@@ -110,7 +111,6 @@ extern byte I2C_LCD_SECOND_ADDRESS; //only using Dual LCD Mode
|
|||||||
#define FN_ADCMONITOR 1 //516
|
#define FN_ADCMONITOR 1 //516
|
||||||
#define FN_TXONOFF 1 //58
|
#define FN_TXONOFF 1 //58
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
//Recommended Character LCD Developer 87%
|
//Recommended Character LCD Developer 87%
|
||||||
#define FN_BAND 1 //592
|
#define FN_BAND 1 //592
|
||||||
@@ -137,7 +137,6 @@ extern byte I2C_LCD_SECOND_ADDRESS; //only using Dual LCD Mode
|
|||||||
#define FN_TXONOFF 1 //58
|
#define FN_TXONOFF 1 //58
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
//Recommended for Nextion, TJC LCD 88%
|
//Recommended for Nextion, TJC LCD 88%
|
||||||
#define FN_BAND 1 //600
|
#define FN_BAND 1 //600
|
||||||
#define FN_VFO_TOGGLE 1 //90
|
#define FN_VFO_TOGGLE 1 //90
|
||||||
@@ -161,7 +160,7 @@ extern byte I2C_LCD_SECOND_ADDRESS; //only using Dual LCD Mode
|
|||||||
#define FN_KEYTYPE 0 //294
|
#define FN_KEYTYPE 0 //294
|
||||||
#define FN_ADCMONITOR 0 //526 //not available with Nextion or Serial UI
|
#define FN_ADCMONITOR 0 //526 //not available with Nextion or Serial UI
|
||||||
#define FN_TXONOFF 1 //70
|
#define FN_TXONOFF 1 //70
|
||||||
*/
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
// End of User Select Mode and Compil options
|
// End of User Select Mode and Compil options
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
@@ -223,8 +222,9 @@ extern byte I2C_LCD_SECOND_ADDRESS; //only using Dual LCD Mode
|
|||||||
#define ANALOG_SMETER (A7) //by KD8CEC
|
#define ANALOG_SMETER (A7) //by KD8CEC
|
||||||
|
|
||||||
#ifdef USE_ALTKEYER
|
#ifdef USE_ALTKEYER
|
||||||
#define DIGITAL_DOT (11)
|
#define DIGITAL_DOT (12)
|
||||||
#define DIGITAL_DASH (12)
|
#define DIGITAL_DASH (11)
|
||||||
|
#define DIGITAL_KEY (A3)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -803,8 +803,16 @@ void checkButton(){
|
|||||||
delay(50);
|
delay(50);
|
||||||
if (!btnDown()) //debounce
|
if (!btnDown()) //debounce
|
||||||
return;
|
return;
|
||||||
|
//for touch screen
|
||||||
|
#ifdef USE_SW_SERIAL
|
||||||
|
SetSWActivePage(1);
|
||||||
|
doMenu();
|
||||||
|
|
||||||
|
if (isCWAutoMode == 0)
|
||||||
|
SetSWActivePage(0);
|
||||||
|
#else
|
||||||
doMenu();
|
doMenu();
|
||||||
|
#endif
|
||||||
|
|
||||||
//wait for the button to go up again
|
//wait for the button to go up again
|
||||||
while(btnDown()) {
|
while(btnDown()) {
|
||||||
@@ -1295,6 +1303,7 @@ void initPorts(){
|
|||||||
#ifdef USE_ALTKEYER
|
#ifdef USE_ALTKEYER
|
||||||
pinMode(DIGITAL_DOT, INPUT_PULLUP);
|
pinMode(DIGITAL_DOT, INPUT_PULLUP);
|
||||||
pinMode(DIGITAL_DASH, INPUT_PULLUP);
|
pinMode(DIGITAL_DASH, INPUT_PULLUP);
|
||||||
|
if (DIGITAL_KEY != PTT) pinMode(DIGITAL_KEY, INPUT_PULLUP);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_CUSTOM_LPF_FILTER
|
#ifdef USE_CUSTOM_LPF_FILTER
|
||||||
@@ -1466,14 +1475,14 @@ void checkAutoSaveFreqMode()
|
|||||||
void loop(){
|
void loop(){
|
||||||
if (isCWAutoMode == 0){ //when CW AutoKey Mode, disable this process
|
if (isCWAutoMode == 0){ //when CW AutoKey Mode, disable this process
|
||||||
#ifdef USE_ALTKEYER
|
#ifdef USE_ALTKEYER
|
||||||
// when using the alternate keyer, don't check the PTT if we're in CW mode, because
|
// when using the alternate keyer, don't check the PTT if we're in CW mode--assuming the pin is the same as PTT
|
||||||
// the PTT is also a straight key
|
if (DIGITAL_KEY == PTT) {
|
||||||
if (!txCAT && (cwMode == 0))
|
if (!txCAT && (cwMode == 0))
|
||||||
checkPTT();
|
checkPTT();
|
||||||
#else
|
} else
|
||||||
|
#endif
|
||||||
if (!txCAT)
|
if (!txCAT)
|
||||||
checkPTT();
|
checkPTT();
|
||||||
#endif
|
|
||||||
checkButton();
|
checkButton();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -38,21 +38,20 @@
|
|||||||
char lastPaddle = 0;
|
char lastPaddle = 0;
|
||||||
|
|
||||||
//reads the analog keyer pin and reports the paddle
|
//reads the analog keyer pin and reports the paddle
|
||||||
byte getPaddle(){
|
byte getPaddle() {
|
||||||
#ifdef USE_ALTKEYER
|
#ifdef USE_ALTKEYER
|
||||||
// Alternate keyer... but it looks like getPaddle() ever actually gets used, so...
|
// Alternate keyer
|
||||||
if (cwMode > 0) {
|
if ((DIGITAL_KEY != PTT) || ((DIGITAL_KEY == PTT) && (cwMode > 0))) {
|
||||||
// PTT functions as straight key, but only if we're in CW mode
|
if (digitalRead(DIGITAL_KEY) == LOW) {
|
||||||
if (digitalRead(PTT) == LOW) {
|
|
||||||
return PADDLE_STRAIGHT;
|
return PADDLE_STRAIGHT;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
// paddles work whether or not CW mode is actually selected
|
// paddles work whether or not CW mode is actually selected
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
rv |= digitalRead(DIGITAL_DOT) == LOW ? 1 : 0;
|
rv |= digitalRead(DIGITAL_DOT) == LOW ? PADDLE_DOT : 0;
|
||||||
rv |= digitalRead(DIGITAL_DASH) == LOW ? 2 : 0;
|
rv |= digitalRead(DIGITAL_DASH) == LOW ? PADDLE_DASH : 0;
|
||||||
return rv;
|
return rv;
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
int paddle = analogRead(ANALOG_KEYER);
|
int paddle = analogRead(ANALOG_KEYER);
|
||||||
|
|
||||||
@@ -117,12 +116,14 @@ char update_PaddleLatch(byte isUpdateKeyState) {
|
|||||||
#ifdef USE_ALTKEYER
|
#ifdef USE_ALTKEYER
|
||||||
// One big note... I have no idea how debounce does or doesn't affect this... but there is no debounce right now. It's conceivable
|
// One big note... I have no idea how debounce does or doesn't affect this... but there is no debounce right now. It's conceivable
|
||||||
// that the normal uBITX use of an analog input for this masks bouncing...
|
// that the normal uBITX use of an analog input for this masks bouncing...
|
||||||
if (digitalRead(DIGITAL_DOT) == LOW) tmpKeyerControl |= DIT_L;
|
if ((digitalRead(DIGITAL_DASH) == LOW)) tmpKeyerControl |= DAH_L;
|
||||||
if (Iambic_Key) {
|
if (Iambic_Key) {
|
||||||
if ((digitalRead(DIGITAL_DASH) == LOW)) tmpKeyerControl |= DAH_L;
|
if (digitalRead(DIGITAL_DOT) == LOW) tmpKeyerControl |= DIT_L;
|
||||||
} else {
|
} else {
|
||||||
// I really would like to have the PTT (during CW mode) just result in key down regardless of Iambic, but this doesn't do that yet...
|
// I really would like to have the PTT (during CW mode) just result in key down regardless of Iambic, but this doesn't do that yet...
|
||||||
if ((cwMode > 0) && (digitalRead(PTT) == LOW)) tmpKeyerControl |= DIT_L;
|
if ((DIGITAL_KEY != PTT) || ((DIGITAL_KEY == PTT) && (cwMode > 0))) {
|
||||||
|
if (digitalRead(DIGITAL_KEY) == LOW) tmpKeyerControl |= DAH_L;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
int paddle = analogRead(ANALOG_KEYER);
|
int paddle = analogRead(ANALOG_KEYER);
|
||||||
@@ -252,10 +253,9 @@ void cwKeyer(void){
|
|||||||
|
|
||||||
Check_Cat(2);
|
Check_Cat(2);
|
||||||
} //end of while
|
} //end of while
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
while(1){
|
while(1){
|
||||||
if (update_PaddleLatch(0) == DIT_L) {
|
if (update_PaddleLatch(0) == DAH_L) {
|
||||||
// if we are here, it is only because the key is pressed
|
// if we are here, it is only because the key is pressed
|
||||||
if (!inTx){
|
if (!inTx){
|
||||||
//DelayTime Option
|
//DelayTime Option
|
||||||
@@ -267,7 +267,7 @@ void cwKeyer(void){
|
|||||||
}
|
}
|
||||||
cwKeydown();
|
cwKeydown();
|
||||||
|
|
||||||
while ( update_PaddleLatch(0) == DIT_L )
|
while ( update_PaddleLatch(0) == DAH_L )
|
||||||
delay_background(1, 3);
|
delay_background(1, 3);
|
||||||
|
|
||||||
cwKeyUp();
|
cwKeyUp();
|
||||||
|
Reference in New Issue
Block a user