Iambic B mode (hopefully) corrected.
This commit is contained in:
parent
0d4131653e
commit
0d091aee62
1 changed files with 17 additions and 14 deletions
|
@ -49,6 +49,8 @@ void Keyer::run()
|
|||
case State::Wait:
|
||||
if (left_paddle_pressed() && right_paddle_pressed())
|
||||
{
|
||||
m_keyNextIambicB = false;
|
||||
|
||||
if (m_previousState == State::Dit)
|
||||
{
|
||||
state = State::Dah;
|
||||
|
@ -57,16 +59,29 @@ void Keyer::run()
|
|||
{
|
||||
state = State::Dit;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (left_paddle_pressed())
|
||||
else if (left_paddle_pressed())
|
||||
{
|
||||
m_keyNextIambicB = false;
|
||||
state = State::Dit;
|
||||
}
|
||||
else if (right_paddle_pressed())
|
||||
{
|
||||
m_keyNextIambicB = false;
|
||||
state = State::Dah;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_mode == Mode::IAMBIC_B && m_keyNextIambicB)
|
||||
{
|
||||
if (m_previousState == State::Dit)
|
||||
state = State::Dah;
|
||||
else
|
||||
state = State::Dit;
|
||||
|
||||
m_keyNextIambicB = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case State::Dit:
|
||||
if (!m_currentlyKeying)
|
||||
|
@ -124,18 +139,6 @@ void Keyer::run()
|
|||
if (absolute_time_diff_us(timestamp, m_pausing_until) <= 0)
|
||||
{
|
||||
m_currentlyPausing = false;
|
||||
|
||||
if (m_mode == Mode::IAMBIC_B && m_keyNextIambicB)
|
||||
{
|
||||
if (m_previousState == State::Dit)
|
||||
state = State::Dah;
|
||||
else
|
||||
state = State::Dit;
|
||||
|
||||
m_keyNextIambicB = false;
|
||||
break;
|
||||
}
|
||||
|
||||
state = State::Wait;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue