From 04515eecb58840cc1ec7c41decb09c1ae81c9db0 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Sun, 19 Dec 2021 04:42:01 +0100 Subject: [PATCH] Moved ota to taskmanager --- main/main.cpp | 13 ------------- main/taskmanager.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index b079924..7d3d52e 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -25,10 +25,6 @@ using namespace std::chrono_literals; #include "macros_bobbycar.h" #include "globals.h" #include "screens.h" -#ifdef FEATURE_OTA -#include "ota.h" -#include "displays/menus/selectbuildservermenu.h" -#endif #include "presets.h" #include "statistics.h" #ifdef FEATURE_BLE @@ -132,11 +128,6 @@ extern "C" void app_main() currentMode = &modes::defaultMode; -#ifdef FEATURE_OTA - bootLabel.redraw("ota"); - initOta(); -#endif - #ifdef FEATURE_BLE bootLabel.redraw("ble"); initBle(); @@ -239,10 +230,6 @@ extern "C" void app_main() performance.lastTime = now; } -#ifdef FEATURE_OTA - handleOta(); -#endif - #ifdef FEATURE_BLE if (!lastBleUpdate || now - *lastBleUpdate >= 250ms) { diff --git a/main/taskmanager.cpp b/main/taskmanager.cpp index 7b4afcd..801881c 100644 --- a/main/taskmanager.cpp +++ b/main/taskmanager.cpp @@ -48,6 +48,9 @@ #ifdef FEATURE_SERIAL #include "serial_bobby.h" #endif +#ifdef FEATURE_OTA +#include "ota.h" +#endif using namespace std::chrono_literals; @@ -93,6 +96,9 @@ espcpputils::SchedulerTask schedulerTasksArr[] { #ifdef FEATURE_SERIAL espcpputils::SchedulerTask { "serial", initSerial, updateSerial, 50ms }, #endif +#ifdef FEATURE_OTA + espcpputils::SchedulerTask { "ota", initOta, handleOta, 50ms }, +#endif }; } // namespace