more code cleanup

This commit is contained in:
Martin Brodbeck 2024-02-09 12:20:30 +01:00
parent 1d4d387299
commit 69b6214668
5 changed files with 35 additions and 2 deletions

View file

@ -1,4 +1,5 @@
target_sources(pico_keyer PRIVATE target_sources(pico_keyer PRIVATE
pico_keyer.cpp pico_keyer.cpp
settings.cpp settings.cpp
keyer.cpp
) )

14
src/keyer.cpp Normal file
View file

@ -0,0 +1,14 @@
#include "keyer.h"
void Keyer::run()
{
switch (state)
{
case State::WAIT:
// do nothing
break;
default:
break;
}
}

18
src/keyer.h Normal file
View file

@ -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

View file

@ -1,6 +1,6 @@
#include <cstring> #include <cstring>
#include <pico/stdlib.h> #include "pico/stdlib.h"
#include "settings.h" #include "settings.h"

View file

@ -1,7 +1,7 @@
#ifndef SETTINGS_H #ifndef SETTINGS_H
#define SETTINGS_H #define SETTINGS_H
#include <pico/flash.h> #include "pico/flash.h"
const uint16_t MAGIC_NUMBER = 2; const uint16_t MAGIC_NUMBER = 2;