Enclosure files + firmware
This commit is contained in:
16
firmware/include/states/AdjustState.h
Normal file
16
firmware/include/states/AdjustState.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "State.h"
|
||||
|
||||
class AdjustState : public State
|
||||
{
|
||||
public:
|
||||
void enter() override;
|
||||
void update() override;
|
||||
void exit() override;
|
||||
void adjustTimer(int duration);
|
||||
|
||||
private:
|
||||
int adjustDuration;
|
||||
unsigned long lastActivity;
|
||||
};
|
||||
15
firmware/include/states/DoneState.h
Normal file
15
firmware/include/states/DoneState.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "State.h"
|
||||
|
||||
class DoneState : public State
|
||||
{
|
||||
public:
|
||||
DoneState();
|
||||
void enter() override;
|
||||
void update() override;
|
||||
void exit() override;
|
||||
|
||||
private:
|
||||
unsigned long doneEnter;
|
||||
};
|
||||
17
firmware/include/states/IdleState.h
Normal file
17
firmware/include/states/IdleState.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "State.h"
|
||||
|
||||
class IdleState : public State
|
||||
{
|
||||
public:
|
||||
IdleState();
|
||||
void enter() override;
|
||||
void update() override;
|
||||
void exit() override;
|
||||
void setTimer(int duration);
|
||||
|
||||
private:
|
||||
int defaultDuration;
|
||||
unsigned long lastActivity;
|
||||
};
|
||||
19
firmware/include/states/PausedState.h
Normal file
19
firmware/include/states/PausedState.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "State.h"
|
||||
|
||||
class PausedState : public State
|
||||
{
|
||||
public:
|
||||
PausedState();
|
||||
void enter() override;
|
||||
void update() override;
|
||||
void exit() override;
|
||||
|
||||
void setPause(int duration, unsigned long elapsedTime);
|
||||
|
||||
private:
|
||||
int duration;
|
||||
unsigned long pauseEnter;
|
||||
unsigned long elapsedTime;
|
||||
};
|
||||
11
firmware/include/states/ProvisionState.h
Normal file
11
firmware/include/states/ProvisionState.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "State.h"
|
||||
|
||||
class ProvisionState : public State
|
||||
{
|
||||
public:
|
||||
void enter() override;
|
||||
void update() override;
|
||||
void exit() override;
|
||||
};
|
||||
13
firmware/include/states/ResetState.h
Normal file
13
firmware/include/states/ResetState.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "State.h"
|
||||
|
||||
class ResetState : public State
|
||||
{
|
||||
public:
|
||||
void enter() override;
|
||||
void update() override;
|
||||
void exit() override;
|
||||
|
||||
unsigned long resetStartTime = 0;
|
||||
};
|
||||
11
firmware/include/states/SleepState.h
Normal file
11
firmware/include/states/SleepState.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "State.h"
|
||||
|
||||
class SleepState : public State
|
||||
{
|
||||
public:
|
||||
void enter() override;
|
||||
void update() override;
|
||||
void exit() override;
|
||||
};
|
||||
15
firmware/include/states/StartupState.h
Normal file
15
firmware/include/states/StartupState.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "State.h"
|
||||
|
||||
class StartupState : public State
|
||||
{
|
||||
public:
|
||||
StartupState();
|
||||
void enter() override;
|
||||
void update() override;
|
||||
void exit() override;
|
||||
|
||||
private:
|
||||
unsigned long startEnter;
|
||||
};
|
||||
20
firmware/include/states/TimerState.h
Normal file
20
firmware/include/states/TimerState.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include "State.h"
|
||||
|
||||
class TimerState : public State
|
||||
{
|
||||
public:
|
||||
TimerState();
|
||||
|
||||
void enter() override;
|
||||
void update() override;
|
||||
void exit() override;
|
||||
|
||||
void setTimer(int duration, unsigned long elapsedTime);
|
||||
|
||||
private:
|
||||
int duration;
|
||||
unsigned long startTime;
|
||||
unsigned long elapsedTime;
|
||||
};
|
||||
Reference in New Issue
Block a user