Compare commits
194 Commits
gabor-test
...
new-idf
Author | SHA1 | Date | |
---|---|---|---|
c307b64b0a | |||
101a2b03a8 | |||
7b4fd61a39 | |||
f32013f782 | |||
cca17b7ded | |||
a9794b13bd | |||
1a7e83de83 | |||
69b030268f | |||
b3b45653b5 | |||
199a8f1e4e | |||
d6c76f3c3f | |||
0909c055de | |||
52b55b38cd | |||
65d7a7e9ec | |||
13a6ce3cc2 | |||
6bc85875ee | |||
4688326323 | |||
1b7a523acd | |||
c85e84e9a1 | |||
9e6ee2c957 | |||
d29a74dbd4 | |||
b984360956 | |||
fa819822f0 | |||
52ff7acd02 | |||
b61dfcf53d | |||
f6b4966071 | |||
a6fb1b7396 | |||
fd40d8dbd8 | |||
8cf766356c | |||
da8b91403d | |||
4b4044626b | |||
71906ba511 | |||
ef7e605eb7 | |||
32389f2bf9 | |||
e647c4b372 | |||
3c0b0cdbb1 | |||
43c2338dbd | |||
846a5d753a | |||
f4110bb854 | |||
226636a82a | |||
a93f34e0ba | |||
f2350c8746 | |||
1840030461 | |||
62a4b88acb | |||
bc9a0c396c | |||
2bc1625fab | |||
9db3da4b27 | |||
4e0fdd65c3 | |||
129cc64d24 | |||
f8b1454f9a | |||
4f703c4d10 | |||
95e04ef543 | |||
87751682b2 | |||
7a3a081af4 | |||
327932ac14 | |||
17eff6127f | |||
2ec6ddc150 | |||
ba5d907e38 | |||
3de6827bc5 | |||
846d90836d | |||
6e3324fe65 | |||
79e51f7511 | |||
33f35f14b7 | |||
b43e4e76ac | |||
e6ddc39177 | |||
780fe01015 | |||
5085b1daa6 | |||
4f174fe76f | |||
219b995695 | |||
44100bcc0a | |||
e3f783977b | |||
9ea453f94b | |||
4ff623195f | |||
d8eb55277b | |||
47e49da69c | |||
91ebc22dc9 | |||
6202f5c913 | |||
16b7924c93 | |||
d71fd669e8 | |||
5b0df729b3 | |||
40e200a147 | |||
4347377d61 | |||
c532907f20 | |||
b27135ab90 | |||
a829b69217 | |||
dd91c5826c | |||
8c5e19f880 | |||
27e690b058 | |||
0eba8b3cce | |||
cac60a248d | |||
a062b9369b | |||
8b6cdabfbc | |||
eb353f56b9 | |||
ebc1bf88b6 | |||
e9d0915b69 | |||
cd9a6ba32c | |||
1b63870c4e | |||
b13e45065f | |||
a97f84de33 | |||
cbad8dfa7b | |||
dd3608a09d | |||
6a2720c437 | |||
e930a515ca | |||
61fddd0724 | |||
a7242a4a7d | |||
e518388631 | |||
785c887efe | |||
de17619208 | |||
c71e02b004 | |||
3246d5ec07 | |||
c412ff6a01 | |||
12975932e3 | |||
79be6d2fe6 | |||
8e8e694b57 | |||
d6b2b4b41c | |||
bff99bd6c5 | |||
98a1160c6f | |||
7db25a5642 | |||
405ab92cf2 | |||
6f7b598bd7 | |||
c129106ff4 | |||
4885913c75 | |||
f5d6535db9 | |||
f18a057411 | |||
72c1e959a1 | |||
3fe227a82b | |||
e518c80e03 | |||
f8baa1c6ea | |||
67580cb7ec | |||
1abb83e6b1 | |||
ad9b3c4e53 | |||
e23418dbb0 | |||
c39033399b | |||
0565c3042d | |||
cb7d4180c4 | |||
bc6dd5a50c | |||
7a887a3323 | |||
73fd65b04f | |||
0fab6e72e1 | |||
0cf28d961a | |||
6c94b608fa | |||
1366f3fedb | |||
ca1b7173e7 | |||
1317cec337 | |||
e49603751f | |||
c16a126a2f | |||
91f2f621fe | |||
7bece3c32f | |||
2773f0614d | |||
474b48ff3e | |||
11b9564b07 | |||
0c81c96e46 | |||
01cf28e8f0 | |||
3722d87aee | |||
12261a815f | |||
c0069006cd | |||
8a8f800447 | |||
9068be4a2d | |||
cab4dd2ca1 | |||
83ea64a086 | |||
5d4655b549 | |||
6f6966d13e | |||
72ce9fb3a5 | |||
d805bcfb2c | |||
a462e97d5f | |||
cff49fa3a8 | |||
ee6fb1f99c | |||
3c13473d0c | |||
38fb68ce2e | |||
55386b5fb3 | |||
0393ac750b | |||
647365c5fc | |||
756c8bde94 | |||
56d0cb2ab0 | |||
d829c0d5cb | |||
ff104923d7 | |||
a5ee6bb557 | |||
b9961e2e2f | |||
65bc7d2b38 | |||
08e2f6e4d3 | |||
0843e4881b | |||
cf278e4d18 | |||
3e70a1fc74 | |||
5971061bc7 | |||
eef937edea | |||
401c870287 | |||
66a469f4e3 | |||
ba45f28f17 | |||
735ad66dba | |||
325d719aee | |||
6144a05e25 | |||
5db917786a | |||
cf2f9a5939 | |||
54cdeee1c9 |
66
.clang-format
Normal file
66
.clang-format
Normal file
@ -0,0 +1,66 @@
|
||||
# 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
|
2
.github/workflows/workflow.yml
vendored
2
.github/workflows/workflow.yml
vendored
@ -154,7 +154,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node: [feedc0de, comred, comred_new, peter, mick, nofeatures, seatbot, gernot]
|
||||
node: [feedc0de, feedc0de_new, comred_new, peter, mick, nofeatures, seatbot]
|
||||
name: ${{ matrix.node }}
|
||||
needs:
|
||||
- checkout
|
||||
|
22
.gitmodules
vendored
22
.gitmodules
vendored
@ -3,7 +3,7 @@
|
||||
url = ../../0xFEEDC0DE64/espcpputils.git
|
||||
[submodule "esp-idf"]
|
||||
path = esp-idf
|
||||
url = ../../0xFEEDC0DE64/esp-idf.git
|
||||
url = ../../bobbycar-graz/esp-idf.git
|
||||
[submodule "components/cpputils"]
|
||||
path = components/cpputils
|
||||
url = ../../0xFEEDC0DE64/cpputils.git
|
||||
@ -19,15 +19,9 @@
|
||||
[submodule "components/ArduinoJson"]
|
||||
path = components/ArduinoJson
|
||||
url = ../../0xFEEDC0DE64/ArduinoJson.git
|
||||
[submodule "components/TFT_eSPI"]
|
||||
path = components/TFT_eSPI
|
||||
url = ../../0xFEEDC0DE64/TFT_eSPI.git
|
||||
[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
|
||||
@ -39,7 +33,7 @@
|
||||
url = ../../0xFEEDC0DE64/espwifistack.git
|
||||
[submodule "components/esp-nimble-cpp"]
|
||||
path = components/esp-nimble-cpp
|
||||
url = ../../0xFEEDC0DE64/esp-nimble-cpp.git
|
||||
url = ../../bobbycar-graz/esp-nimble-cpp.git
|
||||
[submodule "components/espasyncota"]
|
||||
path = components/espasyncota
|
||||
url = ../../0xFEEDC0DE64/espasyncota.git
|
||||
@ -67,3 +61,15 @@
|
||||
[submodule "esp-protocols"]
|
||||
path = esp-protocols
|
||||
url = ../../0xFEEDC0DE64/esp-protocols.git
|
||||
[submodule "components/TFT_eSPI"]
|
||||
path = components/TFT_eSPI
|
||||
url = ../../0xFEEDC0DE64/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
|
||||
|
@ -22,10 +22,13 @@ include(config.cmake)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
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: 76e19791f9...6a64e87bc3
Submodule components/TFT_eSPI updated: 5ca80d8cf8...69f86aa4f2
Submodule components/arduino-esp32 updated: 2b2f7cd936...745ccdeae8
Submodule components/bobbycar-protocol updated: a74791e2aa...0734d65146
Submodule components/cpputils updated: 2a957fb627...96e318fd6d
Submodule components/esp-gui-lib updated: bb02a6c267...53c5f9a0f3
Submodule components/esp-nimble-cpp updated: 641f297120...29f9273c65
Submodule components/espasynchttpreq updated: 4719a27c5d...06ca1a6881
Submodule components/espasyncota updated: 1cc204f1af...ee623d78ea
Submodule components/espchrono updated: b83cc027cd...eff94f175c
Submodule components/espconfiglib updated: 3ca0eb09d6...379533571f
Submodule components/espcpputils updated: a155041878...4cf49eac1d
1
components/espfontlib
Submodule
1
components/espfontlib
Submodule
Submodule components/espfontlib added at 89048ff162
Submodule components/esphttpdutils updated: c095443979...6ed0915d85
1
components/esptftlib
Submodule
1
components/esptftlib
Submodule
Submodule components/esptftlib added at b779a4c09d
Submodule components/espwifistack updated: 4749a9db5c...e70b509e20
Submodule components/expected deleted from ce14a0fc6e
Submodule components/fmt updated: 7b25dd172b...32e16173ce
@ -1,4 +1,5 @@
|
||||
set(BOBBY_APP_NAME bobbyquad_allfeatures)
|
||||
set(BOBBY_DEFAULT_USERNAME allfeatures)
|
||||
|
||||
add_definitions(
|
||||
-DUSER_SETUP_LOADED=1
|
||||
@ -17,8 +18,6 @@ add_definitions(
|
||||
|
||||
set(BOBBYCAR_BUILDFLAGS
|
||||
# Pins
|
||||
-DPINS_GAS=34
|
||||
-DPINS_BREMS=35
|
||||
# -DFEATURE_JOYSTICK
|
||||
# -DPINS_RX1=4
|
||||
# -DPINS_TX1=5
|
90
configs/config_aveexy.cmake
Normal file
90
configs/config_aveexy.cmake
Normal file
@ -0,0 +1,90 @@
|
||||
set(BOBBY_APP_NAME bobbyquad_aveexy)
|
||||
set(BOBBY_DEFAULT_USERNAME aveexy)
|
||||
|
||||
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
|
||||
-DPINS_GAS=34
|
||||
-DPINS_BREMS=35
|
||||
# -DFEATURE_JOYSTICK
|
||||
# -DPINS_RX1=4
|
||||
# -DPINS_TX1=5
|
||||
# -DPINS_RX2=22
|
||||
# -DPINS_TX2=23
|
||||
# -DPINS_MOSFET0=18
|
||||
# -DPINS_MOSFET1=19
|
||||
# -DPINS_MOSFET2=21
|
||||
# -DPINS_GAMETRAKX=34
|
||||
# -DPINS_GAMETRAKY=39
|
||||
# -DPINS_GAMETRAKDIST=36
|
||||
-DPINS_LEDBACKLIGHT=23
|
||||
-DPINS_LEDSTRIP=33
|
||||
|
||||
# Config flags
|
||||
-DFEATURE_ADC_IN
|
||||
-DFEATURE_CAN
|
||||
# -DFEATURE_SERIAL
|
||||
# -DFEATURE_MOSFETS
|
||||
# -DFEATURE_BLUETOOTH
|
||||
# -DFEATURE_BMS
|
||||
# -DFEATURE_GAMETRAK
|
||||
# -DFEATURE_POWERSUPPLY
|
||||
-DFEATURE_LEDBACKLIGHT
|
||||
|
||||
-DLEDBACKLIGHT_INVERTED
|
||||
# -DLEDSTRIP_WRONG_DIRECTION
|
||||
-DHEAP_LRGST_CRASH_TEXT_FIX
|
||||
|
||||
# Default values
|
||||
-DDEFAULT_SWAPSCREENBYTES=false
|
||||
-DDEFAULT_INVERTFRONTLEFT=false
|
||||
-DDEFAULT_INVERTFRONTRIGHT=true
|
||||
-DDEFAULT_INVERTBACKLEFT=false
|
||||
-DDEFAULT_INVERTBACKRIGHT=true
|
||||
-DDEFAULT_WHEELDIAMETER=200
|
||||
-DDEFAULT_IMOTMAX=28
|
||||
-DDEFAULT_IDCMAX=30
|
||||
-DDEFAULT_NMOTMAX=2000
|
||||
-DDEFAULT_FIELDWEAKMAX=17
|
||||
-DDEFAULT_FIELDADVMAX=40
|
||||
|
||||
# DPAD
|
||||
# -DFEATURE_DPAD_5WIRESW
|
||||
# -DPINS_DPAD_5WIRESW_OUT=4
|
||||
# -DPINS_DPAD_5WIRESW_IN1=5
|
||||
# -DPINS_DPAD_5WIRESW_IN2=27
|
||||
# -DPINS_DPAD_5WIRESW_IN3=18
|
||||
# -DPINS_DPAD_5WIRESW_IN4=19
|
||||
# -DPINS_DPAD_EXTRASW_IN5=25
|
||||
# -DFEATURE_DPAD_6WIRESW
|
||||
# -DPINS_DPAD_6WIRESW_OUT=4
|
||||
# -DPINS_DPAD_6WIRESW_IN1=5
|
||||
# -DPINS_DPAD_6WIRESW_IN2=27
|
||||
# -DPINS_DPAD_6WIRESW_IN3=18
|
||||
# -DPINS_DPAD_6WIRESW_IN4=19
|
||||
# -DPINS_DPAD_6WIRESW_IN5=26
|
||||
# -DFEATURE_GSCHISSENE_DIODE
|
||||
-DDPAD_BOARDCOMPUTER_V2
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_OUT1=19
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_OUT2=5
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_IN1=4
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_IN2=18
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_IN3=27
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_IN4=16
|
||||
# -DDPAD_BOARDCOMPUTER_V2_DEBUG
|
||||
)
|
||||
|
@ -1,4 +1,5 @@
|
||||
set(BOBBY_APP_NAME bobbyquad_comred)
|
||||
set(BOBBY_DEFAULT_USERNAMENAME comred)
|
||||
|
||||
add_definitions(
|
||||
-DUSER_SETUP_LOADED=1
|
@ -1,19 +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,24 +1,8 @@
|
||||
set(BOBBY_APP_NAME bobbyquad_feedc0de)
|
||||
|
||||
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(BOBBY_DEFAULT_USERNAME feedc0de)
|
||||
|
||||
set(BOBBYCAR_BUILDFLAGS
|
||||
# Pins
|
||||
-DPINS_GAS=34
|
||||
-DPINS_BREMS=35
|
||||
# -DFEATURE_JOYSTICK
|
||||
# -DPINS_RX1=4
|
||||
# -DPINS_TX1=5
|
56
configs/config_feedc0de_new.cmake
Normal file
56
configs/config_feedc0de_new.cmake
Normal file
@ -0,0 +1,56 @@
|
||||
set(BOBBY_APP_NAME bobbyquad_feedc0de)
|
||||
set(BOBBY_DEFAULT_USERNAME feedc0de)
|
||||
|
||||
set(BOBBYCAR_BUILDFLAGS
|
||||
# Pins
|
||||
# -DFEATURE_JOYSTICK
|
||||
# -DPINS_RX1=4
|
||||
# -DPINS_TX1=5
|
||||
# -DPINS_RX2=22
|
||||
# -DPINS_TX2=23
|
||||
-DPINS_MOSFET0=4
|
||||
-DPINS_MOSFET1=5
|
||||
-DPINS_MOSFET2=25
|
||||
# -DPINS_GAMETRAKX=34
|
||||
# -DPINS_GAMETRAKY=39
|
||||
# -DPINS_GAMETRAKDIST=36
|
||||
-DPINS_LEDBACKLIGHT=23
|
||||
-DPINS_LEDSTRIP=26
|
||||
|
||||
# Config flags
|
||||
-DFEATURE_ADC_IN
|
||||
-DFEATURE_CAN
|
||||
# -DFEATURE_SERIAL
|
||||
-DFEATURE_MOSFETS
|
||||
# -DFEATURE_BLUETOOTH
|
||||
# -DFEATURE_BMS
|
||||
# -DFEATURE_GAMETRAK
|
||||
-DFEATURE_POWERSUPPLY
|
||||
-DFEATURE_LEDBACKLIGHT
|
||||
|
||||
# -DLEDBACKLIGHT_INVERTED
|
||||
# -DLEDSTRIP_WRONG_DIRECTION
|
||||
# -DHEAP_LRGST_CRASH_TEXT_FIX
|
||||
|
||||
# Default values
|
||||
-DDEFAULT_SWAPSCREENBYTES=false
|
||||
-DDEFAULT_INVERTFRONTLEFT=false
|
||||
-DDEFAULT_INVERTFRONTRIGHT=true
|
||||
-DDEFAULT_INVERTBACKLEFT=false
|
||||
-DDEFAULT_INVERTBACKRIGHT=true
|
||||
-DDEFAULT_WHEELDIAMETER=255
|
||||
-DDEFAULT_IMOTMAX=40
|
||||
-DDEFAULT_IDCMAX=42
|
||||
-DDEFAULT_NMOTMAX=2000
|
||||
-DDEFAULT_FIELDWEAKMAX=17
|
||||
-DDEFAULT_FIELDADVMAX=40
|
||||
|
||||
# DPAD
|
||||
-DDPAD_BOARDCOMPUTER_V2
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_OUT1=19
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_OUT2=5
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_IN1=4
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_IN2=18
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_IN3=27
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_IN4=16
|
||||
)
|
@ -1,4 +1,5 @@
|
||||
set(BOBBY_APP_NAME bobbyquad_gernot)
|
||||
set(BOBBY_DEFAULT_USERNAME gernot)
|
||||
|
||||
add_definitions(
|
||||
-DUSER_SETUP_LOADED=1
|
@ -1,4 +1,5 @@
|
||||
set(BOBBY_APP_NAME bobbyquad_greyhash)
|
||||
set(BOBBY_DEFAULT_USERNAME greyhash)
|
||||
|
||||
add_definitions(
|
||||
-DUSER_SETUP_LOADED=1
|
@ -1,19 +1,5 @@
|
||||
set(BOBBY_APP_NAME bobbyquad_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(BOBBY_DEFAULT_USERNAME mick)
|
||||
|
||||
set(BOBBYCAR_BUILDFLAGS
|
||||
# Pins
|
@ -1,4 +1,5 @@
|
||||
set(BOBBY_APP_NAME bobbyquad_nofeatures)
|
||||
set(BOBBY_DEFAULT_USERNAME nofeatures)
|
||||
|
||||
add_definitions(
|
||||
-DUSER_SETUP_LOADED=1
|
@ -1,4 +1,5 @@
|
||||
set(BOBBY_APP_NAME bobbyquad_peter)
|
||||
set(BOBBY_DEFAULT_USERNAME peter)
|
||||
|
||||
add_definitions(
|
||||
-DUSER_SETUP_LOADED=1
|
@ -1,4 +1,5 @@
|
||||
set(BOBBY_APP_NAME bobbyquad_seatbot)
|
||||
set(BOBBY_DEFAULT_USERNAME seatbot)
|
||||
|
||||
add_definitions(
|
||||
-DUSER_SETUP_LOADED=1
|
||||
@ -45,7 +46,7 @@ set(BOBBYCAR_BUILDFLAGS
|
||||
-DFEATURE_LEDBACKLIGHT
|
||||
|
||||
-DLEDBACKLIGHT_INVERTED
|
||||
# -DLEDSTRIP_WRONG_DIRECTION
|
||||
-DLEDSTRIP_WRONG_DIRECTION
|
||||
-DHEAP_LRGST_CRASH_TEXT_FIX
|
||||
|
||||
# Default values
|
90
configs/config_testdevice.cmake
Normal file
90
configs/config_testdevice.cmake
Normal file
@ -0,0 +1,90 @@
|
||||
set(BOBBY_APP_NAME testdevice)
|
||||
set(BOBBY_DEFAULT_USERNAME testdevice)
|
||||
|
||||
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
|
||||
-DPINS_GAS=34
|
||||
-DPINS_BREMS=35
|
||||
# -DFEATURE_JOYSTICK
|
||||
# -DPINS_RX1=4
|
||||
# -DPINS_TX1=5
|
||||
# -DPINS_RX2=22
|
||||
# -DPINS_TX2=23
|
||||
# -DPINS_MOSFET0=18
|
||||
# -DPINS_MOSFET1=19
|
||||
# -DPINS_MOSFET2=21
|
||||
# -DPINS_GAMETRAKX=34
|
||||
# -DPINS_GAMETRAKY=39
|
||||
# -DPINS_GAMETRAKDIST=36
|
||||
-DPINS_LEDBACKLIGHT=23
|
||||
-DPINS_LEDSTRIP=33
|
||||
|
||||
# Config flags
|
||||
-DFEATURE_ADC_IN
|
||||
-DFEATURE_CAN
|
||||
# -DFEATURE_SERIAL
|
||||
# -DFEATURE_MOSFETS
|
||||
# -DFEATURE_BLUETOOTH
|
||||
# -DFEATURE_BMS
|
||||
# -DFEATURE_GAMETRAK
|
||||
# -DFEATURE_POWERSUPPLY
|
||||
-DFEATURE_LEDBACKLIGHT
|
||||
|
||||
-DLEDBACKLIGHT_INVERTED
|
||||
# -DLEDSTRIP_WRONG_DIRECTION
|
||||
-DHEAP_LRGST_CRASH_TEXT_FIX
|
||||
|
||||
# Default values
|
||||
-DDEFAULT_SWAPSCREENBYTES=false
|
||||
-DDEFAULT_INVERTFRONTLEFT=false
|
||||
-DDEFAULT_INVERTFRONTRIGHT=true
|
||||
-DDEFAULT_INVERTBACKLEFT=false
|
||||
-DDEFAULT_INVERTBACKRIGHT=true
|
||||
-DDEFAULT_WHEELDIAMETER=200
|
||||
-DDEFAULT_IMOTMAX=28
|
||||
-DDEFAULT_IDCMAX=30
|
||||
-DDEFAULT_NMOTMAX=2000
|
||||
-DDEFAULT_FIELDWEAKMAX=17
|
||||
-DDEFAULT_FIELDADVMAX=40
|
||||
|
||||
# DPAD
|
||||
# -DFEATURE_DPAD_5WIRESW
|
||||
# -DPINS_DPAD_5WIRESW_OUT=4
|
||||
# -DPINS_DPAD_5WIRESW_IN1=5
|
||||
# -DPINS_DPAD_5WIRESW_IN2=27
|
||||
# -DPINS_DPAD_5WIRESW_IN3=18
|
||||
# -DPINS_DPAD_5WIRESW_IN4=19
|
||||
# -DPINS_DPAD_EXTRASW_IN5=25
|
||||
# -DFEATURE_DPAD_6WIRESW
|
||||
# -DPINS_DPAD_6WIRESW_OUT=4
|
||||
# -DPINS_DPAD_6WIRESW_IN1=5
|
||||
# -DPINS_DPAD_6WIRESW_IN2=27
|
||||
# -DPINS_DPAD_6WIRESW_IN3=18
|
||||
# -DPINS_DPAD_6WIRESW_IN4=19
|
||||
# -DPINS_DPAD_6WIRESW_IN5=26
|
||||
# -DFEATURE_GSCHISSENE_DIODE
|
||||
-DDPAD_BOARDCOMPUTER_V2
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_OUT1=19
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_OUT2=5
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_IN1=4
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_IN2=18
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_IN3=27
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_IN4=16
|
||||
# -DDPAD_BOARDCOMPUTER_V2_DEBUG
|
||||
)
|
||||
|
90
configs/config_testdevice2.cmake
Normal file
90
configs/config_testdevice2.cmake
Normal file
@ -0,0 +1,90 @@
|
||||
set(BOBBY_APP_NAME testdevice2)
|
||||
set(BOBBY_DEFAULT_USERNAME testdevice2)
|
||||
|
||||
add_definitions(
|
||||
-DUSER_SETUP_LOADED=1
|
||||
-DLOAD_GLCD=1
|
||||
-DLOAD_FONT2=1
|
||||
-DLOAD_FONT4=1
|
||||
-DLOAD_FONT7=1
|
||||
-DST7789_DRIVER=1
|
||||
-DTFT_MOSI=13
|
||||
-DTFT_SCLK=15
|
||||
-DTFT_CS=14
|
||||
-DTFT_DC=12
|
||||
-DTFT_RST=2
|
||||
-DSPI_FREQUENCY=40000000
|
||||
)
|
||||
|
||||
set(BOBBYCAR_BUILDFLAGS
|
||||
# Pins
|
||||
-DPINS_GAS=34
|
||||
-DPINS_BREMS=35
|
||||
# -DFEATURE_JOYSTICK
|
||||
# -DPINS_RX1=4
|
||||
# -DPINS_TX1=5
|
||||
# -DPINS_RX2=22
|
||||
# -DPINS_TX2=23
|
||||
# -DPINS_MOSFET0=18
|
||||
# -DPINS_MOSFET1=19
|
||||
# -DPINS_MOSFET2=21
|
||||
# -DPINS_GAMETRAKX=34
|
||||
# -DPINS_GAMETRAKY=39
|
||||
# -DPINS_GAMETRAKDIST=36
|
||||
-DPINS_LEDBACKLIGHT=23
|
||||
-DPINS_LEDSTRIP=33
|
||||
|
||||
# Config flags
|
||||
-DFEATURE_ADC_IN
|
||||
-DFEATURE_CAN
|
||||
# -DFEATURE_SERIAL
|
||||
# -DFEATURE_MOSFETS
|
||||
# -DFEATURE_BLUETOOTH
|
||||
# -DFEATURE_BMS
|
||||
# -DFEATURE_GAMETRAK
|
||||
# -DFEATURE_POWERSUPPLY
|
||||
-DFEATURE_LEDBACKLIGHT
|
||||
|
||||
-DLEDBACKLIGHT_INVERTED
|
||||
# -DLEDSTRIP_WRONG_DIRECTION
|
||||
-DHEAP_LRGST_CRASH_TEXT_FIX
|
||||
|
||||
# Default values
|
||||
-DDEFAULT_SWAPSCREENBYTES=false
|
||||
-DDEFAULT_INVERTFRONTLEFT=false
|
||||
-DDEFAULT_INVERTFRONTRIGHT=true
|
||||
-DDEFAULT_INVERTBACKLEFT=false
|
||||
-DDEFAULT_INVERTBACKRIGHT=true
|
||||
-DDEFAULT_WHEELDIAMETER=200
|
||||
-DDEFAULT_IMOTMAX=28
|
||||
-DDEFAULT_IDCMAX=30
|
||||
-DDEFAULT_NMOTMAX=2000
|
||||
-DDEFAULT_FIELDWEAKMAX=17
|
||||
-DDEFAULT_FIELDADVMAX=40
|
||||
|
||||
# DPAD
|
||||
# -DFEATURE_DPAD_5WIRESW
|
||||
# -DPINS_DPAD_5WIRESW_OUT=4
|
||||
# -DPINS_DPAD_5WIRESW_IN1=5
|
||||
# -DPINS_DPAD_5WIRESW_IN2=27
|
||||
# -DPINS_DPAD_5WIRESW_IN3=18
|
||||
# -DPINS_DPAD_5WIRESW_IN4=19
|
||||
# -DPINS_DPAD_EXTRASW_IN5=25
|
||||
# -DFEATURE_DPAD_6WIRESW
|
||||
# -DPINS_DPAD_6WIRESW_OUT=4
|
||||
# -DPINS_DPAD_6WIRESW_IN1=5
|
||||
# -DPINS_DPAD_6WIRESW_IN2=27
|
||||
# -DPINS_DPAD_6WIRESW_IN3=18
|
||||
# -DPINS_DPAD_6WIRESW_IN4=19
|
||||
# -DPINS_DPAD_6WIRESW_IN5=26
|
||||
# -DFEATURE_GSCHISSENE_DIODE
|
||||
-DDPAD_BOARDCOMPUTER_V2
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_OUT1=19
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_OUT2=5
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_IN1=4
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_IN2=18
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_IN3=27
|
||||
-DPINS_DPAD_BOARDCOMPUTER_V2_IN4=16
|
||||
# -DDPAD_BOARDCOMPUTER_V2_DEBUG
|
||||
)
|
||||
|
File diff suppressed because it is too large
Load Diff
2282
configs/sdkconfig_aveexy
Normal file
2282
configs/sdkconfig_aveexy
Normal file
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
2282
configs/sdkconfig_feedc0de_new
Normal file
2282
configs/sdkconfig_feedc0de_new
Normal file
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
2282
configs/sdkconfig_testdevice
Normal file
2282
configs/sdkconfig_testdevice
Normal file
File diff suppressed because it is too large
Load Diff
2281
configs/sdkconfig_testdevice2
Normal file
2281
configs/sdkconfig_testdevice2
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,15 @@
|
||||
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.0.0
|
||||
manifest_hash: 7c3516d5e235caf076ae74598eb0fa0e7367ac4e40a46f5f1c262bd592a127e4
|
||||
version: 5.2.0
|
||||
manifest_hash: 04b1e89bb78c4187b4d7bc0cf9461b7a3475762e58fec6f3bb49a885c56532c2
|
||||
target: esp32
|
||||
version: 1.0.0
|
||||
|
2
esp-idf
2
esp-idf
Submodule esp-idf updated: d0026946cd...14b365579b
Submodule esp-protocols updated: 555cd0ab92...d38f04b88f
1
esp_boost
Submodule
1
esp_boost
Submodule
Submodule esp_boost added at 76e5b5075c
@ -53,4 +53,4 @@ export PATH=$PATH:$(pwd)/tools
|
||||
alias open-ide=open_ide
|
||||
alias switchconf=./switchconf.sh
|
||||
alias bobby-build="idf.py build"
|
||||
export PS1="\033[1;32m(bobby-sourced)\033[;0m$PS1"
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
set(headers
|
||||
set(BOBBY_HEADERS
|
||||
accessorhelpers.h
|
||||
accessors/globalaccessors.h
|
||||
accessors/settingsaccessors.h
|
||||
@ -23,8 +23,9 @@ set(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
|
||||
@ -62,6 +63,7 @@ set(headers
|
||||
debuginputhandler.h
|
||||
debugtexthelpers.h
|
||||
displays/batterygraphdisplay.h
|
||||
displays/batteryinfodisplay.h
|
||||
displays/bmsdisplay.h
|
||||
displays/bobbychangevaluedisplay.h
|
||||
displays/bobbydisplay.h
|
||||
@ -70,7 +72,6 @@ set(headers
|
||||
displays/bobbymenudisplay.h
|
||||
displays/bobbypopupdisplay.h
|
||||
displays/bobbysplitgraphdisplay.h
|
||||
displays/buttoncalibratedisplay.h
|
||||
displays/calibratevoltagedisplay.h
|
||||
displays/confiscationdisplay.h
|
||||
displays/gameoflifedisplay.h
|
||||
@ -127,6 +128,7 @@ set(headers
|
||||
displays/menus/networksettingsmenu.h
|
||||
displays/menus/otamenu.h
|
||||
displays/menus/profilesmenu.h
|
||||
displays/menus/recoverymenu.h
|
||||
displays/menus/remotecontrolmodesettingsmenu.h
|
||||
displays/menus/selectbuildserverbranch.h
|
||||
displays/menus/selectbuildservermenu.h
|
||||
@ -156,10 +158,20 @@ set(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
|
||||
displays/statusdisplay.h
|
||||
displays/updatedisplay.h
|
||||
displays/xydebugdisplay.h
|
||||
dnsannounce.h
|
||||
dpad.h
|
||||
dpad3wire.h
|
||||
@ -170,6 +182,7 @@ set(headers
|
||||
drivingstatistics.h
|
||||
espnowfunctions.h
|
||||
esptexthelpers.h
|
||||
feedbackemulator.h
|
||||
feedbackparser.h
|
||||
globals.h
|
||||
handbremse.h
|
||||
@ -215,6 +228,7 @@ set(headers
|
||||
modes/tempomatmode.h
|
||||
modes/wheelchairmode.h
|
||||
mosfets.h
|
||||
motorpwmlimiter.h
|
||||
newsettings.h
|
||||
ota.h
|
||||
potis.h
|
||||
@ -226,6 +240,8 @@ set(headers
|
||||
serial_bobby.h
|
||||
settingspersister.h
|
||||
settingsutils.h
|
||||
setup.h
|
||||
softpwmlimiter.h
|
||||
statistics.h
|
||||
statustexthelper.h
|
||||
taskmanager.h
|
||||
@ -235,6 +251,7 @@ set(headers
|
||||
texthelpers/wifistatexthelpers.h
|
||||
time_bobbycar.h
|
||||
types.h
|
||||
typeutils.h
|
||||
udpcloud.h
|
||||
unifiedmodelmode.h
|
||||
utils.h
|
||||
@ -250,7 +267,7 @@ set(headers
|
||||
wifiguiutils.h
|
||||
)
|
||||
|
||||
set(sources
|
||||
set(BOBBY_SOURCES
|
||||
accessors/wifistaconfigaccessors.cpp
|
||||
actions/assertaction.cpp
|
||||
actions/bluetoothbeginaction.cpp
|
||||
@ -270,8 +287,9 @@ set(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
|
||||
@ -306,6 +324,7 @@ set(sources
|
||||
debuginputhandler.cpp
|
||||
debugtexthelpers.cpp
|
||||
displays/batterygraphdisplay.cpp
|
||||
displays/batteryinfodisplay.cpp
|
||||
displays/bmsdisplay.cpp
|
||||
displays/bobbychangevaluedisplay.cpp
|
||||
displays/bobbydisplay.cpp
|
||||
@ -314,7 +333,6 @@ set(sources
|
||||
displays/bobbymenudisplay.cpp
|
||||
displays/bobbypopupdisplay.cpp
|
||||
displays/bobbysplitgraphdisplay.cpp
|
||||
displays/buttoncalibratedisplay.cpp
|
||||
displays/calibratevoltagedisplay.cpp
|
||||
displays/confiscationdisplay.cpp
|
||||
displays/gameoflifedisplay.cpp
|
||||
@ -369,6 +387,7 @@ set(sources
|
||||
displays/menus/networksettingsmenu.cpp
|
||||
displays/menus/otamenu.cpp
|
||||
displays/menus/profilesmenu.cpp
|
||||
displays/menus/recoverymenu.cpp
|
||||
displays/menus/remotecontrolmodesettingsmenu.cpp
|
||||
displays/menus/selectbuildserverbranch.cpp
|
||||
displays/menus/selectbuildservermenu.cpp
|
||||
@ -398,10 +417,20 @@ set(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
|
||||
displays/statusdisplay.cpp
|
||||
displays/updatedisplay.cpp
|
||||
displays/xydebugdisplay.cpp
|
||||
dnsannounce.cpp
|
||||
dpad.cpp
|
||||
dpad3wire.cpp
|
||||
@ -412,6 +441,7 @@ set(sources
|
||||
drivingstatistics.cpp
|
||||
espnowfunctions.cpp
|
||||
esptexthelpers.cpp
|
||||
feedbackemulator.cpp
|
||||
feedbackparser.cpp
|
||||
globals.cpp
|
||||
handbremse.cpp
|
||||
@ -458,6 +488,7 @@ set(sources
|
||||
modes/tempomatmode.cpp
|
||||
modes/wheelchairmode.cpp
|
||||
mosfets.cpp
|
||||
motorpwmlimiter.cpp
|
||||
newsettings.cpp
|
||||
ota.cpp
|
||||
potis.cpp
|
||||
@ -469,6 +500,8 @@ set(sources
|
||||
serial_bobby.cpp
|
||||
settingspersister.cpp
|
||||
settingsutils.cpp
|
||||
setup.cpp
|
||||
softpwmlimiter.cpp
|
||||
statistics.cpp
|
||||
statustexthelper.cpp
|
||||
taskmanager.cpp
|
||||
@ -494,16 +527,16 @@ set(sources
|
||||
)
|
||||
|
||||
set(dependencies
|
||||
freertos nvs_flash esp_http_server esp_https_ota mdns app_update esp_system esp_websocket_client driver
|
||||
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 expected fmt
|
||||
espasynchttpreq espasyncota espchrono espcpputils espconfiglib esp-gui-lib esphttpdutils espwifistack fmt
|
||||
)
|
||||
|
||||
idf_component_register(
|
||||
SRCS
|
||||
${headers}
|
||||
${sources}
|
||||
${BOBBY_HEADERS}
|
||||
${BOBBY_SOURCES}
|
||||
INCLUDE_DIRS
|
||||
.
|
||||
REQUIRES
|
||||
@ -521,13 +554,35 @@ 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)
|
||||
|
||||
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
|
||||
-fstack-reuse=all
|
||||
@ -541,5 +596,6 @@ target_compile_options(${COMPONENT_TARGET}
|
||||
-DGIT_SHORT_REV="${GIT_SHORT_REV}"
|
||||
-DGIT_MESSAGE="${GIT_MESSAGE}"
|
||||
-DGIT_BRANCH="${GIT_BRANCH}"
|
||||
-DBOBBY_DEFAULT_USERNAME="${BOBBY_DEFAULT_USERNAME}"
|
||||
${BOBBYCAR_BUILDFLAGS}
|
||||
)
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
// system includes
|
||||
#include <cstdint>
|
||||
#include <expected>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <accessorinterface.h>
|
||||
@ -19,7 +20,7 @@ struct RefAccessorSaveSettings : public virtual espgui::RefAccessor<T>
|
||||
espgui::RefAccessor<T>::setValue(value);
|
||||
|
||||
if (!saveProfileSettings())
|
||||
return tl::make_unexpected("saveProfileSettings() failed!");
|
||||
return std::unexpected("saveProfileSettings() failed!");
|
||||
|
||||
return {};
|
||||
};
|
||||
|
@ -1,5 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
// system includes
|
||||
#include <expected>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <accessorinterface.h>
|
||||
|
||||
@ -29,7 +32,7 @@ struct NMotMaxKmhAccessor : public virtual espgui::AccessorInterface<int16_t>
|
||||
{
|
||||
profileSettings.limits.nMotMax = convertFromKmh(value);
|
||||
if (!saveProfileSettings())
|
||||
return tl::make_unexpected("saveProfileSettings() failed!");
|
||||
return std::unexpected("saveProfileSettings() failed!");
|
||||
return {};
|
||||
}
|
||||
};
|
||||
@ -39,10 +42,14 @@ struct PhaseAdvMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &
|
||||
|
||||
// Bluetooth Low Energy
|
||||
struct BleEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.bleSettings.bleEnabled; } };
|
||||
struct BleFenceEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.bleSettings.bleFenceEnabled; } };
|
||||
|
||||
// Cloud
|
||||
struct CloudEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.cloudSettings.cloudEnabled; } };
|
||||
struct CloudTransmitTimeoutAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.cloudSettings.cloudTransmitTimeout; } };
|
||||
struct 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; } };
|
||||
|
||||
// Time
|
||||
//struct TimezoneOffsetAccessor : public NewSettingsAccessor<int32_t> { ConfigWrapper<int32_t> &getConfig() const override { return configs.timezoneOffset; } };
|
||||
@ -73,7 +80,7 @@ struct WheelDiameterInchAccessor : public virtual espgui::AccessorInterface<floa
|
||||
{
|
||||
// profileSettings.controllerHardware.wheelDiameter = convertFromInch(value);
|
||||
// if (!saveProfileSettings())
|
||||
// return tl::make_unexpected("saveProfileSettings() failed!");
|
||||
// return std::unexpected("saveProfileSettings() failed!");
|
||||
// return {};
|
||||
return configs.write_config(configs.controllerHardware.wheelDiameter, convertFromInch(value));
|
||||
}
|
||||
@ -125,11 +132,13 @@ struct CloudSendRateAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapp
|
||||
|
||||
struct UdpCloudSendIntervalAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.timersSettings.udpSendRateMs; } };
|
||||
struct UdpCloudEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.udpCloudSettings.udpCloudEnabled; } };
|
||||
struct CloudDebugEnableAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.udpCloudSettings.enableCloudDebug; } };
|
||||
struct UdpUseStdStringAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.udpCloudSettings.udpUseStdString; } };
|
||||
struct UdpCloudDebugEnableAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.udpCloudSettings.enableCloudDebug; } };
|
||||
struct UdpCloudHostAccessor : public NewSettingsAccessor<std::string> { ConfigWrapper<std::string> &getConfig() const override { return configs.udpCloudSettings.udpCloudHost; } };
|
||||
struct UdpCloudPortAccessor : public NewSettingsAccessor<uint16_t> { ConfigWrapper<uint16_t> &getConfig() const override { return configs.udpCloudSettings.udpCloudPort; } };
|
||||
|
||||
// DefaultMode
|
||||
struct DefaultModeModelModeAccessor : public RefAccessorSaveSettings<UnifiedModelMode> { UnifiedModelMode &getRef() const override { return profileSettings.defaultMode.modelMode; } };
|
||||
struct DefaultModeAllowRemoteControlAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return profileSettings.defaultMode.allowRemoteControl; } };
|
||||
struct DefaultModeSquareGasAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return profileSettings.defaultMode.squareGas; } };
|
||||
struct DefaultModeSquareBremsAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return profileSettings.defaultMode.squareBrems; } };
|
||||
|
||||
@ -199,6 +208,9 @@ 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; } };
|
||||
@ -259,5 +271,9 @@ struct QuickActionExtra2Accessor : public NewSettingsAccessor<BobbyQuickActions>
|
||||
struct QuickActionExtra3Accessor : public NewSettingsAccessor<BobbyQuickActions> { ConfigWrapper<BobbyQuickActions> &getConfig() const override { return configs.quickActionExtra3; } };
|
||||
struct QuickActionExtra4Accessor : public NewSettingsAccessor<BobbyQuickActions> { ConfigWrapper<BobbyQuickActions> &getConfig() const override { return configs.quickActionExtra4; } };
|
||||
|
||||
// boardcomputer-hardware
|
||||
struct FlipScreenAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.boardcomputerHardware.flipScreen; } };
|
||||
|
||||
// Other
|
||||
struct AnhaengerIdAccessor : public NewSettingsAccessor<uint16_t> { ConfigWrapper<uint16_t> &getConfig() const override { return configs.anhaenger_id; } };
|
||||
struct UsernameAccessor : public NewSettingsAccessor<std::string> { ConfigWrapper<std::string> &getConfig() const override { return configs.otaUsername; } };
|
||||
|
@ -16,7 +16,7 @@ public:
|
||||
void triggered() override
|
||||
{
|
||||
if (auto result = configs.write_config(configs.ledstrip.animationType, type); !result)
|
||||
BobbyErrorHandler{}.errorOccured(std::move(result).error());
|
||||
BobbyErrorHandler{}.errorOccurred(std::move(result).error());
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -32,7 +32,6 @@ private:
|
||||
std::string m_msg;
|
||||
};
|
||||
|
||||
template<typename TMenu>
|
||||
class PushQrImportDisplayAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
public:
|
||||
@ -41,7 +40,7 @@ public:
|
||||
|
||||
void triggered() override
|
||||
{
|
||||
espgui::pushScreen<QrImportDisplay<TMenu>>(std::move(m_nvskey));
|
||||
espgui::pushScreen<QrImportDisplay>(std::move(m_nvskey));
|
||||
}
|
||||
private:
|
||||
std::string m_nvskey;
|
||||
|
@ -1,22 +0,0 @@
|
||||
#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();
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <actioninterface.h>
|
||||
|
||||
class RebootAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
public:
|
||||
void triggered() override;
|
||||
};
|
0
main/actions/resetnvsaction.cpp
Normal file
0
main/actions/resetnvsaction.cpp
Normal file
40
main/actions/resetnvsaction.h
Normal file
40
main/actions/resetnvsaction.h
Normal file
@ -0,0 +1,40 @@
|
||||
#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();
|
||||
}
|
||||
}
|
||||
};
|
26
main/actions/setupactions.cpp
Normal file
26
main/actions/setupactions.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#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
|
||||
}
|
24
main/actions/setupactions.h
Normal file
24
main/actions/setupactions.h
Normal file
@ -0,0 +1,24 @@
|
||||
#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;
|
||||
};
|
@ -6,11 +6,11 @@
|
||||
// 3rdparty lib includes
|
||||
#include <ArduinoJson.h>
|
||||
#include <wifi_bobbycar.h>
|
||||
#include <futurecpp.h>
|
||||
|
||||
// local includes
|
||||
#include "ledstrip.h"
|
||||
#include "globals.h"
|
||||
#include "modes/defaultmode.h"
|
||||
#include "modes/remotecontrolmode.h"
|
||||
#include "utils.h"
|
||||
#include "newsettings.h"
|
||||
@ -21,19 +21,19 @@ constexpr const char * const TAG = "BOBBYBLE";
|
||||
class RemoteControlCallbacks : public NimBLECharacteristicCallbacks
|
||||
{
|
||||
public:
|
||||
void onWrite(NimBLECharacteristic* pCharacteristic) override;
|
||||
void onWrite(NimBLECharacteristic* pCharacteristic, NimBLEConnInfo& connInfo) override;
|
||||
};
|
||||
|
||||
class WirelessSettingsCallbacks : public NimBLECharacteristicCallbacks
|
||||
{
|
||||
public:
|
||||
void onWrite(NimBLECharacteristic* pCharacteristic) override;
|
||||
void onWrite(NimBLECharacteristic* pCharacteristic, NimBLEConnInfo& connInfo) override;
|
||||
};
|
||||
|
||||
class WiFiListCallbacks : public NimBLECharacteristicCallbacks
|
||||
{
|
||||
public:
|
||||
void onRead(NimBLECharacteristic* pCharacteristic) override;
|
||||
void onRead(NimBLECharacteristic* pCharacteristic, NimBLEConnInfo& connInfo) override;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
@ -55,14 +55,20 @@ void createBle()
|
||||
{
|
||||
ESP_LOGI("BOBBY", "called");
|
||||
|
||||
BLEDevice::init(configs.bluetoothName.value());
|
||||
NimBLEDevice::init(configs.bluetoothName.value());
|
||||
|
||||
const auto serviceUuid{"0335e46c-f355-4ce6-8076-017de08cee98"};
|
||||
|
||||
pServer = BLEDevice::createServer();
|
||||
ESP_LOGI(TAG, "Creating BLE server");
|
||||
|
||||
pServer = NimBLEDevice::createServer();
|
||||
|
||||
ESP_LOGI(TAG, "Creating BLE service");
|
||||
|
||||
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);
|
||||
@ -72,19 +78,23 @@ void createBle()
|
||||
getwifilist = pService->createCharacteristic("4201def2-a264-43e6-946b-6b2d9612dfed", NIMBLE_PROPERTY::READ);
|
||||
getwifilist->setCallbacks(&bleWiFiListCallbacks);
|
||||
|
||||
ESP_LOGI(TAG, "Starting BLE service");
|
||||
|
||||
pService->start();
|
||||
|
||||
BLEAdvertising *pAdvertising = BLEDevice::getAdvertising();
|
||||
ESP_LOGI(TAG, "Starting BLE advertising");
|
||||
|
||||
NimBLEAdvertising *pAdvertising = NimBLEDevice::getAdvertising();
|
||||
pAdvertising->addServiceUUID(serviceUuid);
|
||||
pAdvertising->setScanResponse(true);
|
||||
BLEDevice::startAdvertising();
|
||||
NimBLEDevice::startAdvertising();
|
||||
}
|
||||
|
||||
void destroyBle()
|
||||
{
|
||||
ESP_LOGI("BOBBY", "called");
|
||||
|
||||
BLEDevice::deinit(true);
|
||||
NimBLEDevice::deinit(true);
|
||||
|
||||
pServer = {};
|
||||
pService = {};
|
||||
@ -226,9 +236,9 @@ void handleBle()
|
||||
|
||||
namespace {
|
||||
|
||||
void RemoteControlCallbacks::onWrite(NimBLECharacteristic* pCharacteristic)
|
||||
void RemoteControlCallbacks::onWrite(NimBLECharacteristic* pCharacteristic, NimBLEConnInfo& connInfo)
|
||||
{
|
||||
const auto &val = pCharacteristic->getValue();
|
||||
const std::string& val = pCharacteristic->getValue();
|
||||
|
||||
StaticJsonDocument<256> doc;
|
||||
if (const auto error = deserializeJson(doc, val))
|
||||
@ -247,18 +257,20 @@ void RemoteControlCallbacks::onWrite(NimBLECharacteristic* pCharacteristic)
|
||||
|
||||
if (!simplified)
|
||||
{
|
||||
modes::remoteControlMode.setCommand(RemoteCommand{
|
||||
RemoteCommand cmd {
|
||||
.frontLeft = doc[isInverted ? "fr":"fl"].as<int16_t>(),
|
||||
.frontRight = doc[isInverted ? "fl":"fr"].as<int16_t>(),
|
||||
.backLeft = doc["bl"].as<int16_t>(),
|
||||
.backRight = doc["br"].as<int16_t>()
|
||||
});
|
||||
};
|
||||
modes::defaultMode.setRemoteCommand(cmd);
|
||||
modes::remoteControlMode.setRemoteCommand(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
void WirelessSettingsCallbacks::onWrite(NimBLECharacteristic* pCharacteristic)
|
||||
void WirelessSettingsCallbacks::onWrite(NimBLECharacteristic* pCharacteristic, NimBLEConnInfo& connInfo)
|
||||
{
|
||||
const auto &val = pCharacteristic->getValue();
|
||||
const std::string& val = pCharacteristic->getValue();
|
||||
|
||||
StaticJsonDocument<256> doc;
|
||||
if (const auto error = deserializeJson(doc, val))
|
||||
@ -271,7 +283,7 @@ void WirelessSettingsCallbacks::onWrite(NimBLECharacteristic* pCharacteristic)
|
||||
|
||||
if (write_type == "wifi") {
|
||||
const int index = doc["wifi_index"].as<int>();
|
||||
ESP_LOGI(TAG, "[ble_config]: Set wifi%i: WiFi-SSID: %s, WiFi-Password: ***", doc["wifi_index"].as<int>(), doc["wifi_ssid"].as<const char*>());
|
||||
ESP_LOGI(TAG, "Set wifi%i: WiFi-SSID: %s, WiFi-Password: ***", doc["wifi_index"].as<int>(), doc["wifi_ssid"].as<const char*>());
|
||||
configs.write_config(configs.wifi_configs[index].ssid, doc["wifi_ssid"].as<std::string>());
|
||||
configs.write_config(configs.wifi_configs[index].key, doc["wifi_pass"].as<std::string>());
|
||||
} else {
|
||||
@ -280,11 +292,11 @@ void WirelessSettingsCallbacks::onWrite(NimBLECharacteristic* pCharacteristic)
|
||||
}
|
||||
}
|
||||
|
||||
void WiFiListCallbacks::onRead(NimBLECharacteristic *pCharacteristic)
|
||||
void WiFiListCallbacks::onRead(NimBLECharacteristic* pCharacteristic, NimBLEConnInfo& connInfo)
|
||||
{
|
||||
StaticJsonDocument<768> responseDoc;
|
||||
auto wifiArray = responseDoc.createNestedArray("wifis");
|
||||
ESP_LOGI(TAG, "[ble_wifilist] Got request for listing wifi ssids.");
|
||||
ESP_LOGI(TAG, "Got request for listing wifi ssids.");
|
||||
for (const auto &wifi : configs.wifi_configs)
|
||||
{
|
||||
wifiArray.add(wifi.ssid.value());
|
||||
|
@ -13,3 +13,10 @@ extern BLECharacteristic *getwifilist;
|
||||
void initBle();
|
||||
|
||||
void handleBle();
|
||||
|
||||
struct RemoteCommand {
|
||||
int16_t frontLeft{};
|
||||
int16_t frontRight{};
|
||||
int16_t backLeft{};
|
||||
int16_t backRight{};
|
||||
};
|
||||
|
@ -60,23 +60,18 @@ namespace bobbyblinker {
|
||||
}
|
||||
if (configs.ledstrip.enableBrakeLights.value() && espchrono::ago(*brake_last_time_sent) > 500ms)
|
||||
{
|
||||
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 == brakeLightsOffSent)
|
||||
{
|
||||
sendState("BRAKELIGHTSON");
|
||||
brakeLightsOffSent = false;
|
||||
}
|
||||
else if (!brakeLightsOffSent && avgPwm > -1.f)
|
||||
{
|
||||
sendState("BRAKELIGHTSOFF");
|
||||
brakeLightsOffSent = true;
|
||||
if (brakeLightsStatus)
|
||||
{
|
||||
sendState("BRAKELIGHTSON");
|
||||
brakeLightsOffSent = false;
|
||||
}
|
||||
else if (!brakeLightsOffSent)
|
||||
{
|
||||
sendState("BRAKELIGHTSOFF");
|
||||
brakeLightsOffSent = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,9 +6,7 @@
|
||||
// local includes
|
||||
#include "newsettings.h"
|
||||
#include "settingsutils.h"
|
||||
#include "modes/defaultmode.h"
|
||||
#include "ledstripdefines.h"
|
||||
#include "ledstrip.h"
|
||||
|
||||
#include "bobbyquickactions.h"
|
||||
|
||||
@ -112,6 +110,7 @@ void buttonReleasedCommon(espgui::Button button)
|
||||
|
||||
void BobbyButtons::rawButtonPressed(uint8_t button)
|
||||
{
|
||||
ESP_LOGI(TAG, "%hhu", button);
|
||||
//Base::rawButtonPressed(button);
|
||||
if (const auto translated = translateRawButton(button))
|
||||
buttonPressed(*translated);
|
||||
@ -119,6 +118,7 @@ void BobbyButtons::rawButtonPressed(uint8_t button)
|
||||
|
||||
void BobbyButtons::rawButtonReleased(uint8_t button)
|
||||
{
|
||||
ESP_LOGI(TAG, "%hhu", button);
|
||||
//Base::rawButtonReleased(button);
|
||||
if (const auto translated = translateRawButton(button))
|
||||
buttonReleased(*translated);
|
||||
|
@ -21,7 +21,8 @@ enum BobbyButton
|
||||
Extra3,
|
||||
Extra4,
|
||||
Confirm = espgui::Button::Right,
|
||||
Back = espgui::Button::Left
|
||||
Back = espgui::Button::Left,
|
||||
ButtonMax = Back
|
||||
};
|
||||
|
||||
[[nodiscard]] std::optional<espgui::Button> translateRawButton(uint8_t button);
|
||||
|
@ -6,9 +6,11 @@
|
||||
// local includes
|
||||
#include "displays/bobbypopupdisplay.h"
|
||||
|
||||
void BobbyErrorHandler::errorOccured(std::string &&error)
|
||||
void BobbyErrorHandler::errorOccurred(std::string &&error)
|
||||
{
|
||||
auto newDisplay = std::make_unique<BobbyPopupDisplay>(std::move(error), std::move(espgui::currentDisplay));
|
||||
newDisplay->initOverlay();
|
||||
espgui::currentDisplay = std::move(newDisplay);
|
||||
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);
|
||||
};
|
||||
}
|
||||
|
@ -5,5 +5,5 @@
|
||||
|
||||
struct BobbyErrorHandler : public virtual espgui::ErrorHandlerInterface
|
||||
{
|
||||
void errorOccured(std::string &&error) override;
|
||||
void errorOccurred(std::string &&error) override;
|
||||
};
|
||||
|
@ -95,6 +95,9 @@ 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));
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <buttonsinterface.h>
|
||||
#include <cpptypesafeenum.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbytypesafeenum.h"
|
||||
#include "bobbybuttons.h"
|
||||
|
||||
#define BobbyQuickActionsValues(x) \
|
||||
@ -18,7 +18,7 @@
|
||||
x(HUPE) \
|
||||
x(COMPRESSOR_TOGGLE)
|
||||
|
||||
DECLARE_TYPESAFE_ENUM(BobbyQuickActions, : uint8_t, BobbyQuickActionsValues)
|
||||
DECLARE_BOBBYTYPESAFE_ENUM(BobbyQuickActions, : uint8_t, BobbyQuickActionsValues)
|
||||
|
||||
namespace quickactions {
|
||||
|
||||
|
@ -3,11 +3,42 @@
|
||||
// 3rdparty lib includes
|
||||
#include <schedulertask.h>
|
||||
|
||||
#include <esp_log.h>
|
||||
|
||||
class BobbySchedulerTask : public espcpputils::SchedulerTask {
|
||||
public:
|
||||
using SchedulerTask::SchedulerTask;
|
||||
void setup() const { SchedulerTask::setup(); m_wasInitialized = true; }
|
||||
// using SchedulerTask::SchedulerTask; -> we need to add one more parameter
|
||||
BobbySchedulerTask(const char *name, void (&setupCallback)(), void (&loopCallback)(),
|
||||
espchrono::millis_clock::duration loopInterval, bool use_in_recovery = false,
|
||||
bool intervalImportant = false,
|
||||
std::string (*perfInfo)() = nullptr) :
|
||||
espcpputils::SchedulerTask(name, setupCallback, loopCallback, loopInterval, intervalImportant, perfInfo),
|
||||
m_use_in_recovery{use_in_recovery}
|
||||
{
|
||||
}
|
||||
void setup(bool in_recovery = false)
|
||||
{
|
||||
m_in_recovery = in_recovery;
|
||||
if (in_recovery && !m_use_in_recovery)
|
||||
{
|
||||
ESP_LOGI("BobbySchedulerTask", "Skipping setup of %s (%s)", name(), m_use_in_recovery ? "use in recovery" : "no use in recovery");
|
||||
return;
|
||||
}
|
||||
SchedulerTask::setup();
|
||||
m_wasInitialized = true;
|
||||
ESP_LOGI("BobbySchedulerTask", "Task %s initialized", name());
|
||||
}
|
||||
void loop()
|
||||
{
|
||||
if (!m_in_recovery || m_use_in_recovery)
|
||||
{
|
||||
// ESP_LOGI("BobbySchedulerTask", "Loop %s", name());
|
||||
SchedulerTask::loop();
|
||||
}
|
||||
}
|
||||
bool isInitialized() const { return m_wasInitialized; }
|
||||
private:
|
||||
mutable bool m_wasInitialized{false};
|
||||
const bool m_use_in_recovery;
|
||||
bool m_in_recovery{false};
|
||||
};
|
||||
|
@ -155,7 +155,7 @@ namespace buildserver {
|
||||
|
||||
std::string get_hash_url(std::string hash)
|
||||
{
|
||||
return fmt::format(url_for_hashes, hash);
|
||||
return fmt::format("{}{}.bin", 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["url"].as<std::string>());
|
||||
url_for_hashes = fmt::format("{}{}", configs.otaServerUrl.value(), doc["new_url"].as<std::string>());
|
||||
parsing_finished = true;
|
||||
}
|
||||
|
||||
|
91
main/can.cpp
91
main/can.cpp
@ -4,6 +4,7 @@
|
||||
// system includes
|
||||
#include <cstring>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
// esp-idf
|
||||
#include <driver/twai.h>
|
||||
@ -14,7 +15,6 @@
|
||||
#include <espchrono.h>
|
||||
#include <tickchrono.h>
|
||||
#include <screenmanager.h>
|
||||
#include <futurecpp.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbycar-can.h"
|
||||
@ -82,6 +82,11 @@ void initCan()
|
||||
|
||||
void updateCan()
|
||||
{
|
||||
if (configs.emulateFeedback.value())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
if (!tryParseCanInput())
|
||||
break;
|
||||
@ -161,6 +166,18 @@ bool parseMotorControllerCanMessage(const twai_message_t &message, Controller &c
|
||||
case MotorController<isBack, true>::Feedback::Temp:
|
||||
controller.feedback.boardTemp = *((int16_t*)message.data);
|
||||
return true;
|
||||
case MotorController<isBack, false>::Feedback::Id:
|
||||
controller.feedback.left.id = *((int16_t*)message.data);
|
||||
return true;
|
||||
case MotorController<isBack, true>::Feedback::Id:
|
||||
controller.feedback.right.id = *((int16_t*)message.data);
|
||||
return true;
|
||||
case MotorController<isBack, false>::Feedback::Iq:
|
||||
controller.feedback.left.iq = *((int16_t*)message.data);
|
||||
return true;
|
||||
case MotorController<isBack, true>::Feedback::Iq:
|
||||
controller.feedback.right.iq = *((int16_t*)message.data);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -253,7 +270,7 @@ bool tryParseCanInput()
|
||||
if (parseBoardcomputerCanMessage(message))
|
||||
return true;
|
||||
|
||||
ESP_LOGW(TAG, "Unknown CAN info received .identifier = %u", message.identifier);
|
||||
ESP_LOGW(TAG, "Unknown CAN info received .identifier = %lu", message.identifier);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -265,6 +282,9 @@ void sendCanCommands()
|
||||
static uint32_t can_sequential_error_cnt = 0;
|
||||
static uint32_t can_sequential_bus_errors = 0;
|
||||
|
||||
if (!configs.controllerHardware.sendFrontCanCmd.value() && !configs.controllerHardware.sendBackCanCmd.value())
|
||||
return;
|
||||
|
||||
constexpr auto send = [](uint32_t addr, auto value){
|
||||
twai_message_t message;
|
||||
twai_status_info_t status_info;
|
||||
@ -281,22 +301,24 @@ void sendCanCommands()
|
||||
const auto status = twai_get_status_info(&status_info);
|
||||
const auto timestamp_after = espchrono::millis_clock::now();
|
||||
|
||||
if ((result == ESP_ERR_TIMEOUT || status_info.state == TWAI_STATE_BUS_OFF) || (status == ESP_OK && status_info.bus_error_count > can_sequential_bus_errors))
|
||||
if ((result == ESP_ERR_TIMEOUT || status_info.state == TWAI_STATE_BUS_OFF) ||
|
||||
(status == ESP_OK && status_info.bus_error_count > can_sequential_bus_errors))
|
||||
{
|
||||
++can_sequential_error_cnt;
|
||||
++can_total_error_cnt;
|
||||
can_sequential_bus_errors = status_info.bus_error_count;
|
||||
|
||||
ESP_LOGW(TAG, "twai_transmit() failed after %lldms with %s, seq err: %d, total err: %d",
|
||||
(timestamp_after - timestamp_before).count(),
|
||||
esp_err_to_name(result),
|
||||
can_sequential_error_cnt,
|
||||
can_total_error_cnt);
|
||||
if (can_total_error_cnt < 500 && (configs.canUninstallOnReset.value() && can_total_error_cnt < 100))
|
||||
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),
|
||||
can_sequential_error_cnt,
|
||||
can_total_error_cnt);
|
||||
}
|
||||
else if (result != ESP_OK)
|
||||
{
|
||||
ESP_LOGD(TAG, "ERROR: twai_transmit() failed after %lldms with %s",
|
||||
(timestamp_after - timestamp_before).count(),
|
||||
ESP_LOGE(TAG, "twai_transmit() failed after %lldms with %s",
|
||||
std::chrono::floor<std::chrono::milliseconds>(timestamp_after - timestamp_before).count(),
|
||||
esp_err_to_name(result));
|
||||
}
|
||||
else
|
||||
@ -310,28 +332,28 @@ void sendCanCommands()
|
||||
can_sequential_error_cnt = 0;
|
||||
if (configs.canResetOnError.value())
|
||||
{
|
||||
ESP_LOGW(TAG, "WARNING: Something isn't right, trying to restart can ic...");
|
||||
ESP_LOGW(TAG, "Something isn't right, trying to restart can ic...");
|
||||
if (const auto err = twai_stop(); err != ESP_OK)
|
||||
{
|
||||
ESP_LOGE(TAG, "ERROR: twai_stop() failed with %s", esp_err_to_name(err));
|
||||
ESP_LOGE(TAG, "twai_stop() failed with %s", esp_err_to_name(err));
|
||||
}
|
||||
|
||||
if (configs.canUninstallOnReset.value())
|
||||
{
|
||||
if (const auto err = twai_driver_uninstall(); err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "ERROR: twai_driver_uninstall() failed with %s", esp_err_to_name(err));
|
||||
ESP_LOGE(TAG, "twai_driver_uninstall() failed with %s", esp_err_to_name(err));
|
||||
}
|
||||
twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT(GPIO_NUM_21, GPIO_NUM_22,
|
||||
TWAI_MODE_NORMAL);
|
||||
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_250KBITS();
|
||||
twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL();
|
||||
if (const auto err = twai_driver_install(&g_config, &t_config, &f_config); err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "ERROR: twai_driver_install() failed with %s", esp_err_to_name(err));
|
||||
ESP_LOGE(TAG, "twai_driver_install() failed with %s", esp_err_to_name(err));
|
||||
}
|
||||
}
|
||||
if (const auto err = twai_start(); err != ESP_OK)
|
||||
{
|
||||
ESP_LOGE(TAG, "ERROR: twai_start() failed with %s", esp_err_to_name(err));
|
||||
ESP_LOGE(TAG, "twai_start() failed with %s", esp_err_to_name(err));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -371,18 +393,33 @@ void sendCanCommands()
|
||||
|
||||
static struct {
|
||||
struct {
|
||||
uint8_t freq = 0;
|
||||
uint8_t pattern = 0;
|
||||
struct {
|
||||
int16_t nCruiseMotTgt{};
|
||||
bool cruiseCtrlEna{};
|
||||
} left, right;
|
||||
uint8_t freq{};
|
||||
uint8_t pattern{};
|
||||
} front, back;
|
||||
std::underlying_type_t<Boardcomputer::Button> buttonLeds{};
|
||||
} lastValues;
|
||||
|
||||
static int i{};
|
||||
|
||||
if ((front && front->command.buzzer.freq != lastValues.front.freq ) ||
|
||||
(front && front->command.buzzer.pattern != lastValues.front.pattern ) ||
|
||||
(back && back->command.buzzer.freq != lastValues.back.freq) ||
|
||||
(back && back->command.buzzer.pattern != lastValues.back.pattern))
|
||||
// anti aufklatsch when tempomat
|
||||
if ((front && front->command.left.nCruiseMotTgt != lastValues.front.left.nCruiseMotTgt) ||
|
||||
(front && front->command.right.nCruiseMotTgt != lastValues.front.right.nCruiseMotTgt) ||
|
||||
(back && back->command.left.nCruiseMotTgt != lastValues.back.left.nCruiseMotTgt) ||
|
||||
(back && back->command.right.nCruiseMotTgt != lastValues.back.right.nCruiseMotTgt))
|
||||
i = 8;
|
||||
else if ((front && front->command.left.cruiseCtrlEna != lastValues.front.left.cruiseCtrlEna) ||
|
||||
(front && front->command.right.cruiseCtrlEna != lastValues.front.right.cruiseCtrlEna) ||
|
||||
(back && back->command.left.cruiseCtrlEna != lastValues.back.left.cruiseCtrlEna) ||
|
||||
(back && back->command.right.cruiseCtrlEna != lastValues.back.right.cruiseCtrlEna))
|
||||
i = 9;
|
||||
else if ((front && front->command.buzzer.freq != lastValues.front.freq ) ||
|
||||
(front && front->command.buzzer.pattern != lastValues.front.pattern ) ||
|
||||
(back && back->command.buzzer.freq != lastValues.back.freq) ||
|
||||
(back && back->command.buzzer.pattern != lastValues.back.pattern))
|
||||
i = 10;
|
||||
else if (buttonLeds != lastValues.buttonLeds)
|
||||
i = 12;
|
||||
@ -457,17 +494,17 @@ void sendCanCommands()
|
||||
if (back) send(MotorController<true, true>::Command::PhaseAdvMax, back->command.right.phaseAdvMax);
|
||||
break;
|
||||
case 8:
|
||||
if (front) send(MotorController<false, false>::Command::CruiseCtrlEna, front->command.left.cruiseCtrlEna);
|
||||
if (front) send(MotorController<false, true>::Command::CruiseCtrlEna, front->command.right.cruiseCtrlEna);
|
||||
if (back) send(MotorController<true, false>::Command::CruiseCtrlEna, back->command.left.cruiseCtrlEna);
|
||||
if (back) send(MotorController<true, true>::Command::CruiseCtrlEna, back->command.right.cruiseCtrlEna);
|
||||
break;
|
||||
case 9:
|
||||
if (front) send(MotorController<false, false>::Command::CruiseMotTgt, front->command.left.nCruiseMotTgt);
|
||||
if (front) send(MotorController<false, true>::Command::CruiseMotTgt, front->command.right.nCruiseMotTgt);
|
||||
if (back) send(MotorController<true, false>::Command::CruiseMotTgt, back->command.left.nCruiseMotTgt);
|
||||
if (back) send(MotorController<true, true>::Command::CruiseMotTgt, back->command.right.nCruiseMotTgt);
|
||||
break;
|
||||
case 9:
|
||||
if (front) send(MotorController<false, false>::Command::CruiseCtrlEna, front->command.left.cruiseCtrlEna);
|
||||
if (front) send(MotorController<false, true>::Command::CruiseCtrlEna, front->command.right.cruiseCtrlEna);
|
||||
if (back) send(MotorController<true, false>::Command::CruiseCtrlEna, back->command.left.cruiseCtrlEna);
|
||||
if (back) send(MotorController<true, true>::Command::CruiseCtrlEna, back->command.right.cruiseCtrlEna);
|
||||
break;
|
||||
case 10:
|
||||
if (front && send(MotorController<false, false>::Command::BuzzerFreq, front->command.buzzer.freq) == ESP_OK)
|
||||
lastValues.front.freq = front->command.buzzer.freq;
|
||||
|
@ -1,5 +1,8 @@
|
||||
#include "changevaluedisplay_bobbyquickactions.h"
|
||||
|
||||
// system includes
|
||||
#include <utility>
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_log.h>
|
||||
|
||||
@ -7,7 +10,6 @@
|
||||
#include <actions/setvalueaction.h>
|
||||
#include <actions/backproxyaction.h>
|
||||
#include <icons/back.h>
|
||||
#include <futurecpp.h>
|
||||
|
||||
// local includes
|
||||
#include "utils.h"
|
||||
|
@ -1,5 +1,8 @@
|
||||
#include "changevaluedisplay_controlmode.h"
|
||||
|
||||
// system includes
|
||||
#include <utility>
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_log.h>
|
||||
|
||||
@ -7,7 +10,6 @@
|
||||
#include <actions/setvalueaction.h>
|
||||
#include <actions/backproxyaction.h>
|
||||
#include <icons/back.h>
|
||||
#include <futurecpp.h>
|
||||
|
||||
// local includes
|
||||
#include "utils.h"
|
||||
|
@ -1,5 +1,8 @@
|
||||
#include "changevaluedisplay_controltype.h"
|
||||
|
||||
// system includes
|
||||
#include <utility>
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_log.h>
|
||||
|
||||
@ -7,7 +10,6 @@
|
||||
#include <actions/setvalueaction.h>
|
||||
#include <actions/backproxyaction.h>
|
||||
#include <icons/back.h>
|
||||
#include <futurecpp.h>
|
||||
|
||||
// local includes
|
||||
#include "utils.h"
|
||||
|
@ -1,5 +1,8 @@
|
||||
#include "changevaluedisplay_handbremsmode.h"
|
||||
|
||||
// system includes
|
||||
#include <utility>
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_log.h>
|
||||
|
||||
@ -7,7 +10,6 @@
|
||||
#include <actions/setvalueaction.h>
|
||||
#include <actions/backproxyaction.h>
|
||||
#include <icons/back.h>
|
||||
#include <futurecpp.h>
|
||||
|
||||
// local includes
|
||||
#include "utils.h"
|
||||
|
@ -1,5 +1,8 @@
|
||||
#include "changevaluedisplay_larsmmode_mode.h"
|
||||
|
||||
// system includes
|
||||
#include <utility>
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_log.h>
|
||||
|
||||
@ -7,7 +10,6 @@
|
||||
#include <actions/setvalueaction.h>
|
||||
#include <actions/backproxyaction.h>
|
||||
#include <icons/back.h>
|
||||
#include <futurecpp.h>
|
||||
|
||||
// local includes
|
||||
#include "utils.h"
|
||||
|
@ -1,5 +1,8 @@
|
||||
#include "changevaluedisplay_unifiedmodelmode.h"
|
||||
|
||||
// system includes
|
||||
#include <utility>
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_log.h>
|
||||
|
||||
@ -7,7 +10,6 @@
|
||||
#include <actions/setvalueaction.h>
|
||||
#include <actions/backproxyaction.h>
|
||||
#include <icons/back.h>
|
||||
#include <futurecpp.h>
|
||||
|
||||
// local includes
|
||||
#include "utils.h"
|
||||
|
1035
main/cloud.cpp
1035
main/cloud.cpp
File diff suppressed because it is too large
Load Diff
@ -7,6 +7,9 @@
|
||||
#include <wrappers/websocket_client.h>
|
||||
#include <espchrono.h>
|
||||
|
||||
// local includes
|
||||
#include "bobbytypesafeenum.h"
|
||||
|
||||
extern espcpputils::websocket_client cloudClient;
|
||||
extern bool cloudStarted;
|
||||
extern espchrono::millis_clock::time_point lastCreateTry;
|
||||
@ -21,3 +24,5 @@ void initCloud();
|
||||
void updateCloud();
|
||||
void cloudCollect();
|
||||
void cloudSend();
|
||||
|
||||
std::string getLoginMessage();
|
||||
|
@ -6,12 +6,13 @@
|
||||
|
||||
// local includes
|
||||
#include "battery.h"
|
||||
#include "ledstrip.h"
|
||||
#include "handbremse.h"
|
||||
#include "bobbyquickactions.h"
|
||||
#include "cloud.h"
|
||||
#include "handbremse.h"
|
||||
#include "ledstrip.h"
|
||||
|
||||
IMPLEMENT_NVS_GET_SET_ENUM(OtaAnimationModes)
|
||||
IMPLEMENT_NVS_GET_SET_ENUM(BatteryCellType)
|
||||
IMPLEMENT_NVS_GET_SET_ENUM(BobbyQuickActions)
|
||||
IMPLEMENT_NVS_GET_SET_ENUM(HandbremseMode)
|
||||
IMPLEMENT_NVS_GET_SET_ENUM(LedstripAnimation)
|
||||
IMPLEMENT_NVS_GET_SET_ENUM(BobbyQuickActions)
|
||||
IMPLEMENT_NVS_GET_SET_ENUM(BatteryCellType)
|
||||
IMPLEMENT_NVS_GET_SET_ENUM(OtaAnimationModes)
|
||||
|
@ -4,8 +4,8 @@
|
||||
#define CONFIGWRAPPER_TOSTRING_USINGS using ::toString;
|
||||
#include <configwrapper_priv.h>
|
||||
|
||||
INSTANTIATE_CONFIGWRAPPER_TEMPLATES(OtaAnimationModes)
|
||||
INSTANTIATE_CONFIGWRAPPER_TEMPLATES(BatteryCellType)
|
||||
INSTANTIATE_CONFIGWRAPPER_TEMPLATES(BobbyQuickActions)
|
||||
INSTANTIATE_CONFIGWRAPPER_TEMPLATES(HandbremseMode)
|
||||
INSTANTIATE_CONFIGWRAPPER_TEMPLATES(LedstripAnimation)
|
||||
INSTANTIATE_CONFIGWRAPPER_TEMPLATES(BobbyQuickActions)
|
||||
INSTANTIATE_CONFIGWRAPPER_TEMPLATES(BatteryCellType)
|
||||
INSTANTIATE_CONFIGWRAPPER_TEMPLATES(OtaAnimationModes)
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include <esp_log.h>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinstance.h>
|
||||
#include <esp32-hal-gpio.h>
|
||||
#include <screenmanager.h>
|
||||
#include <changevaluedisplay.h>
|
||||
@ -117,7 +116,7 @@ void handleNormalChar(char c)
|
||||
{
|
||||
case 'i':
|
||||
case 'I':
|
||||
espgui::tft.init();
|
||||
tft.init();
|
||||
break;
|
||||
case 'p':
|
||||
case 'P':
|
||||
|
@ -77,6 +77,8 @@ private:
|
||||
struct DcPhaCFixedText : public virtual TextInterface { public: std::string text() const override { std::string line{"dcPhaC: "}; if (controller::get().feedbackValid) line += fmt::format("{:.2f}A", fixCurrent(MotorFeedbackGetter::get().dcPhaC)); return line; } };
|
||||
struct ChopsText : public virtual TextInterface { public: std::string text() const override { std::string line{"chops: "}; if (controller::get().feedbackValid) line += std::to_string(MotorFeedbackGetter::get().chops); return line; } };
|
||||
struct HallText : public virtual TextInterface { public: std::string text() const override { std::string line{"hall: "}; if (controller::get().feedbackValid) line += hallString(MotorFeedbackGetter::get()); return line; } };
|
||||
struct IdText : public virtual TextInterface { public: std::string text() const override { std::string line{"id: "}; if (controller::get().feedbackValid) line += fmt::format("{:.2f}A", fixCurrent(MotorFeedbackGetter::get().id)); return line; } };
|
||||
struct IqText : public virtual TextInterface { public: std::string text() const override { std::string line{"iq: "}; if (controller::get().feedbackValid) line += fmt::format("{:.2f}A", fixCurrent(MotorFeedbackGetter::get().iq)); return line; } };
|
||||
};
|
||||
|
||||
public:
|
||||
|
@ -3,7 +3,7 @@ constexpr const char * const TAG = "BatteryGraphDisplay";
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <screenmanager.h>
|
||||
#include <tftinstance.h>
|
||||
#include <tftcolors.h>
|
||||
|
||||
// local includes
|
||||
#include "battery.h"
|
||||
@ -18,13 +18,13 @@ namespace {
|
||||
constexpr const uint8_t TOP_OFFSET = 40;
|
||||
} // namespace
|
||||
|
||||
void BatteryGraphDisplay::initScreen()
|
||||
void BatteryGraphDisplay::initScreen(espgui::TftInterface &tft)
|
||||
{
|
||||
Base::initScreen();
|
||||
drawBatteryCurve();
|
||||
Base::initScreen(tft);
|
||||
drawBatteryCurve(tft);
|
||||
}
|
||||
|
||||
std::string BatteryGraphDisplay::text() const
|
||||
std::string BatteryGraphDisplay::title() const
|
||||
{
|
||||
if (const auto avgVoltage = controllers.getAvgVoltage(); avgVoltage)
|
||||
{
|
||||
@ -33,10 +33,10 @@ std::string BatteryGraphDisplay::text() const
|
||||
return TEXT_BATTERY_GRAPH;
|
||||
}
|
||||
|
||||
void BatteryGraphDisplay::redraw()
|
||||
void BatteryGraphDisplay::redraw(espgui::TftInterface &tft)
|
||||
{
|
||||
using namespace espgui;
|
||||
Base::redraw();
|
||||
Base::redraw(tft);
|
||||
|
||||
if (const auto avgVoltage = controllers.getAvgVoltage(); avgVoltage)
|
||||
{
|
||||
@ -50,10 +50,10 @@ void BatteryGraphDisplay::redraw()
|
||||
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, TFT_BLACK);
|
||||
tft.fillRect(xOffset + 2, TOP_OFFSET, onePercent, tft.height() - TOP_OFFSET, TFT_WHITE);
|
||||
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);
|
||||
m_lastBatVoltage = *avgVoltage;
|
||||
drawBatteryCurve();
|
||||
drawBatteryCurve(tft);
|
||||
}
|
||||
// tft.drawLine() code
|
||||
}
|
||||
@ -73,11 +73,11 @@ void BatteryGraphDisplay::buttonPressed(espgui::Button button)
|
||||
}
|
||||
}
|
||||
|
||||
void BatteryGraphDisplay::drawBatteryCurve()
|
||||
void BatteryGraphDisplay::drawBatteryCurve(espgui::TftInterface &tft)
|
||||
{
|
||||
const auto points = count_curve_points(configs.battery.cellType.value());
|
||||
const auto max_height = espgui::tft.height() - 1;
|
||||
const auto max_width = espgui::tft.width() - 4;
|
||||
const auto max_height = tft.height() - 1;
|
||||
const auto max_width = 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()
|
||||
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);
|
||||
espgui::tft.drawLine(x1, y1, x2, y2, TFT_WHITE);
|
||||
tft.drawLine(x1, y1, x2, y2, espgui::TFT_WHITE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,13 +7,13 @@ class BatteryGraphDisplay : public BobbyDisplayWithTitle {
|
||||
using Base = BobbyDisplayWithTitle;
|
||||
|
||||
public:
|
||||
std::string text() const override;
|
||||
void initScreen() override;
|
||||
void redraw() override;
|
||||
std::string title() const override;
|
||||
void initScreen(espgui::TftInterface &tft) override;
|
||||
void redraw(espgui::TftInterface &tft) override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
|
||||
static void drawBatteryCurve();
|
||||
static void drawBatteryCurve(espgui::TftInterface &tft);
|
||||
|
||||
private:
|
||||
float m_lastBatVoltage{0};
|
||||
|
80
main/displays/batteryinfodisplay.cpp
Normal file
80
main/displays/batteryinfodisplay.cpp
Normal file
@ -0,0 +1,80 @@
|
||||
#include "batteryinfodisplay.h"
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <screenmanager.h>
|
||||
#include <tftcolors.h>
|
||||
|
||||
// local includes
|
||||
#include "battery.h"
|
||||
#include "displays/menus/mainmenu.h"
|
||||
#include "displays/metersdisplay.h"
|
||||
#include "displays/speedinfodisplay.h"
|
||||
#include "globals.h"
|
||||
#include "newsettings.h"
|
||||
|
||||
// display with big battery and ten bars (0-100%)
|
||||
|
||||
void BatteryInfoDisplay::initScreen(espgui::TftInterface &tft)
|
||||
{
|
||||
using namespace espgui;
|
||||
Base::initScreen(tft);
|
||||
|
||||
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);
|
||||
m_lastBarCount = 0;
|
||||
}
|
||||
|
||||
void BatteryInfoDisplay::redraw(espgui::TftInterface &tft)
|
||||
{
|
||||
using namespace espgui;
|
||||
Base::redraw(tft);
|
||||
|
||||
// calculate height of space available for all bars
|
||||
const auto min_x = m_offset + 3; // leave 2 pixels + 1 pixel for border
|
||||
const auto max_x = tft.width() - m_offset - 3;
|
||||
const auto topY = m_offset + 3;
|
||||
const auto bottomY = tft.height() - m_offset - 3;
|
||||
const auto height = bottomY - topY;
|
||||
const auto width = max_x - min_x;
|
||||
const uint16_t segment_height = (height / 10);
|
||||
|
||||
if (const auto avgVoltage = controllers.getAvgVoltage(); avgVoltage)
|
||||
{
|
||||
const auto cellType = configs.battery.cellType.value();
|
||||
const uint16_t percentage = getBatteryPercentage(*avgVoltage, cellType);
|
||||
const auto segment_count = std::max(percentage / 10, 1);
|
||||
|
||||
if (segment_count != m_lastBarCount)
|
||||
{
|
||||
m_lastBarCount = segment_count;
|
||||
// draw battery
|
||||
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.fillRect(0, 0, tft.width(), topY, TFT_CYAN);
|
||||
// tft.fillRect(0, bottomY, tft.width(), tft.height()-bottomY, TFT_YELLOW);
|
||||
}
|
||||
|
||||
void BatteryInfoDisplay::buttonPressed(espgui::Button button)
|
||||
{
|
||||
Base::buttonPressed(button);
|
||||
|
||||
switch (button) {
|
||||
using espgui::Button;
|
||||
case Button::Right:
|
||||
espgui::pushScreen<MainMenu>();
|
||||
break;
|
||||
case Button::Up:
|
||||
espgui::switchScreen<MetersDisplay>();
|
||||
break;
|
||||
case Button::Down:
|
||||
espgui::switchScreen<SpeedInfoDisplay>();
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
}
|
18
main/displays/batteryinfodisplay.h
Normal file
18
main/displays/batteryinfodisplay.h
Normal file
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "bobbydisplay.h"
|
||||
|
||||
class BatteryInfoDisplay : public BobbyDisplay
|
||||
{
|
||||
using Base = BobbyDisplay;
|
||||
|
||||
public:
|
||||
void initScreen(espgui::TftInterface &tft) override;
|
||||
void redraw(espgui::TftInterface &tft) override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
private:
|
||||
static constexpr const auto m_offset = 40;
|
||||
uint16_t m_lastBarCount{0};
|
||||
};
|
@ -2,16 +2,15 @@
|
||||
|
||||
#if defined(FEATURE_BLUETOOTH) && defined(FEATURE_BMS)
|
||||
#include "displays/menus/mainmenu.h"
|
||||
#include "displays/metersdisplay.h"
|
||||
#include "displays/speedinfodisplay.h"
|
||||
#include "displays/statusdisplay.h"
|
||||
#include "screenmanager.h"
|
||||
#include "tftinstance.h"
|
||||
|
||||
using namespace espgui;
|
||||
|
||||
void BmsDisplay::initScreen()
|
||||
void BmsDisplay::initScreen(espgui::TftInterface &tft)
|
||||
{
|
||||
Base::initScreen();
|
||||
Base::initScreen(tft);
|
||||
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
@ -43,9 +42,9 @@ void BmsDisplay::initScreen()
|
||||
m_cycleLabel.start();
|
||||
}
|
||||
|
||||
void BmsDisplay::redraw()
|
||||
void BmsDisplay::redraw(espgui::TftInterface &tft)
|
||||
{
|
||||
Base::redraw();
|
||||
Base::redraw(tft);
|
||||
|
||||
if (bluetoothSerial.hasClient())
|
||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
@ -102,7 +101,7 @@ void BmsDisplay::buttonPressed(espgui::Button button)
|
||||
{
|
||||
using espgui::Button;
|
||||
case Button::Right: pushScreen<MainMenu>(); break;
|
||||
case Button::Up: switchScreen<MetersDisplay>(); break;
|
||||
case Button::Up: switchScreen<SpeedInfoDisplay>(); break;
|
||||
case Button::Down: switchScreen<StatusDisplay>(); break;
|
||||
default:;
|
||||
}
|
||||
|
@ -18,8 +18,8 @@ class BmsDisplay :
|
||||
using Base = BobbyDisplay;
|
||||
|
||||
public:
|
||||
void initScreen() override;
|
||||
void redraw() override;
|
||||
void initScreen(espgui::TftInterface &tft) override;
|
||||
void redraw(espgui::TftInterface &tft) override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
|
||||
|
@ -48,5 +48,6 @@ void BobbyChangeValueDisplay<Tvalue>::buttonPressed(espgui::Button button)
|
||||
template<typename Tvalue>
|
||||
void BobbyChangeValueDisplay<Tvalue>::buttonReleased(espgui::Button button)
|
||||
{
|
||||
//Base::buttonReleased(button);
|
||||
Base::buttonReleased(button);
|
||||
buttonReleasedCommon(button);
|
||||
}
|
||||
|
@ -26,4 +26,5 @@ void BobbyDisplayWithTitle::buttonPressed(espgui::Button button)
|
||||
void BobbyDisplayWithTitle::buttonReleased(espgui::Button button)
|
||||
{
|
||||
//Base::buttonReleased(button);
|
||||
buttonReleasedCommon(button);
|
||||
}
|
||||
|
@ -46,4 +46,5 @@ template<size_t COUNT>
|
||||
void BobbyGraphDisplay<COUNT>::buttonReleased(espgui::Button button)
|
||||
{
|
||||
//Base::buttonReleased(button);
|
||||
buttonReleasedCommon(button);
|
||||
}
|
||||
|
@ -26,6 +26,6 @@ void BobbyMenuDisplay::buttonPressed(espgui::Button button)
|
||||
|
||||
void BobbyMenuDisplay::buttonReleased(espgui::Button button)
|
||||
{
|
||||
//Base::buttonReleased(button);
|
||||
Base::buttonReleased(button);
|
||||
buttonReleasedCommon(button);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user