From 69b6214668d892266cb9e647207bfbd25e4c5ebd Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Fri, 9 Feb 2024 12:20:30 +0100 Subject: [PATCH] more code cleanup --- src/CMakeLists.txt | 1 + src/keyer.cpp | 14 ++++++++++++++ src/keyer.h | 18 ++++++++++++++++++ src/settings.cpp | 2 +- src/settings.h | 2 +- 5 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 src/keyer.cpp create mode 100644 src/keyer.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e58fc71..510430c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,5 @@ target_sources(pico_keyer PRIVATE pico_keyer.cpp settings.cpp + keyer.cpp ) \ No newline at end of file diff --git a/src/keyer.cpp b/src/keyer.cpp new file mode 100644 index 0000000..83f631d --- /dev/null +++ b/src/keyer.cpp @@ -0,0 +1,14 @@ +#include "keyer.h" + +void Keyer::run() +{ + switch (state) + { + case State::WAIT: + // do nothing + break; + + default: + break; + } +} \ No newline at end of file diff --git a/src/keyer.h b/src/keyer.h new file mode 100644 index 0000000..96abae0 --- /dev/null +++ b/src/keyer.h @@ -0,0 +1,18 @@ +#ifndef KEYER_H +#define KEYER_H + +class Keyer final +{ +public: + enum class State + { + WAIT + }; + + void run(); + +private: + State state{State::WAIT}; +}; + +#endif \ No newline at end of file diff --git a/src/settings.cpp b/src/settings.cpp index 637e94e..2f5c147 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1,6 +1,6 @@ #include -#include +#include "pico/stdlib.h" #include "settings.h" diff --git a/src/settings.h b/src/settings.h index 3e8ddcf..2b36485 100644 --- a/src/settings.h +++ b/src/settings.h @@ -1,7 +1,7 @@ #ifndef SETTINGS_H #define SETTINGS_H -#include +#include "pico/flash.h" const uint16_t MAGIC_NUMBER = 2;