Re-enable app console

custom
jacqueline 2 years ago
parent 4bff06c76c
commit ebcdf93930
  1. 2
      src/system_fsm/CMakeLists.txt
  2. 9
      src/system_fsm/booting.cpp
  3. 4
      src/system_fsm/include/system_fsm.hpp

@ -1,5 +1,5 @@
idf_component_register(
SRCS "system_fsm.cpp" "running.cpp" "booting.cpp"
INCLUDE_DIRS "include"
REQUIRES "tinyfsm" "drivers" "database" "ui" "result" "events" "audio")
REQUIRES "tinyfsm" "drivers" "database" "ui" "result" "events" "audio" "app_console")
target_compile_options(${COMPONENT_LIB} PRIVATE ${EXTRA_WARNINGS})

@ -20,6 +20,8 @@ namespace states {
static const char kTag[] = "BOOT";
console::AppConsole *Booting::sAppConsole;
auto Booting::entry() -> void {
ESP_LOGI(kTag, "beginning tangara boot");
ESP_LOGI(kTag, "installing bare minimum drivers");
@ -73,8 +75,15 @@ auto Booting::entry() -> void {
BootComplete());
}
auto Booting::exit() -> void {
// TODO(jacqueline): Gate this on something. Debug flag? Flashing mode?
sAppConsole = new console::AppConsole(sDatabase);
sAppConsole->Launch();
}
auto Booting::react(const BootComplete& ev) -> void {
ESP_LOGI(kTag, "bootup completely successfully");
// It's possible that the SAMD is currently exposing the SD card as a USB
// device. Make sure we don't immediately try to claim it.
if (sSamd && sSamd->ReadUsbMscStatus() ==

@ -2,6 +2,7 @@
#include <memory>
#include "app_console.hpp"
#include "battery.hpp"
#include "dac.hpp"
#include "database.hpp"
@ -58,8 +59,11 @@ namespace states {
* looks good.
*/
class Booting : public SystemState {
private:
static console::AppConsole *sAppConsole;
public:
void entry() override;
void exit() override;
void react(const BootComplete&) override;
using SystemState::react;

Loading…
Cancel
Save