Enclosure files + firmware

This commit is contained in:
Salim Benbouziyane
2024-12-27 16:11:21 -05:00
parent a0ae88370c
commit 5fd10e2f6b
62 changed files with 3587 additions and 1 deletions

View File

@@ -0,0 +1,41 @@
#include "StateMachine.h"
#include "Controllers.h"
DoneState::DoneState() : doneEnter(0) {}
void DoneState::enter()
{
Serial.println("Entering Done State");
doneEnter = millis();
ledController.setBreath(GREEN, -1, true, 2);
// Register state-specific handlers
inputController.onPressHandler([]()
{
Serial.println("Done State: Button pressed");
stateMachine.changeState(&StateMachine::idleState); });
// Send 'Stop' webhook
networkController.sendWebhookAction("stop");
}
void DoneState::update()
{
inputController.update();
ledController.update();
displayController.drawDoneScreen();
if (millis() - doneEnter >= (CHANGE_TIMEOUT * 1000))
{
// Transition to Idle after timeout
stateMachine.changeState(&StateMachine::idleState);
}
}
void DoneState::exit()
{
Serial.println("Exiting Done State");
inputController.releaseHandlers();
}