Iambic Mode funktioniert nicht, zum Prüfen eine ältere Version

auschecken, testen und dann wieder auf diese Version zurück.
main
Tom 1 year ago
parent fa91f5c9d1
commit da9d6dd4d0

@ -420,6 +420,8 @@ void UpdateDisplay(void)
sprintf(line,"%s", IambicA); sprintf(line,"%s", IambicA);
if(bConfig.KeyerMode == IAMBIC_B) if(bConfig.KeyerMode == IAMBIC_B)
sprintf(line,"%s", IambicB); sprintf(line,"%s", IambicB);
if(bConfig.KeyerMode == ULTIMATIC)
sprintf(line,"%s", Ultimatic);
lcd_puts(line); lcd_puts(line);
lcd_gotoxy(0,0); lcd_gotoxy(0,0);
if(bConfig.TRX == 1) if(bConfig.TRX == 1)

@ -344,7 +344,8 @@ void CheckStraightKey(void)
{ {
if(PIND & (1<<STRAIGHT_KEY)) if(PIND & (1<<STRAIGHT_KEY))
{ {
TXKey(0); if(bState.SendStatus == NOTHING)
TXKey(0);
StateStraightKeyPressed = NO_KEY_PRESSED; StateStraightKeyPressed = NO_KEY_PRESSED;
} else { } else {
if(StateStraightKeyPressed == NO_KEY_PRESSED) if(StateStraightKeyPressed == NO_KEY_PRESSED)
@ -354,7 +355,8 @@ void CheckStraightKey(void)
} }
if(StateStraightKeyPressed == KEY_PRESSED) if(StateStraightKeyPressed == KEY_PRESSED)
{ {
TXKey(1); if(bState.SendStatus == NOTHING)
TXKey(1);
} }
} }
} }
@ -441,8 +443,7 @@ void CheckPaddles(void)
} }
break; break;
} }
} }
} }
/** \brief CheckDitPaddle /** \brief CheckDitPaddle
* *
@ -465,7 +466,8 @@ void CheckDitPaddle(void)
TimerPaddleKeyPressed = 0; TimerPaddleKeyPressed = 0;
} }
if(StatePaddleKeyPressed == KEY_PRESSED) // Debounce ok if(StatePaddleKeyPressed == KEY_PRESSED) // Debounce ok
{ {
SerialWriteString("470:DitBuffer == 1\r\n");
DitBuffer = 1; DitBuffer = 1;
StatePaddleKeyPressed = NO_KEY_PRESSED; StatePaddleKeyPressed = NO_KEY_PRESSED;
} }
@ -492,8 +494,9 @@ void CheckDahPaddle(void)
} }
if(StatePaddleKeyPressed == KEY_PRESSED) // Debounce ok if(StatePaddleKeyPressed == KEY_PRESSED) // Debounce ok
{ {
SerialWriteString("496:DahBuffer == 1\r\n");
DahBuffer = 1; DahBuffer = 1;
StatePaddleKeyPressed == NO_KEY_PRESSED; StatePaddleKeyPressed = NO_KEY_PRESSED;
} }
} }
} }
@ -517,17 +520,39 @@ void SymbolLoop(uint8_t Len)
t_elementlength = 0; // Reset Timer 0 variable t_elementlength = 0; // Reset Timer 0 variable
while(t_elementlength < ticks) while(t_elementlength < ticks)
{ {
if(KeyerMode != ULTIMATIC)
{
if((KeyerMode == IAMBIC_A) && (!(PIND & (1<<LEFT_PADDLE))) && (!(PIND & (1<<RIGHT_PADDLE))))
{
IambicFlag = 1;
SerialWriteString("526:IambicFlag == 1\r\n");
}
if((KeyerMode == IAMBIC_A) && (!(PIND & (1<<LEFT_PADDLE))) && (!(PIND & (1<<RIGHT_PADDLE)))) if(bState.SendStatus == SENDING_DIT)
IambicFlag = 1; {
CheckDahPaddle();
if(bState.SendStatus == SENDING_DIT) } else {
CheckDahPaddle(); if(bState.SendStatus == SENDING_DAH)
else if(bState.SendStatus == SENDING_DAH) {
CheckDitPaddle(); CheckDitPaddle();
else { } else {
CheckDahPaddle(); CheckDahPaddle();
CheckDitPaddle(); CheckDitPaddle();
}
}
} else {
if(bState.SendStatus == SENDING_DIT)
{
CheckDahPaddle();
} else {
if(bState.SendStatus == SENDING_DAH)
{
CheckDitPaddle();
} else {
CheckDahPaddle();
CheckDitPaddle();
}
}
} }
} }
// Wenn Taste losgelassen, dann im KeyerMode IAMBIC_A das IambicFlag löschen // Wenn Taste losgelassen, dann im KeyerMode IAMBIC_A das IambicFlag löschen
@ -536,6 +561,7 @@ void SymbolLoop(uint8_t Len)
IambicFlag = 0; IambicFlag = 0;
DitBuffer = 0; DitBuffer = 0;
DahBuffer = 0; DahBuffer = 0;
SerialWriteString("562:IambicFlag == 0\r\n");
} }
if((bState.SendStatus == SENDING_DIT) || (bState.SendStatus == SENDING_DAH)) if((bState.SendStatus == SENDING_DIT) || (bState.SendStatus == SENDING_DAH))
{ {
@ -581,7 +607,7 @@ void SendDah(uint8_t SendingType)
*/ */
void DitDahBuffers(void) void DitDahBuffers(void)
{ {
if((bConfig.KeyerMode == IAMBIC_A) || (bConfig.KeyerMode == IAMBIC_B) || (bConfig.KeyerMode == ULTIMATIC)) if((bConfig.KeyerMode == IAMBIC_A) || (bConfig.KeyerMode == IAMBIC_B))
{ {
// IAMBIC_A // IAMBIC_A
if((bConfig.KeyerMode == IAMBIC_A) && (IambicFlag) && (PIND & (1<<LEFT_PADDLE)) && (PIND & (1<<RIGHT_PADDLE))) if((bConfig.KeyerMode == IAMBIC_A) && (IambicFlag) && (PIND & (1<<LEFT_PADDLE)) && (PIND & (1<<RIGHT_PADDLE)))
@ -589,6 +615,7 @@ void DitDahBuffers(void)
IambicFlag = 0; IambicFlag = 0;
DitBuffer = 0; DitBuffer = 0;
DahBuffer = 0; DahBuffer = 0;
SerialWriteString("616:IambicFlag == 0\r\n");
} else { } else {
// IAMBIC_B // IAMBIC_B
if(DitBuffer) if(DitBuffer)
@ -603,6 +630,11 @@ void DitDahBuffers(void)
} }
} }
} }
if(bConfig.KeyerMode == ULTIMATIC)
{
SerialWriteString("Ultimatic\r\n");
}
} }
/* /*

@ -183,7 +183,6 @@ uint8_t LengthOfElement;
// State Machines // State Machines
uint8_t PaddleMode; uint8_t PaddleMode;
uint8_t KeyerMode; uint8_t KeyerMode;
uint8_t state_sidetoneoff;
// History // History
uint8_t keyhistory; uint8_t keyhistory;
uint8_t KeyTX; uint8_t KeyTX;

@ -306,34 +306,6 @@ ISR(USART_RX_vect)
data = UDR0; data = UDR0;
SerialWriteChar(data); SerialWriteChar(data);
} }
/*
** DoMorse
*/
void DoMorse(void)
{
if((KeyerMode == IAMBIC_A) || (KeyerMode == IAMBIC_B) || KeyerMode == ULTIMATIC)
{
if((KeyerMode == IAMBIC_A) && (IambicFlag) && (ReadKeyPin(LEFT_PADDLE)))
{
IambicFlag = 0;
DitBuffer = 0;
DahBuffer = 0;
}
else
{
if(DitBuffer)
{
DitBuffer = 0;
SendDit(MAN);
}
if(DahBuffer)
{
DahBuffer = 0;
SendDah(MAN);
}
}
}
}
/** @brief Initialisierung bei Reset und Neustart /** @brief Initialisierung bei Reset und Neustart
* @param none * @param none
* @return none * @return none
@ -395,7 +367,6 @@ int main(void)
CheckStraightKey(); CheckStraightKey();
CheckPaddles(); CheckPaddles();
DitDahBuffers(); DitDahBuffers();
DoMorse();
} }
} }

@ -18,20 +18,11 @@ struct State bState;
// Function prototypes // Function prototypes
void Init(void); void Init(void);
void InitTimer(void); void InitTimer(void);
void ReStart(void);
void CheckDahPaddle(void); extern void CheckDahPaddle(void);
void CheckDitPaddle(void); extern void CheckDitPaddle(void);
void CheckPaddle(void); extern void CheckStraightKey(void);
void CheckStraightKey(void); extern void SetFrequency(uint16_t f);
void SendDit(uint8_t SendingType); extern void DitDahBuffers(void);
void SendDah(uint8_t SendingType);
void SideToneOff(void);
void SideToneOn(void);
void TXKey(uint8_t State);
void SendChar(uint8_t);
void ChangeSpeed(void);
void DoMorse(void);
void SetFrequency(uint16_t f);
#endif // BJ-KEYER_H_INCLUDED #endif // BJ-KEYER_H_INCLUDED

Loading…
Cancel
Save