Iambic B fixed
This commit is contained in:
parent
e99c590cda
commit
9a07c24d8f
2 changed files with 6 additions and 10 deletions
|
@ -80,18 +80,17 @@ void Keyer::run()
|
||||||
if (!m_currentlyKeying)
|
if (!m_currentlyKeying)
|
||||||
{
|
{
|
||||||
m_currentlyKeying = true;
|
m_currentlyKeying = true;
|
||||||
m_bothPaddlesPressed = (left_paddle_pressed() && right_paddle_pressed()) ? true : false;
|
|
||||||
m_keying_until = make_timeout_time_us(m_elementDuration);
|
m_keying_until = make_timeout_time_us(m_elementDuration);
|
||||||
gpio_put(LED_PIN, 1);
|
gpio_put(LED_PIN, 1);
|
||||||
m_Sidetone.on(SIDETONE_FREQ);
|
m_Sidetone.on(SIDETONE_FREQ);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If both paddles are released during this dit -> note for Iambic B
|
// If right paddle üressed -> note for Iambic B
|
||||||
if (m_bothPaddlesPressed && !right_paddle_pressed() && !left_paddle_pressed() && !m_keyNextIambicB)
|
if (right_paddle_pressed() && !m_keyNextIambicB)
|
||||||
{
|
{
|
||||||
|
printf("Iambic B -> lang\n");
|
||||||
m_keyNextIambicB = true;
|
m_keyNextIambicB = true;
|
||||||
m_bothPaddlesPressed = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (absolute_time_diff_us(timestamp, m_keying_until) <= 0)
|
if (absolute_time_diff_us(timestamp, m_keying_until) <= 0)
|
||||||
|
@ -108,18 +107,17 @@ void Keyer::run()
|
||||||
if (!m_currentlyKeying)
|
if (!m_currentlyKeying)
|
||||||
{
|
{
|
||||||
m_currentlyKeying = true;
|
m_currentlyKeying = true;
|
||||||
m_bothPaddlesPressed = (left_paddle_pressed() && right_paddle_pressed()) ? true : false;
|
|
||||||
m_keying_until = make_timeout_time_us(m_elementDuration * 3);
|
m_keying_until = make_timeout_time_us(m_elementDuration * 3);
|
||||||
gpio_put(LED_PIN, 1);
|
gpio_put(LED_PIN, 1);
|
||||||
m_Sidetone.on(SIDETONE_FREQ);
|
m_Sidetone.on(SIDETONE_FREQ);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If both paddles are released during this dah -> note for Iambic B
|
// If left paddle pressed -> Note for Iambic B
|
||||||
if (m_bothPaddlesPressed && !right_paddle_pressed() && !left_paddle_pressed() && !m_keyNextIambicB)
|
if (left_paddle_pressed() && !m_keyNextIambicB)
|
||||||
{
|
{
|
||||||
|
printf("Iambic B -> kurz\n");
|
||||||
m_keyNextIambicB = true;
|
m_keyNextIambicB = true;
|
||||||
m_bothPaddlesPressed = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (absolute_time_diff_us(timestamp, m_keying_until) <= 0)
|
if (absolute_time_diff_us(timestamp, m_keying_until) <= 0)
|
||||||
|
@ -196,7 +194,6 @@ void Keyer::run()
|
||||||
m_keyNextIambicB = false;
|
m_keyNextIambicB = false;
|
||||||
m_currentlyPausing = false;
|
m_currentlyPausing = false;
|
||||||
m_currentlyKeying = false;
|
m_currentlyKeying = false;
|
||||||
m_bothPaddlesPressed = false;
|
|
||||||
m_previousState = State::Abort;
|
m_previousState = State::Abort;
|
||||||
m_state = State::Wait;
|
m_state = State::Wait;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -43,7 +43,6 @@ private:
|
||||||
bool m_currentlyKeying{false};
|
bool m_currentlyKeying{false};
|
||||||
bool m_currentlyPausing{false};
|
bool m_currentlyPausing{false};
|
||||||
bool m_keyNextIambicB{false};
|
bool m_keyNextIambicB{false};
|
||||||
bool m_bothPaddlesPressed{false};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in a new issue