#ifndef KEYER_H #define KEYER_H class Keyer final { public: enum class State { Wait, Dit, Dah, InterCharSpace, }; Keyer(uint8_t wpm); void run(); private: Keyer() {}; State state{State::Wait}; State m_previousState{State::Wait}; uint8_t m_wpm{18}; uint64_t m_elementDuration{0}; bool m_currentlyKeying {false}; absolute_time_t m_keying_until{0}; absolute_time_t m_pausing_until{0}; }; #endif