From 6970ca81823b1c8aa01b2061f627dcdb61c0681b Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Tue, 13 Feb 2024 09:03:14 +0100 Subject: [PATCH] getting rid of symbol type --- src/keyer.cpp | 6 ++---- src/keyer.h | 6 ------ 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/keyer.cpp b/src/keyer.cpp index f2a4a77..37e0996 100644 --- a/src/keyer.cpp +++ b/src/keyer.cpp @@ -49,11 +49,11 @@ void Keyer::run() case State::Wait: if (left_paddle_pressed() && right_paddle_pressed()) { - if (m_lastSymbolWas == Symbol::Dit) + if (m_previousState == State::Dit) { state = State::Dah; } - else if (m_lastSymbolWas == Symbol::Dah) + else if (m_previousState == State::Dah) { state = State::Dit; } @@ -75,7 +75,6 @@ void Keyer::run() m_keying_until = make_timeout_time_us(m_elementDuration); gpio_put(LED_PIN, 1); m_Sidetone.on(SIDETONE_FREQ); - m_lastSymbolWas = Symbol::Dit; } else { @@ -99,7 +98,6 @@ void Keyer::run() m_keying_until = make_timeout_time_us(m_elementDuration * 3); gpio_put(LED_PIN, 1); m_Sidetone.on(SIDETONE_FREQ); - m_lastSymbolWas = Symbol::Dah; } else { diff --git a/src/keyer.h b/src/keyer.h index 624cfd1..7aaf1c6 100644 --- a/src/keyer.h +++ b/src/keyer.h @@ -22,11 +22,6 @@ public: void run(); private: - enum class Symbol - { - Dit, - Dah - }; Keyer(){}; State state{State::Wait}; State m_previousState{State::Wait}; @@ -37,7 +32,6 @@ private: bool m_currentlyPausing{false}; absolute_time_t m_keying_until{0}; absolute_time_t m_pausing_until{0}; - Symbol m_lastSymbolWas{Symbol::Dit}; Sidetone m_Sidetone{BUZZER_PIN}; bool m_keyNextIambicB{false}; };