feat(doorbell): add staged boot sequence and refactor main loop
This commit is contained in:
@@ -5,9 +5,12 @@ enum class DeviceState { BOOTED, SILENT, ALERTING, SILENCED };
|
||||
|
||||
enum class ScreenID { BOOT, OFF, ALERT, DASHBOARD };
|
||||
|
||||
enum class BootStage { SPLASH, INIT_DISPLAY, INIT_NETWORK, CONNECTING_WIFI, READY, DONE };
|
||||
|
||||
struct ScreenState {
|
||||
DeviceState deviceState = DeviceState::BOOTED;
|
||||
ScreenID screen = ScreenID::BOOT;
|
||||
BootStage bootStage = BootStage::SPLASH;
|
||||
|
||||
String alertTitle;
|
||||
String alertBody;
|
||||
@@ -52,3 +55,21 @@ inline const char* screenIdStr(ScreenID s) {
|
||||
}
|
||||
return "?";
|
||||
}
|
||||
|
||||
inline const char* bootStageStr(BootStage s) {
|
||||
switch(s) {
|
||||
case BootStage::SPLASH:
|
||||
return "SPLASH";
|
||||
case BootStage::INIT_DISPLAY:
|
||||
return "INIT_DISPLAY";
|
||||
case BootStage::INIT_NETWORK:
|
||||
return "INIT_NETWORK";
|
||||
case BootStage::CONNECTING_WIFI:
|
||||
return "CONNECTING_WIFI";
|
||||
case BootStage::READY:
|
||||
return "READY";
|
||||
case BootStage::DONE:
|
||||
return "DONE";
|
||||
}
|
||||
return "?";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user