wip
This commit is contained in:
49
src/states.hpp
Normal file
49
src/states.hpp
Normal file
@@ -0,0 +1,49 @@
|
||||
#include "appcontext.hpp"
|
||||
#include "pin.h"
|
||||
#include "statemachine.hpp"
|
||||
|
||||
enum class StateId
|
||||
{
|
||||
StartState,
|
||||
NetworkInitializeState
|
||||
};
|
||||
|
||||
class StartState : public State
|
||||
{
|
||||
public:
|
||||
StartState(AppContext *appContext) : State("StartState", StateId::StartState), appContext(appContext) {}
|
||||
|
||||
void onEnter(StateMachineBase &stateMachine) override {
|
||||
if (appContext) {
|
||||
appContext->pinR->setLedLevel(0);
|
||||
appContext->pinG->setLedLevel(0);
|
||||
appContext->pinB->setLedLevel(0);
|
||||
appContext->pinCW->setLedLevel(0);
|
||||
appContext->pinWW->setLedLevel(0);
|
||||
}
|
||||
}
|
||||
|
||||
void onExit(StateMachineBase &stateMachine) override {
|
||||
}
|
||||
|
||||
void onUpdate(StateMachineBase &stateMachine) override {
|
||||
}
|
||||
|
||||
private:
|
||||
AppContext *appContext = nullptr;
|
||||
};
|
||||
|
||||
class NetworkInitializeState : public State
|
||||
{
|
||||
public:
|
||||
NetworkInitializeState() : State("NetworkInitializeState", StateId::NetworkInitializeState) {}
|
||||
|
||||
void onEnter(StateMachineBase &stateMachine) override {
|
||||
}
|
||||
|
||||
void onExit(StateMachineBase &stateMachine) override {
|
||||
}
|
||||
|
||||
void onUpdate(StateMachineBase &stateMachine) override {
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user