Moved FEATURE_CLOUD and FEATURE_UDPCLOUD into config-system
This commit is contained in:
@@ -65,8 +65,6 @@ set(BOBBYCAR_BUILDFLAGS
|
|||||||
# -DPINS_GAMETRAKY=39
|
# -DPINS_GAMETRAKY=39
|
||||||
# -DPINS_GAMETRAKDIST=36
|
# -DPINS_GAMETRAKDIST=36
|
||||||
-DFEATURE_POWERSUPPLY
|
-DFEATURE_POWERSUPPLY
|
||||||
-DFEATURE_CLOUD
|
|
||||||
-DFEATURE_UDPCLOUD
|
|
||||||
-DFEATURE_LEDBACKLIGHT
|
-DFEATURE_LEDBACKLIGHT
|
||||||
-DPINS_LEDBACKLIGHT=23
|
-DPINS_LEDBACKLIGHT=23
|
||||||
-DLEDBACKLIGHT_INVERTED
|
-DLEDBACKLIGHT_INVERTED
|
||||||
|
@@ -58,8 +58,6 @@ set(BOBBYCAR_BUILDFLAGS
|
|||||||
# -DPINS_GAMETRAKY=39
|
# -DPINS_GAMETRAKY=39
|
||||||
# -DPINS_GAMETRAKDIST=36
|
# -DPINS_GAMETRAKDIST=36
|
||||||
# -DFEATURE_POWERSUPPLY
|
# -DFEATURE_POWERSUPPLY
|
||||||
# -DFEATURE_CLOUD
|
|
||||||
-DFEATURE_UDPCLOUD
|
|
||||||
-DFEATURE_LEDBACKLIGHT
|
-DFEATURE_LEDBACKLIGHT
|
||||||
-DPINS_LEDBACKLIGHT=23
|
-DPINS_LEDBACKLIGHT=23
|
||||||
-DLEDBACKLIGHT_INVERTED
|
-DLEDBACKLIGHT_INVERTED
|
||||||
|
@@ -56,8 +56,6 @@ set(BOBBYCAR_BUILDFLAGS
|
|||||||
# -DPINS_GAMETRAKY=39
|
# -DPINS_GAMETRAKY=39
|
||||||
# -DPINS_GAMETRAKDIST=36
|
# -DPINS_GAMETRAKDIST=36
|
||||||
-DFEATURE_POWERSUPPLY
|
-DFEATURE_POWERSUPPLY
|
||||||
-DFEATURE_CLOUD
|
|
||||||
-DFEATURE_UDPCLOUD
|
|
||||||
-DFEATURE_LEDBACKLIGHT
|
-DFEATURE_LEDBACKLIGHT
|
||||||
-DPINS_LEDBACKLIGHT=23
|
-DPINS_LEDBACKLIGHT=23
|
||||||
-DLEDBACKLIGHT_INVERTED
|
-DLEDBACKLIGHT_INVERTED
|
||||||
|
@@ -56,8 +56,6 @@ set(BOBBYCAR_BUILDFLAGS
|
|||||||
# -DPINS_GAMETRAKY=39
|
# -DPINS_GAMETRAKY=39
|
||||||
# -DPINS_GAMETRAKDIST=36
|
# -DPINS_GAMETRAKDIST=36
|
||||||
# -DFEATURE_POWERSUPPLY
|
# -DFEATURE_POWERSUPPLY
|
||||||
# -DFEATURE_CLOUD
|
|
||||||
-DFEATURE_UDPCLOUD
|
|
||||||
-DFEATURE_LEDBACKLIGHT
|
-DFEATURE_LEDBACKLIGHT
|
||||||
-DPINS_LEDBACKLIGHT=23
|
-DPINS_LEDBACKLIGHT=23
|
||||||
-DLEDBACKLIGHT_INVERTED
|
-DLEDBACKLIGHT_INVERTED
|
||||||
|
@@ -65,8 +65,6 @@ set(BOBBYCAR_BUILDFLAGS
|
|||||||
# -DPINS_GAMETRAKY=39
|
# -DPINS_GAMETRAKY=39
|
||||||
# -DPINS_GAMETRAKDIST=36
|
# -DPINS_GAMETRAKDIST=36
|
||||||
# -DFEATURE_POWERSUPPLY
|
# -DFEATURE_POWERSUPPLY
|
||||||
# -DFEATURE_CLOUD
|
|
||||||
# -DFEATURE_UDPCLOUD
|
|
||||||
# -DFEATURE_LEDBACKLIGHT
|
# -DFEATURE_LEDBACKLIGHT
|
||||||
# -DPINS_LEDBACKLIGHT=23
|
# -DPINS_LEDBACKLIGHT=23
|
||||||
# -DLEDBACKLIGHT_INVERTED
|
# -DLEDBACKLIGHT_INVERTED
|
||||||
|
@@ -56,8 +56,6 @@ set(BOBBYCAR_BUILDFLAGS
|
|||||||
# -DPINS_GAMETRAKY=39
|
# -DPINS_GAMETRAKY=39
|
||||||
# -DPINS_GAMETRAKDIST=36
|
# -DPINS_GAMETRAKDIST=36
|
||||||
# -DFEATURE_POWERSUPPLY
|
# -DFEATURE_POWERSUPPLY
|
||||||
# -DFEATURE_CLOUD
|
|
||||||
-DFEATURE_UDPCLOUD
|
|
||||||
-DFEATURE_LEDBACKLIGHT
|
-DFEATURE_LEDBACKLIGHT
|
||||||
-DPINS_LEDBACKLIGHT=23
|
-DPINS_LEDBACKLIGHT=23
|
||||||
-DLEDBACKLIGHT_INVERTED
|
-DLEDBACKLIGHT_INVERTED
|
||||||
|
@@ -43,10 +43,8 @@ struct BleEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<boo
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Cloud
|
// Cloud
|
||||||
#ifdef FEATURE_CLOUD
|
|
||||||
struct CloudEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.cloudSettings.cloudEnabled; } };
|
struct CloudEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.cloudSettings.cloudEnabled; } };
|
||||||
struct CloudTransmitTimeoutAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.cloudSettings.cloudTransmitTimeout; } };
|
struct CloudTransmitTimeoutAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.cloudSettings.cloudTransmitTimeout; } };
|
||||||
#endif
|
|
||||||
|
|
||||||
// Time
|
// Time
|
||||||
//struct TimezoneOffsetAccessor : public NewSettingsAccessor<int32_t> { ConfigWrapper<int32_t> &getConfig() const override { return configs.timezoneOffset; } };
|
//struct TimezoneOffsetAccessor : public NewSettingsAccessor<int32_t> { ConfigWrapper<int32_t> &getConfig() const override { return configs.timezoneOffset; } };
|
||||||
@@ -126,17 +124,13 @@ struct GametrakDistMaxAccessor : public NewSettingsAccessor<int16_t> { ConfigWra
|
|||||||
struct StatsUpdateRateAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.timersSettings.statsUpdateRate; } };
|
struct StatsUpdateRateAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.timersSettings.statsUpdateRate; } };
|
||||||
|
|
||||||
// Cloud
|
// Cloud
|
||||||
#ifdef FEATURE_CLOUD
|
|
||||||
struct CloudCollectRateAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.timersSettings.cloudCollectRate; } };
|
struct CloudCollectRateAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.timersSettings.cloudCollectRate; } };
|
||||||
struct CloudSendRateAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.timersSettings.cloudSendRate; } };
|
struct CloudSendRateAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.timersSettings.cloudSendRate; } };
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FEATURE_UDPCLOUD
|
|
||||||
struct UdpCloudSendIntervalAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.timersSettings.udpSendRateMs; } };
|
struct UdpCloudSendIntervalAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.timersSettings.udpSendRateMs; } };
|
||||||
struct UdpCloudEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.udpCloudSettings.udpCloudEnabled; } };
|
struct UdpCloudEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.udpCloudSettings.udpCloudEnabled; } };
|
||||||
struct CloudDebugEnableAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.udpCloudSettings.enableCloudDebug; } };
|
struct CloudDebugEnableAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.udpCloudSettings.enableCloudDebug; } };
|
||||||
struct UdpUseStdStringAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.udpCloudSettings.udpUseStdString; } };
|
struct UdpUseStdStringAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.udpCloudSettings.udpUseStdString; } };
|
||||||
#endif
|
|
||||||
|
|
||||||
// DefaultMode
|
// DefaultMode
|
||||||
struct DefaultModeModelModeAccessor : public RefAccessorSaveSettings<UnifiedModelMode> { UnifiedModelMode &getRef() const override { return profileSettings.defaultMode.modelMode; } };
|
struct DefaultModeModelModeAccessor : public RefAccessorSaveSettings<UnifiedModelMode> { UnifiedModelMode &getRef() const override { return profileSettings.defaultMode.modelMode; } };
|
||||||
|
@@ -24,7 +24,6 @@ namespace {
|
|||||||
constexpr const char * const TAG = "BOBBYCLOUD";
|
constexpr const char * const TAG = "BOBBYCLOUD";
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#ifdef FEATURE_CLOUD
|
|
||||||
|
|
||||||
espcpputils::websocket_client cloudClient;
|
espcpputils::websocket_client cloudClient;
|
||||||
bool cloudStarted{};
|
bool cloudStarted{};
|
||||||
@@ -53,6 +52,9 @@ void initCloud()
|
|||||||
|
|
||||||
void updateCloud()
|
void updateCloud()
|
||||||
{
|
{
|
||||||
|
if (!configs.feature.cloud.value)
|
||||||
|
return;
|
||||||
|
|
||||||
const auto now = espchrono::millis_clock::now();
|
const auto now = espchrono::millis_clock::now();
|
||||||
|
|
||||||
if (!lastCloudCollect || now - *lastCloudCollect >= std::chrono::milliseconds{configs.boardcomputerHardware.timersSettings.cloudCollectRate.value})
|
if (!lastCloudCollect || now - *lastCloudCollect >= std::chrono::milliseconds{configs.boardcomputerHardware.timersSettings.cloudCollectRate.value})
|
||||||
@@ -284,5 +286,3 @@ void destroyCloud()
|
|||||||
cloudClient = {};
|
cloudClient = {};
|
||||||
cloudStarted = false;
|
cloudStarted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@@ -7,7 +7,6 @@
|
|||||||
#include <wrappers/websocket_client.h>
|
#include <wrappers/websocket_client.h>
|
||||||
#include <espchrono.h>
|
#include <espchrono.h>
|
||||||
|
|
||||||
#ifdef FEATURE_CLOUD
|
|
||||||
extern espcpputils::websocket_client cloudClient;
|
extern espcpputils::websocket_client cloudClient;
|
||||||
extern bool cloudStarted;
|
extern bool cloudStarted;
|
||||||
extern espchrono::millis_clock::time_point lastCreateTry;
|
extern espchrono::millis_clock::time_point lastCreateTry;
|
||||||
@@ -22,4 +21,3 @@ void initCloud();
|
|||||||
void updateCloud();
|
void updateCloud();
|
||||||
void cloudCollect();
|
void cloudCollect();
|
||||||
void cloudSend();
|
void cloudSend();
|
||||||
#endif
|
|
||||||
|
@@ -6,7 +6,6 @@
|
|||||||
// local includes
|
// local includes
|
||||||
#include "cloud.h"
|
#include "cloud.h"
|
||||||
|
|
||||||
#ifdef FEATURE_CLOUD
|
|
||||||
std::string CloudCreatedText::text() const
|
std::string CloudCreatedText::text() const
|
||||||
{
|
{
|
||||||
return fmt::format("created: {}", cloudClient ? "true" : "false");
|
return fmt::format("created: {}", cloudClient ? "true" : "false");
|
||||||
@@ -27,4 +26,3 @@ std::string CloudConnectedText::text() const
|
|||||||
text += cloudClient.is_connected() ? "true" : "false";
|
text += cloudClient.is_connected() ? "true" : "false";
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
// local includes
|
// local includes
|
||||||
#include "textinterface.h"
|
#include "textinterface.h"
|
||||||
|
|
||||||
#ifdef FEATURE_CLOUD
|
|
||||||
struct CloudCreatedText : public virtual espgui::TextInterface
|
struct CloudCreatedText : public virtual espgui::TextInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -21,4 +20,3 @@ struct CloudConnectedText : public virtual espgui::TextInterface
|
|||||||
public:
|
public:
|
||||||
std::string text() const override;
|
std::string text() const override;
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
@@ -16,7 +16,6 @@
|
|||||||
#include "displays/menus/settingsmenu.h"
|
#include "displays/menus/settingsmenu.h"
|
||||||
#include "bobbycheckbox.h"
|
#include "bobbycheckbox.h"
|
||||||
|
|
||||||
#ifdef FEATURE_CLOUD
|
|
||||||
namespace {
|
namespace {
|
||||||
constexpr char TEXT_CLOUDSETTINGS[] = "Cloud settings";
|
constexpr char TEXT_CLOUDSETTINGS[] = "Cloud settings";
|
||||||
constexpr char TEXT_CLOUDENABLED[] = "Cloud enabled";
|
constexpr char TEXT_CLOUDENABLED[] = "Cloud enabled";
|
||||||
@@ -83,4 +82,3 @@ void CloudSettingsMenu::back()
|
|||||||
{
|
{
|
||||||
switchScreen<SettingsMenu>();
|
switchScreen<SettingsMenu>();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
// local includes
|
// local includes
|
||||||
#include "displays/bobbymenudisplay.h"
|
#include "displays/bobbymenudisplay.h"
|
||||||
|
|
||||||
#ifdef FEATURE_CLOUD
|
|
||||||
class CloudSettingsMenu : public BobbyMenuDisplay
|
class CloudSettingsMenu : public BobbyMenuDisplay
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -13,4 +12,3 @@ public:
|
|||||||
|
|
||||||
void back() override;
|
void back() override;
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
@@ -66,9 +66,10 @@ DebugMenu::DebugMenu()
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_CANDEBUG>, SwitchScreenAction<CanDebugMenu>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_CANDEBUG>, SwitchScreenAction<CanDebugMenu>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_QRCODE_DEBUG>, SwitchScreenAction<QrCodeDebugDisplay>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_QRCODE_DEBUG>, SwitchScreenAction<QrCodeDebugDisplay>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BATTERYDEBUG>, SwitchScreenAction<BatteryDebugMenu>, StaticMenuItemIcon<&bobbyicons::battery>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BATTERYDEBUG>, SwitchScreenAction<BatteryDebugMenu>, StaticMenuItemIcon<&bobbyicons::battery>>>();
|
||||||
#ifdef FEATURE_UDPCLOUD
|
if (configs.feature.udpcloud.value)
|
||||||
|
{
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_TOGGLECLOUDDEBUG>, BobbyCheckbox, CloudDebugEnableAccessor>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_TOGGLECLOUDDEBUG>, BobbyCheckbox, CloudDebugEnableAccessor>>();
|
||||||
#endif
|
}
|
||||||
constructMenuItem<makeComponent<MenuItem, LastRebootReasonText, StaticFont<2>, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, LastRebootReasonText, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, CanIcCrashText, StaticFont<2>, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, CanIcCrashText, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, EmptyText, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, EmptyText, DummyAction>>();
|
||||||
|
@@ -25,12 +25,8 @@
|
|||||||
#include "displays/menus/networksettingsmenu.h"
|
#include "displays/menus/networksettingsmenu.h"
|
||||||
#include "displays/menus/bluetoothsettingsmenu.h"
|
#include "displays/menus/bluetoothsettingsmenu.h"
|
||||||
#include "displays/menus/blesettingsmenu.h"
|
#include "displays/menus/blesettingsmenu.h"
|
||||||
#ifdef FEATURE_CLOUD
|
|
||||||
#include "displays/menus/cloudsettingsmenu.h"
|
#include "displays/menus/cloudsettingsmenu.h"
|
||||||
#endif
|
|
||||||
#ifdef FEATURE_UDPCLOUD
|
|
||||||
#include "displays/menus/udpcloudsettingsmenu.h"
|
#include "displays/menus/udpcloudsettingsmenu.h"
|
||||||
#endif
|
|
||||||
#include "displays/menus/espnowmenu.h"
|
#include "displays/menus/espnowmenu.h"
|
||||||
#include "displays/menus/selectbuildservermenu.h"
|
#include "displays/menus/selectbuildservermenu.h"
|
||||||
#include "displays/menus/timesettingsmenu.h"
|
#include "displays/menus/timesettingsmenu.h"
|
||||||
@@ -99,12 +95,14 @@ SettingsMenu::SettingsMenu()
|
|||||||
#ifdef FEATURE_BLE
|
#ifdef FEATURE_BLE
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BLESETTINGS>, SwitchScreenAction<BleSettingsMenu>, StaticMenuItemIcon<&bobbyicons::bluetooth>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BLESETTINGS>, SwitchScreenAction<BleSettingsMenu>, StaticMenuItemIcon<&bobbyicons::bluetooth>>>();
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEATURE_CLOUD
|
if (configs.feature.cloud.value)
|
||||||
|
{
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_CLOUDSETTINGS>, SwitchScreenAction<CloudSettingsMenu>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_CLOUDSETTINGS>, SwitchScreenAction<CloudSettingsMenu>>>();
|
||||||
#endif
|
}
|
||||||
#ifdef FEATURE_UDPCLOUD
|
if (configs.feature.udpcloud.value)
|
||||||
|
{
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_UDPCLOUDSETTINGS>, SwitchScreenAction<UdpCloudSettingsMenu>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_UDPCLOUDSETTINGS>, SwitchScreenAction<UdpCloudSettingsMenu>>>();
|
||||||
#endif
|
}
|
||||||
#ifdef FEATURE_OTA
|
#ifdef FEATURE_OTA
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SELECTBUILDSERVERMENU>, SwitchScreenAction<SelectBuildServerMenu>, StaticMenuItemIcon<&bobbyicons::update>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SELECTBUILDSERVERMENU>, SwitchScreenAction<SelectBuildServerMenu>, StaticMenuItemIcon<&bobbyicons::update>>>();
|
||||||
#endif
|
#endif
|
||||||
|
@@ -14,7 +14,6 @@
|
|||||||
#include "displays/menus/settingsmenu.h"
|
#include "displays/menus/settingsmenu.h"
|
||||||
#include "bobbycheckbox.h"
|
#include "bobbycheckbox.h"
|
||||||
|
|
||||||
#ifdef FEATURE_UDPCLOUD
|
|
||||||
namespace {
|
namespace {
|
||||||
constexpr char TEXT_UDPCLOUDSETTINGS[] = "UDP Cloud settings";
|
constexpr char TEXT_UDPCLOUDSETTINGS[] = "UDP Cloud settings";
|
||||||
constexpr char TEXT_UDPCLOUDENABLED[] = "Udp Cloud enabled";
|
constexpr char TEXT_UDPCLOUDENABLED[] = "Udp Cloud enabled";
|
||||||
@@ -50,4 +49,3 @@ void UdpCloudSettingsMenu::back()
|
|||||||
{
|
{
|
||||||
switchScreen<SettingsMenu>();
|
switchScreen<SettingsMenu>();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
// local includes
|
// local includes
|
||||||
#include "displays/bobbymenudisplay.h"
|
#include "displays/bobbymenudisplay.h"
|
||||||
|
|
||||||
#ifdef FEATURE_UDPCLOUD
|
|
||||||
class UdpCloudSettingsMenu : public BobbyMenuDisplay
|
class UdpCloudSettingsMenu : public BobbyMenuDisplay
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -13,4 +12,3 @@ public:
|
|||||||
|
|
||||||
void back() override;
|
void back() override;
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
@@ -150,7 +150,9 @@ void StatusDisplay::redraw()
|
|||||||
m_backStatus.redraw(controllers.back);
|
m_backStatus.redraw(controllers.back);
|
||||||
|
|
||||||
tft.setTextFont(2);
|
tft.setTextFont(2);
|
||||||
#ifdef FEATURE_UDPCLOUD
|
|
||||||
|
if (configs.feature.udpcloud.value)
|
||||||
|
{
|
||||||
if(configs.udpCloudSettings.udpCloudEnabled.value && configs.udpCloudSettings.enableCloudDebug.value)
|
if(configs.udpCloudSettings.udpCloudEnabled.value && configs.udpCloudSettings.enableCloudDebug.value)
|
||||||
{
|
{
|
||||||
tft.fillRect(125, 258, 8, 8, (visualSendUdpPacket) ? TFT_DARKGREY : TFT_BLACK);
|
tft.fillRect(125, 258, 8, 8, (visualSendUdpPacket) ? TFT_DARKGREY : TFT_BLACK);
|
||||||
@@ -159,7 +161,7 @@ void StatusDisplay::redraw()
|
|||||||
// {
|
// {
|
||||||
// tft.fillRect(125, 258, 8, 8, TFT_BLACK);
|
// tft.fillRect(125, 258, 8, 8, TFT_BLACK);
|
||||||
// }
|
// }
|
||||||
#endif
|
}
|
||||||
|
|
||||||
const auto staStatus = wifi_stack::get_sta_status();
|
const auto staStatus = wifi_stack::get_sta_status();
|
||||||
if (staStatus == wifi_stack::WiFiStaStatus::CONNECTED)
|
if (staStatus == wifi_stack::WiFiStaStatus::CONNECTED)
|
||||||
|
@@ -308,6 +308,8 @@ public:
|
|||||||
ConfigWrapper<bool> ledstrip {false, DoReset, {}, "f_ledstrip" };
|
ConfigWrapper<bool> ledstrip {false, DoReset, {}, "f_ledstrip" };
|
||||||
ConfigWrapper<bool> webserver_disable_lock{false, DoReset, {}, "f_no_web_lock" };
|
ConfigWrapper<bool> webserver_disable_lock{false, DoReset, {}, "f_no_web_lock" };
|
||||||
ConfigWrapper<bool> garage {false, DoReset, {}, "f_garage" };
|
ConfigWrapper<bool> garage {false, DoReset, {}, "f_garage" };
|
||||||
|
ConfigWrapper<bool> cloud {false, DoReset, {}, "f_cloud" };
|
||||||
|
ConfigWrapper<bool> udpcloud {false, DoReset, {}, "f_udpcloud" };
|
||||||
ConfigWrapper<bool> gschissene_diode {false, DoReset, {}, "f_gschissDiode" };
|
ConfigWrapper<bool> gschissene_diode {false, DoReset, {}, "f_gschissDiode" };
|
||||||
} feature;
|
} feature;
|
||||||
|
|
||||||
@@ -592,13 +594,18 @@ public:
|
|||||||
x(feature.gschissene_diode) \
|
x(feature.gschissene_diode) \
|
||||||
x(feature.ledstrip) \
|
x(feature.ledstrip) \
|
||||||
x(feature.webserver_disable_lock) \
|
x(feature.webserver_disable_lock) \
|
||||||
x(feature.garage)
|
x(feature.garage) \
|
||||||
|
x(feature.udpcloud) \
|
||||||
|
x(feature.cloud)
|
||||||
//x(bleSettings.bleEnabled)
|
//x(bleSettings.bleEnabled)
|
||||||
|
|
||||||
#define FEATURES(x) \
|
#define FEATURES(x) \
|
||||||
x(feature.ledstrip) \
|
x(feature.ledstrip) \
|
||||||
x(feature.webserver_disable_lock) \
|
x(feature.webserver_disable_lock) \
|
||||||
x(feature.garage)
|
x(feature.garage) \
|
||||||
|
x(feature.udpcloud) \
|
||||||
|
x(feature.cloud)
|
||||||
|
//x(feature.gschisseneDiode)
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void callForEveryConfig(T &&callback)
|
void callForEveryConfig(T &&callback)
|
||||||
|
@@ -60,12 +60,8 @@
|
|||||||
#ifdef FEATURE_ESPNOW
|
#ifdef FEATURE_ESPNOW
|
||||||
#include "espnowfunctions.h"
|
#include "espnowfunctions.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEATURE_CLOUD
|
|
||||||
#include "cloud.h"
|
#include "cloud.h"
|
||||||
#endif
|
|
||||||
#ifdef FEATURE_UDPCLOUD
|
|
||||||
#include "udpcloud.h"
|
#include "udpcloud.h"
|
||||||
#endif
|
|
||||||
#include "modes.h"
|
#include "modes.h"
|
||||||
#include "drivingstatistics.h"
|
#include "drivingstatistics.h"
|
||||||
#ifdef FEATURE_DNS_NS
|
#ifdef FEATURE_DNS_NS
|
||||||
@@ -133,12 +129,8 @@ BobbySchedulerTask schedulerTasksArr[] {
|
|||||||
#ifdef FEATURE_ESPNOW
|
#ifdef FEATURE_ESPNOW
|
||||||
BobbySchedulerTask { "espnow", espnow::initESPNow, espnow::handle, 100ms },
|
BobbySchedulerTask { "espnow", espnow::initESPNow, espnow::handle, 100ms },
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEATURE_CLOUD
|
|
||||||
BobbySchedulerTask { "cloud", initCloud, updateCloud, 50ms },
|
BobbySchedulerTask { "cloud", initCloud, updateCloud, 50ms },
|
||||||
#endif
|
|
||||||
#ifdef FEATURE_UDPCLOUD
|
|
||||||
BobbySchedulerTask { "udpcloud", udpCloudInit, udpCloudUpdate, 50ms },
|
BobbySchedulerTask { "udpcloud", udpCloudInit, udpCloudUpdate, 50ms },
|
||||||
#endif
|
|
||||||
BobbySchedulerTask { "drivingmode", initDrivingMode, updateDrivingMode, 20ms },
|
BobbySchedulerTask { "drivingmode", initDrivingMode, updateDrivingMode, 20ms },
|
||||||
BobbySchedulerTask { "drivingstatistics", initStatistics, calculateStatistics, 100ms },
|
BobbySchedulerTask { "drivingstatistics", initStatistics, calculateStatistics, 100ms },
|
||||||
#ifdef FEATURE_DNS_NS
|
#ifdef FEATURE_DNS_NS
|
||||||
|
@@ -21,7 +21,6 @@
|
|||||||
#include "drivingstatistics.h"
|
#include "drivingstatistics.h"
|
||||||
#include "newsettings.h"
|
#include "newsettings.h"
|
||||||
|
|
||||||
#ifdef FEATURE_UDPCLOUD
|
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -40,6 +39,9 @@ void udpCloudInit()
|
|||||||
|
|
||||||
void udpCloudUpdate()
|
void udpCloudUpdate()
|
||||||
{
|
{
|
||||||
|
if (!configs.feature.udpcloud.value)
|
||||||
|
return;
|
||||||
|
|
||||||
if (configs.udpCloudSettings.udpCloudEnabled.value && configs.udpCloudSettings.udpUid.touched())
|
if (configs.udpCloudSettings.udpCloudEnabled.value && configs.udpCloudSettings.udpUid.touched())
|
||||||
sendUdpCloudPacket();
|
sendUdpCloudPacket();
|
||||||
}
|
}
|
||||||
@@ -372,4 +374,3 @@ void sendUdpCloudPacket()
|
|||||||
visualSendUdpPacket = !visualSendUdpPacket;
|
visualSendUdpPacket = !visualSendUdpPacket;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
// system includes
|
// system includes
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#ifdef FEATURE_UDPCLOUD
|
|
||||||
// Little "flash" on statusdisplay when udp stuff is happening
|
// Little "flash" on statusdisplay when udp stuff is happening
|
||||||
extern bool visualSendUdpPacket;
|
extern bool visualSendUdpPacket;
|
||||||
|
|
||||||
@@ -14,4 +13,3 @@ void spamUdpBroadcast();
|
|||||||
std::string buildUdpCloudJson();
|
std::string buildUdpCloudJson();
|
||||||
std::string buildUdpCloudString();
|
std::string buildUdpCloudString();
|
||||||
void sendUdpCloudPacket();
|
void sendUdpCloudPacket();
|
||||||
#endif
|
|
||||||
|
Reference in New Issue
Block a user