Moved FEATURE_WEBSERVER into config-system

This commit is contained in:
CommanderRedYT
2022-01-18 20:04:31 +01:00
parent 5e242eb098
commit eb8cacec5a
20 changed files with 5 additions and 56 deletions

View File

@ -37,7 +37,6 @@ set(BOBBYCAR_BUILDFLAGS
-DFEATURE_CAN
# -DFEATURE_SERIAL
# -DFEATURE_MOSFETS
-DFEATURE_WEBSERVER
# -DFEATURE_BLUETOOTH
# -DFEATURE_BMS
# -DFEATURE_GAMETRAK

View File

@ -37,7 +37,6 @@ set(BOBBYCAR_BUILDFLAGS
-DFEATURE_CAN
# -DFEATURE_SERIAL
# -DFEATURE_MOSFETS
-DFEATURE_WEBSERVER
# -DFEATURE_BLUETOOTH
# -DFEATURE_BMS
# -DFEATURE_GAMETRAK

View File

@ -37,7 +37,6 @@ set(BOBBYCAR_BUILDFLAGS
-DFEATURE_CAN
# -DFEATURE_SERIAL
-DFEATURE_MOSFETS
-DFEATURE_WEBSERVER
# -DFEATURE_BLUETOOTH
# -DFEATURE_BMS
# -DFEATURE_GAMETRAK

View File

@ -37,7 +37,6 @@ set(BOBBYCAR_BUILDFLAGS
-DFEATURE_CAN
# -DFEATURE_SERIAL
# -DFEATURE_MOSFETS
-DFEATURE_WEBSERVER
# -DFEATURE_BLUETOOTH
# -DFEATURE_BMS
# -DFEATURE_GAMETRAK

View File

@ -37,7 +37,6 @@ set(BOBBYCAR_BUILDFLAGS
# -DFEATURE_CAN
# -DFEATURE_SERIAL
# -DFEATURE_MOSFETS
# -DFEATURE_WEBSERVER
# -DFEATURE_BLUETOOTH
# -DFEATURE_BMS
# -DFEATURE_GAMETRAK

View File

@ -37,7 +37,6 @@ set(BOBBYCAR_BUILDFLAGS
-DFEATURE_CAN
# -DFEATURE_SERIAL
# -DFEATURE_MOSFETS
-DFEATURE_WEBSERVER
# -DFEATURE_BLUETOOTH
# -DFEATURE_BMS
# -DFEATURE_GAMETRAK

View File

@ -330,7 +330,8 @@ public:
ConfigWrapper<bool> ntp {false, DoReset, {}, "f_ntp" };
ConfigWrapper<bool> ble {false, DoReset, {}, "f_ble" };
ConfigWrapper<bool> ota {false, DoReset, {}, "f_ota" };
ConfigWrapper<bool> gschissene_diode {false, DoReset, {}, "f_gschissDiode" };
ConfigWrapper<bool> webserver {true, DoReset, {}, "featureWebserv" };
ConfigWrapper<bool> gschissene_diode {false, DoReset, {}, "featurDiodeHin" };
} feature;
struct {
@ -631,6 +632,7 @@ public:
x(feature.ntp) \
x(feature.ble) \
x(feature.ota) \
x(feature.webserver) \
x(feature.gschissene_diode)
//x(bleSettings.bleEnabled)
@ -643,7 +645,8 @@ public:
x(feature.dnsannounce) \
x(feature.ntp) \
x(feature.ble) \
x(feature.ota)
x(feature.ota) \
x(feature.webserver)
//x(feature.gschisseneDiode)
template<typename T>

View File

@ -47,9 +47,7 @@
#endif
#include "ota.h"
#include "ble_bobby.h"
#ifdef FEATURE_WEBSERVER
#include "webserver.h"
#endif
#include "ledstrip.h"
#ifdef FEATURE_ESPNOW
#include "espnowfunctions.h"
@ -108,9 +106,7 @@ BobbySchedulerTask schedulerTasksArr[] {
#endif
BobbySchedulerTask { "ota", initOta, handleOta, 50ms },
BobbySchedulerTask { "ble", initBle, handleBle, 100ms },
#ifdef FEATURE_WEBSERVER
BobbySchedulerTask { "webserver", initWebserver, handleWebserver, 100ms },
#endif
BobbySchedulerTask { "ledstrip", initLedStrip, updateLedStrip, 30ms },
#ifdef FEATURE_ESPNOW
BobbySchedulerTask { "espnow", espnow::initESPNow, espnow::handle, 100ms },

View File

@ -29,7 +29,6 @@
using namespace std::chrono_literals;
#ifdef FEATURE_WEBSERVER
namespace {
constexpr const char * const TAG = "BOBBYWEB";
@ -204,4 +203,3 @@ esp_err_t webserver_status_handler(httpd_req_t *req)
}
} // namespace
#endif

View File

@ -1,14 +1,10 @@
#pragma once
// esp-idf includes
#ifdef FEATURE_WEBSERVER
#include <esp_http_server.h>
#endif
#ifdef FEATURE_WEBSERVER
extern httpd_handle_t httpdHandle;
void initWebserver();
void handleWebserver();
bool MenuDisplayChanged();
#endif

View File

@ -1,9 +1,7 @@
#include "webserver_displaycontrol.h"
// esp-idf includes
#ifdef FEATURE_WEBSERVER
#include <esp_http_server.h>
#endif
#include <esp_log.h>
// 3rdparty lib includes
@ -26,7 +24,6 @@
#include "webserver_lock.h"
#include "newsettings.h"
#ifdef FEATURE_WEBSERVER
using esphttpdutils::HtmlTag;
using namespace std::chrono_literals;
@ -613,4 +610,3 @@ esp_err_t webserver_setValue_handler(httpd_req_t *req)
CALL_AND_EXIT_ON_ERROR(httpd_resp_set_hdr, req, "Location", "/")
CALL_AND_EXIT(esphttpdutils::webserver_resp_send, req, esphttpdutils::ResponseStatus::TemporaryRedirect, "text/html", "Ok, continue at <a href=\"/\">/</a>")
}
#endif

View File

@ -1,15 +1,11 @@
#pragma once
// esp-idf includes
#ifdef FEATURE_WEBSERVER
#include <esp_http_server.h>
#endif
#include <esp_err.h>
#ifdef FEATURE_WEBSERVER
esp_err_t webserver_root_handler(httpd_req_t *req);
esp_err_t webserver_triggerRawButton_handler(httpd_req_t *req);
esp_err_t webserver_triggerButton_handler(httpd_req_t *req);
esp_err_t webserver_triggerItem_handler(httpd_req_t *req);
esp_err_t webserver_setValue_handler(httpd_req_t *req);
#endif

View File

@ -1,9 +1,7 @@
#include "webserver_dumpnvs.h"
// esp-idf includes
#ifdef FEATURE_WEBSERVER
#include <esp_http_server.h>
#endif
#include <esp_log.h>
// 3rdparty lib includes

View File

@ -1,12 +1,8 @@
#pragma once
// esp-idf includes
#ifdef FEATURE_WEBSERVER
#include <esp_http_server.h>
#endif
#include <esp_err.h>
#ifdef FEATURE_WEBSERVER
esp_err_t webserver_dump_nvs_handler(httpd_req_t *req);
#endif

View File

@ -4,9 +4,7 @@
#include <limits>
// esp-idf includes
#ifdef FEATURE_WEBSERVER
#include <esp_http_server.h>
#endif
#include <esp_log.h>
// 3rdparty lib includes
@ -24,7 +22,6 @@
#include "newsettings.h"
#include "webserver_lock.h"
#ifdef FEATURE_WEBSERVER
using namespace std::chrono_literals;
using esphttpdutils::HtmlTag;
@ -645,4 +642,3 @@ esp_err_t webserver_resetNewSettings_handler(httpd_req_t *req)
"text/plain",
body)
}
#endif

View File

@ -1,13 +1,9 @@
#pragma once
// esp-idf includes
#ifdef FEATURE_WEBSERVER
#include <esp_http_server.h>
#endif
#include <esp_err.h>
#ifdef FEATURE_WEBSERVER
esp_err_t webserver_newSettings_handler(httpd_req_t *req);
esp_err_t webserver_saveNewSettings_handler(httpd_req_t *req);
esp_err_t webserver_resetNewSettings_handler(httpd_req_t *req);
#endif

View File

@ -1,9 +1,7 @@
#include "webserver_ota.h"
// esp-idf includes
#ifdef FEATURE_WEBSERVER
#include <esp_http_server.h>
#endif
#include <esp_log.h>
#include <esp_ota_ops.h>
@ -22,7 +20,6 @@
#include "globals.h"
#include "newsettings.h"
#ifdef FEATURE_WEBSERVER
using namespace std::chrono_literals;
using esphttpdutils::HtmlTag;
@ -423,4 +420,3 @@ esp_err_t webserver_trigger_ota_handler(httpd_req_t *req)
CALL_AND_EXIT_ON_ERROR(httpd_resp_set_hdr, req, "Location", "/ota")
CALL_AND_EXIT(esphttpdutils::webserver_resp_send, req, esphttpdutils::ResponseStatus::TemporaryRedirect, "text/html", "Ok, continue at <a href=\"/ota\">/</a>")
}
#endif

View File

@ -1,13 +1,9 @@
#pragma once
// esp-idf includes
#ifdef FEATURE_WEBSERVER
#include <esp_http_server.h>
#endif
#include <esp_err.h>
#ifdef FEATURE_WEBSERVER
esp_err_t webserver_ota_handler(httpd_req_t *req);
esp_err_t webserver_ota_percentage_handler(httpd_req_t *req);
esp_err_t webserver_trigger_ota_handler(httpd_req_t *req);
#endif

View File

@ -4,9 +4,7 @@
#include <limits>
// esp-idf includes
#ifdef FEATURE_WEBSERVER
#include <esp_http_server.h>
#endif
#include <esp_log.h>
// 3rdparty lib includes
@ -22,7 +20,6 @@
#include "globals.h"
#include "webserver_lock.h"
#ifdef FEATURE_WEBSERVER
using namespace std::chrono_literals;
using esphttpdutils::HtmlTag;
@ -325,4 +322,3 @@ esp_err_t webserver_saveSettings_handler(httpd_req_t *req)
"text/plain",
body)
}
#endif

View File

@ -1,12 +1,8 @@
#pragma once
// esp-idf includes
#ifdef FEATURE_WEBSERVER
#include <esp_http_server.h>
#endif
#include <esp_err.h>
#ifdef FEATURE_WEBSERVER
esp_err_t webserver_settings_handler(httpd_req_t *req);
esp_err_t webserver_saveSettings_handler(httpd_req_t *req);
#endif