diff --git a/main/main.cpp b/main/main.cpp index 2eb9eb5..5674eca 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -27,9 +27,6 @@ using namespace std::chrono_literals; #include "screens.h" #include "presets.h" #include "statistics.h" -#ifdef FEATURE_WEBSERVER -#include "webserver.h" -#endif #ifdef FEATURE_CLOUD #include "cloud.h" #include "udpcloud.h" @@ -122,14 +119,6 @@ extern "C" void app_main() currentMode = &modes::defaultMode; -#ifdef FEATURE_WEBSERVER - bootLabel.redraw("webserver"); - initWebserver(); -#endif - - bootLabel.redraw("potis"); - readPotis(); - #ifdef FEATURE_CLOUD bootLabel.redraw("cloud"); initCloud(); @@ -239,10 +228,6 @@ extern "C" void app_main() } #endif -#ifdef FEATURE_WEBSERVER - handleWebserver(); -#endif - #ifdef FEATURE_BMS bms::update(); #endif diff --git a/main/potis.cpp b/main/potis.cpp index 5b2dc07..bc20584 100644 --- a/main/potis.cpp +++ b/main/potis.cpp @@ -18,6 +18,8 @@ void initPotis() raw_brems = std::nullopt; gas = std::nullopt; brems = std::nullopt; + + readPotis(); } void readPotis() diff --git a/main/taskmanager.cpp b/main/taskmanager.cpp index 0cfd15e..2a185f8 100644 --- a/main/taskmanager.cpp +++ b/main/taskmanager.cpp @@ -54,6 +54,9 @@ #ifdef FEATURE_BLE #include "ble_bobby.h" #endif +#ifdef FEATURE_WEBSERVER +#include "webserver.h" +#endif using namespace std::chrono_literals; @@ -105,6 +108,9 @@ espcpputils::SchedulerTask schedulerTasksArr[] { #ifdef FEATURE_BLE espcpputils::SchedulerTask { "ble", initBle, handleBle, 100ms }, #endif +#ifdef FEATURE_WEBSERVER + espcpputils::SchedulerTask { "webserver", initWebserver, handleWebserver, 100ms }, +#endif }; } // namespace