Moved webserver into taskmanager

This commit is contained in:
2021-12-19 04:56:24 +01:00
parent be53c39ebf
commit b55b649b10
3 changed files with 8 additions and 15 deletions

View File

@@ -27,9 +27,6 @@ using namespace std::chrono_literals;
#include "screens.h" #include "screens.h"
#include "presets.h" #include "presets.h"
#include "statistics.h" #include "statistics.h"
#ifdef FEATURE_WEBSERVER
#include "webserver.h"
#endif
#ifdef FEATURE_CLOUD #ifdef FEATURE_CLOUD
#include "cloud.h" #include "cloud.h"
#include "udpcloud.h" #include "udpcloud.h"
@@ -122,14 +119,6 @@ extern "C" void app_main()
currentMode = &modes::defaultMode; currentMode = &modes::defaultMode;
#ifdef FEATURE_WEBSERVER
bootLabel.redraw("webserver");
initWebserver();
#endif
bootLabel.redraw("potis");
readPotis();
#ifdef FEATURE_CLOUD #ifdef FEATURE_CLOUD
bootLabel.redraw("cloud"); bootLabel.redraw("cloud");
initCloud(); initCloud();
@@ -239,10 +228,6 @@ extern "C" void app_main()
} }
#endif #endif
#ifdef FEATURE_WEBSERVER
handleWebserver();
#endif
#ifdef FEATURE_BMS #ifdef FEATURE_BMS
bms::update(); bms::update();
#endif #endif

View File

@@ -18,6 +18,8 @@ void initPotis()
raw_brems = std::nullopt; raw_brems = std::nullopt;
gas = std::nullopt; gas = std::nullopt;
brems = std::nullopt; brems = std::nullopt;
readPotis();
} }
void readPotis() void readPotis()

View File

@@ -54,6 +54,9 @@
#ifdef FEATURE_BLE #ifdef FEATURE_BLE
#include "ble_bobby.h" #include "ble_bobby.h"
#endif #endif
#ifdef FEATURE_WEBSERVER
#include "webserver.h"
#endif
using namespace std::chrono_literals; using namespace std::chrono_literals;
@@ -105,6 +108,9 @@ espcpputils::SchedulerTask schedulerTasksArr[] {
#ifdef FEATURE_BLE #ifdef FEATURE_BLE
espcpputils::SchedulerTask { "ble", initBle, handleBle, 100ms }, espcpputils::SchedulerTask { "ble", initBle, handleBle, 100ms },
#endif #endif
#ifdef FEATURE_WEBSERVER
espcpputils::SchedulerTask { "webserver", initWebserver, handleWebserver, 100ms },
#endif
}; };
} // namespace } // namespace