Compare commits
2 Commits
new-idf
...
websocket-
Author | SHA1 | Date | |
---|---|---|---|
ee4092a722 | |||
5ff8864ac3 |
@ -1,66 +0,0 @@
|
||||
# Generated from CLion C/C++ Code Style settings
|
||||
BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: None
|
||||
AlignOperands: Align
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
AllowAllConstructorInitializersOnNextLine: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: Always
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: Always
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortLoopsOnASingleLine: true
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
BreakBeforeBraces: Custom
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: true
|
||||
AfterControlStatement: Always
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: false
|
||||
AfterUnion: true
|
||||
BeforeCatch: false
|
||||
BeforeElse: true
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: true
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeTernaryOperators: false
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakInheritanceList: BeforeColon
|
||||
ColumnLimit: 0
|
||||
CompactNamespaces: false
|
||||
ContinuationIndentWidth: 8
|
||||
IndentCaseLabels: false
|
||||
IndentPPDirectives: None
|
||||
IndentWidth: 4
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
MaxEmptyLinesToKeep: 2
|
||||
NamespaceIndentation: None
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PointerAlignment: Right
|
||||
ReflowComments: false
|
||||
SpaceAfterCStyleCast: true
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCpp11BracedList: false
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeRangeBasedForLoopColon: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 0
|
||||
SpacesInAngles: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
18
.gitmodules
vendored
18
.gitmodules
vendored
@ -3,7 +3,7 @@
|
||||
url = ../../0xFEEDC0DE64/espcpputils.git
|
||||
[submodule "esp-idf"]
|
||||
path = esp-idf
|
||||
url = ../../bobbycar-graz/esp-idf.git
|
||||
url = ../../0xFEEDC0DE64/esp-idf.git
|
||||
[submodule "components/cpputils"]
|
||||
path = components/cpputils
|
||||
url = ../../0xFEEDC0DE64/cpputils.git
|
||||
@ -22,6 +22,9 @@
|
||||
[submodule "components/arduino-esp32"]
|
||||
path = components/arduino-esp32
|
||||
url = ../../0xFEEDC0DE64/arduino-esp32.git
|
||||
[submodule "components/expected"]
|
||||
path = components/expected
|
||||
url = ../../0xFEEDC0DE64/expected.git
|
||||
[submodule "components/bobbycar-protocol"]
|
||||
path = components/bobbycar-protocol
|
||||
url = ../../bobbycar-graz/bobbycar-protocol.git
|
||||
@ -33,7 +36,7 @@
|
||||
url = ../../0xFEEDC0DE64/espwifistack.git
|
||||
[submodule "components/esp-nimble-cpp"]
|
||||
path = components/esp-nimble-cpp
|
||||
url = ../../bobbycar-graz/esp-nimble-cpp.git
|
||||
url = ../../0xFEEDC0DE64/esp-nimble-cpp.git
|
||||
[submodule "components/espasyncota"]
|
||||
path = components/espasyncota
|
||||
url = ../../0xFEEDC0DE64/espasyncota.git
|
||||
@ -63,13 +66,10 @@
|
||||
url = ../../0xFEEDC0DE64/esp-protocols.git
|
||||
[submodule "components/TFT_eSPI"]
|
||||
path = components/TFT_eSPI
|
||||
url = ../../0xFEEDC0DE64/TFT_eSPI.git
|
||||
url = ../../bobbycar-graz/TFT_eSPI.git
|
||||
[submodule "esp_boost"]
|
||||
path = esp_boost
|
||||
url = ../../0xFEEDC0DE64/esp_boost.git
|
||||
[submodule "components/esptftlib"]
|
||||
path = components/esptftlib
|
||||
url = ../../0xFEEDC0DE64/esptftlib.git
|
||||
[submodule "components/espfontlib"]
|
||||
path = components/espfontlib
|
||||
url = ../../0xFEEDC0DE64/espfontlib.git
|
||||
[submodule "components/asio_web"]
|
||||
path = components/asio_web
|
||||
url = ../../0xFEEDC0DE64/asio_web.git
|
||||
|
@ -25,8 +25,6 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
idf_build_set_property(CXX_COMPILE_OPTIONS -std=gnu++23 APPEND)
|
||||
|
||||
set(EXTRA_COMPONENT_DIRS
|
||||
esp_boost
|
||||
esp-protocols/components
|
||||
|
Submodule components/FastLED-idf updated: 6a64e87bc3...3f4d71050e
Submodule components/TFT_eSPI updated: 69f86aa4f2...9fa26a02fb
Submodule components/arduino-esp32 updated: 745ccdeae8...07f43ec91c
1
components/asio_web
Submodule
1
components/asio_web
Submodule
Submodule components/asio_web added at 1e901fafbf
Submodule components/bobbycar-protocol updated: 0734d65146...701243ad89
Submodule components/cpputils updated: 96e318fd6d...3ab7a6c5ef
Submodule components/esp-gui-lib updated: 53c5f9a0f3...ab946208e5
Submodule components/esp-nimble-cpp updated: 29f9273c65...c218a27dd8
Submodule components/espasynchttpreq updated: 06ca1a6881...4719a27c5d
Submodule components/espasyncota updated: ee623d78ea...ac540310a4
Submodule components/espchrono updated: eff94f175c...b83cc027cd
Submodule components/espconfiglib updated: 379533571f...6129681a6d
Submodule components/espcpputils updated: 4cf49eac1d...00fa5ec601
Submodule components/espfontlib deleted from 89048ff162
Submodule components/esphttpdutils updated: 6ed0915d85...eb152b8406
Submodule components/esptftlib deleted from b779a4c09d
Submodule components/espwifistack updated: e70b509e20...2bf332f3eb
1
components/expected
Submodule
1
components/expected
Submodule
Submodule components/expected added at ce14a0fc6e
@ -1,20 +1,20 @@
|
||||
set(BOBBY_APP_NAME bobbyquad_comred_new)
|
||||
set(BOBBY_DEFAULT_USERNAME comred_new)
|
||||
|
||||
# add_definitions(
|
||||
# -DUSER_SETUP_LOADED=1
|
||||
# -DLOAD_GLCD=1
|
||||
# -DLOAD_FONT2=1
|
||||
# -DLOAD_FONT4=1
|
||||
# -DLOAD_FONT7=1
|
||||
# -DILI9341_DRIVER=1
|
||||
# -DTFT_MOSI=13
|
||||
# -DTFT_SCLK=15
|
||||
# -DTFT_CS=14
|
||||
# -DTFT_DC=12
|
||||
# -DTFT_RST=2
|
||||
# -DSPI_FREQUENCY=40000000
|
||||
# )
|
||||
add_definitions(
|
||||
-DUSER_SETUP_LOADED=1
|
||||
-DLOAD_GLCD=1
|
||||
-DLOAD_FONT2=1
|
||||
-DLOAD_FONT4=1
|
||||
-DLOAD_FONT7=1
|
||||
-DILI9341_DRIVER=1
|
||||
-DTFT_MOSI=13
|
||||
-DTFT_SCLK=15
|
||||
-DTFT_CS=14
|
||||
-DTFT_DC=12
|
||||
-DTFT_RST=2
|
||||
-DSPI_FREQUENCY=40000000
|
||||
)
|
||||
|
||||
set(BOBBYCAR_BUILDFLAGS
|
||||
# Pins
|
||||
|
@ -1,6 +1,21 @@
|
||||
set(BOBBY_APP_NAME bobbyquad_mick)
|
||||
set(BOBBY_DEFAULT_USERNAME mick)
|
||||
|
||||
add_definitions(
|
||||
-DUSER_SETUP_LOADED=1
|
||||
-DLOAD_GLCD=1
|
||||
-DLOAD_FONT2=1
|
||||
-DLOAD_FONT4=1
|
||||
-DLOAD_FONT7=1
|
||||
-DILI9341_DRIVER=1
|
||||
-DTFT_MOSI=13
|
||||
-DTFT_SCLK=15
|
||||
-DTFT_CS=14
|
||||
-DTFT_DC=12
|
||||
-DTFT_RST=2
|
||||
-DSPI_FREQUENCY=27000000
|
||||
)
|
||||
|
||||
set(BOBBYCAR_BUILDFLAGS
|
||||
# Pins
|
||||
-DPINS_GAS=34
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,15 +1,9 @@
|
||||
dependencies:
|
||||
espressif/esp-idf-cxx:
|
||||
component_hash: df7921090d6601b268b99b5d54d2f53bb5ea25dbd58cc53961ef7784326621de
|
||||
source:
|
||||
service_url: https://api.components.espressif.com/
|
||||
type: service
|
||||
version: 1.0.1-beta
|
||||
idf:
|
||||
component_hash: null
|
||||
source:
|
||||
type: idf
|
||||
version: 5.2.0
|
||||
manifest_hash: 04b1e89bb78c4187b4d7bc0cf9461b7a3475762e58fec6f3bb49a885c56532c2
|
||||
version: 5.1.0
|
||||
manifest_hash: 61ebe3a040bdb7a8bb7b582261db12d83b6028789124b5f6ddacb4104628daa6
|
||||
target: esp32
|
||||
version: 1.0.0
|
||||
|
2
esp-idf
2
esp-idf
Submodule esp-idf updated: 14b365579b...756de87ccf
Submodule esp-protocols updated: d38f04b88f...49e1369ae9
@ -1,4 +1,4 @@
|
||||
set(BOBBY_HEADERS
|
||||
set(headers
|
||||
accessorhelpers.h
|
||||
accessors/globalaccessors.h
|
||||
accessors/settingsaccessors.h
|
||||
@ -23,9 +23,9 @@ set(BOBBY_HEADERS
|
||||
actions/loadsettingsaction.h
|
||||
actions/modesettingsaction.h
|
||||
actions/qraction.h
|
||||
actions/rebootaction.h
|
||||
actions/resetnvsaction.h
|
||||
actions/savesettingsaction.h
|
||||
actions/setupactions.h
|
||||
actions/switchprofileaction.h
|
||||
actions/tempomatmodeapplycurrentpeedaction.h
|
||||
actions/updateswapfrontbackaction.h
|
||||
@ -72,6 +72,7 @@ set(BOBBY_HEADERS
|
||||
displays/bobbymenudisplay.h
|
||||
displays/bobbypopupdisplay.h
|
||||
displays/bobbysplitgraphdisplay.h
|
||||
displays/buttoncalibratedisplay.h
|
||||
displays/calibratevoltagedisplay.h
|
||||
displays/confiscationdisplay.h
|
||||
displays/gameoflifedisplay.h
|
||||
@ -158,14 +159,6 @@ set(BOBBY_HEADERS
|
||||
displays/qrcodedebug.h
|
||||
displays/qrdisplay.h
|
||||
displays/qrimportdisplay.h
|
||||
displays/rebootscreen.h
|
||||
displays/setup/ask_calibrate_other_buttons.h
|
||||
displays/setup/ask_setup_clouds.h
|
||||
displays/setup/basic_buttons.h
|
||||
displays/setup/calibrate_potis.h
|
||||
displays/setup/final_information.h
|
||||
displays/setup/information.h
|
||||
displays/setup/setup_cloud.h
|
||||
displays/speedinfodisplay.h
|
||||
displays/spirodisplay.h
|
||||
displays/starfielddisplay.h
|
||||
@ -235,12 +228,12 @@ set(BOBBY_HEADERS
|
||||
presets.h
|
||||
profilesettings.h
|
||||
qrimport.h
|
||||
remotedisplaywebsocket.h
|
||||
rotary.h
|
||||
screens.h
|
||||
serial_bobby.h
|
||||
settingspersister.h
|
||||
settingsutils.h
|
||||
setup.h
|
||||
softpwmlimiter.h
|
||||
statistics.h
|
||||
statustexthelper.h
|
||||
@ -267,7 +260,7 @@ set(BOBBY_HEADERS
|
||||
wifiguiutils.h
|
||||
)
|
||||
|
||||
set(BOBBY_SOURCES
|
||||
set(sources
|
||||
accessors/wifistaconfigaccessors.cpp
|
||||
actions/assertaction.cpp
|
||||
actions/bluetoothbeginaction.cpp
|
||||
@ -287,9 +280,9 @@ set(BOBBY_SOURCES
|
||||
actions/loadsettingsaction.cpp
|
||||
actions/modesettingsaction.cpp
|
||||
actions/qraction.cpp
|
||||
actions/rebootaction.cpp
|
||||
actions/resetnvsaction.cpp
|
||||
actions/savesettingsaction.cpp
|
||||
actions/setupactions.cpp
|
||||
actions/switchprofileaction.cpp
|
||||
actions/tempomatmodeapplycurrentpeedaction.cpp
|
||||
actions/updateswapfrontbackaction.cpp
|
||||
@ -333,6 +326,7 @@ set(BOBBY_SOURCES
|
||||
displays/bobbymenudisplay.cpp
|
||||
displays/bobbypopupdisplay.cpp
|
||||
displays/bobbysplitgraphdisplay.cpp
|
||||
displays/buttoncalibratedisplay.cpp
|
||||
displays/calibratevoltagedisplay.cpp
|
||||
displays/confiscationdisplay.cpp
|
||||
displays/gameoflifedisplay.cpp
|
||||
@ -417,14 +411,6 @@ set(BOBBY_SOURCES
|
||||
displays/qrcodedebug.cpp
|
||||
displays/qrdisplay.cpp
|
||||
displays/qrimportdisplay.cpp
|
||||
displays/rebootscreen.cpp
|
||||
displays/setup/ask_calibrate_other_buttons.cpp
|
||||
displays/setup/ask_setup_clouds.cpp
|
||||
displays/setup/basic_buttons.cpp
|
||||
displays/setup/calibrate_potis.cpp
|
||||
displays/setup/final_information.cpp
|
||||
displays/setup/information.cpp
|
||||
displays/setup/setup_cloud.cpp
|
||||
displays/speedinfodisplay.cpp
|
||||
displays/spirodisplay.cpp
|
||||
displays/starfielddisplay.cpp
|
||||
@ -495,12 +481,12 @@ set(BOBBY_SOURCES
|
||||
presets.cpp
|
||||
profilesettings.cpp
|
||||
qrimport.cpp
|
||||
remotedisplaywebsocket.cpp
|
||||
rotary.cpp
|
||||
screens.cpp
|
||||
serial_bobby.cpp
|
||||
settingspersister.cpp
|
||||
settingsutils.cpp
|
||||
setup.cpp
|
||||
softpwmlimiter.cpp
|
||||
statistics.cpp
|
||||
statustexthelper.cpp
|
||||
@ -530,13 +516,13 @@ set(dependencies
|
||||
freertos nvs_flash esp_http_server esp_https_ota mdns app_update esp_system esp_websocket_client driver esp_adc
|
||||
arduino-esp32 ArduinoJson esp-nimble-cpp FastLED-idf TFT_eSPI QRCode-esp32
|
||||
bobbycar-protocol cpputils cxx-ring-buffer date sunset
|
||||
espasynchttpreq espasyncota espchrono espcpputils espconfiglib esp-gui-lib esphttpdutils espwifistack fmt
|
||||
espasynchttpreq espasyncota espchrono espcpputils espconfiglib esp-gui-lib esphttpdutils espwifistack expected fmt
|
||||
)
|
||||
|
||||
idf_component_register(
|
||||
SRCS
|
||||
${BOBBY_HEADERS}
|
||||
${BOBBY_SOURCES}
|
||||
${headers}
|
||||
${sources}
|
||||
INCLUDE_DIRS
|
||||
.
|
||||
REQUIRES
|
||||
@ -554,34 +540,22 @@ execute_process(
|
||||
COMMAND git rev-parse --abbrev-ref HEAD
|
||||
OUTPUT_VARIABLE GIT_BRANCH
|
||||
)
|
||||
execute_process(
|
||||
COMMAND git status --short
|
||||
OUTPUT_VARIABLE GIT_STATUS
|
||||
)
|
||||
|
||||
if (NOT GIT_STATUS STREQUAL "")
|
||||
set(GIT_STATUS "dirty")
|
||||
else()
|
||||
set(GIT_STATUS "clean")
|
||||
endif()
|
||||
|
||||
string(STRIP "${GIT_REV}" GIT_REV)
|
||||
string(SUBSTRING "${GIT_REV}" 1 7 GIT_SHORT_REV)
|
||||
string(STRIP "${GIT_MESSAGE}" GIT_MESSAGE)
|
||||
string(REPLACE "\n" " " GIT_MESSAGE "${GIT_MESSAGE}")
|
||||
string(REPLACE "\"" "\\\"" GIT_MESSAGE "${GIT_MESSAGE}")
|
||||
string(SUBSTRING "${GIT_MESSAGE}" 0 100 GIT_MESSAGE)
|
||||
string(STRIP "${GIT_BRANCH}" GIT_BRANCH)
|
||||
|
||||
if(NOT DEFINED BOBBY_DEFAULT_USERNAME)
|
||||
message(FATAL_ERROR "Please define BOBBY_DEFAULT_USERNAME")
|
||||
endif()
|
||||
|
||||
message(WARNING "Git revision: ${GIT_REV}")
|
||||
message(WARNING "Git short revision: ${GIT_SHORT_REV}")
|
||||
message(WARNING "Git message: ${GIT_MESSAGE}")
|
||||
message(WARNING "Git branch: ${GIT_BRANCH}")
|
||||
message(WARNING "Git status: ${GIT_STATUS}")
|
||||
|
||||
if(NOT DEFINED BOBBY_DEFAULT_USERNAME)
|
||||
message(FATAL_ERROR "Please define BOBBY_DEFAULT_USERNAME")
|
||||
endif()
|
||||
|
||||
target_compile_options(${COMPONENT_TARGET}
|
||||
PRIVATE
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
// system includes
|
||||
#include <cstdint>
|
||||
#include <expected>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <accessorinterface.h>
|
||||
@ -20,7 +19,7 @@ struct RefAccessorSaveSettings : public virtual espgui::RefAccessor<T>
|
||||
espgui::RefAccessor<T>::setValue(value);
|
||||
|
||||
if (!saveProfileSettings())
|
||||
return std::unexpected("saveProfileSettings() failed!");
|
||||
return tl::make_unexpected("saveProfileSettings() failed!");
|
||||
|
||||
return {};
|
||||
};
|
||||
|
@ -1,8 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
// system includes
|
||||
#include <expected>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <accessorinterface.h>
|
||||
|
||||
@ -32,7 +29,7 @@ struct NMotMaxKmhAccessor : public virtual espgui::AccessorInterface<int16_t>
|
||||
{
|
||||
profileSettings.limits.nMotMax = convertFromKmh(value);
|
||||
if (!saveProfileSettings())
|
||||
return std::unexpected("saveProfileSettings() failed!");
|
||||
return tl::make_unexpected("saveProfileSettings() failed!");
|
||||
return {};
|
||||
}
|
||||
};
|
||||
@ -50,6 +47,7 @@ struct CloudTransmitTimeoutAccessor : public NewSettingsAccessor<int16_t> { Conf
|
||||
struct CloudSendStatisticsAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.cloudSettings.sendStatistic; } };
|
||||
struct CloudURLAccessor : public NewSettingsAccessor<std::string> { ConfigWrapper<std::string> &getConfig() const override { return configs.cloudUrl; } };
|
||||
struct CloudKeyAccessor : public NewSettingsAccessor<std::string> { ConfigWrapper<std::string> &getConfig() const override { return configs.cloudSettings.cloudKey; } };
|
||||
struct CloudSendScreenAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.cloudSettings.sendScreen; } };
|
||||
|
||||
// Time
|
||||
//struct TimezoneOffsetAccessor : public NewSettingsAccessor<int32_t> { ConfigWrapper<int32_t> &getConfig() const override { return configs.timezoneOffset; } };
|
||||
@ -80,7 +78,7 @@ struct WheelDiameterInchAccessor : public virtual espgui::AccessorInterface<floa
|
||||
{
|
||||
// profileSettings.controllerHardware.wheelDiameter = convertFromInch(value);
|
||||
// if (!saveProfileSettings())
|
||||
// return std::unexpected("saveProfileSettings() failed!");
|
||||
// return tl::make_unexpected("saveProfileSettings() failed!");
|
||||
// return {};
|
||||
return configs.write_config(configs.controllerHardware.wheelDiameter, convertFromInch(value));
|
||||
}
|
||||
@ -208,9 +206,6 @@ struct LedstripEnableBlinkAnimationAccessor : public NewSettingsAccessor<bool> {
|
||||
struct LedstripOtaAnimationAccessor : public NewSettingsAccessor<OtaAnimationModes> { ConfigWrapper<OtaAnimationModes> &getConfig() const override { return configs.ledstrip.otaMode; } };
|
||||
struct LedstripEnableVisualizeBlinkAnimationAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.ledstrip.enableVisualizeBlink; } };
|
||||
struct LedstripAutomaticLightAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.ledstrip.automaticLight; } };
|
||||
struct LedstripBrakeLightUseAccelAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.ledstrip.brakeLights_useAccel; } };
|
||||
struct LedstripBrakeLightUsePowerAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.ledstrip.brakeLights_usePower; } };
|
||||
|
||||
|
||||
// Battery
|
||||
struct BatterySeriesCellsAccessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.battery.cellsSeries; } };
|
||||
|
@ -32,6 +32,7 @@ private:
|
||||
std::string m_msg;
|
||||
};
|
||||
|
||||
template<typename TMenu>
|
||||
class PushQrImportDisplayAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
public:
|
||||
@ -40,7 +41,7 @@ public:
|
||||
|
||||
void triggered() override
|
||||
{
|
||||
espgui::pushScreen<QrImportDisplay>(std::move(m_nvskey));
|
||||
espgui::pushScreen<QrImportDisplay<TMenu>>(std::move(m_nvskey));
|
||||
}
|
||||
private:
|
||||
std::string m_nvskey;
|
||||
|
22
main/actions/rebootaction.cpp
Normal file
22
main/actions/rebootaction.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
#include "rebootaction.h"
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_system.h>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
|
||||
void RebootAction::triggered()
|
||||
{
|
||||
espgui::tft.fillScreen(TFT_BLACK);
|
||||
espgui::tft.setTextColor(TFT_YELLOW);
|
||||
|
||||
espgui::tft.drawString("Reboot", 5, 5, 4);
|
||||
|
||||
espgui::tft.fillRect(0, 34, espgui::tft.width(), 3, TFT_WHITE);
|
||||
|
||||
espgui::tft.setTextColor(TFT_WHITE);
|
||||
espgui::tft.drawString("Rebooting now...", 0, 50, 4);
|
||||
|
||||
esp_restart();
|
||||
}
|
10
main/actions/rebootaction.h
Normal file
10
main/actions/rebootaction.h
Normal file
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <actioninterface.h>
|
||||
|
||||
class RebootAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
public:
|
||||
void triggered() override;
|
||||
};
|
@ -0,0 +1,11 @@
|
||||
#include "resetnvsaction.h"
|
||||
|
||||
// system includes
|
||||
#include <esp_system.h>
|
||||
#include <nvs_flash.h>
|
||||
|
||||
void ResetNVSAction::triggered()
|
||||
{
|
||||
nvs_flash_erase();
|
||||
esp_restart();
|
||||
}
|
||||
|
@ -1,40 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
// system includes
|
||||
#include <esp_system.h>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <actioninterface.h>
|
||||
#include <tftcolors.h>
|
||||
|
||||
// local includes
|
||||
#include "newsettings.h"
|
||||
|
||||
template<bool reboot>
|
||||
class ResetNVSAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
public:
|
||||
void triggered() override
|
||||
{
|
||||
if (reboot)
|
||||
{
|
||||
tft.fillScreen(espgui::TFT_BLACK);
|
||||
tft.setTextColor(espgui::TFT_YELLOW);
|
||||
|
||||
tft.drawString("Reboot", 5, 5, 4);
|
||||
|
||||
tft.fillRect(0, 34, tft.width(), 3, espgui::TFT_WHITE);
|
||||
|
||||
tft.setTextColor(espgui::TFT_WHITE);
|
||||
tft.drawString("Rebooting now...", 0, 50, 4);
|
||||
|
||||
configs.reset();
|
||||
|
||||
esp_restart();
|
||||
}
|
||||
else
|
||||
{
|
||||
configs.reset();
|
||||
}
|
||||
}
|
||||
void triggered() override;
|
||||
};
|
||||
|
@ -1,26 +0,0 @@
|
||||
#include "setupactions.h"
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <screenmanager.h>
|
||||
|
||||
// local includes
|
||||
#include "displays/setup/basic_buttons.h"
|
||||
#include "displays/setup/calibrate_potis.h"
|
||||
|
||||
PushButtonCalibrateDisplayAction::PushButtonCalibrateDisplayAction(const bool early_return) :
|
||||
m_early_return{early_return}
|
||||
{}
|
||||
|
||||
void PushButtonCalibrateDisplayAction::triggered()
|
||||
{
|
||||
espgui::pushScreen<SetupBasicButtonsDisplay>(m_early_return);
|
||||
}
|
||||
|
||||
PushPotiCalibrateDisplayAction::PushPotiCalibrateDisplayAction(const bool early_return) :
|
||||
m_early_return{early_return}
|
||||
{}
|
||||
|
||||
void PushPotiCalibrateDisplayAction::triggered()
|
||||
{
|
||||
// espgui::pushScreen<SetupCalibratePotisDisplay>(m_early_return); // commented out until implemented
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <actioninterface.h>
|
||||
|
||||
class PushButtonCalibrateDisplayAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
public:
|
||||
explicit PushButtonCalibrateDisplayAction(bool early_return);
|
||||
|
||||
void triggered() override;
|
||||
private:
|
||||
const bool m_early_return;
|
||||
};
|
||||
|
||||
class PushPotiCalibrateDisplayAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
public:
|
||||
explicit PushPotiCalibrateDisplayAction(bool early_return);
|
||||
|
||||
void triggered() override;
|
||||
private:
|
||||
const bool m_early_return;
|
||||
};
|
@ -21,19 +21,19 @@ constexpr const char * const TAG = "BOBBYBLE";
|
||||
class RemoteControlCallbacks : public NimBLECharacteristicCallbacks
|
||||
{
|
||||
public:
|
||||
void onWrite(NimBLECharacteristic* pCharacteristic, NimBLEConnInfo& connInfo) override;
|
||||
void onWrite(NimBLECharacteristic* pCharacteristic) override;
|
||||
};
|
||||
|
||||
class WirelessSettingsCallbacks : public NimBLECharacteristicCallbacks
|
||||
{
|
||||
public:
|
||||
void onWrite(NimBLECharacteristic* pCharacteristic, NimBLEConnInfo& connInfo) override;
|
||||
void onWrite(NimBLECharacteristic* pCharacteristic) override;
|
||||
};
|
||||
|
||||
class WiFiListCallbacks : public NimBLECharacteristicCallbacks
|
||||
{
|
||||
public:
|
||||
void onRead(NimBLECharacteristic* pCharacteristic, NimBLEConnInfo& connInfo) override;
|
||||
void onRead(NimBLECharacteristic* pCharacteristic) override;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
@ -55,20 +55,14 @@ void createBle()
|
||||
{
|
||||
ESP_LOGI("BOBBY", "called");
|
||||
|
||||
NimBLEDevice::init(configs.bluetoothName.value());
|
||||
BLEDevice::init(configs.bluetoothName.value());
|
||||
|
||||
const auto serviceUuid{"0335e46c-f355-4ce6-8076-017de08cee98"};
|
||||
|
||||
ESP_LOGI(TAG, "Creating BLE server");
|
||||
|
||||
pServer = NimBLEDevice::createServer();
|
||||
|
||||
ESP_LOGI(TAG, "Creating BLE service");
|
||||
pServer = BLEDevice::createServer();
|
||||
|
||||
pService = pServer->createService(serviceUuid);
|
||||
|
||||
ESP_LOGI(TAG, "Creating BLE characteristics");
|
||||
|
||||
livestatsCharacteristic = pService->createCharacteristic("a48321ea-329f-4eab-a401-30e247211524", NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::NOTIFY);
|
||||
remotecontrolCharacteristic = pService->createCharacteristic("4201def0-a264-43e6-946b-6b2d9612dfed", NIMBLE_PROPERTY::WRITE);
|
||||
remotecontrolCharacteristic->setCallbacks(&bleRemoteCallbacks);
|
||||
@ -78,23 +72,19 @@ void createBle()
|
||||
getwifilist = pService->createCharacteristic("4201def2-a264-43e6-946b-6b2d9612dfed", NIMBLE_PROPERTY::READ);
|
||||
getwifilist->setCallbacks(&bleWiFiListCallbacks);
|
||||
|
||||
ESP_LOGI(TAG, "Starting BLE service");
|
||||
|
||||
pService->start();
|
||||
|
||||
ESP_LOGI(TAG, "Starting BLE advertising");
|
||||
|
||||
NimBLEAdvertising *pAdvertising = NimBLEDevice::getAdvertising();
|
||||
BLEAdvertising *pAdvertising = BLEDevice::getAdvertising();
|
||||
pAdvertising->addServiceUUID(serviceUuid);
|
||||
pAdvertising->setScanResponse(true);
|
||||
NimBLEDevice::startAdvertising();
|
||||
BLEDevice::startAdvertising();
|
||||
}
|
||||
|
||||
void destroyBle()
|
||||
{
|
||||
ESP_LOGI("BOBBY", "called");
|
||||
|
||||
NimBLEDevice::deinit(true);
|
||||
BLEDevice::deinit(true);
|
||||
|
||||
pServer = {};
|
||||
pService = {};
|
||||
@ -236,9 +226,9 @@ void handleBle()
|
||||
|
||||
namespace {
|
||||
|
||||
void RemoteControlCallbacks::onWrite(NimBLECharacteristic* pCharacteristic, NimBLEConnInfo& connInfo)
|
||||
void RemoteControlCallbacks::onWrite(NimBLECharacteristic* pCharacteristic)
|
||||
{
|
||||
const std::string& val = pCharacteristic->getValue();
|
||||
const auto &val = pCharacteristic->getValue();
|
||||
|
||||
StaticJsonDocument<256> doc;
|
||||
if (const auto error = deserializeJson(doc, val))
|
||||
@ -268,9 +258,9 @@ void RemoteControlCallbacks::onWrite(NimBLECharacteristic* pCharacteristic, NimB
|
||||
}
|
||||
}
|
||||
|
||||
void WirelessSettingsCallbacks::onWrite(NimBLECharacteristic* pCharacteristic, NimBLEConnInfo& connInfo)
|
||||
void WirelessSettingsCallbacks::onWrite(NimBLECharacteristic* pCharacteristic)
|
||||
{
|
||||
const std::string& val = pCharacteristic->getValue();
|
||||
const auto &val = pCharacteristic->getValue();
|
||||
|
||||
StaticJsonDocument<256> doc;
|
||||
if (const auto error = deserializeJson(doc, val))
|
||||
@ -292,7 +282,7 @@ void WirelessSettingsCallbacks::onWrite(NimBLECharacteristic* pCharacteristic, N
|
||||
}
|
||||
}
|
||||
|
||||
void WiFiListCallbacks::onRead(NimBLECharacteristic* pCharacteristic, NimBLEConnInfo& connInfo)
|
||||
void WiFiListCallbacks::onRead(NimBLECharacteristic *pCharacteristic)
|
||||
{
|
||||
StaticJsonDocument<768> responseDoc;
|
||||
auto wifiArray = responseDoc.createNestedArray("wifis");
|
||||
|
@ -60,18 +60,23 @@ namespace bobbyblinker {
|
||||
}
|
||||
if (configs.ledstrip.enableBrakeLights.value() && espchrono::ago(*brake_last_time_sent) > 500ms)
|
||||
{
|
||||
if (brakeLightsStatus == brakeLightsOffSent)
|
||||
float avgPwm{};
|
||||
for (const Controller &controller: controllers) {
|
||||
avgPwm +=
|
||||
controller.command.left.pwm * (controller.invertLeft ? -1 : 1) +
|
||||
controller.command.right.pwm * (controller.invertRight ? -1 : 1);
|
||||
}
|
||||
avgPwm /= 4;
|
||||
|
||||
if (avgPwm < -1.f)
|
||||
{
|
||||
if (brakeLightsStatus)
|
||||
{
|
||||
sendState("BRAKELIGHTSON");
|
||||
brakeLightsOffSent = false;
|
||||
}
|
||||
else if (!brakeLightsOffSent)
|
||||
{
|
||||
sendState("BRAKELIGHTSOFF");
|
||||
brakeLightsOffSent = true;
|
||||
}
|
||||
sendState("BRAKELIGHTSON");
|
||||
brakeLightsOffSent = false;
|
||||
}
|
||||
else if (!brakeLightsOffSent && avgPwm > -1.f)
|
||||
{
|
||||
sendState("BRAKELIGHTSOFF");
|
||||
brakeLightsOffSent = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,9 +8,7 @@
|
||||
|
||||
void BobbyErrorHandler::errorOccurred(std::string &&error)
|
||||
{
|
||||
espgui::changeScreenCallback = [error_ = std::move(error)](espgui::TftInterface &tft) mutable {
|
||||
auto newDisplay = std::make_unique<BobbyPopupDisplay>(std::move(error_), std::move(espgui::currentDisplay));
|
||||
newDisplay->initOverlay(tft);
|
||||
espgui::currentDisplay = std::move(newDisplay);
|
||||
};
|
||||
auto newDisplay = std::make_unique<BobbyPopupDisplay>(std::move(error), std::move(espgui::currentDisplay));
|
||||
newDisplay->initOverlay();
|
||||
espgui::currentDisplay = std::move(newDisplay);
|
||||
}
|
||||
|
@ -95,9 +95,6 @@ void open_garage()
|
||||
return;
|
||||
for (const auto &config : configs.wireless_door_configs)
|
||||
{
|
||||
if (config.doorId.value().empty() || config.doorToken.value().empty())
|
||||
continue;
|
||||
|
||||
if (const auto error = espnow::send_espnow_message(fmt::format("BOBBYOPEN:{}:{}", config.doorId.value(), config.doorToken.value())); error != ESP_OK)
|
||||
{
|
||||
ESP_LOGE("BOBBY", "send_espnow_message() failed with: %s", esp_err_to_name(error));
|
||||
|
@ -155,7 +155,7 @@ namespace buildserver {
|
||||
|
||||
std::string get_hash_url(std::string hash)
|
||||
{
|
||||
return fmt::format("{}{}.bin", url_for_hashes, hash);
|
||||
return fmt::format(fmt::runtime(url_for_hashes), hash);
|
||||
}
|
||||
|
||||
std::string get_latest_url()
|
||||
@ -197,7 +197,7 @@ namespace buildserver {
|
||||
index = 0;
|
||||
|
||||
url_for_latest = fmt::format("{}{}", configs.otaServerUrl.value(), doc["latest"].as<std::string>());
|
||||
url_for_hashes = fmt::format("{}{}", configs.otaServerUrl.value(), doc["new_url"].as<std::string>());
|
||||
url_for_hashes = fmt::format("{}{}", configs.otaServerUrl.value(), doc["url"].as<std::string>());
|
||||
parsing_finished = true;
|
||||
}
|
||||
|
||||
|
@ -308,7 +308,7 @@ void sendCanCommands()
|
||||
++can_total_error_cnt;
|
||||
can_sequential_bus_errors = status_info.bus_error_count;
|
||||
|
||||
if (can_total_error_cnt < 500 && (configs.canUninstallOnReset.value() && can_total_error_cnt < 100))
|
||||
if (can_total_error_cnt < 500)
|
||||
ESP_LOGW(TAG, "twai_transmit() failed after %lldms with %s, seq err: %lu, total err: %lu",
|
||||
std::chrono::floor<std::chrono::milliseconds>(timestamp_after - timestamp_before).count(),
|
||||
esp_err_to_name(result),
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
// system includes
|
||||
#include <optional>
|
||||
#include <expected>
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_log.h>
|
||||
@ -14,6 +13,7 @@
|
||||
#include <menudisplay.h>
|
||||
#include <numberparsing.h>
|
||||
#include <screenmanager.h>
|
||||
#include <tftinstance.h>
|
||||
#include <tickchrono.h>
|
||||
#include <wrappers/websocket_client.h>
|
||||
|
||||
@ -196,41 +196,41 @@ typename std::enable_if<
|
||||
!std::is_same_v<T, HandbremseMode> &&
|
||||
!std::is_same_v<T, BobbyQuickActions> &&
|
||||
!std::is_same_v<T, BatteryCellType>
|
||||
, std::expected<void, std::string>>::type
|
||||
, tl::expected<void, std::string>>::type
|
||||
set_config(ConfigWrapper<T> &config, std::string_view newValue)
|
||||
{
|
||||
return std::unexpected("Unsupported config type");
|
||||
return tl::make_unexpected("Unsupported config type");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
typename std::enable_if<
|
||||
std::is_same_v<T, bool>
|
||||
, std::expected<void, std::string>>::type
|
||||
, tl::expected<void, std::string>>::type
|
||||
set_config(ConfigWrapper<T> &config, std::string_view newValue)
|
||||
{
|
||||
if (cpputils::is_in(newValue, "true", "false"))
|
||||
return configs.write_config(config, newValue == "true");
|
||||
else
|
||||
return std::unexpected(fmt::format("only true and false allowed, not {}", newValue));
|
||||
return tl::make_unexpected(fmt::format("only true and false allowed, not {}", newValue));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
typename std::enable_if<
|
||||
!std::is_same_v<T, bool> &&
|
||||
std::is_integral_v<T>
|
||||
, std::expected<void, std::string>>::type
|
||||
, tl::expected<void, std::string>>::type
|
||||
set_config(ConfigWrapper<T> &config, std::string_view newValue)
|
||||
{
|
||||
if (auto parsed = cpputils::fromString<T>(newValue))
|
||||
return configs.write_config(config, *parsed);
|
||||
else
|
||||
return std::unexpected(fmt::format("could not parse {}", newValue));
|
||||
return tl::make_unexpected(fmt::format("could not parse {}", newValue));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
typename std::enable_if<
|
||||
std::is_same_v<T, std::string>
|
||||
, std::expected<void, std::string>>::type
|
||||
, tl::expected<void, std::string>>::type
|
||||
set_config(ConfigWrapper<T> &config, std::string_view newValue)
|
||||
{
|
||||
return configs.write_config(config, std::string{newValue});
|
||||
@ -239,31 +239,31 @@ set_config(ConfigWrapper<T> &config, std::string_view newValue)
|
||||
template<typename T>
|
||||
typename std::enable_if<
|
||||
std::is_same_v<T, wifi_stack::ip_address_t>
|
||||
, std::expected<void, std::string>>::type
|
||||
, tl::expected<void, std::string>>::type
|
||||
set_config(ConfigWrapper<T> &config, std::string_view newValue)
|
||||
{
|
||||
if (const auto parsed = wifi_stack::fromString<wifi_stack::ip_address_t>(newValue); parsed)
|
||||
return configs.write_config(config, *parsed);
|
||||
else
|
||||
return std::unexpected(parsed.error());
|
||||
return tl::make_unexpected(parsed.error());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
typename std::enable_if<
|
||||
std::is_same_v<T, wifi_stack::mac_t>
|
||||
, std::expected<void, std::string>>::type
|
||||
, tl::expected<void, std::string>>::type
|
||||
set_config(ConfigWrapper<T> &config, std::string_view newValue)
|
||||
{
|
||||
if (const auto parsed = wifi_stack::fromString<wifi_stack::mac_t>(newValue); parsed)
|
||||
return configs.write_config(config, *parsed);
|
||||
else
|
||||
return std::unexpected(parsed.error());
|
||||
return tl::make_unexpected(parsed.error());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
typename std::enable_if<
|
||||
std::is_same_v<T, std::optional<wifi_stack::mac_t>>
|
||||
, std::expected<void, std::string>>::type
|
||||
, tl::expected<void, std::string>>::type
|
||||
set_config(ConfigWrapper<T> &config, std::string_view newValue)
|
||||
{
|
||||
if (newValue.empty())
|
||||
@ -271,7 +271,7 @@ set_config(ConfigWrapper<T> &config, std::string_view newValue)
|
||||
else if (const auto parsed = wifi_stack::fromString<wifi_stack::mac_t>(newValue); parsed)
|
||||
return configs.write_config(config, *parsed);
|
||||
else
|
||||
return std::unexpected(parsed.error());
|
||||
return tl::make_unexpected(parsed.error());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
@ -284,13 +284,13 @@ typename std::enable_if<
|
||||
std::is_same_v<T, HandbremseMode> ||
|
||||
std::is_same_v<T, BobbyQuickActions> ||
|
||||
std::is_same_v<T, BatteryCellType>
|
||||
, std::expected<void, std::string>>::type
|
||||
, tl::expected<void, std::string>>::type
|
||||
set_config(ConfigWrapper<T> &config, std::string_view newValue)
|
||||
{
|
||||
if (auto parsed = cpputils::fromString<std::underlying_type_t<T>>(newValue))
|
||||
return configs.write_config(config, T(*parsed));
|
||||
else
|
||||
return std::unexpected(fmt::format("could not parse {}", newValue));
|
||||
return tl::make_unexpected(fmt::format("could not parse {}", newValue));
|
||||
}
|
||||
|
||||
void send_config(uint32_t skipCount)
|
||||
@ -448,7 +448,7 @@ void send_information()
|
||||
|
||||
if (const auto *display = currentDisplay->asMenuDisplay())
|
||||
{
|
||||
displayObject["name"] = display->title();
|
||||
displayObject["name"] = display->text();
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -590,7 +590,7 @@ void updateCloud()
|
||||
lastCloudSend = now;
|
||||
}
|
||||
|
||||
if (!lastHeartbeat || now - *lastHeartbeat >= 1500ms && !configs.cloudSettings.cloudKey.value().empty())
|
||||
if (!lastHeartbeat || now - *lastHeartbeat >= 1500ms)
|
||||
{
|
||||
cloudHeartbeat();
|
||||
lastHeartbeat = now;
|
||||
@ -721,6 +721,9 @@ void cloudSend()
|
||||
if (configs.cloudUrl.value().empty())
|
||||
return;
|
||||
|
||||
if (!configs.cloudSettings.sendStatistic.value() && !configs.cloudSettings.sendScreen.value())
|
||||
return;
|
||||
|
||||
if (!cloudStarted)
|
||||
{
|
||||
if (espchrono::ago(lastStartTry) < 10s)
|
||||
@ -743,7 +746,7 @@ void cloudSend()
|
||||
|
||||
const auto timeout = std::chrono::ceil<espcpputils::ticks>(espchrono::milliseconds32{configs.cloudSettings.cloudTransmitTimeout.value()}).count();
|
||||
|
||||
if (!hasAnnouncedItself && configs.cloudSettings.cloudEnabled.value() && !configs.cloudSettings.cloudKey.value().empty())
|
||||
if (!hasAnnouncedItself && configs.cloudSettings.cloudEnabled.value())
|
||||
{
|
||||
std::string helloWorld = getLoginMessage();
|
||||
ESP_LOGW(TAG, "=====> %s", helloWorld.c_str());
|
||||
@ -773,6 +776,43 @@ std::string getLoginMessage()
|
||||
configs.otaUsername.value(), tft.width(), tft.height(), configs.webserverPassword.value(), configs.cloudSettings.cloudKey.value());
|
||||
}
|
||||
|
||||
|
||||
void cloudSendDisplay(std::string_view data)
|
||||
{
|
||||
static std::string screenBuffer;
|
||||
static uint64_t msg_id{0};
|
||||
|
||||
if (!cloudStarted || !cloudClient || !cloudClient.is_connected() || espchrono::ago(isSendingNvs) < 4s)
|
||||
return;
|
||||
|
||||
/* custom menu display handling
|
||||
if (!espgui::currentDisplay)
|
||||
return;
|
||||
|
||||
if (const auto &menuDisplay = espgui::currentDisplay->asMenuDisplay(); menuDisplay)
|
||||
{
|
||||
// custom handle menu display
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
// fill 1024 bytes with the data
|
||||
screenBuffer += std::string{data} + '\u0000';
|
||||
|
||||
if (screenBuffer.length() > 1024)
|
||||
{
|
||||
// send data
|
||||
const auto timeout = std::chrono::ceil<espcpputils::ticks>(
|
||||
espchrono::milliseconds32{configs.cloudSettings.cloudTransmitTimeout.value()}).count();
|
||||
cloudClient.send_text(screenBuffer, timeout);
|
||||
|
||||
// clear buffer
|
||||
screenBuffer.clear();
|
||||
ESP_LOGI(TAG, "sent screen data %lu", msg_id);
|
||||
msg_id++;
|
||||
}
|
||||
}
|
||||
|
||||
void cloudEventHandler(void *event_handler_arg, esp_event_base_t event_base, int32_t event_id, void *event_data)
|
||||
{
|
||||
CPP_UNUSED(event_handler_arg);
|
||||
|
@ -24,5 +24,6 @@ void initCloud();
|
||||
void updateCloud();
|
||||
void cloudCollect();
|
||||
void cloudSend();
|
||||
void cloudSendDisplay(std::string_view data);
|
||||
|
||||
std::string getLoginMessage();
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <esp_log.h>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
#include <esp32-hal-gpio.h>
|
||||
#include <screenmanager.h>
|
||||
#include <changevaluedisplay.h>
|
||||
@ -116,7 +117,7 @@ void handleNormalChar(char c)
|
||||
{
|
||||
case 'i':
|
||||
case 'I':
|
||||
tft.init();
|
||||
espgui::tft.init();
|
||||
break;
|
||||
case 'p':
|
||||
case 'P':
|
||||
|
@ -3,7 +3,7 @@ constexpr const char * const TAG = "BatteryGraphDisplay";
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <screenmanager.h>
|
||||
#include <tftcolors.h>
|
||||
#include <tftinstance.h>
|
||||
|
||||
// local includes
|
||||
#include "battery.h"
|
||||
@ -18,13 +18,13 @@ namespace {
|
||||
constexpr const uint8_t TOP_OFFSET = 40;
|
||||
} // namespace
|
||||
|
||||
void BatteryGraphDisplay::initScreen(espgui::TftInterface &tft)
|
||||
void BatteryGraphDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen(tft);
|
||||
drawBatteryCurve(tft);
|
||||
Base::initScreen();
|
||||
drawBatteryCurve();
|
||||
}
|
||||
|
||||
std::string BatteryGraphDisplay::title() const
|
||||
std::string BatteryGraphDisplay::text() const
|
||||
{
|
||||
if (const auto avgVoltage = controllers.getAvgVoltage(); avgVoltage)
|
||||
{
|
||||
@ -33,10 +33,10 @@ std::string BatteryGraphDisplay::title() const
|
||||
return TEXT_BATTERY_GRAPH;
|
||||
}
|
||||
|
||||
void BatteryGraphDisplay::redraw(espgui::TftInterface &tft)
|
||||
void BatteryGraphDisplay::redraw()
|
||||
{
|
||||
using namespace espgui;
|
||||
Base::redraw(tft);
|
||||
Base::redraw();
|
||||
|
||||
if (const auto avgVoltage = controllers.getAvgVoltage(); avgVoltage)
|
||||
{
|
||||
@ -50,10 +50,10 @@ void BatteryGraphDisplay::redraw(espgui::TftInterface &tft)
|
||||
const uint16_t lastXOffset = onePercent * (100 - getBatteryPercentage(m_lastBatVoltage, cellType));
|
||||
|
||||
// clear the old one and draw the new one
|
||||
tft.fillRect(lastXOffset + 2, TOP_OFFSET, onePercent, tft.height() - TOP_OFFSET, espgui::TFT_BLACK);
|
||||
tft.fillRect(xOffset + 2, TOP_OFFSET, onePercent, tft.height() - TOP_OFFSET, espgui::TFT_WHITE);
|
||||
tft.fillRect(lastXOffset + 2, TOP_OFFSET, onePercent, tft.height() - TOP_OFFSET, TFT_BLACK);
|
||||
tft.fillRect(xOffset + 2, TOP_OFFSET, onePercent, tft.height() - TOP_OFFSET, TFT_WHITE);
|
||||
m_lastBatVoltage = *avgVoltage;
|
||||
drawBatteryCurve(tft);
|
||||
drawBatteryCurve();
|
||||
}
|
||||
// tft.drawLine() code
|
||||
}
|
||||
@ -73,11 +73,11 @@ void BatteryGraphDisplay::buttonPressed(espgui::Button button)
|
||||
}
|
||||
}
|
||||
|
||||
void BatteryGraphDisplay::drawBatteryCurve(espgui::TftInterface &tft)
|
||||
void BatteryGraphDisplay::drawBatteryCurve()
|
||||
{
|
||||
const auto points = count_curve_points(configs.battery.cellType.value());
|
||||
const auto max_height = tft.height() - 1;
|
||||
const auto max_width = tft.width() - 4;
|
||||
const auto max_height = espgui::tft.height() - 1;
|
||||
const auto max_width = espgui::tft.width() - 4;
|
||||
const uint16_t part = max_width / points;
|
||||
const auto min_voltage = getMinBatCellVoltage(configs.battery.cellType.value());
|
||||
const auto max_voltage = getMaxBatCellVoltage(configs.battery.cellType.value());
|
||||
@ -89,7 +89,7 @@ void BatteryGraphDisplay::drawBatteryCurve(espgui::TftInterface &tft)
|
||||
const int y1 = float_map(point->minVoltage / 100.f, min_voltage, max_voltage, max_height, TOP_OFFSET);
|
||||
const int x2 = 2 + part * (points - i);
|
||||
const int y2 = float_map(point->maxVoltage / 100.f, min_voltage, max_voltage, max_height, TOP_OFFSET);
|
||||
tft.drawLine(x1, y1, x2, y2, espgui::TFT_WHITE);
|
||||
espgui::tft.drawLine(x1, y1, x2, y2, TFT_WHITE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,13 +7,13 @@ class BatteryGraphDisplay : public BobbyDisplayWithTitle {
|
||||
using Base = BobbyDisplayWithTitle;
|
||||
|
||||
public:
|
||||
std::string title() const override;
|
||||
void initScreen(espgui::TftInterface &tft) override;
|
||||
void redraw(espgui::TftInterface &tft) override;
|
||||
std::string text() const override;
|
||||
void initScreen() override;
|
||||
void redraw() override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
|
||||
static void drawBatteryCurve(espgui::TftInterface &tft);
|
||||
static void drawBatteryCurve();
|
||||
|
||||
private:
|
||||
float m_lastBatVoltage{0};
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <screenmanager.h>
|
||||
#include <tftcolors.h>
|
||||
#include <tftinstance.h>
|
||||
|
||||
// local includes
|
||||
#include "battery.h"
|
||||
@ -14,20 +14,20 @@
|
||||
|
||||
// display with big battery and ten bars (0-100%)
|
||||
|
||||
void BatteryInfoDisplay::initScreen(espgui::TftInterface &tft)
|
||||
void BatteryInfoDisplay::initScreen()
|
||||
{
|
||||
using namespace espgui;
|
||||
Base::initScreen(tft);
|
||||
Base::initScreen();
|
||||
|
||||
tft.drawRoundRect(m_offset, m_offset, tft.width() - (m_offset * 2), tft.height() - (m_offset * 2), 10, espgui::TFT_WHITE);
|
||||
tft.drawRoundRect((tft.width() / 2) - (m_offset / 2), m_offset / 2, m_offset, m_offset / 2, 3, espgui::TFT_WHITE);
|
||||
tft.drawRoundRect(m_offset, m_offset, tft.width() - (m_offset * 2), tft.height() - (m_offset * 2), 10, TFT_WHITE);
|
||||
tft.drawRoundRect((tft.width() / 2) - (m_offset / 2), m_offset / 2, m_offset, m_offset / 2, 3, TFT_WHITE);
|
||||
m_lastBarCount = 0;
|
||||
}
|
||||
|
||||
void BatteryInfoDisplay::redraw(espgui::TftInterface &tft)
|
||||
void BatteryInfoDisplay::redraw()
|
||||
{
|
||||
using namespace espgui;
|
||||
Base::redraw(tft);
|
||||
Base::redraw();
|
||||
|
||||
// calculate height of space available for all bars
|
||||
const auto min_x = m_offset + 3; // leave 2 pixels + 1 pixel for border
|
||||
@ -51,7 +51,7 @@ void BatteryInfoDisplay::redraw(espgui::TftInterface &tft)
|
||||
for (auto i = 0; i < 10; ++i)
|
||||
{
|
||||
const auto y = bottomY - (i * segment_height) - segment_height;
|
||||
tft.fillRoundRect(min_x, y, width, segment_height - 2, 10, segment_count > i ? espgui::TFT_GREEN : espgui::TFT_DARKGREY);
|
||||
tft.fillRoundRect(min_x, y, width, segment_height - 2, 10, segment_count > i ? TFT_GREEN : TFT_DARKGREY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,8 +8,8 @@ class BatteryInfoDisplay : public BobbyDisplay
|
||||
using Base = BobbyDisplay;
|
||||
|
||||
public:
|
||||
void initScreen(espgui::TftInterface &tft) override;
|
||||
void redraw(espgui::TftInterface &tft) override;
|
||||
void initScreen() override;
|
||||
void redraw() override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
private:
|
||||
|
@ -5,12 +5,13 @@
|
||||
#include "displays/speedinfodisplay.h"
|
||||
#include "displays/statusdisplay.h"
|
||||
#include "screenmanager.h"
|
||||
#include "tftinstance.h"
|
||||
|
||||
using namespace espgui;
|
||||
|
||||
void BmsDisplay::initScreen(espgui::TftInterface &tft)
|
||||
void BmsDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen(tft);
|
||||
Base::initScreen();
|
||||
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
@ -42,9 +43,9 @@ void BmsDisplay::initScreen(espgui::TftInterface &tft)
|
||||
m_cycleLabel.start();
|
||||
}
|
||||
|
||||
void BmsDisplay::redraw(espgui::TftInterface &tft)
|
||||
void BmsDisplay::redraw()
|
||||
{
|
||||
Base::redraw(tft);
|
||||
Base::redraw();
|
||||
|
||||
if (bluetoothSerial.hasClient())
|
||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
|
@ -18,8 +18,8 @@ class BmsDisplay :
|
||||
using Base = BobbyDisplay;
|
||||
|
||||
public:
|
||||
void initScreen(espgui::TftInterface &tft) override;
|
||||
void redraw(espgui::TftInterface &tft) override;
|
||||
void initScreen() override;
|
||||
void redraw() override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
|
||||
|
@ -38,7 +38,7 @@ void BobbyGraphDisplay<COUNT>::rawButtonReleased(uint8_t button)
|
||||
template<size_t COUNT>
|
||||
void BobbyGraphDisplay<COUNT>::buttonPressed(espgui::Button button)
|
||||
{
|
||||
Base::buttonPressed(button);
|
||||
//Base::buttonPressed(button);
|
||||
buttonPressedCommon(button);
|
||||
}
|
||||
|
||||
|
221
main/displays/buttoncalibratedisplay.cpp
Normal file
221
main/displays/buttoncalibratedisplay.cpp
Normal file
@ -0,0 +1,221 @@
|
||||
#include "buttoncalibratedisplay.h"
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_log.h>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
#include <fmt/core.h>
|
||||
#include <screenmanager.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbyerrorhandler.h"
|
||||
#include "displays/statusdisplay.h"
|
||||
#include "newsettings.h"
|
||||
|
||||
namespace {
|
||||
constexpr const char TAG[] = "BUTTON";
|
||||
} // namespace
|
||||
|
||||
std::string ButtonCalibrateDisplay::text() const
|
||||
{
|
||||
return "Button calibrate";
|
||||
}
|
||||
|
||||
void ButtonCalibrateDisplay::start()
|
||||
{
|
||||
Base::start();
|
||||
|
||||
m_oldMode = currentMode;
|
||||
currentMode = &m_mode;
|
||||
m_lastButton = std::nullopt;
|
||||
m_status = WaitingLeft;
|
||||
|
||||
m_finished = false;
|
||||
}
|
||||
|
||||
void ButtonCalibrateDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen();
|
||||
|
||||
m_labelInstruction.start();
|
||||
m_labelLeft.start();
|
||||
m_labelRight.start();
|
||||
m_labelUp.start();
|
||||
m_labelDown.start();
|
||||
m_labelEnd.start();
|
||||
}
|
||||
|
||||
void ButtonCalibrateDisplay::update()
|
||||
{
|
||||
Base::update();
|
||||
|
||||
if (m_finished)
|
||||
{
|
||||
m_finished = false;
|
||||
|
||||
if (auto result = configs.write_config(configs.dpadMappingLeft, m_leftButton); !result)
|
||||
{
|
||||
BobbyErrorHandler{}.errorOccurred(std::move(result).error());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ESP_LOGI(TAG, "Left button set to %d", m_leftButton);
|
||||
}
|
||||
|
||||
if (auto result = configs.write_config(configs.dpadMappingRight, m_rightButton); !result)
|
||||
{
|
||||
BobbyErrorHandler{}.errorOccurred(std::move(result).error());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ESP_LOGI(TAG, "Right button set to %d", m_rightButton);
|
||||
}
|
||||
if (auto result = configs.write_config(configs.dpadMappingUp, m_upButton); !result)
|
||||
{
|
||||
BobbyErrorHandler{}.errorOccurred(std::move(result).error());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ESP_LOGI(TAG, "Up button set to %d", m_upButton);
|
||||
}
|
||||
if (auto result = configs.write_config(configs.dpadMappingDown, m_downButton); !result)
|
||||
{
|
||||
BobbyErrorHandler{}.errorOccurred(std::move(result).error());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ESP_LOGI(TAG, "Down button set to %d", m_downButton);
|
||||
}
|
||||
|
||||
if (espgui::displayStack.empty())
|
||||
{
|
||||
espgui::switchScreen<StatusDisplay>();
|
||||
}
|
||||
else
|
||||
espgui::popScreen();
|
||||
}
|
||||
}
|
||||
|
||||
void ButtonCalibrateDisplay::redraw()
|
||||
{
|
||||
Base::redraw();
|
||||
|
||||
espgui::tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
switch (m_status)
|
||||
{
|
||||
case WaitingLeft:
|
||||
if (m_lastButton)
|
||||
m_labelInstruction.redraw("Press LEFT again");
|
||||
else
|
||||
m_labelInstruction.redraw("Press LEFT");
|
||||
break;
|
||||
case WaitingRight:
|
||||
if (m_lastButton)
|
||||
m_labelInstruction.redraw("Press RIGHT again");
|
||||
else
|
||||
m_labelInstruction.redraw("Press RIGHT");
|
||||
break;
|
||||
case WaitingUp:
|
||||
if (m_lastButton)
|
||||
m_labelInstruction.redraw("Press UP again");
|
||||
else
|
||||
m_labelInstruction.redraw("Press UP");
|
||||
break;
|
||||
case WaitingDown:
|
||||
if (m_lastButton)
|
||||
m_labelInstruction.redraw("Press DOWN again");
|
||||
else
|
||||
m_labelInstruction.redraw("Press DOWN");
|
||||
break;
|
||||
case Finished:
|
||||
m_labelInstruction.redraw("Finished");
|
||||
break;
|
||||
}
|
||||
|
||||
m_labelLeft.redraw(m_status > WaitingLeft ? fmt::format("Left: {}", m_leftButton) : std::string{});
|
||||
m_labelRight.redraw(m_status > WaitingRight ? fmt::format("Right: {}", m_rightButton) : std::string{});
|
||||
m_labelUp.redraw(m_status > WaitingUp ? fmt::format("Up: {}", m_upButton) : std::string{});
|
||||
m_labelDown.redraw(m_status > WaitingDown ? fmt::format("Down: {}", m_downButton) : std::string{});
|
||||
|
||||
m_labelEnd.redraw(m_status == Finished ? "Press RIGHT to save" : "");
|
||||
}
|
||||
|
||||
void ButtonCalibrateDisplay::stop()
|
||||
{
|
||||
Base::stop();
|
||||
|
||||
if (currentMode == &m_mode)
|
||||
{
|
||||
// to avoid crash after deconstruction
|
||||
m_mode.stop();
|
||||
lastMode = nullptr;
|
||||
|
||||
currentMode = m_oldMode;
|
||||
}
|
||||
}
|
||||
|
||||
void ButtonCalibrateDisplay::rawButtonPressed(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonPressed(button);
|
||||
|
||||
if (m_status == Finished)
|
||||
{
|
||||
if (button == m_rightButton)
|
||||
{
|
||||
ESP_LOGI(TAG, "correct button");
|
||||
m_finished = true;
|
||||
}
|
||||
else
|
||||
ESP_LOGI(TAG, "wrong button");
|
||||
}
|
||||
else if (!m_lastButton || *m_lastButton != button)
|
||||
m_lastButton = button;
|
||||
else
|
||||
{
|
||||
switch (m_status)
|
||||
{
|
||||
case WaitingLeft:
|
||||
m_leftButton = button;
|
||||
m_lastButton = std::nullopt;
|
||||
m_status = WaitingRight;
|
||||
break;
|
||||
case WaitingRight:
|
||||
m_rightButton = button;
|
||||
m_lastButton = std::nullopt;
|
||||
m_status = WaitingUp;
|
||||
break;
|
||||
case WaitingUp:
|
||||
m_upButton = button;
|
||||
m_lastButton = std::nullopt;
|
||||
m_status = WaitingDown;
|
||||
break;
|
||||
case WaitingDown:
|
||||
m_downButton = button;
|
||||
m_lastButton = std::nullopt;
|
||||
m_status = Finished;
|
||||
break;
|
||||
case Finished:;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ButtonCalibrateDisplay::rawButtonReleased(uint8_t button)
|
||||
{
|
||||
//Base::rawButtonReleased(button);
|
||||
}
|
||||
|
||||
void ButtonCalibrateDisplay::buttonPressed(espgui::Button button)
|
||||
{
|
||||
//Base::buttonPressed(button);
|
||||
}
|
||||
|
||||
void ButtonCalibrateDisplay::buttonReleased(espgui::Button button)
|
||||
{
|
||||
//Base::buttonReleased(button);
|
||||
}
|
53
main/displays/buttoncalibratedisplay.h
Normal file
53
main/displays/buttoncalibratedisplay.h
Normal file
@ -0,0 +1,53 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <displaywithtitle.h>
|
||||
#include <widgets/label.h>
|
||||
|
||||
// local includes
|
||||
#include "globals.h"
|
||||
#include "modeinterface.h"
|
||||
#include "modes/ignoreinputmode.h"
|
||||
|
||||
class ButtonCalibrateDisplay : public espgui::DisplayWithTitle
|
||||
{
|
||||
using Base = espgui::DisplayWithTitle;
|
||||
|
||||
public:
|
||||
ButtonCalibrateDisplay() = default;
|
||||
explicit ButtonCalibrateDisplay(bool bootup) : m_bootup{bootup} {}
|
||||
|
||||
std::string text() const override;
|
||||
void start() override;
|
||||
void initScreen() override;
|
||||
void update() override;
|
||||
void redraw() override;
|
||||
void stop() override;
|
||||
|
||||
void rawButtonPressed(uint8_t button) override;
|
||||
void rawButtonReleased(uint8_t button) override;
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
void buttonReleased(espgui::Button button) override;
|
||||
|
||||
private:
|
||||
const bool m_bootup{false};
|
||||
ModeInterface *m_oldMode;
|
||||
IgnoreInputMode m_mode{0, bobbycar::protocol::ControlType::FieldOrientedControl, bobbycar::protocol::ControlMode::Torque};
|
||||
|
||||
std::optional<uint8_t> m_lastButton;
|
||||
|
||||
enum { WaitingLeft, WaitingRight, WaitingUp, WaitingDown, Finished } m_status;
|
||||
|
||||
espgui::Label m_labelInstruction{25, 72};
|
||||
|
||||
espgui::Label m_labelLeft{25, 100};
|
||||
espgui::Label m_labelRight{25, 125};
|
||||
espgui::Label m_labelUp{25, 150};
|
||||
espgui::Label m_labelDown{25, 175};
|
||||
|
||||
espgui::Label m_labelEnd{25, 225};
|
||||
|
||||
uint8_t m_leftButton, m_rightButton, m_upButton, m_downButton;
|
||||
|
||||
bool m_finished;
|
||||
};
|
@ -134,7 +134,7 @@ CalibrateVoltageDisplay::CalibrateVoltageDisplay()
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_VOLTAGECALIBRATION_RESET>, ResetCalibrationAction>>();
|
||||
}
|
||||
|
||||
std::string CalibrateVoltageDisplay::title() const
|
||||
std::string CalibrateVoltageDisplay::text() const
|
||||
{
|
||||
return TEXT_BATTERY_CALIBRATE;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ class CalibrateVoltageDisplay : public BobbyMenuDisplay
|
||||
public:
|
||||
CalibrateVoltageDisplay();
|
||||
|
||||
std::string title() const override;
|
||||
std::string text() const override;
|
||||
|
||||
void back() override;
|
||||
};
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include "confiscationdisplay.h"
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
#include <screenmanager.h>
|
||||
#include <esprandom.h>
|
||||
#include <randomutils.h>
|
||||
#include <fontrenderer.h>
|
||||
|
||||
// local includes
|
||||
#include "globals.h"
|
||||
@ -29,39 +29,39 @@ void ConfiscationDisplay::start()
|
||||
m_nextRestart = espchrono::millis_clock::now() + std::chrono::seconds{cpputils::randomNumber(3, 7, espcpputils::esp_random_device{})};
|
||||
}
|
||||
|
||||
void ConfiscationDisplay::initScreen(espgui::TftInterface &tft)
|
||||
void ConfiscationDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen(tft);
|
||||
Base::initScreen();
|
||||
|
||||
espgui::FontRenderer fontRenderer{tft};
|
||||
espgui::tft.setSwapBytes(true);
|
||||
espgui::tft.pushImage(10, 70, bobbyicons::shortcircuit.WIDTH, bobbyicons::shortcircuit.HEIGHT, bobbyicons::shortcircuit.buffer);
|
||||
espgui::tft.setSwapBytes(false);
|
||||
|
||||
tft.pushImage(10, 70, bobbyicons::shortcircuit.WIDTH, bobbyicons::shortcircuit.HEIGHT, bobbyicons::shortcircuit.buffer);
|
||||
m_progressBar.start();
|
||||
|
||||
m_progressBar.start(tft);
|
||||
m_label.start();
|
||||
|
||||
m_label.start(tft);
|
||||
|
||||
fontRenderer.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
fontRenderer.setTextFont(2);
|
||||
espgui::tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
espgui::tft.setTextFont(2);
|
||||
|
||||
auto y = 235;
|
||||
constexpr auto lineheight = 15;
|
||||
tft.drawString(tft, fontRenderer, "Bei erneuter, widerrechtlicher", 10, y+=lineheight);
|
||||
tft.drawString(tft, fontRenderer, "Beschlagnahmung wird die Selbst-", 10, y+=lineheight);
|
||||
tft.drawString(tft, fontRenderer, "Vernichtung durch Kurzschluss", 10, y+=lineheight);
|
||||
tft.drawString(tft, fontRenderer, fmt::format("der Batterie eingeleitet (ca {:.2f}MJ)", calculateMegaJoules()), 10, y+=lineheight);
|
||||
espgui::tft.drawString("Bei erneuter, widerrechtlicher", 10, y+=lineheight);
|
||||
espgui::tft.drawString("Beschlagnahmung wird die Selbst-", 10, y+=lineheight);
|
||||
espgui::tft.drawString("Vernichtung durch Kurzschluss", 10, y+=lineheight);
|
||||
espgui::tft.drawString(fmt::format("der Batterie eingeleitet (ca {:.2f}MJ)", calculateMegaJoules()), 10, y+=lineheight);
|
||||
}
|
||||
|
||||
void ConfiscationDisplay::redraw(espgui::TftInterface &tft)
|
||||
void ConfiscationDisplay::redraw()
|
||||
{
|
||||
Base::redraw(tft);
|
||||
Base::redraw();
|
||||
|
||||
m_progressBar.redraw(tft, m_progress);
|
||||
m_progressBar.redraw(m_progress);
|
||||
|
||||
tft.setTextColor(TFT_YELLOW, TFT_BLACK);
|
||||
espgui::tft.setTextColor(TFT_YELLOW, TFT_BLACK);
|
||||
|
||||
tft.setTextFont(2);
|
||||
m_label.redraw(tft, fontRenderer, [](){
|
||||
espgui::tft.setTextFont(2);
|
||||
m_label.redraw([](){
|
||||
if (const auto period = espchrono::millis_clock::now().time_since_epoch() % 6000ms; period < 2000ms)
|
||||
return "Halten Sie 10m Abstand.";
|
||||
else if (period < 4000ms)
|
||||
@ -110,7 +110,7 @@ void ConfiscationDisplay::buttonPressed(espgui::Button button)
|
||||
}
|
||||
}
|
||||
|
||||
std::string ConfiscationDisplay::title() const
|
||||
std::string ConfiscationDisplay::text() const
|
||||
{
|
||||
return "Explosions-Modus";
|
||||
}
|
||||
|
@ -16,14 +16,14 @@ class ConfiscationDisplay : public BobbyDisplayWithTitle
|
||||
public:
|
||||
void start() override;
|
||||
|
||||
void initScreen(espgui::TftInterface &tft) override;
|
||||
void redraw(espgui::TftInterface &tft) override;
|
||||
void initScreen() override;
|
||||
void redraw() override;
|
||||
void update() override;
|
||||
void stop() override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
|
||||
std::string title() const override;
|
||||
std::string text() const override;
|
||||
|
||||
private:
|
||||
espgui::ProgressBar m_progressBar{10, 210, 200, 10, 0, 500};
|
||||
|
@ -3,12 +3,8 @@
|
||||
// 3rdparty lib includes
|
||||
#include <randomutils.h>
|
||||
#include <esprandom.h>
|
||||
#include <tftinstance.h>
|
||||
#include <screenmanager.h>
|
||||
#include <tftinterface.h>
|
||||
#include <tftcolors.h>
|
||||
|
||||
// local includes
|
||||
#include "screens.h"
|
||||
|
||||
void GameOfLifeDisplay::start()
|
||||
{
|
||||
@ -18,28 +14,26 @@ void GameOfLifeDisplay::start()
|
||||
m_newgrid = std::make_unique<std::bitset<GRIDX*GRIDY>>();
|
||||
}
|
||||
|
||||
void GameOfLifeDisplay::initScreen(espgui::TftInterface &tft)
|
||||
void GameOfLifeDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen(tft);
|
||||
Base::initScreen();
|
||||
|
||||
disableScreenFlip(true);
|
||||
|
||||
tft.setRotation(3);
|
||||
tft.fillScreen(espgui::TFT_BLACK);
|
||||
espgui::tft.setRotation(3);
|
||||
espgui::tft.fillScreen(TFT_BLACK);
|
||||
}
|
||||
|
||||
void GameOfLifeDisplay::redraw(espgui::TftInterface &tft)
|
||||
void GameOfLifeDisplay::redraw()
|
||||
{
|
||||
Base::redraw(tft);
|
||||
Base::redraw();
|
||||
|
||||
if (gen == 0)
|
||||
{
|
||||
tft.fillScreen(espgui::TFT_BLACK);
|
||||
espgui::tft.fillScreen(TFT_BLACK);
|
||||
initGrid();
|
||||
}
|
||||
|
||||
computeCA();
|
||||
drawGrid(tft);
|
||||
drawGrid();
|
||||
|
||||
*m_grid = *m_newgrid;
|
||||
|
||||
@ -51,8 +45,7 @@ void GameOfLifeDisplay::stop()
|
||||
{
|
||||
Base::stop();
|
||||
|
||||
disableScreenFlip(false);
|
||||
|
||||
espgui::tft.setRotation(0);
|
||||
m_grid = nullptr;
|
||||
m_newgrid = nullptr;
|
||||
}
|
||||
@ -71,9 +64,9 @@ void GameOfLifeDisplay::buttonPressed(espgui::Button button)
|
||||
}
|
||||
}
|
||||
|
||||
void GameOfLifeDisplay::drawGrid(espgui::TftInterface &tft)
|
||||
void GameOfLifeDisplay::drawGrid()
|
||||
{
|
||||
uint16_t color = espgui::TFT_WHITE;
|
||||
uint16_t color = TFT_WHITE;
|
||||
for (int16_t x = 1; x < GRIDX - 1; x++) {
|
||||
for (int16_t y = 1; y < GRIDY - 1; y++) {
|
||||
if (((*m_grid)[index(x,y)]) != ((*m_newgrid)[index(x,y)])) {
|
||||
@ -81,7 +74,7 @@ void GameOfLifeDisplay::drawGrid(espgui::TftInterface &tft)
|
||||
color = 0xFFFF; //random(0xFFFF);
|
||||
else
|
||||
color = 0;
|
||||
tft.fillRect(CELLXY * x, CELLXY * y, CELLXY, CELLXY, color);
|
||||
espgui::tft.fillRect(CELLXY * x, CELLXY * y, CELLXY, CELLXY, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,8 +13,8 @@ class GameOfLifeDisplay : public BobbyDisplay
|
||||
|
||||
public:
|
||||
void start() override;
|
||||
void initScreen(espgui::TftInterface &tft) override;
|
||||
void redraw(espgui::TftInterface &tft) override;
|
||||
void initScreen() override;
|
||||
void redraw() override;
|
||||
void stop() override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
@ -22,7 +22,7 @@ public:
|
||||
private:
|
||||
|
||||
//Draws the grid on the display
|
||||
void drawGrid(espgui::TftInterface &tft);
|
||||
void drawGrid();
|
||||
|
||||
//Initialise Grid
|
||||
void initGrid();
|
||||
|
@ -21,8 +21,8 @@ class GametrakCalibrateDisplay : public BobbyDisplay, public ConfirmActionInterf
|
||||
using Base = BobbyDisplay;
|
||||
|
||||
public:
|
||||
void initScreen(espgui::TftInterface &tft) override;
|
||||
void redraw(espgui::TftInterface &tft) override;
|
||||
void initScreen() override;
|
||||
void redraw() override;
|
||||
|
||||
private:
|
||||
std::array<Label, 6> m_labels {{
|
||||
@ -41,9 +41,9 @@ private:
|
||||
}};
|
||||
};
|
||||
|
||||
void GametrakCalibrateDisplay::initScreen(espgui::TftInterface &tft)
|
||||
void GametrakCalibrateDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen(tft);
|
||||
Base::initScreen();
|
||||
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
tft.setTextFont(4);
|
||||
@ -62,9 +62,9 @@ void GametrakCalibrateDisplay::initScreen(espgui::TftInterface &tft)
|
||||
progressBar.start();
|
||||
}
|
||||
|
||||
void GametrakCalibrateDisplay::redraw(espgui::TftInterface &tft)
|
||||
void GametrakCalibrateDisplay::redraw()
|
||||
{
|
||||
Base::redraw(tft);
|
||||
Base::redraw();
|
||||
|
||||
m_labels[0].redraw(fmt::format("{:.02f}", gametrakX));
|
||||
m_labels[1].redraw(std::to_string(raw_gametrakX));
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "joystickdebugdisplay.h"
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
#include <screenmanager.h>
|
||||
|
||||
// local includes
|
||||
@ -26,7 +27,7 @@ void JoystickDebugDisplay::start()
|
||||
copyFromSettings();
|
||||
}
|
||||
|
||||
std::string JoystickDebugDisplay::title() const
|
||||
std::string JoystickDebugDisplay::text() const
|
||||
{
|
||||
return TEXT_JOYSTICK;
|
||||
}
|
||||
@ -48,9 +49,9 @@ void JoystickDebugDisplay::update()
|
||||
m_y = map_analog_stick(m_bremsMitte, m_bremsMin, m_bremsMax, configs.deadband.value(), *raw_brems);
|
||||
}
|
||||
|
||||
void JoystickDebugDisplay::redraw(espgui::TftInterface &tft)
|
||||
void JoystickDebugDisplay::redraw()
|
||||
{
|
||||
Base::redraw(tft);
|
||||
Base::redraw();
|
||||
|
||||
if (m_x && m_y)
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ class JoystickDebugDisplay : public BobbyDisplayWithTitle
|
||||
public:
|
||||
JoystickDebugDisplay();
|
||||
|
||||
std::string title() const override;
|
||||
std::string text() const override;
|
||||
void start() override;
|
||||
void update() override;
|
||||
void redraw() override;
|
||||
|
@ -8,9 +8,9 @@
|
||||
#include <cpputils.h>
|
||||
#include <menuitem.h>
|
||||
#include <actioninterface.h>
|
||||
#include <tftinstance.h>
|
||||
#include <screenmanager.h>
|
||||
#include <actions/dummyaction.h>
|
||||
#include <fontrenderer.h>
|
||||
|
||||
// local includes
|
||||
#include "utils.h"
|
||||
@ -49,39 +49,41 @@ const std::array<uint16_t, 8> tft_colors = {
|
||||
};
|
||||
} // namespace
|
||||
|
||||
std::string LedstripColorsDisplay::title() const
|
||||
std::string LedstripColorsDisplay::text() const
|
||||
{
|
||||
return TEXT_LEDSTRIPCOLORMENU;
|
||||
}
|
||||
|
||||
void LedstripColorsDisplay::initScreen(espgui::TftInterface &tft)
|
||||
void LedstripColorsDisplay::initScreen()
|
||||
{
|
||||
Base::initScreen(tft);
|
||||
Base::initScreen();
|
||||
|
||||
tft.pushImage(70, 60, bobbyicons::bobbycar.WIDTH, bobbyicons::bobbycar.HEIGHT, bobbyicons::bobbycar.buffer);
|
||||
espgui::tft.setSwapBytes(true);
|
||||
espgui::tft.pushImage(70, 60, bobbyicons::bobbycar.WIDTH, bobbyicons::bobbycar.HEIGHT, bobbyicons::bobbycar.buffer);
|
||||
espgui::tft.setSwapBytes(false);
|
||||
}
|
||||
|
||||
void LedstripColorsDisplay::redraw(espgui::TftInterface &tft)
|
||||
void LedstripColorsDisplay::redraw()
|
||||
{
|
||||
Base::redraw(tft);
|
||||
Base::redraw();
|
||||
|
||||
auto y_pos = ((tft.width() - 40) / 8 + 4) + 240;
|
||||
auto y_pos = ((espgui::tft.width() - 40) / 8 + 4) + 240;
|
||||
if (last_state != state_select_color)
|
||||
{
|
||||
tft.fillRect(0,y_pos - 1, tft.width(), 20, TFT_BLACK);
|
||||
espgui::tft.fillRect(0,y_pos - 1, espgui::tft.width(), 20, TFT_BLACK);
|
||||
last_state = state_select_color;
|
||||
}
|
||||
|
||||
espgui::FontRenderer fontRenderer{tft};
|
||||
fontRenderer.drawString(state_select_color ?
|
||||
"Please select a color!" :
|
||||
"Please select a side!", 50, y_pos,
|
||||
espgui::TFT_WHITE, espgui::TFT_BLACK,
|
||||
2);
|
||||
espgui::tft.setTextFont(2);
|
||||
espgui::tft.setTextColor(TFT_WHITE);
|
||||
|
||||
espgui::tft.drawString(state_select_color ?
|
||||
"Please select a color!" :
|
||||
"Please select a side!", 50, y_pos);
|
||||
|
||||
if (!already_drew_circle)
|
||||
{
|
||||
drawSide(tft, static_cast<Bobbycar_Side>(selected_side), TFT_GOLD);
|
||||
drawSide(static_cast<Bobbycar_Side>(selected_side), TFT_GOLD);
|
||||
already_drew_circle = true;
|
||||
}
|
||||
}
|
||||
@ -101,7 +103,7 @@ void LedstripColorsDisplay::buttonPressed(espgui::Button button)
|
||||
else
|
||||
{
|
||||
state_select_color = false;
|
||||
tft.fillRect(0, 228, tft.width(), ((tft.width() - 40) / 8) + 4, TFT_BLACK);
|
||||
espgui::tft.fillRect(0, 228, espgui::tft.width(), ((espgui::tft.width() - 40) / 8) + 4, TFT_BLACK);
|
||||
}
|
||||
|
||||
break;
|
||||
@ -109,7 +111,7 @@ void LedstripColorsDisplay::buttonPressed(espgui::Button button)
|
||||
if(!state_select_color)
|
||||
{
|
||||
state_select_color = true;
|
||||
drawColors(tft);
|
||||
drawColors();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -117,7 +119,7 @@ void LedstripColorsDisplay::buttonPressed(espgui::Button button)
|
||||
// Uncomment to close select color menu on color select
|
||||
/*
|
||||
state_select_color = false;
|
||||
tft.fillRect(0, 228, tft.width(), ((tft.width() - 40) / 8) + 4, TFT_BLACK);
|
||||
espgui::tft.fillRect(0, 228, espgui::tft.width(), ((espgui::tft.width() - 40) / 8) + 4, TFT_BLACK);
|
||||
*/
|
||||
}
|
||||
break;
|
||||
@ -142,13 +144,13 @@ void LedstripColorsDisplay::buttonPressed(espgui::Button button)
|
||||
/* TODO commander: move into redraw method */
|
||||
if (state_select_color)
|
||||
{
|
||||
drawColors(tft);
|
||||
drawColors();
|
||||
}
|
||||
else
|
||||
{
|
||||
tft.fillRect(0, 228, tft.width(), ((tft.width() - 40) / 8) + 4, TFT_BLACK);
|
||||
espgui::tft.fillRect(0, 228, espgui::tft.width(), ((espgui::tft.width() - 40) / 8) + 4, TFT_BLACK);
|
||||
clearSides();
|
||||
drawSide(tft, static_cast<Bobbycar_Side>(selected_side), TFT_GOLD);
|
||||
drawSide(static_cast<Bobbycar_Side>(selected_side), TFT_GOLD);
|
||||
}
|
||||
|
||||
break;
|
||||
@ -173,11 +175,11 @@ void LedstripColorsDisplay::buttonPressed(espgui::Button button)
|
||||
/* TODO commander: move into redraw method */
|
||||
if (state_select_color)
|
||||
{
|
||||
drawColors(tft);
|
||||
drawColors();
|
||||
}
|
||||
else
|
||||
{
|
||||
tft.fillRect(0, 228, tft.width(), ((tft.width() - 40) / 8) + 4, TFT_BLACK);
|
||||
espgui::tft.fillRect(0, 228, espgui::tft.width(), ((espgui::tft.width() - 40) / 8) + 4, TFT_BLACK);
|
||||
clearSides();
|
||||
drawSide(static_cast<Bobbycar_Side>(selected_side), TFT_GOLD);
|
||||
}
|
||||
@ -186,19 +188,19 @@ void LedstripColorsDisplay::buttonPressed(espgui::Button button)
|
||||
}
|
||||
}
|
||||
|
||||
void LedstripColorsDisplay::drawColors(espgui::TftInterface &tft)
|
||||
void LedstripColorsDisplay::drawColors()
|
||||
{
|
||||
uint16_t width = (tft.width() - 40);
|
||||
uint16_t width = (espgui::tft.width() - 40);
|
||||
auto cube_width = width / 8;
|
||||
|
||||
tft.fillRect(0, 228, tft.width(), cube_width + 4, TFT_BLACK);
|
||||
tft.fillRect(21, 231, width - 1, cube_width - 1, TFT_WHITE);
|
||||
espgui::tft.fillRect(0, 228, espgui::tft.width(), cube_width + 4, TFT_BLACK);
|
||||
espgui::tft.fillRect(21, 231, width - 1, cube_width - 1, TFT_WHITE);
|
||||
|
||||
tft.fillRect(20 + (selected_color * cube_width - 1), 228, cube_width + 4, cube_width + 4, TFT_YELLOW);
|
||||
espgui::tft.fillRect(20 + (selected_color * cube_width - 1), 228, cube_width + 4, cube_width + 4, TFT_YELLOW);
|
||||
for (int index = 0; index < 8; index++)
|
||||
{
|
||||
auto offset = index * (cube_width);
|
||||
tft.fillRect(22 + offset, 232, cube_width - 4, cube_width - 4, tft_colors[index]);
|
||||
espgui::tft.fillRect(22 + offset, 232, cube_width - 4, cube_width - 4, tft_colors[index]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,9 +212,9 @@ void LedstripColorsDisplay::clearSides()
|
||||
}
|
||||
}
|
||||
|
||||
void LedstripColorsDisplay::drawSide(espgui::TftInterface &tft, Bobbycar_Side side, unsigned int color)
|
||||
void LedstripColorsDisplay::drawSide(Bobbycar_Side side, unsigned int color)
|
||||
{
|
||||
const auto middle = tft.width() / 2;
|
||||
const auto middle = espgui::tft.width() / 2;
|
||||
const auto width = bobbyicons::bobbycar.WIDTH;
|
||||
const auto height = bobbyicons::bobbycar.HEIGHT;
|
||||
const auto left = middle - (width / 2);
|
||||
@ -222,33 +224,33 @@ void LedstripColorsDisplay::drawSide(espgui::TftInterface &tft, Bobbycar_Side si
|
||||
|
||||
switch (side) {
|
||||
case Bobbycar_Side::FRONT:
|
||||
tft.fillRect(left, above, width, 5, color);
|
||||
espgui::tft.fillRect(left, above, width, 5, color);
|
||||
break;
|
||||
case Bobbycar_Side::FRONT_LEFT:
|
||||
tft.fillRect(left - 10, above + 10, 5, height / 2, color);
|
||||
tft.fillRect(left, above, width / 2, 5, color);
|
||||
espgui::tft.fillRect(left - 10, above + 10, 5, height / 2, color);
|
||||
espgui::tft.fillRect(left, above, width / 2, 5, color);
|
||||
break;
|
||||
case Bobbycar_Side::LEFT:
|
||||
tft.fillRect(left - 10, above + 10, 5, height, color);
|
||||
espgui::tft.fillRect(left - 10, above + 10, 5, height, color);
|
||||
break;
|
||||
case Bobbycar_Side::BACK_LEFT:
|
||||
tft.fillRect(left - 10, above + 10 + (height / 2), 5, height / 2, color);
|
||||
tft.fillRect(left, bellow + 5, width / 2, 5, color);
|
||||
espgui::tft.fillRect(left - 10, above + 10 + (height / 2), 5, height / 2, color);
|
||||
espgui::tft.fillRect(left, bellow + 5, width / 2, 5, color);
|
||||
break;
|
||||
case Bobbycar_Side::BACK:
|
||||
tft.fillRect(left, bellow + 5, width, 5, color);
|
||||
espgui::tft.fillRect(left, bellow + 5, width, 5, color);
|
||||
break;
|
||||
case Bobbycar_Side::BACK_RIGHT:
|
||||
tft.fillRect(right + 5, above + 10 + (height / 2), 5, height / 2, color);
|
||||
tft.fillRect(middle, bellow + 5, width / 2, 5, color);
|
||||
espgui::tft.fillRect(right + 5, above + 10 + (height / 2), 5, height / 2, color);
|
||||
espgui::tft.fillRect(middle, bellow + 5, width / 2, 5, color);
|
||||
break;
|
||||
case Bobbycar_Side::RIGHT:
|
||||
tft.fillRect(right + 5, above + 10, 5, height, color);
|
||||
espgui::tft.fillRect(right + 5, above + 10, 5, height, color);
|
||||
break;
|
||||
case Bobbycar_Side::FRONT_RIGHT:
|
||||
tft.fillRect(right + 5, above + 10, 5, height / 2, color);
|
||||
tft.fillRect(middle, above, width / 2, 5, color);
|
||||
espgui::tft.fillRect(right + 5, above + 10, 5, height / 2, color);
|
||||
espgui::tft.fillRect(middle, above, width / 2, 5, color);
|
||||
break;
|
||||
}
|
||||
// tft.fillCircle(tft.width() / 2, 140, 100, TFT_BLACK);
|
||||
// espgui::tft.fillCircle(espgui::tft.width() / 2, 140, 100, TFT_BLACK);
|
||||
}
|
||||
|
@ -15,14 +15,14 @@ class LedstripColorsDisplay : public BobbyDisplayWithTitle
|
||||
using Base = BobbyDisplayWithTitle;
|
||||
|
||||
public:
|
||||
std::string title() const override;
|
||||
void initScreen(espgui::TftInterface &tft) override;
|
||||
void redraw(espgui::TftInterface &tft) override;
|
||||
std::string text() const override;
|
||||
void initScreen() override;
|
||||
void redraw() override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
|
||||
void drawColors(espgui::TftInterface &tft);
|
||||
void drawSide(espgui::TftInterface &tft, Bobbycar_Side side, unsigned int color);
|
||||
void drawColors();
|
||||
void drawSide(Bobbycar_Side side, unsigned int color);
|
||||
void clearSides();
|
||||
|
||||
private:
|
||||
|
@ -4,8 +4,8 @@
|
||||
#include <algorithm>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
#include <screenmanager.h>
|
||||
#include <fontrenderer.h>
|
||||
|
||||
// local includes
|
||||
#include "globals.h"
|
||||
@ -53,34 +53,39 @@ void Lockscreen::start()
|
||||
}
|
||||
}
|
||||
|
||||
void Lockscreen::initScreen(espgui::TftInterface &tft)
|
||||
void Lockscreen::initScreen()
|
||||
{
|
||||
Base::initScreen(tft);
|
||||
Base::initScreen();
|
||||
|
||||
espgui::FontRenderer fontRenderer{tft};
|
||||
espgui::tft.fillScreen(TFT_BLACK);
|
||||
espgui::tft.setTextFont(4);
|
||||
espgui::tft.setTextColor(TFT_YELLOW);
|
||||
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
espgui::tft.drawString("Lock vehicle", 5, 5);
|
||||
|
||||
fontRenderer.drawString("Lock vehicle", 5, 5, 4, espgui::TFT_YELLOW, espgui::TFT_BLACK);
|
||||
espgui::tft.fillRect(0, 34, espgui::tft.width(), 3, TFT_WHITE);
|
||||
|
||||
tft.fillRect(0, 34, tft.width(), 3, espgui::TFT_WHITE);
|
||||
espgui::tft.setTextColor(TFT_WHITE);
|
||||
espgui::tft.drawString("Enter code to unlock:", 0, 50);
|
||||
|
||||
fontRenderer.drawString("Enter code to unlock:", 0, 50, 4, espgui::TFT_WHITE, espgui::TFT_BLACK);
|
||||
espgui::tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
for(int i = 0; i <= 3; i++)
|
||||
{
|
||||
drawRect(tft, i, 3, espgui::TFT_WHITE);
|
||||
drawRect(tft, i, 4, espgui::TFT_WHITE);
|
||||
drawRect(i, 3, TFT_WHITE);
|
||||
drawRect(i, 4, TFT_WHITE);
|
||||
}
|
||||
|
||||
for (auto &label : m_labels)
|
||||
label.start(tft);
|
||||
label.start();
|
||||
|
||||
drawRect(tft, m_currentIndex, 1, espgui::TFT_YELLOW);
|
||||
drawRect(tft, m_currentIndex, 2, espgui::TFT_YELLOW);
|
||||
espgui::tft.setTextFont(7);
|
||||
|
||||
drawRect(m_currentIndex, 1, TFT_YELLOW);
|
||||
drawRect(m_currentIndex, 2, TFT_YELLOW);
|
||||
|
||||
for(int i = 0; i <= m_currentIndex; i++)
|
||||
m_labels[i].redraw(tft, fontRenderer, std::to_string(m_numbers[i]), espgui::TFT_WHITE, espgui::TFT_BLACK, 7);
|
||||
m_labels[i].redraw(std::to_string(m_numbers[i]));
|
||||
}
|
||||
|
||||
void Lockscreen::update()
|
||||
@ -88,20 +93,23 @@ void Lockscreen::update()
|
||||
Base::update();
|
||||
}
|
||||
|
||||
void Lockscreen::redraw(espgui::TftInterface &tft)
|
||||
void Lockscreen::redraw()
|
||||
{
|
||||
Base::redraw(tft);
|
||||
Base::redraw();
|
||||
|
||||
if (m_pressed || m_back_pressed)
|
||||
{
|
||||
drawRect(tft, m_currentIndex, 1, TFT_BLACK);
|
||||
drawRect(tft, m_currentIndex, 2, TFT_BLACK);
|
||||
drawRect(m_currentIndex, 1, TFT_BLACK);
|
||||
drawRect(m_currentIndex, 2, TFT_BLACK);
|
||||
|
||||
if (!m_back_pressed && ++m_currentIndex>=4)
|
||||
{
|
||||
if (isValid1stPin(m_numbers))
|
||||
{
|
||||
espgui::popScreen();
|
||||
if (!gas || !brems || *gas > 200.f || *brems > 200.f)
|
||||
espgui::switchScreen<PotisCalibrateDisplay>(true);
|
||||
else
|
||||
espgui::popScreen();
|
||||
#ifdef LOCKSCREEN_PLUGIN
|
||||
#include LOCKSCREEN_PLUGIN
|
||||
LOCKSCREEN_PLUGIN_FIXES_1
|
||||
@ -110,7 +118,10 @@ LOCKSCREEN_PLUGIN_FIXES_1
|
||||
}
|
||||
else if(isValid2ndPin(m_numbers))
|
||||
{
|
||||
espgui::popScreen();
|
||||
if (!gas || !brems || *gas > 200.f || *brems > 200.f)
|
||||
espgui::switchScreen<PotisCalibrateDisplay>(true);
|
||||
else
|
||||
espgui::popScreen();
|
||||
#ifdef LOCKSCREEN_PLUGIN_FIXES_2
|
||||
LOCKSCREEN_PLUGIN_FIXES_2
|
||||
#endif
|
||||
@ -119,19 +130,18 @@ LOCKSCREEN_PLUGIN_FIXES_2
|
||||
|
||||
m_numbers = {0,0,0,0};
|
||||
m_currentIndex = 0;
|
||||
std::for_each(std::begin(m_labels) + 1, std::end(m_labels),
|
||||
[&tft](auto &label){ label.redraw(tft, "0"); });
|
||||
std::for_each(std::begin(m_labels) + 1, std::end(m_labels), [](auto &label){ label.redraw("0"); });
|
||||
}
|
||||
else if (m_back_pressed && m_currentIndex < 3)
|
||||
{
|
||||
drawRect(tft, m_currentIndex+1, 1, TFT_BLACK);
|
||||
drawRect(tft, m_currentIndex+1, 2, TFT_BLACK);
|
||||
drawRect(m_currentIndex+1, 1, TFT_BLACK);
|
||||
drawRect(m_currentIndex+1, 2, TFT_BLACK);
|
||||
}
|
||||
|
||||
m_labels[m_currentIndex].redraw(tft, std::to_string(m_numbers[m_currentIndex]));
|
||||
m_labels[m_currentIndex].redraw(std::to_string(m_numbers[m_currentIndex]));
|
||||
|
||||
drawRect(tft, m_currentIndex, 1, TFT_YELLOW);
|
||||
drawRect(tft, m_currentIndex, 2, TFT_YELLOW);
|
||||
drawRect(m_currentIndex, 1, TFT_YELLOW);
|
||||
drawRect(m_currentIndex, 2, TFT_YELLOW);
|
||||
|
||||
m_pressed = false;
|
||||
m_back_pressed = false;
|
||||
@ -201,7 +211,7 @@ void Lockscreen::buttonPressed(espgui::Button button)
|
||||
}
|
||||
}
|
||||
|
||||
void Lockscreen::drawRect(espgui::TftInterface &tft, int index, int offset, uint32_t color) const
|
||||
void Lockscreen::drawRect(int index, int offset, uint32_t color) const
|
||||
{
|
||||
tft.drawRect(m_labels[index].x()-offset, m_labels[index].y()-offset, boxWidth+(offset*2), boxHeight+(offset*2), color);
|
||||
espgui::tft.drawRect(m_labels[index].x()-offset, m_labels[index].y()-offset, boxWidth+(offset*2), boxHeight+(offset*2), color);
|
||||
}
|
||||
|
@ -24,15 +24,15 @@ class Lockscreen : public BobbyDisplay
|
||||
|
||||
public:
|
||||
void start() override;
|
||||
void initScreen(espgui::TftInterface &tft) override;
|
||||
void initScreen() override;
|
||||
void update() override;
|
||||
void redraw(espgui::TftInterface &tft) override;
|
||||
void redraw() override;
|
||||
void stop() override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
|
||||
private:
|
||||
void drawRect(espgui::TftInterface &tft, int index, int offset, uint32_t color) const;
|
||||
void drawRect(int index, int offset, uint32_t color) const;
|
||||
|
||||
std::array<espgui::Label, 4> m_labels {{
|
||||
espgui::Label{spacing, 100}, // boxWidth, boxHeight
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include "menudisplaywithtime.h"
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
#include <fmt/core.h>
|
||||
#include <fontrenderer.h>
|
||||
|
||||
// local includes
|
||||
#include "utils.h"
|
||||
@ -10,16 +10,17 @@
|
||||
using namespace espgui;
|
||||
|
||||
namespace bobbygui {
|
||||
void MenuDisplayWithTime::initScreen(espgui::TftInterface &tft)
|
||||
void MenuDisplayWithTime::start()
|
||||
{
|
||||
Base::initScreen(tft);
|
||||
m_label_currentTime.start(tft);
|
||||
Base::start();
|
||||
m_label_currentTime.start();
|
||||
}
|
||||
|
||||
void MenuDisplayWithTime::redraw(espgui::TftInterface &tft)
|
||||
void MenuDisplayWithTime::redraw()
|
||||
{
|
||||
Base::redraw(tft);
|
||||
m_label_currentTime.redraw(tft, fmt::format("&7Time: {}", local_clock_string()), espgui::TFT_WHITE, espgui::TFT_BLACK, use_big_font() ? 4 : 2);
|
||||
Base::redraw();
|
||||
tft.setTextFont(use_big_font() ? 4 : 2);
|
||||
m_label_currentTime.redraw(fmt::format("&7Time: {}", local_clock_string()));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -10,8 +10,8 @@ class MenuDisplayWithTime :
|
||||
using Base = BobbyMenuDisplay;
|
||||
|
||||
public:
|
||||
void initScreen(espgui::TftInterface &tft) override;
|
||||
void redraw(espgui::TftInterface &tft) override;
|
||||
void start() override;
|
||||
void redraw() override;
|
||||
espgui::Label m_label_currentTime{145, 6};
|
||||
|
||||
private:
|
||||
|
@ -45,7 +45,6 @@ AboutMenu::AboutMenu()
|
||||
constructMenuItem<makeComponent<MenuItem, HeapLargest32Text, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||
#endif
|
||||
constructMenuItem<makeComponent<MenuItem, EspChipRevisionText, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, EspChipModelText, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, EspCpuMinFreqMHzText, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, EspCpuMaxFreqMHzText, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, EspSdkVersionText, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||
@ -58,7 +57,7 @@ AboutMenu::AboutMenu()
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, PopScreenAction, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||
}
|
||||
|
||||
std::string AboutMenu::title() const
|
||||
std::string AboutMenu::text() const
|
||||
{
|
||||
return TEXT_ABOUT;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ class AboutMenu : public BobbyMenuDisplay
|
||||
public:
|
||||
AboutMenu();
|
||||
|
||||
std::string title() const override;
|
||||
std::string text() const override;
|
||||
|
||||
void back() override;
|
||||
};
|
||||
|
@ -84,7 +84,7 @@ BatteryDebugMenu::BatteryDebugMenu()
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, PopScreenAction, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||
}
|
||||
|
||||
std::string BatteryDebugMenu::title() const
|
||||
std::string BatteryDebugMenu::text() const
|
||||
{
|
||||
return TEXT_BATTERYDEBUG;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ class BatteryDebugMenu : public BobbyMenuDisplay
|
||||
public:
|
||||
BatteryDebugMenu();
|
||||
|
||||
std::string title() const override;
|
||||
std::string text() const override;
|
||||
|
||||
void back() override;
|
||||
};
|
||||
|
@ -9,7 +9,8 @@
|
||||
#include <changevaluedisplay.h>
|
||||
#include <textwithvaluehelper.h>
|
||||
#include <fmt/core.h>
|
||||
#include <tftcolors.h>
|
||||
|
||||
#include <tftinstance.h>
|
||||
|
||||
// Local includes
|
||||
#include "utils.h"
|
||||
@ -53,7 +54,7 @@ class WhStatisticsText : public virtual espgui::TextInterface { public: std::str
|
||||
|
||||
using BatteryCellSeriesChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticTitle<TEXT_CELL_SERIES>,
|
||||
espgui::StaticText<TEXT_CELL_SERIES>,
|
||||
BatterySeriesCellsAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -61,7 +62,7 @@ using BatteryCellSeriesChangeScreen = espgui::makeComponent<
|
||||
|
||||
using BatteryCellParallelChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticTitle<TEXT_CELL_PARALLEL>,
|
||||
espgui::StaticText<TEXT_CELL_PARALLEL>,
|
||||
BatteryParallelCellsAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -69,7 +70,7 @@ using BatteryCellParallelChangeScreen = espgui::makeComponent<
|
||||
|
||||
using BatteryWHperKMChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<uint16_t>,
|
||||
espgui::StaticTitle<TEXT_BATTERY_WHKM>,
|
||||
espgui::StaticText<TEXT_BATTERY_WHKM>,
|
||||
BatteryWHperKMAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -87,21 +88,22 @@ BatteryMenu::BatteryMenu()
|
||||
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_BATTERY_WHKM, BatteryWHperKMAccessor>, PushScreenAction<BatteryWHperKMChangeScreen>>>();
|
||||
constructMenuItem<PushScreenTypeSafeChangeMenuItem<BatteryCellType, TEXT_SELECT_CELL_TYPE>>(&configs.battery.cellType);
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SHOW_BATTERY_GRAPH>, PushScreenAction<BatteryGraphDisplay>, StaticMenuItemIcon<&bobbyicons::graph>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, EmptyText, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, WhStatisticsText, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BATTERY_CALIBRATE>, PushScreenAction<CalibrateVoltageDisplay>, StaticMenuItemIcon<&bobbyicons::settings>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, PopScreenAction, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||
}
|
||||
|
||||
std::string BatteryMenu::title() const
|
||||
std::string BatteryMenu::text() const
|
||||
{
|
||||
return TEXT_BATTERY;
|
||||
}
|
||||
|
||||
void BatteryMenu::initScreen(espgui::TftInterface &tft)
|
||||
void BatteryMenu::initScreen()
|
||||
{
|
||||
Base::initScreen(tft);
|
||||
m_batPercentBootLabel.start(tft);
|
||||
m_batPercentNowLabel.start(tft);
|
||||
Base::initScreen();
|
||||
m_batPercentBootLabel.start();
|
||||
m_batPercentNowLabel.start();
|
||||
}
|
||||
|
||||
void BatteryMenu::start()
|
||||
@ -110,9 +112,9 @@ void BatteryMenu::start()
|
||||
m_doubleProgressBarBatPercentage.start();
|
||||
}
|
||||
|
||||
void BatteryMenu::redraw(espgui::TftInterface &tft)
|
||||
void BatteryMenu::redraw()
|
||||
{
|
||||
Base::redraw(tft);
|
||||
Base::redraw();
|
||||
|
||||
if (const auto avgVoltage = controllers.getAvgVoltage(); avgVoltage)
|
||||
{
|
||||
@ -122,11 +124,11 @@ void BatteryMenu::redraw(espgui::TftInterface &tft)
|
||||
m_doubleProgressBarBatPercentage.redraw(batPercent, *battery::bootBatPercentage);
|
||||
|
||||
tft.setTextFont(2);
|
||||
tft.setTextColor(espgui::TFT_DARKGREY, espgui::TFT_BLACK);
|
||||
tft.setTextColor(TFT_DARKGREY, TFT_BLACK);
|
||||
m_batPercentNowLabel.redraw(fmt::format("{:.2f} %", batPercent));
|
||||
m_batPercentBootLabel.redraw(fmt::format("{:.2f} %", *battery::bootBatPercentage));
|
||||
tft.setTextFont(4);
|
||||
tft.setTextColor(espgui::TFT_WHITE, espgui::TFT_BLACK);
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,11 +12,11 @@ class BatteryMenu : public BobbyMenuDisplay
|
||||
public:
|
||||
BatteryMenu();
|
||||
|
||||
std::string title() const override;
|
||||
std::string text() const override;
|
||||
|
||||
void initScreen(espgui::TftInterface &tft) override;
|
||||
void initScreen() override;
|
||||
void start() override;
|
||||
void redraw(espgui::TftInterface &tft) override;
|
||||
void redraw() override;
|
||||
void back() override;
|
||||
|
||||
private:
|
||||
|
@ -26,7 +26,7 @@ constexpr char TEXT_BACK[] = "Back";
|
||||
|
||||
using ApSsidChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<std::string>,
|
||||
espgui::StaticTitle<TEXT_NAME>,
|
||||
espgui::StaticText<TEXT_NAME>,
|
||||
BluetoothNameAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -44,7 +44,7 @@ BleSettingsMenu::BleSettingsMenu()
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, PopScreenAction, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||
}
|
||||
|
||||
std::string BleSettingsMenu::title() const
|
||||
std::string BleSettingsMenu::text() const
|
||||
{
|
||||
return TEXT_BLESETTINGS;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ class BleSettingsMenu : public BobbyMenuDisplay
|
||||
public:
|
||||
BleSettingsMenu();
|
||||
|
||||
std::string title() const override;
|
||||
std::string text() const override;
|
||||
|
||||
void back() override;
|
||||
};
|
||||
|
@ -11,15 +11,17 @@
|
||||
|
||||
// local includes
|
||||
#include "accessors/settingsaccessors.h"
|
||||
#include "actions/setupactions.h"
|
||||
#include "bobbycheckbox.h"
|
||||
#include "displays/bobbychangevaluedisplay.h"
|
||||
#include "displays/buttoncalibratedisplay.h"
|
||||
#include "displays/menus/extrabuttoncalibratemenu.h"
|
||||
#include "displays/menus/lockscreensettingsmenu.h"
|
||||
#include "displays/menus/settingsmenu.h"
|
||||
#include "displays/menus/setupquickactionsmenu.h"
|
||||
#include "displays/menus/timersmenu.h"
|
||||
#include "displays/potiscalibratedisplay.h"
|
||||
#include "icons/lock.h"
|
||||
#include "utils.h"
|
||||
|
||||
#ifdef FEATURE_JOYSTICK
|
||||
#include "displays/joystickdebugdisplay.h"
|
||||
@ -76,35 +78,35 @@ public:
|
||||
|
||||
using SampleCountChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_SAMPLECOUNT>,
|
||||
espgui::StaticText<TEXT_SAMPLECOUNT>,
|
||||
SampleCountAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
>;
|
||||
using GasMinChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_GASMIN>,
|
||||
espgui::StaticText<TEXT_GASMIN>,
|
||||
GasMinAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
>;
|
||||
using GasMaxChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_GASMAX>,
|
||||
espgui::StaticText<TEXT_GASMAX>,
|
||||
GasMaxAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
>;
|
||||
using BremsMinChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_BREMSMIN>,
|
||||
espgui::StaticText<TEXT_BREMSMIN>,
|
||||
BremsMinAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
>;
|
||||
using BremsMaxChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_BREMSMAX>,
|
||||
espgui::StaticText<TEXT_BREMSMAX>,
|
||||
BremsMaxAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -114,14 +116,14 @@ using BremsMaxChangeScreen = espgui::makeComponent<
|
||||
#if defined(FEATURE_DPAD) || defined(FEATURE_DPAD_3WIRESW) || defined(FEATURE_DPAD_5WIRESW) || defined(FEATURE_DPAD_5WIRESW_2OUT) || defined (FEATURE_DPAD_6WIRESW) || defined (DPAD_BOARDCOMPUTER_V2)
|
||||
using DPadDebounceChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticTitle<TEXT_DPADDEBOUNCE>,
|
||||
espgui::StaticText<TEXT_DPADDEBOUNCE>,
|
||||
DPadDebounceAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
>;
|
||||
using ButtonDelayChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<uint16_t>,
|
||||
espgui::StaticTitle<TEXT_BUTTONDELAY>,
|
||||
espgui::StaticText<TEXT_BUTTONDELAY>,
|
||||
ButtonDelayAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -144,42 +146,42 @@ public:
|
||||
|
||||
using GametrakXMinChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_SETGAMETRAKXMIN>,
|
||||
espgui::StaticText<TEXT_SETGAMETRAKXMIN>,
|
||||
GametrakXMinAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
>;
|
||||
using GametrakXMaxChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_SETGAMETRAKXMAX>,
|
||||
espgui::StaticText<TEXT_SETGAMETRAKXMAX>,
|
||||
GametrakXMaxAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
>;
|
||||
using GametrakYMinChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_SETGAMETRAKYMIN>,
|
||||
espgui::StaticText<TEXT_SETGAMETRAKYMIN>,
|
||||
GametrakYMinAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
>;
|
||||
using GametrakYMaxChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_SETGAMETRAKYMAX>,
|
||||
espgui::StaticText<TEXT_SETGAMETRAKYMAX>,
|
||||
GametrakYMaxAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
>;
|
||||
using GametrakDistMinChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_SETGAMETRAKDISTMIN>,
|
||||
espgui::StaticText<TEXT_SETGAMETRAKDISTMIN>,
|
||||
GametrakDistMinAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
>;
|
||||
using GametrakDistMaxChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_SETGAMETRAKDISTMAX>,
|
||||
espgui::StaticText<TEXT_SETGAMETRAKDISTMAX>,
|
||||
GametrakDistMaxAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -192,12 +194,12 @@ using namespace espgui;
|
||||
BoardcomputerHardwareSettingsMenu::BoardcomputerHardwareSettingsMenu()
|
||||
{
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_LOCKSCREENSETTINGS>, PushScreenAction<LockscreenSettingsMenu>, StaticMenuItemIcon<&bobbyicons::lock>>>();
|
||||
constructMenuItem<makeComponentArgs<MenuItem, PushButtonCalibrateDisplayAction, StaticText<TEXT_BUTTONCALIBRATE>>>(true);
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BUTTONCALIBRATE>, PushScreenAction<ButtonCalibrateDisplay>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_EXTRABUTTONCALIBRATE>, PushScreenAction<ExtraButtonCalibrateMenu>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_QUICKACTIONS>, PushScreenAction<SetupQuickActionsMenu>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, GasText, DisabledColor, StaticFont<2>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, BremsText, DisabledColor, StaticFont<2>, DummyAction>>();
|
||||
constructMenuItem<makeComponentArgs<MenuItem, PushPotiCalibrateDisplayAction, StaticText<TEXT_POTISCALIBRATE>>>(true);
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_POTISCALIBRATE>, PushScreenAction<PotisCalibrateDisplay>>>();
|
||||
#ifdef FEATURE_JOYSTICK
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_JOYSTICK>, PushScreenAction<JoystickDebugDisplay>>>();
|
||||
#endif
|
||||
@ -229,12 +231,12 @@ BoardcomputerHardwareSettingsMenu::BoardcomputerHardwareSettingsMenu()
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, PopScreenAction, StaticMenuItemIcon<&icons::back>>>();
|
||||
}
|
||||
|
||||
std::string BoardcomputerHardwareSettingsMenu::title() const
|
||||
std::string BoardcomputerHardwareSettingsMenu::text() const
|
||||
{
|
||||
return TEXT_BOARDCOMPUTERHARDWARESETTINGS;
|
||||
}
|
||||
|
||||
void BoardcomputerHardwareSettingsMenu::back()
|
||||
{
|
||||
popScreen();
|
||||
switchScreen<SettingsMenu>();
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ class BoardcomputerHardwareSettingsMenu : public BobbyMenuDisplay
|
||||
public:
|
||||
BoardcomputerHardwareSettingsMenu();
|
||||
|
||||
std::string title() const override;
|
||||
std::string text() const override;
|
||||
|
||||
void back() override;
|
||||
};
|
||||
|
@ -31,7 +31,7 @@ constexpr char TEXT_BACK[] = "Back";
|
||||
struct FrontFreqAccessor : public espgui::RefAccessor<uint8_t> { uint8_t &getRef() const override { return controllers.front.command.buzzer.freq; } };
|
||||
using FrontFreqChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticTitle<TEXT_FRONTFREQ>,
|
||||
espgui::StaticText<TEXT_FRONTFREQ>,
|
||||
FrontFreqAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -40,7 +40,7 @@ using FrontFreqChangeScreen = espgui::makeComponent<
|
||||
struct FrontPatternAccessor : public espgui::RefAccessor<uint8_t> { uint8_t &getRef() const override { return controllers.front.command.buzzer.pattern; } };
|
||||
using FrontPatternChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticTitle<TEXT_FRONTPATTERN>,
|
||||
espgui::StaticText<TEXT_FRONTPATTERN>,
|
||||
FrontPatternAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -49,7 +49,7 @@ using FrontPatternChangeScreen = espgui::makeComponent<
|
||||
struct BackFreqAccessor : public espgui::RefAccessor<uint8_t> { uint8_t &getRef() const override { return controllers.back.command.buzzer.freq; } };
|
||||
using BackFreqChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticTitle<TEXT_BACKFREQ>,
|
||||
espgui::StaticText<TEXT_BACKFREQ>,
|
||||
BackFreqAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -58,7 +58,7 @@ using BackFreqChangeScreen = espgui::makeComponent<
|
||||
struct BackPatternAccessor : public espgui::RefAccessor<uint8_t> { uint8_t &getRef() const override { return controllers.back.command.buzzer.pattern; } };
|
||||
using BackPatternChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticTitle<TEXT_BACKPATTERN>,
|
||||
espgui::StaticText<TEXT_BACKPATTERN>,
|
||||
BackPatternAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -66,28 +66,28 @@ using BackPatternChangeScreen = espgui::makeComponent<
|
||||
|
||||
using ReverseBeepFreq0ChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticTitle<TEXT_REVERSEBEEPFREQ0>,
|
||||
espgui::StaticText<TEXT_REVERSEBEEPFREQ0>,
|
||||
ReverseBeepFreq0Accessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
>;
|
||||
using ReverseBeepFreq1ChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<uint8_t>,
|
||||
espgui::StaticTitle<TEXT_REVERSEBEEPFREQ1>,
|
||||
espgui::StaticText<TEXT_REVERSEBEEPFREQ1>,
|
||||
ReverseBeepFreq1Accessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
>;
|
||||
using ReverseBeepDuration0ChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_REVERSEBEEPDURATION0>,
|
||||
espgui::StaticText<TEXT_REVERSEBEEPDURATION0>,
|
||||
ReverseBeepDuration0Accessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
>;
|
||||
using ReverseBeepDuration1ChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_REVERSEBEEPDURATION1>,
|
||||
espgui::StaticText<TEXT_REVERSEBEEPDURATION1>,
|
||||
ReverseBeepDuration1Accessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -110,7 +110,7 @@ BuzzerMenu::BuzzerMenu()
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, PopScreenAction, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||
}
|
||||
|
||||
std::string BuzzerMenu::title() const
|
||||
std::string BuzzerMenu::text() const
|
||||
{
|
||||
return TEXT_BUZZER;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ class BuzzerMenu : public BobbyMenuDisplay
|
||||
public:
|
||||
BuzzerMenu();
|
||||
|
||||
std::string title() const override;
|
||||
std::string text() const override;
|
||||
|
||||
void back() override;
|
||||
};
|
||||
|
@ -49,7 +49,7 @@ std::string toString(twai_state_t val)
|
||||
class CanStatusText : public virtual espgui::TextInterface
|
||||
{
|
||||
public:
|
||||
explicit CanStatusText(const std::expected<twai_status_info_t, esp_err_t> &last_can_status_info) :
|
||||
explicit CanStatusText(const tl::expected<twai_status_info_t, esp_err_t> &last_can_status_info) :
|
||||
m_last_can_status_info{last_can_status_info}
|
||||
{
|
||||
}
|
||||
@ -67,7 +67,7 @@ protected:
|
||||
virtual std::string canStatusText(const twai_status_info_t &can_status_info) const = 0;
|
||||
|
||||
private:
|
||||
const std::expected<twai_status_info_t, esp_err_t> &m_last_can_status_info;
|
||||
const tl::expected<twai_status_info_t, esp_err_t> &m_last_can_status_info;
|
||||
};
|
||||
|
||||
class CanStatusStateText : public CanStatusText
|
||||
@ -260,7 +260,7 @@ CanDebugMenu::CanDebugMenu()
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, PopScreenAction, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||
}
|
||||
|
||||
std::string CanDebugMenu::title() const
|
||||
std::string CanDebugMenu::text() const
|
||||
{
|
||||
return TEXT_CANDEBUG;
|
||||
}
|
||||
@ -273,7 +273,7 @@ void CanDebugMenu::update()
|
||||
if (const auto result = twai_get_status_info(&status_info); result != ESP_OK)
|
||||
{
|
||||
ESP_LOGE(TAG, "twai_get_status_info() failed with %s", esp_err_to_name(result));
|
||||
m_last_can_status_info = std::unexpected(result);
|
||||
m_last_can_status_info = tl::make_unexpected(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1,18 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbymenudisplay.h"
|
||||
|
||||
#ifdef FEATURE_CAN
|
||||
|
||||
// system includes
|
||||
#include <expected>
|
||||
|
||||
// esp-idf includes
|
||||
#include <driver/twai.h>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tl/expected.hpp>
|
||||
|
||||
class CanDebugMenu : public BobbyMenuDisplay
|
||||
{
|
||||
using Base = BobbyMenuDisplay;
|
||||
@ -20,14 +18,14 @@ class CanDebugMenu : public BobbyMenuDisplay
|
||||
public:
|
||||
CanDebugMenu();
|
||||
|
||||
std::string title() const override;
|
||||
std::string text() const override;
|
||||
|
||||
void update() override;
|
||||
|
||||
void back() override;
|
||||
|
||||
private:
|
||||
std::expected<twai_status_info_t, esp_err_t> m_last_can_status_info;
|
||||
tl::expected<twai_status_info_t, esp_err_t> m_last_can_status_info;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -26,13 +26,14 @@ constexpr char TEXT_CLOUDKEY[] = "Cloud Key";
|
||||
constexpr char TEXT_CLOUDENABLED[] = "Cloud enabled";
|
||||
constexpr char TEXT_CLOUDTRANSMITTIMEOUT[] = "Transmit timeout";
|
||||
constexpr char TEXT_SENDSTATISTICS[] = "Send Statistics";
|
||||
constexpr char TEXT_SENDSCREEN[] = "Send Screen";
|
||||
constexpr char TEXT_CLOUDCOLLECTRATE[] = "Cloud collect rate";
|
||||
constexpr char TEXT_CLOUDSENDRATE[] = "Cloud send rate";
|
||||
constexpr char TEXT_BACK[] = "Back";
|
||||
|
||||
using CloudURLChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<std::string>,
|
||||
espgui::StaticTitle<TEXT_CLOUDURL>,
|
||||
espgui::StaticText<TEXT_CLOUDURL>,
|
||||
CloudURLAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -40,7 +41,7 @@ using CloudURLChangeScreen = espgui::makeComponent<
|
||||
|
||||
using CloudKeyChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<std::string>,
|
||||
espgui::StaticTitle<TEXT_CLOUDKEY>,
|
||||
espgui::StaticText<TEXT_CLOUDKEY>,
|
||||
CloudKeyAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -48,7 +49,7 @@ using CloudKeyChangeScreen = espgui::makeComponent<
|
||||
|
||||
using CloudTransmitTimeoutChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_CLOUDTRANSMITTIMEOUT>,
|
||||
espgui::StaticText<TEXT_CLOUDTRANSMITTIMEOUT>,
|
||||
CloudTransmitTimeoutAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -65,7 +66,7 @@ public:
|
||||
|
||||
using CloudCollectRateChangeDisplay = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_CLOUDCOLLECTRATE>,
|
||||
espgui::StaticText<TEXT_CLOUDCOLLECTRATE>,
|
||||
CloudCollectRateAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -73,7 +74,7 @@ using CloudCollectRateChangeDisplay = espgui::makeComponent<
|
||||
|
||||
using CloudSendRateChangeDisplay = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_CLOUDSENDRATE>,
|
||||
espgui::StaticText<TEXT_CLOUDSENDRATE>,
|
||||
CloudSendRateAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -89,6 +90,7 @@ CloudSettingsMenu::CloudSettingsMenu()
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_CLOUDKEY>, PushScreenAction<CloudKeyChangeScreen>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_CLOUDTRANSMITTIMEOUT>, PushScreenAction<CloudTransmitTimeoutChangeScreen>>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SENDSTATISTICS>, BobbyCheckbox, CloudSendStatisticsAccessor>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SENDSCREEN>, BobbyCheckbox, CloudSendScreenAccessor>>();
|
||||
constructMenuItem<makeComponent<MenuItem, CloudCreatedText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, CloudStartedText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, CloudConnectedText, DisabledColor, DummyAction>>();
|
||||
@ -98,7 +100,7 @@ CloudSettingsMenu::CloudSettingsMenu()
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, PushScreenAction<SettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||
}
|
||||
|
||||
std::string CloudSettingsMenu::title() const
|
||||
std::string CloudSettingsMenu::text() const
|
||||
{
|
||||
return TEXT_CLOUDSETTINGS;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ class CloudSettingsMenu : public BobbyMenuDisplay
|
||||
public:
|
||||
CloudSettingsMenu();
|
||||
|
||||
std::string title() const override;
|
||||
std::string text() const override;
|
||||
|
||||
void back() override;
|
||||
};
|
||||
|
@ -39,14 +39,14 @@ constexpr char TEXT_BACK[] = "Back";
|
||||
|
||||
using WheelDiameterMmChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_WHEELDIAMETERMM>,
|
||||
espgui::StaticText<TEXT_WHEELDIAMETERMM>,
|
||||
WheelDiameterMmAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
>;
|
||||
using WheelDiameterInchChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<float>,
|
||||
espgui::StaticTitle<TEXT_WHEELDIAMETERINCH>,
|
||||
espgui::StaticText<TEXT_WHEELDIAMETERINCH>,
|
||||
WheelDiameterInchAccessor,
|
||||
espgui::RatioNumberStep<float, std::ratio<1,10>>,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
@ -54,7 +54,7 @@ using WheelDiameterInchChangeScreen = espgui::makeComponent<
|
||||
>;
|
||||
using NumMagnetPolesChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_NUMMAGNETPOLES>,
|
||||
espgui::StaticText<TEXT_NUMMAGNETPOLES>,
|
||||
NumMagnetPolesAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -62,14 +62,14 @@ using NumMagnetPolesChangeScreen = espgui::makeComponent<
|
||||
#ifdef FEATURE_CAN
|
||||
using CanTransmitTimeoutChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_CANTRANSMITTIMEOUT>,
|
||||
espgui::StaticText<TEXT_CANTRANSMITTIMEOUT>,
|
||||
CanTransmitTimeoutAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
>;
|
||||
using CanReceiveTimeoutChangeScreen = espgui::makeComponent<
|
||||
BobbyChangeValueDisplay<int16_t>,
|
||||
espgui::StaticTitle<TEXT_CANRECEIVETIMEOUT>,
|
||||
espgui::StaticText<TEXT_CANRECEIVETIMEOUT>,
|
||||
CanReceiveTimeoutAccessor,
|
||||
espgui::ConfirmActionInterface<espgui::PopScreenAction>,
|
||||
espgui::BackActionInterface<espgui::PopScreenAction>
|
||||
@ -97,7 +97,7 @@ ControllerHardwareSettingsMenu::ControllerHardwareSettingsMenu()
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, PopScreenAction, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||
}
|
||||
|
||||
std::string ControllerHardwareSettingsMenu::title() const
|
||||
std::string ControllerHardwareSettingsMenu::text() const
|
||||
{
|
||||
return TEXT_CONTROLLERHARDWARESETTINGS;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user