|
|
|
@ -344,7 +344,8 @@ void CheckStraightKey(void)
|
|
|
|
|
{
|
|
|
|
|
if(PIND & (1<<STRAIGHT_KEY))
|
|
|
|
|
{
|
|
|
|
|
TXKey(0);
|
|
|
|
|
if(bState.SendStatus == NOTHING)
|
|
|
|
|
TXKey(0);
|
|
|
|
|
StateStraightKeyPressed = NO_KEY_PRESSED;
|
|
|
|
|
} else {
|
|
|
|
|
if(StateStraightKeyPressed == NO_KEY_PRESSED)
|
|
|
|
@ -354,7 +355,8 @@ void CheckStraightKey(void)
|
|
|
|
|
}
|
|
|
|
|
if(StateStraightKeyPressed == KEY_PRESSED)
|
|
|
|
|
{
|
|
|
|
|
TXKey(1);
|
|
|
|
|
if(bState.SendStatus == NOTHING)
|
|
|
|
|
TXKey(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -441,8 +443,7 @@ void CheckPaddles(void)
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/** \brief CheckDitPaddle
|
|
|
|
|
*
|
|
|
|
@ -465,7 +466,8 @@ void CheckDitPaddle(void)
|
|
|
|
|
TimerPaddleKeyPressed = 0;
|
|
|
|
|
}
|
|
|
|
|
if(StatePaddleKeyPressed == KEY_PRESSED) // Debounce ok
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
SerialWriteString("470:DitBuffer == 1\r\n");
|
|
|
|
|
DitBuffer = 1;
|
|
|
|
|
StatePaddleKeyPressed = NO_KEY_PRESSED;
|
|
|
|
|
}
|
|
|
|
@ -492,8 +494,9 @@ void CheckDahPaddle(void)
|
|
|
|
|
}
|
|
|
|
|
if(StatePaddleKeyPressed == KEY_PRESSED) // Debounce ok
|
|
|
|
|
{
|
|
|
|
|
SerialWriteString("496:DahBuffer == 1\r\n");
|
|
|
|
|
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
|
|
|
|
|
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))))
|
|
|
|
|
IambicFlag = 1;
|
|
|
|
|
|
|
|
|
|
if(bState.SendStatus == SENDING_DIT)
|
|
|
|
|
CheckDahPaddle();
|
|
|
|
|
else if(bState.SendStatus == SENDING_DAH)
|
|
|
|
|
CheckDitPaddle();
|
|
|
|
|
else {
|
|
|
|
|
CheckDahPaddle();
|
|
|
|
|
CheckDitPaddle();
|
|
|
|
|
if(bState.SendStatus == SENDING_DIT)
|
|
|
|
|
{
|
|
|
|
|
CheckDahPaddle();
|
|
|
|
|
} else {
|
|
|
|
|
if(bState.SendStatus == SENDING_DAH)
|
|
|
|
|
{
|
|
|
|
|
CheckDitPaddle();
|
|
|
|
|
} else {
|
|
|
|
|
CheckDahPaddle();
|
|
|
|
|
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
|
|
|
|
@ -536,6 +561,7 @@ void SymbolLoop(uint8_t Len)
|
|
|
|
|
IambicFlag = 0;
|
|
|
|
|
DitBuffer = 0;
|
|
|
|
|
DahBuffer = 0;
|
|
|
|
|
SerialWriteString("562:IambicFlag == 0\r\n");
|
|
|
|
|
}
|
|
|
|
|
if((bState.SendStatus == SENDING_DIT) || (bState.SendStatus == SENDING_DAH))
|
|
|
|
|
{
|
|
|
|
@ -581,7 +607,7 @@ void SendDah(uint8_t SendingType)
|
|
|
|
|
*/
|
|
|
|
|
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
|
|
|
|
|
if((bConfig.KeyerMode == IAMBIC_A) && (IambicFlag) && (PIND & (1<<LEFT_PADDLE)) && (PIND & (1<<RIGHT_PADDLE)))
|
|
|
|
@ -589,6 +615,7 @@ void DitDahBuffers(void)
|
|
|
|
|
IambicFlag = 0;
|
|
|
|
|
DitBuffer = 0;
|
|
|
|
|
DahBuffer = 0;
|
|
|
|
|
SerialWriteString("616:IambicFlag == 0\r\n");
|
|
|
|
|
} else {
|
|
|
|
|
// IAMBIC_B
|
|
|
|
|
if(DitBuffer)
|
|
|
|
@ -603,6 +630,11 @@ void DitDahBuffers(void)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(bConfig.KeyerMode == ULTIMATIC)
|
|
|
|
|
{
|
|
|
|
|
SerialWriteString("Ultimatic\r\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|