436 Commits

Author SHA1 Message Date
a6e08af976 init gabor config 2022-06-13 22:36:07 +02:00
c6879016b1 Merge pull request #338 from bobbycar-graz/ned_gschissana_compiler
Ned gschissana compiler
2022-06-13 21:45:27 +02:00
eb94c1912d Ned gschissana compiler 2022-06-13 21:16:44 +02:00
f6bc1f5dbd Merge pull request #336 from bobbycar-graz/lockscreen-fix 2022-06-12 17:36:17 +01:00
a9905232c6 Fix push/pop 2022-06-12 18:19:03 +02:00
a1d51c3f2a Merge pull request #337 from bobbycar-graz/remove-doubles 2022-06-12 17:18:26 +01:00
b08572d503 Double 2022-06-12 18:10:31 +02:00
460f40ce47 Removed doubles 2022-06-12 17:51:31 +02:00
c42e44c40b Merge pull request #333 from bobbycar-graz/pride-animation 2022-06-12 14:58:04 +01:00
2a157f32ec Added animation, still needs optimizationgit st 2022-06-12 15:23:20 +02:00
aea4533893 Merge pull request #335 from bobbycar-graz/update-configs 2022-06-12 14:22:50 +01:00
039b97e5c1 Updated sdkconfigs 2022-06-12 15:16:08 +02:00
5288efe0ef Merge pull request #329 from bobbycar-graz/update_submodules 2022-05-30 18:43:08 +02:00
f29f8308d1 Fix for @0xFEEDC0DE64 2022-05-30 18:22:30 +02:00
ed149bf287 Updated sdkconfigs 2022-05-30 15:39:17 +02:00
4ac8896591 Updated script 2022-05-30 15:39:02 +02:00
89e5428af2 Updated to work with removal of Arduino.h 2022-05-30 15:34:27 +02:00
7bb09e4085 Still dont know what this is 2022-05-30 15:34:10 +02:00
4ccfc4340a Updated idf 2022-05-30 15:33:01 +02:00
6a189e2d06 Updated submodules 2022-05-30 15:32:53 +02:00
ab02a1c437 Merge pull request #328 from bobbycar-graz/remote-fixes 2022-05-27 16:47:13 +02:00
f4ac629823 Added remote control settings for changing model mode 2022-05-27 16:37:06 +02:00
5f4627ffb9 Moved into cpp 2022-05-27 16:36:51 +02:00
f7def7cf2c Merge pull request #278 from bobbycar-graz/qr 2022-05-26 19:41:04 +02:00
86cae5d564 Made some changes, +1 is a workarround 2022-05-26 19:27:25 +02:00
5bba53bfb9 Merge pull request #325 from bobbycar-graz/hidden-ssid 2022-05-25 03:23:57 +02:00
5eac6fd671 Added hidden ssid parameter 2022-05-25 03:11:21 +02:00
840c43ef0e Merge pull request #324 from bobbycar-graz/refactoring 2022-05-25 03:07:57 +02:00
3c10185e5e Added git menu 2022-05-25 03:02:06 +02:00
b6be6e6a83 Added git icon 2022-05-25 03:01:58 +02:00
30832a42f7 Removed unnecessarily complicated popup 2022-05-25 01:56:20 +02:00
c90ad518c5 Replaced 99.999% of switchScreen with Push/Pop 2022-05-25 01:40:56 +02:00
a5bfab2df7 Updated gui lib 2022-05-25 01:40:32 +02:00
349ffafedf Merge pull request #322 from bobbycar-graz/update-submodules 2022-05-21 14:05:45 +02:00
a3a7868988 Updated some submodules 2022-05-21 13:50:57 +02:00
8c0addd600 Merge pull request #321 from bobbycar-graz/fix-mick-mode
Fix mick mode
2022-05-20 16:53:22 +02:00
884ac87314 Fix mick mode 2022-05-19 18:35:21 +02:00
b7b86a5e8a Merge pull request #320 from bobbycar-graz/about-menu
Fixed a few menu items from about menu
2022-05-16 00:20:00 +02:00
9190cb6634 Fixed a few menu items from about menu 2022-05-16 00:11:04 +02:00
3818e50eab Merge pull request #311 from bobbycar-graz/update_submodules
BLE Works again!
2022-05-15 23:48:00 +02:00
5f27748675 Somehow the bobbycar was blue since like forever 2022-05-15 23:42:24 +02:00
367907d432 Added reboot key 2022-05-15 23:42:04 +02:00
873e3a027a Switch back to old version 2022-05-15 23:31:08 +02:00
230a9614d9 Updated rebased files to new submodules 2022-05-15 23:28:32 +02:00
304b7225df Added sdkconfig update helper 2022-05-15 23:27:30 +02:00
f9760528ca Updated sdkconfigs 2022-05-15 23:27:06 +02:00
d692f0261c Updated submodules again 2022-05-15 23:14:58 +02:00
4c7e438c18 Added fix for 'Mir egal ob die lokalzeit richtig is' 2022-05-15 23:14:58 +02:00
d277202fa3 Updated sdkconfigs 2022-05-15 23:14:58 +02:00
ed4444ad93 Wrong direction ledstrip 2022-05-15 23:14:58 +02:00
ee294392fc Fixes for normal bobbycars 2022-05-15 23:14:57 +02:00
91880608dc Fixed project for new submodules 2022-05-15 23:14:55 +02:00
84a1cd40e9 Added executable flag 2022-05-15 23:13:58 +02:00
71624b99b6 Added helper script 2022-05-15 23:13:58 +02:00
e9de923224 Merge pull request #315 from bobbycar-graz/esp-now-blinker 2022-05-15 23:12:24 +02:00
4b8848d464 Fixed blink (debugging via keyboard) 2022-05-15 23:12:12 +02:00
a58a8d1344 Modified blinker message 2022-05-15 23:02:12 +02:00
8c884c0b4e Added anhaenger id; everything should work now 2022-05-15 23:02:10 +02:00
950d46b109 Added bobby blinker for esp now 2022-05-15 22:58:50 +02:00
4540a2afbf Merge pull request #318 from bobbycar-graz/new-boardcomputer 2022-05-15 22:58:02 +02:00
1268887c37 Fixes 2022-05-15 22:50:39 +02:00
143a3d37e6 Added config to CI 2022-05-15 22:49:36 +02:00
e7ac8b47e3 Removed # 2022-05-15 22:42:24 +02:00
d85a67c05b Added debugging, fixed for loop 2022-05-12 14:31:12 +02:00
f5a7f9bcbe Forgot to add the config params to the list 2022-05-12 14:30:54 +02:00
1a1882d825 In the process of adding new boardcomputer 2022-05-12 02:37:01 +02:00
efb593c8aa Merge pull request #313 from bobbycar-graz/gernot_config
Eini mit der gernot config
2022-04-26 10:24:00 +02:00
d47bd7f095 Weniger abgefucked 2022-04-25 20:47:07 +02:00
5043788aef Add gernot config 2022-04-25 20:25:31 +02:00
4f6b98a27b Merge pull request #310 from bobbycar-graz/push_pop_menus 2022-04-23 17:03:38 +02:00
cf14e94647 Oida was geht ab 2022-04-23 16:50:12 +02:00
f188b42987 keine ahnung was 2022-04-23 16:09:35 +02:00
78d8255b62 Update submodules and implement lots of new push/pop screens 2022-04-23 16:09:35 +02:00
d40f5e71a4 More and more push pop implementations 2022-04-23 16:09:35 +02:00
e4b8622fed More push pops again 2022-04-23 16:09:35 +02:00
c0f911ce05 More push pop screens 2022-04-23 16:09:35 +02:00
c18403a30f Push/Pop screens 2022-04-23 16:09:35 +02:00
b9cb7835a1 Merge pull request #309 from bobbycar-graz/fix_gitmodules
Fix gitmodules
2022-04-23 16:03:36 +02:00
e8217bb038 Anoter fix for .gitmodules 2022-04-23 15:55:10 +02:00
0bef65c4d0 Fix .gitmodules for private 2022-04-23 15:55:10 +02:00
9f36056177 Merge pull request #308 from bobbycar-graz/fix-seatbot 2022-04-23 15:54:14 +02:00
1f6eb46771 Fixed seatbot 2022-04-23 15:45:38 +02:00
c0f8197262 Merge pull request #305 from bobbycar-graz/ledstrip-animations
Ledstrip animations
2022-04-22 23:16:59 +02:00
d5e863eb6b Cleanups 2022-04-22 22:54:29 +02:00
48f9e32cd4 New fancy SpeedOMeter 2022-04-19 09:12:40 +02:00
eb3e1862b2 Moved to unsigned (Bugfix) 2022-04-18 16:45:11 +02:00
936408a17a Fixed snake animation 2022-04-18 16:39:47 +02:00
5ad64d81d0 Cleanups 2022-04-18 15:04:05 +02:00
989da449b0 Snake Animation: Speedsync and animation multiplier 2022-04-18 14:18:17 +02:00
e20176f3ad New Animations: Snake, Efficiency 2022-04-18 13:29:35 +02:00
39500ef59c Merge pull request #304 from bobbycar-graz/sunrise-fix 2022-04-17 13:49:21 +02:00
673e304641 Fixed sunrise when no time is detected 2022-04-17 13:32:45 +02:00
b3e30780a1 Merge pull request #301 from bobbycar-graz/fixes 2022-04-08 18:28:00 +02:00
4765b97a70 Added some features 2022-04-08 18:19:24 +02:00
c7ca2846c7 Nobody knows what this is 2022-04-08 18:10:06 +02:00
15108bf277 Merge pull request #300 from bobbycar-graz/updated-toolchain 2022-04-08 17:59:59 +02:00
f2f479e1a6 Updated tools for new idf 2022-04-08 17:45:16 +02:00
7be54d20c8 Merge pull request #294 from bobbycar-graz/mick-mode-safety 2022-04-03 23:22:47 +02:00
3bd0a4b010 Add lots of safety checks to mick mode 2022-04-03 22:27:44 +02:00
255d09b06e Merge pull request #284 from bobbycar-graz/update_submodules 2022-04-03 22:26:49 +02:00
41a39be51f Fixes for new idf 2022-04-03 22:05:03 +02:00
562554f6d6 Fix compontent errors 2022-04-03 21:37:34 +02:00
8310fe64c9 Updated idf again 2022-04-03 21:09:56 +02:00
d77390e521 Updated idf 2022-04-03 21:09:56 +02:00
33731a5408 Updated submodules 2022-04-03 21:09:56 +02:00
c7a8f5e974 Forgot to add install for sonarcloud 2022-04-03 21:09:56 +02:00
3b4b117219 Added install script for idf 2022-04-03 21:09:56 +02:00
d1c0497dc2 Updated submodules once again 2022-04-03 21:09:56 +02:00
4617f5f26d Merge pull request #299 from bobbycar-graz/nightlight 2022-04-01 15:50:12 +02:00
886a5f32e5 Improved performance 2022-04-01 15:42:24 +02:00
f236d4bf03 Merge pull request #298 from bobbycar-graz/nightlight
Turn on lights when dark
2022-03-30 14:35:38 +02:00
1040ebe4a1 Added sunrise text, fixed timezone 2022-03-27 19:07:55 +02:00
c7573b90a6 Sonarcloud fixes 2022-03-26 20:19:06 +01:00
56996b50a1 Added automated light 2022-03-26 20:17:27 +01:00
48cfe3edbc Updated submodules 2022-03-26 19:11:02 +01:00
0b17b4ffd1 Added header to ledstrip 2022-03-26 19:09:47 +01:00
b75af48353 Added sunset library 2022-03-26 18:44:20 +01:00
7664e409d4 Added timepoint validator 2022-03-26 17:03:12 +01:00
3bbc916348 Merge pull request #293 from bobbycar-graz/mick-mode
Add mick mode
2022-03-25 10:24:07 +01:00
631eb0edad Add mick mode 2022-03-25 03:27:00 +01:00
5bdb0fabce Merge pull request #292 from bobbycar-graz/fix-mick-config 2022-03-24 23:16:39 +01:00
2e57c93252 Fix mick config 2022-03-24 23:05:44 +01:00
924d35ee6a Merge pull request #291 from bobbycar-graz/hupen-update 2022-03-24 23:04:48 +01:00
7db77cc25b Fixed typo 2022-03-24 22:59:31 +01:00
8a670cf608 Implemented buttonReleased() 2022-03-24 22:45:57 +01:00
ce9d9d840b fixed namespace 2022-03-24 22:13:39 +01:00
e7730d0a20 Implemented the hupe 2022-03-24 22:09:51 +01:00
8c69ab02d5 Merge pull request #290 from bobbycar-graz/can-fixes 2022-03-24 20:59:42 +01:00
37961639d1 Fixed can fix 2022-03-24 20:51:29 +01:00
5f23b8dec5 Merge pull request #288 from bobbycar-graz/can-fixes 2022-03-24 17:19:57 +01:00
64a7ac0018 Fixed nvs key 2022-03-23 20:07:04 +01:00
2c339b9273 Changed to debug log 2022-03-23 20:06:55 +01:00
19ea4ebec9 Added fix for canbus 2022-03-23 19:51:35 +01:00
7ad56840be Merge pull request #287 from bobbycar-graz/ci-fixes 2022-03-22 23:08:44 +01:00
c284ac9416 Wrong key 2022-03-22 22:39:54 +01:00
813abbefd6 Ignore failure of sonar scanner, we want green checks! 2022-03-22 22:37:12 +01:00
605cd12c8b Merge pull request #283 from bobbycar-graz/error-handling 2022-03-04 22:19:51 +01:00
81d467e69f Some battery graph fixes 2022-03-04 22:14:41 +01:00
bda9707638 Cleanup 2022-03-04 21:54:07 +01:00
af255ec098 Error handling for build selection 2022-03-04 21:49:33 +01:00
e4daf6cf3c Merge pull request #279 from bobbycar-graz/battery-graph 2022-03-04 21:38:31 +01:00
e40253c70f Fixed everything 2022-03-04 21:30:13 +01:00
a222d68264 Implemented float_map, but result is unexpected (see batterygraphdisplay.cpp:33) 2022-03-04 16:16:28 +01:00
177220df6b Added float map (might need debugging) 2022-03-04 16:16:28 +01:00
cb1065ccb4 More changes for battery graph 2022-03-04 16:16:28 +01:00
b48a40742e Added basic percentage display 2022-03-04 16:16:28 +01:00
7f6fa967c8 Added some more code 2022-03-04 16:16:28 +01:00
73d01e8516 Added functions to get the count of known battery points 2022-03-04 16:16:28 +01:00
9dc4ff7d4e Reworked battery curves 2022-03-04 16:16:26 +01:00
11a461bfdd Added basic battery graph display 2022-03-04 16:14:47 +01:00
689d7221a1 Merge pull request #282 from bobbycar-graz/confiscation-mode-port 2022-03-04 16:14:18 +01:00
c3cf4a74b0 Added calculation of megajoules 2022-03-02 15:09:44 +01:00
e7379fd3df Fixed linking error 2022-03-02 14:44:07 +01:00
080ba7dfe0 Add new confiscation mode screen 2022-03-02 14:40:07 +01:00
89f1a0b7a3 Merge pull request #280 from bobbycar-graz/gui-lib-update 2022-02-28 19:31:24 +01:00
4bc93579fb Updated gui lib 2022-02-28 19:17:36 +01:00
1564820f24 Merge pull request #277 from bobbycar-graz/qr 2022-02-26 15:11:58 +01:00
a496c3ab49 Added function for wifi security 2022-02-26 14:58:41 +01:00
f98147295b Merge pull request #276 from bobbycar-graz/ap-qr 2022-02-24 22:46:11 +01:00
db898c38f5 Fixed #272: No dependency on GreenPassMenu 2022-02-24 22:40:21 +01:00
d15b974a21 Added qr code for ap credentials 2022-02-24 22:39:57 +01:00
ba0c0acef2 Merge pull request #274 from bobbycar-graz/qrcodes 2022-02-24 21:34:42 +01:00
401a1db42c Fixed request, better error handling 2022-02-24 21:29:13 +01:00
2e8feaf2b5 Replaced url 2022-02-24 20:34:57 +01:00
db4c76ef5c Automatically calculate qr version 2022-02-22 22:04:59 +01:00
3908772345 Merge pull request #273 from bobbycar-graz/can-fixes
Added fix for bus going offline
2022-02-22 21:33:21 +01:00
f627c8d993 Added more canbus fixes (crashes) 2022-02-21 20:41:39 +01:00
e6c3357788 Added fix for bus going offline 2022-02-21 20:41:22 +01:00
9bb26252c5 Merge pull request #271 from bobbycar-graz/pwmomat-fixes 2022-02-18 22:29:50 +01:00
cc591cebc2 Fixed reverse driving and improved disabling of pwmomat 2022-02-18 22:12:23 +01:00
7222211c08 Merge pull request #270 from bobbycar-graz/better-flags-menu 2022-02-18 21:54:58 +01:00
ca9cf65d66 Removed unused code 2022-02-18 21:46:36 +01:00
6b0260b2c5 Formatting 2022-02-18 21:45:30 +01:00
4db8690677 Fixed query functions 2022-02-18 18:56:20 +01:00
168baeac83 Changed some files 2022-02-18 01:21:54 +01:00
2adccba813 Merge pull request #267 from bobbycar-graz/better-tempomat 2022-02-14 22:51:06 +01:00
97c9ecec4d Added pwmomat 2022-02-14 22:43:32 +01:00
e17e7ba5f8 Fix FEATURE_LEDSTRIP crashing when turning on (uninitialized memory) 2022-02-14 22:27:50 +01:00
89779c4648 Removed unused code 2022-02-14 21:27:26 +01:00
ade3117303 Merge pull request #265 from bobbycar-graz/last-reboot-reason 2022-02-13 20:40:56 +01:00
ddc1b64b20 Implemented last reboot reason 2022-02-13 20:32:57 +01:00
887e55aa3d Merge pull request #264 from bobbycar-graz/fixes 2022-02-13 20:28:08 +01:00
b5aba26f9b Fixed wrong index 2022-02-13 16:38:23 +01:00
0f03c0f88b Merge pull request #261 from bobbycar-graz/fixes 2022-02-13 14:26:48 +01:00
1febc69583 Software fixes 2022-02-13 14:17:55 +01:00
fecdbc2944 Merge pull request #245 from bobbycar-graz/nvs-feature-flags 2022-02-13 02:26:44 +01:00
06f8bd2ac1 Forgot to add to config 2022-02-13 02:16:35 +01:00
d29514a167 Moved FEATURE_ESPNOW into config-system 2022-02-13 02:12:29 +01:00
fb0bed29bf Rename 2022-02-13 01:43:43 +01:00
25a6479887 Fixed sonarcloud 2022-02-13 01:23:53 +01:00
31a0b64377 Pretty-print strings 2022-02-13 01:06:23 +01:00
2033448f65 Fixed webserver locks 2022-02-13 01:05:02 +01:00
dbaf7ddc71 Fixed CI 2022-02-12 23:20:42 +01:00
72b7dc3826 Fixed all configs 2022-02-12 22:51:12 +01:00
377564ff34 Revert "Moved FEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET into config-system"
This reverts commit ccc8eb0e3601e0769988426f3f59713ff6071a61.
2022-02-12 22:51:12 +01:00
a66d48de7d Todo 2022-02-12 22:51:12 +01:00
eb8cacec5a Moved FEATURE_WEBSERVER into config-system 2022-02-12 22:51:12 +01:00
5e242eb098 Moved FEATURE_WEBSERVER into config-system 2022-02-12 22:51:12 +01:00
d202a5a350 Default wifi settings 2022-02-12 22:51:12 +01:00
5908e2c4ca Moved FEATURE_OTA into config-system 2022-02-12 22:51:12 +01:00
c4451bf1cb Moved FEATURE_BLE into config-system 2022-02-12 22:51:12 +01:00
55c9e4ac93 Moved FEATURE_BLE into config-system 2022-02-12 22:51:11 +01:00
21dfe01f0c Removed FEATURE_WIRELESS_CONFIG 2022-02-12 22:51:11 +01:00
55db6f4090 Fixed featureflagsmenu 2022-02-12 22:51:11 +01:00
bebdf0046e Forgot to remove namespace 2022-02-12 22:51:11 +01:00
dbabd70ad4 Implemented featureflags-menu 2022-02-12 22:51:11 +01:00
4a47deccb8 Moved FEATURE_NTP into config-system 2022-02-12 22:51:11 +01:00
18ba362d61 Fixed compiling for absolutely no features 2022-02-12 22:51:11 +01:00
7140e1baf9 Forgot to remove #endif 2022-02-12 22:51:11 +01:00
359facce64 Much needed config refactor 2022-02-12 22:51:09 +01:00
22896d0fb9 Much needed config refactor 2022-02-12 22:45:38 +01:00
3cab7f2cf7 Moved FEATURE_DNS_NS into config-system 2022-02-12 22:45:34 +01:00
3b5538363f Forgot to remove those SWITCH_BLINK 2022-02-12 22:40:09 +01:00
8a0f642324 Forgot to remove those FEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET 2022-02-12 22:40:09 +01:00
3ccccc81a9 Removed -DOLD_NVS; Implemented dump-nvs for new config system 2022-02-12 22:40:09 +01:00
777134eaf1 Removed unused defines 2022-02-12 22:40:08 +01:00
1411a8847c Moved LEDS_PER_METER into config-system 2022-02-12 22:40:08 +01:00
43c0f6e374 Added ledsPerMeter; Forgot to add custom colors 2022-02-12 22:40:08 +01:00
65308be33d Fix some sonarcloud issues 2022-02-12 22:40:08 +01:00
9890c9fb24 Moved FEATURE_CLOUD and FEATURE_UDPCLOUD into config-system 2022-02-12 22:40:08 +01:00
ffd98375cc Satisfying sonarcloud 2022-02-12 22:40:08 +01:00
7a551c14d0 Completly moved ledstrip custom colors into NVS 2022-02-12 22:40:08 +01:00
6f1633d713 Removed ledstrip_custom_colors (replaced with configwrapper) 2022-02-12 22:40:08 +01:00
8e3397c6e5 Added crgb conversion 2022-02-12 22:40:08 +01:00
c44e683941 Moved FEATURE_GARAGE into config-system 2022-02-12 22:40:08 +01:00
fa4aeac27d Added featureflags menu 2022-02-12 22:40:07 +01:00
1a5df4e877 Removed ledstrip define 2022-02-12 22:40:07 +01:00
9640b3fcd3 Formatting 2022-02-12 22:40:07 +01:00
2117be359c Moved FEATURE_LEDSTRIP into config-system 2022-02-12 22:40:07 +01:00
0415d90d1b Implemented Bobbytasks 2022-02-12 22:40:07 +01:00
1fe69c9161 Multiline-comments 2022-02-12 22:40:07 +01:00
144ff531a4 Removed macros; added ledstrip flag 2022-02-12 22:40:07 +01:00
bf42fe05f4 Moved FEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET and FEATURE_GSCHISSENE_DIODE into config-system 2022-02-12 22:40:07 +01:00
fc2d7c511e Moved FEATURE_GSCHISSENE_DIODE into config-system 2022-02-12 22:40:07 +01:00
d40cc5d71d Removed unused flag 2022-02-12 22:40:07 +01:00
9125a968d5 Moved FEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET into config-system 2022-02-12 22:40:06 +01:00
cb11ca3c9e Mick config & fixes (#260) 2022-02-12 18:07:34 +00:00
0d366881b2 Merge pull request #254 from bobbycar-graz/code-cleanup 2022-02-08 17:02:24 +01:00
e52cf82218 Converted menus to a better menu for typesafe enums 2022-02-08 16:49:04 +01:00
a87599c7ea Fixed iterate problem, now the config is the problem 2022-02-08 11:03:29 +01:00
3322120464 Made some changes to the menus, still needs to be fixed 2022-02-08 11:03:29 +01:00
f10cb18dc4 WIP: Custom typesafe enum menu 2022-02-08 11:03:29 +01:00
79f7efeaf9 Fixed some software bugs (#258) 2022-02-08 09:59:47 +00:00
62f91ae0a6 Merge pull request #257 from bobbycar-graz/espchrono-fixes 2022-02-06 19:20:14 +01:00
c589295e30 microseconds fixed 2022-02-06 19:14:44 +01:00
6fe397a103 Merge pull request #256 from bobbycar-graz/battery_he4
Added HE4 cell type
2022-02-06 19:12:24 +01:00
598f74f8a3 Added HE4 cell type 2022-02-06 17:38:02 +01:00
9ac7f3fdc7 Merge pull request #253 from bobbycar-graz/workflow-manual-trigger 2022-02-01 10:23:10 +01:00
ab85b87d29 Added manual trigger 2022-02-01 10:17:11 +01:00
3b45dc8b16 Merge pull request #252 from bobbycar-graz/update_submodules
Update submodules
2022-01-29 23:07:19 +01:00
28ebb57cf3 Fix seatbot 2022-01-29 21:58:10 +01:00
e187f2fa77 Fixed espnow rotz 2022-01-29 21:43:18 +01:00
6a1dfc3b91 Update submodules 2022-01-29 21:10:48 +01:00
3665ac1bd4 Merge pull request #250 from bobbycar-graz/profile-copy 2022-01-29 03:36:43 +01:00
8a1051d91b Finished menu to clear, swap and copy profiles 2022-01-29 03:28:40 +01:00
98ef64d82e Added profile reset functionallity 2022-01-28 19:24:56 +01:00
cfa278a4b1 Basic Menu for managing profiles 2022-01-27 18:02:42 +01:00
bc8cc945e3 Merge pull request #248 from bobbycar-graz/seatbot 2022-01-27 18:01:27 +01:00
e3640046c0 Refactored voltage readings 2022-01-27 01:09:52 +01:00
23e94b213f Added seatbot config 2022-01-26 18:21:59 +01:00
fef3c2d5af Table is still alive 2022-01-26 18:21:59 +01:00
62987cb374 Es funzt jetzt 2022-01-26 18:21:59 +01:00
8bbb098945 Removed copyFromSettings(); Added deadband 2022-01-26 18:21:59 +01:00
003e961c19 SDK-Config 2022-01-26 18:21:59 +01:00
976fc7cf2f Added ifdef 2022-01-26 18:21:58 +01:00
44293a7a32 Added newline 2022-01-26 18:21:58 +01:00
25a0077b88 Fixed code formatting 2022-01-26 18:21:58 +01:00
5d4bd322dc Added some ifdefs 2022-01-26 18:21:58 +01:00
eed2ee4b23 Wheelchair 2022-01-26 18:21:58 +01:00
299729a272 Added seatbot stuff 2022-01-26 18:21:58 +01:00
4d61959c5b Merge pull request #237 from bobbycar-graz/more-statistics 2022-01-26 18:19:42 +01:00
b27cf645e6 Forgot to actually use EstimatedKmLeft 2022-01-26 18:10:26 +01:00
bc340a3319 Implemented remaining estimate km left 2022-01-26 18:10:26 +01:00
d8c97d7f20 Added avg speed over time 2022-01-26 18:10:26 +01:00
40918ec32a Merge pull request #233 from bobbycar-graz/statusdisplay-fix 2022-01-26 18:09:56 +01:00
5a034278f4 Added fix for labels 2022-01-17 09:50:39 +01:00
e23de353aa Merge pull request #243 from bobbycar-graz/can_recovery_action
Added can recovery menu action
2022-01-15 16:44:40 +01:00
4ea3550d54 Added can recovery menu action 2022-01-15 16:32:08 +01:00
c3d364365a Merge pull request #242 from bobbycar-graz/can-debug
More can debug options
2022-01-14 12:04:22 +01:00
5b132cbac3 More can debug options 2022-01-14 11:58:24 +01:00
e611ac0b6d Merge pull request #241 from bobbycar-graz/update-badges 2022-01-14 08:34:01 +01:00
395f7a1829 Updated badges 2022-01-14 08:22:54 +01:00
9ffc85ddec Merge pull request #240 from bobbycar-graz/update_submodules
Update submodules and esp-idf
2022-01-13 22:17:02 +01:00
6d30549264 Updated submodules 2022-01-13 22:03:12 +01:00
f1b4ef9b06 Merge pull request #228 from bobbycar-graz/ci-refactoring 2022-01-13 14:07:02 +01:00
8b91e63f47 Removed 'github does not support ifs' 2022-01-13 13:54:36 +01:00
940c076977 Forgot to download cache 2022-01-13 11:06:14 +01:00
2f13a1b8b1 Combined analysis 2022-01-13 10:54:52 +01:00
592974935e Forgot pipe symbol 2022-01-13 09:58:10 +01:00
9421847f9b test 2022-01-10 08:28:18 +01:00
e6ab721546 Keine ahnung wie viel ich gemacht hab 2022-01-10 08:28:18 +01:00
626d44894d Smaller fixes in workflow.yml 2022-01-10 08:28:18 +01:00
9992bc7286 Fixed wrong build wrapper ouput dir in workflow.yml 2022-01-10 08:28:18 +01:00
11972b31dd Completely refactored CI workflow 2022-01-10 08:28:17 +01:00
27e6ff0c67 Merge pull request #235 from bobbycar-graz/fix-typo 2022-01-10 08:26:52 +01:00
1a5d1e7af5 Copy paste error 2022-01-10 08:16:16 +01:00
d5f4e1a9a2 Merge pull request #232 from bobbycar-graz/statusdisplay-blinker 2022-01-05 02:51:44 +01:00
bd8c32b856 added if-def 2022-01-05 02:47:42 +01:00
6f7fb5817d Added blinker visualization 2022-01-05 02:40:57 +01:00
eaa2951845 Merge pull request #231 from bobbycar-graz/quickaction_wifi_scan
add wifi scan for quick action
2022-01-05 02:17:59 +01:00
a5e41c44a9 add wifi scan for quick action 2022-01-05 02:09:25 +01:00
6b42f5093c Merge pull request #230 from bobbycar-graz/better-quick-actions 2022-01-05 01:31:44 +01:00
10501dacf6 Added quick action select display 2022-01-05 01:21:42 +01:00
280263c145 Sort & added main/bobbyquickactions 2022-01-04 23:35:11 +01:00
64adfc6cb3 Merge pull request #229 from bobbycar-graz/cleanup 2022-01-04 22:25:33 +01:00
508134f0da Fixed actions 2022-01-04 22:15:05 +01:00
dc33a88316 Fixed labels 2022-01-04 22:11:45 +01:00
a0254e36bf Added labels for percentages 2022-01-04 21:18:49 +01:00
802d91deb9 Added display for dBm (wifi) 2022-01-04 21:17:56 +01:00
215061d721 Added saving boot-battery-wh 2022-01-04 21:16:33 +01:00
a3957d0514 Commented out heap debug code; Added saving boot-battery-wh 2022-01-04 21:16:06 +01:00
795a46e54d Code cleanup 2022-01-04 19:13:20 +01:00
dc15d48f36 bleSettings.enable did not show up in webserver 2022-01-04 19:11:47 +01:00
ce3885b7e0 Merge pull request #227 from bobbycar-graz/fix-candebugmenu-old-idf
Fix CanDebugMenu for old IDF
2022-01-04 03:01:51 +01:00
68b15c0dbe Fix CanDebugMenu for old IDF 2022-01-04 02:53:23 +01:00
78512b17dc Merge pull request #226 from bobbycar-graz/can-debug-menu
Add CanDebugMenu
2022-01-04 02:44:49 +01:00
914a1dc60c Add CanDebugMenu 2022-01-04 02:39:22 +01:00
0c77d459a5 Merge pull request #225 from bobbycar-graz/cleanups
Cleanups
2022-01-04 01:06:11 +01:00
f7f9c180af Cleanups 2022-01-04 00:56:07 +01:00
5ed4146341 Merge pull request #224 from bobbycar-graz/gschissenes-std-optional 2022-01-03 23:57:19 +01:00
03aeee7a22 Umgebaut 2022-01-03 23:48:46 +01:00
c8e36dda17 Merge pull request #223 from bobbycar-graz/sdkconfig 2022-01-03 23:31:46 +01:00
5f9638449a Reenabled timezones 2022-01-03 23:22:16 +01:00
1a5ed56788 Merge pull request #222 from bobbycar-graz/new_idf
Updat to newest idf
2022-01-03 23:11:00 +01:00
515c373827 Updated newest idf 2022-01-03 22:53:53 +01:00
c0178f2026 Merge pull request #221 from bobbycar-graz/webserver-newsettings-enum-types
Webserver newsettings enum types
2022-01-03 22:15:54 +01:00
d0a4ac2d4c Webserver newsettings add support for LedstripAnimation 2022-01-03 22:09:43 +01:00
6498723c4d Webserver newsettings add support for HandbremseMode 2022-01-03 22:09:43 +01:00
bc83dc5b5a Webserver newsettings add support for OtaAnimationModes 2022-01-03 22:09:43 +01:00
8579dd1ca8 Merge pull request #220 from bobbycar-graz/fix-ledstrip
Fixed ledstrip animationType
2022-01-03 22:08:08 +01:00
a3e719bd81 Fixed ledstrip animationType 2022-01-03 22:04:43 +01:00
64a6c14d82 Merge pull request #219 from bobbycar-graz/fix-qr
Fix qr import
2022-01-03 22:04:13 +01:00
2bad15978d Fixed qr import 2022-01-03 21:55:07 +01:00
7e5f9b53ad Merge pull request #218 from bobbycar-graz/shit-fix
Shit config fix (indentations, other small changes)
2022-01-03 21:26:40 +01:00
6c251fc566 Shit fix 2022-01-03 21:17:31 +01:00
bdbfde6868 Merge pull request #217 from bobbycar-graz/debug-text 2022-01-03 18:25:45 +01:00
483b5ee4e3 Added debug text for can resets 2022-01-03 18:16:48 +01:00
41b54a2a5f Removed include (#216) 2022-01-03 16:45:52 +00:00
2f0f5357ad Merge pull request #215 from bobbycar-graz/update-libs
Update libs
2022-01-03 17:36:57 +01:00
2dce835d17 Update libs 2022-01-03 17:30:40 +01:00
b3ed07aad1 Merge pull request #211 from bobbycar-graz/more-config-updates 2022-01-03 17:27:04 +01:00
4298710f19 Renamed settings into profileSettings 2022-01-03 17:13:45 +01:00
6e224443c3 Removed hybrid mode 2022-01-03 15:05:37 +01:00
0eb3165216 Moved settings.savedStatistics, settings.handbremse and settings.espnow 2022-01-03 03:28:05 +01:00
da10c84210 Moved settings.lockscreen 2022-01-03 03:03:40 +01:00
eed4f541ec Moved settings.battery 2022-01-03 01:31:48 +01:00
7466a2c3d2 Fixed ledstrip compiling 2022-01-03 00:52:32 +01:00
55496ce87f Removed ledstrip length 2022-01-03 00:52:15 +01:00
654bed2827 Fixed compiling 2022-01-03 00:40:27 +01:00
afe7201d00 Fixed linking 2022-01-03 00:33:14 +01:00
691363129b initial try of custom type in config lib 2022-01-03 00:08:34 +01:00
ade2da7fd2 Readded queue 2022-01-03 00:07:46 +01:00
7f924d8cc2 Moved settings.ledstrip 2022-01-02 22:43:33 +01:00
d276cadc33 Removed wrong file 2022-01-02 22:08:12 +01:00
97d14fda0e Fixed cloud 2022-01-02 21:12:57 +01:00
7c1efb1342 Removed presets menu 2022-01-02 17:17:38 +01:00
116f343523 transfered settings.boardcomputerHardware, settings.cloudSettings and udpCloudSettings 2022-01-02 16:28:31 +01:00
37336d70e5 Oida weg damit 2022-01-02 16:28:31 +01:00
45cd8903df transfered settings.bleSettings and settings.controllerHardware 2022-01-02 16:28:30 +01:00
a4a530b2a3 Merge pull request #213 from bobbycar-graz/feedc0de_fixes
Fix feedc0de config
2022-01-02 16:16:42 +01:00
b9bc5806ed Fix feedc0de config 2022-01-02 16:08:52 +01:00
911a843a39 Merge pull request #210 from bobbycar-graz/esp-now-cleanup 2022-01-01 20:05:40 +01:00
cdf4d6d5ae Removed queue 2022-01-01 19:59:49 +01:00
702e4a7f41 Added can option in menudisplay 2022-01-01 19:58:19 +01:00
e5ac773e39 Merge pull request #209 from bobbycar-graz/cleanup 2022-01-01 17:39:43 +01:00
ba92deb4a9 cleanups 2022-01-01 17:32:08 +01:00
048e1d9482 Merge pull request #208 from bobbycar-graz/extra-button-calibration 2022-01-01 17:25:50 +01:00
e2547867b3 Darker color 2022-01-01 17:13:16 +01:00
0bd64fd40e Added display to calibrate other buttons 2022-01-01 17:03:05 +01:00
607e6ef2c2 Removed back button to enable spamming until this screen (quick back) 2022-01-01 15:02:45 +01:00
bde4524086 Merge pull request #207 from bobbycar-graz/icon-updates 2021-12-31 18:48:35 +01:00
2c91b399b5 Removed background 2021-12-31 18:41:25 +01:00
dca82df270 Merge pull request #205 from bobbycar-graz/button-calibrate
Removed InputDispatcher, add lots of more changevaluedisplays for wifi
2021-12-31 18:28:49 +01:00
3081fc553b Button calibrate menu item 2021-12-31 18:24:11 +01:00
0288ac93a3 Calibrate display save button configs 2021-12-31 18:24:11 +01:00
97c12b103c Basic button calibration implementation 2021-12-31 18:24:11 +01:00
e8a4a9f4b8 Add button calibrate display 2021-12-31 18:24:11 +01:00
0a35bfb77d Remove dpad debug displays 2021-12-31 18:24:11 +01:00
b1de1de93a Removed InputDispatcher, add lots of more changevaluedisplays for wifi 2021-12-31 18:24:11 +01:00
973fb66985 Merge pull request #206 from bobbycar-graz/new-icons 2021-12-30 21:38:23 +01:00
c2a5044667 Finally added missing icons 2021-12-30 21:31:07 +01:00
8619dfff1f Merge pull request #204 from bobbycar-graz/new-changevaluedisplays
New changevaluedisplays
2021-12-30 03:57:48 +01:00
e1a44e0138 Smaller changes 2021-12-30 03:50:43 +01:00
7536e1be9a Quick fix with plugins 2021-12-30 03:23:54 +01:00
f099d15707 Huge refactoring 2021-12-30 03:17:30 +01:00
d5b9c1142f Checkboxes now show an error message if saving fails 2021-12-30 00:57:53 +01:00
81701b4096 String inputs in webserver implemented 2021-12-30 00:00:31 +01:00
68e8c9ea4a Added string inputs for ap ssid and key 2021-12-29 22:54:44 +01:00
4a37f53929 Merge pull request #203 from bobbycar-graz/input-refactorings
Input reafactorings
2021-12-29 22:32:07 +01:00
da1927776e All change value displays now have a confirm and errorOccured 2021-12-29 22:26:44 +01:00
4b9a36f507 Implemented error handler in ChangeValueDisplays 2021-12-29 21:53:47 +01:00
855dbca1ca Again too many improvements 2021-12-29 21:14:13 +01:00
3cd17b6479 More settings refactorings 2021-12-29 21:14:13 +01:00
9540898ced Lots of improvements with newsettings 2021-12-29 21:14:13 +01:00
f50f6eaf1e ADC calib in newsettings 2021-12-29 21:14:13 +01:00
bce81b363b Merge pull request #201 from bobbycar-graz/ledsync 2021-12-29 20:34:10 +01:00
96c22bb2e6 Added syncing 2021-12-29 20:21:51 +01:00
94b47df7dd Merge pull request #202 from bobbycar-graz/more-configs-in-newsettings
Remove string settings
2021-12-29 16:14:32 +01:00
535e643c24 Removed stringSettings completely 2021-12-29 16:07:59 +01:00
aeb89a8d96 moved time related settings into newsettings 2021-12-29 15:49:52 +01:00
2c1aca079f Moved otaServerUrl and otaServerBranch into newsettings 2021-12-29 15:29:48 +01:00
6138c187f4 Moved ota username into newsettings 2021-12-29 15:19:44 +01:00
47233e5ad6 Moved dns announce related stuff into newsettings 2021-12-29 15:12:29 +01:00
e1066f4eae Merge pull request #200 from bobbycar-graz/more-configs-in-newsettings
Move more configs into newSettings
2021-12-29 06:30:51 +01:00
4e1943dbc8 Moved webserverPassword into newSettings 2021-12-29 06:19:09 +01:00
b013bbd693 Merge pull request #199 from bobbycar-graz/more-configs-in-newsettings
Move more configs into newsettings
2021-12-29 06:05:47 +01:00
1aa556dca1 Moved otaUrl into newSettings 2021-12-29 06:00:48 +01:00
c025001d86 Moved udpCloudHost into newSettings 2021-12-29 05:51:49 +01:00
c7fb30a870 Moved cloudUrl into newsettings 2021-12-29 05:42:08 +01:00
3b73865000 Merge pull request #197 from bobbycar-graz/esp_now_substr_fix
fix substr of esp now receive
2021-12-29 05:41:22 +01:00
dfd2f45828 Merge branch 'master' into esp_now_substr_fix 2021-12-29 05:38:16 +01:00
d9f41eb016 Merge pull request #198 from bobbycar-graz/fix_can_reset_counter
Fix can reset counter
2021-12-29 05:36:51 +01:00
6f1a69432d Merge branch 'master' into esp_now_substr_fix 2021-12-29 05:31:43 +01:00
23c5393ca7 Merge branch 'master' into fix_can_reset_counter 2021-12-29 05:31:38 +01:00
66f5ed4137 fix substr of esp now receive 2021-12-29 05:29:36 +01:00
8de0c1309a Merge pull request #196 from bobbycar-graz/webserver_newsettings_reset
Add reset option to webserver newSettings
2021-12-29 05:25:25 +01:00
d8219a7bcf Merge pull request #195 from bobbycar-graz/enable_feedc0de_udp_cloud
Add UDP cloud to feedc0de config
2021-12-29 04:59:03 +01:00
d2fe70fbe4 Add reset option to webserver newSettings 2021-12-29 04:52:33 +01:00
aa3552e3b4 Add UDP cloud to feedc0de config 2021-12-29 04:51:36 +01:00
a5831c2ab6 improve can bus logging 2021-12-29 04:41:10 +01:00
412d82caeb can bus error count fix 2021-12-29 04:36:22 +01:00
a8a28081d6 Merge pull request #193 from bobbycar-graz/fixed-newsettings
Co-authored-by: Peter Pötzi <peter.poetzi@gmail.com>
2021-12-29 04:09:37 +01:00
23736348d3 Fixed newsettings 2021-12-29 04:04:11 +01:00
29c2dc7f1d Moved into newsettings 2021-12-29 04:04:10 +01:00
e74bb68456 Merge pull request #194 from bobbycar-graz/fix_can_reset
Fix can reset
2021-12-29 04:02:38 +01:00
1fe9ff26a6 improve can reset 2021-12-29 03:57:22 +01:00
4b5c2a2be1 Merge pull request #192 from bobbycar-graz/buzzer-newsettings
Moved buzzer settings into newSettings
2021-12-29 03:46:18 +01:00
eedecad2a0 Moved buzzer settings into newSettings 2021-12-29 03:32:01 +01:00
309e829f1f Merge pull request #190 from bobbycar-graz/feature_canbus_reset
feature can bus reset on error
2021-12-29 03:18:54 +01:00
189535b059 feature can bus reset on error 2021-12-29 03:11:31 +01:00
b9c48fe886 Merge pull request #189 from bobbycar-graz/new-wifi-menu
Add new WiFi menu
2021-12-29 02:39:38 +01:00
6ce5ca3927 Add action to delete wifi config 2021-12-29 02:36:14 +01:00
3f6eeca8d6 Add new WiFi menu 2021-12-29 02:13:10 +01:00
86e5e9cf0e Merge pull request #188 from bobbycar-graz/new-wifi-config
Wifi from new settings
2021-12-29 01:05:17 +01:00
4f665bc6fb Fixed compilation 2021-12-29 00:53:06 +01:00
67249cfb2f Wifi from new settings 2021-12-29 00:40:05 +01:00
446 changed files with 26585 additions and 12501 deletions

View File

@ -1,89 +0,0 @@
name: Analysis
on:
push:
release:
types:
- created
# pull_request:
# types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
env:
SONAR_SCANNER_VERSION: 4.4.0.2170
SONAR_SERVER_URL: "https://sonarcloud.io"
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
SONAR_CACHE_DIR: sonar_cache
environment: Analysis
strategy:
fail-fast: false
matrix:
node: [allfeatures]
name: ${{ matrix.node }}
steps:
- name: Checkout (without submodules)
uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11 (for Sonar)
uses: actions/setup-java@v1
with:
java-version: 11
- name: Download and set up sonar-scanner
env:
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
run: |
mkdir -p $HOME/.sonar
curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
- name: Download and set up build-wrapper (for Sonar)
env:
BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-linux-x86.zip
run: |
curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }}
unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
echo "$HOME/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH
- name: Checkout and install esp-idf
uses: 0xFEEDC0DE64/checkout_install_esp_idf@main
- name: Fast Submodule Checkout components/arduino-esp32
uses: 0xFEEDC0DE64/fast_submodule_checkout@main
with:
submodule: components/arduino-esp32
- name: Checkout remaining submodules
run: git submodule update --init --recursive $(git submodule | awk '{ if ($2 != "esp-idf" && $2 != "components/arduino-esp32") print $2 }')
- name: Setup ccache
uses: 0xFEEDC0DE64/setup_ccache@main
with:
key: ${{ runner.os }}-ccache-${{ matrix.node }}
- name: Build firmware
run: |
export CCACHE_MAXSIZE=400M CCACHE_BASEDIR="$(pwd)"
. export.sh
./switchconf.sh ${{ matrix.node }}
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} idf.py --ccache build
ccache -s
- name: Cache sonar
uses: 0xFEEDC0DE64/cache-with-update@update-cache-on-cachehit
with:
path: ${{ env.SONAR_SERVER_URL }}
key: ${{ runner.os }}-sonar-${{ matrix.node }}
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.cfamily.cache.path="${{ env.SONAR_CACHE_DIR }}"

View File

@ -1,67 +0,0 @@
name: Build
on:
push:
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
environment: Userconfigs
strategy:
fail-fast: false
matrix:
node: [feedc0de, comred, peter, mick, nofeatures] # allfeatures not used here
name: ${{ matrix.node }}
steps:
- name: Checkout (without submodules)
uses: actions/checkout@v2
- name: Checkout and install esp-idf
uses: 0xFEEDC0DE64/checkout_install_esp_idf@main
- name: Fast Submodule Checkout components/arduino-esp32
uses: 0xFEEDC0DE64/fast_submodule_checkout@main
with:
submodule: components/arduino-esp32
- name: Checkout remaining submodules
run: git submodule update --init --recursive $(git submodule | awk '{ if ($2 != "esp-idf" && $2 != "components/arduino-esp32") print $2 }')
- name: Setup ccache
uses: 0xFEEDC0DE64/setup_ccache@main
with:
key: ${{ runner.os }}-ccache-${{ matrix.node }}
- name: Unpack ignore folder
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
run: |
tools/bobby-decrypt
- name: Build firmware
run: |
export CCACHE_MAXSIZE=400M CCACHE_BASEDIR="$(pwd)"
. export.sh
./switchconf.sh ${{ matrix.node }}
idf.py --ccache build
ccache -s
- name: Set outputs
id: vars
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- name: Upload Build Artifact
uses: actions/upload-artifact@v2.2.4
with:
name: bobbyquad_${{ matrix.node }}
path: |
build_${{ matrix.node }}/bobbyquad_${{ matrix.node }}.bin
build_${{ matrix.node }}/bobbyquad_${{ matrix.node }}.elf
build_${{ matrix.node }}/bootloader/bootloader.bin
build_${{ matrix.node }}/bootloader/bootloader.elf
build_${{ matrix.node }}/partition_table/partition-table.bin

363
.github/workflows/workflow.yml vendored Normal file
View File

@ -0,0 +1,363 @@
name: CI
on:
workflow_dispatch:
push:
release:
types:
- created
# pull_request:
# types: [opened, synchronize, reopened]
jobs:
checkout:
runs-on: ubuntu-latest
name: Checkout (with submodules)
steps:
- name: Cache repository
uses: actions/cache@v2
id: cache-repository
with:
path: repository
key: ${{ runner.os }}-repository-${{ github.sha }}
- name: Checkout (without submodules)
uses: actions/checkout@v2
with:
path: repository
- name: Fast Submodule Checkout esp-idf
uses: 0xFEEDC0DE64/fast_submodule_checkout@main
with:
submodule: esp-idf
repo: repository
- name: Fast Submodule Checkout components/arduino-esp32
uses: 0xFEEDC0DE64/fast_submodule_checkout@main
with:
submodule: components/arduino-esp32
repo: repository
- name: Checkout remaining submodules
run: git -C repository submodule update --init --recursive $(git -C repository submodule | awk '{ if ($2 != "esp-idf" && $2 != "components/arduino-esp32") print $2 }')
checkout-history:
runs-on: ubuntu-latest
name: Checkout (with history and submodules)
steps:
- name: Cache repository
uses: actions/cache@v2
id: cache-repository
with:
path: repository
key: ${{ runner.os }}-repository-history-${{ github.sha }}
- name: Checkout (without submodules)
uses: actions/checkout@v2
with:
path: repository
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Fast Submodule Checkout esp-idf
uses: 0xFEEDC0DE64/fast_submodule_checkout@main
with:
submodule: esp-idf
repo: repository
- name: Fast Submodule Checkout components/arduino-esp32
uses: 0xFEEDC0DE64/fast_submodule_checkout@main
with:
submodule: components/arduino-esp32
repo: repository
- name: Checkout remaining submodules
run: git -C repository submodule update --init --recursive $(git -C repository submodule | awk '{ if ($2 != "esp-idf" && $2 != "components/arduino-esp32") print $2 }')
install-idf:
runs-on: ubuntu-latest
name: Install esp-idf
needs:
- checkout
steps:
- name: Cache repository
uses: actions/cache@v2
id: cache-repository
with:
path: repository
key: ${{ runner.os }}-repository-${{ github.sha }}
- name: Verify that "Cache repostory" had a hit
if: ${{ steps.cache-repository.outputs.cache-hit != 'true' }}
run: exit 1
- name: Get esp-idf release name
id: get-esp-idf-release
uses: 0xFEEDC0DE64/get_latest_tag@main
with:
repo: repository/esp-idf
- name: Cache .espressif
id: cache-espressif
uses: actions/cache@v2
with:
path: ~/.espressif
key: ${{ runner.os }}-espressif-${{ steps.get-esp-idf-release.outputs.tag_name }}
- name: Install .espressif dependencies
if: ${{ steps.cache-espressif.outputs.cache-hit != 'true' }}
run: repository/esp-idf/install.sh
install-sonar-scanner:
runs-on: ubuntu-latest
env:
SONAR_SCANNER_VERSION: 4.4.0.2170
name: Install sonar-scanner
steps:
- name: Cache sonar-scanner
uses: actions/cache@v2
id: cache-sonar-scanner
with:
path: sonar-scanner
key: ${{ runner.os }}-sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}
- name: Download and set up sonar-scanner
env:
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
if: ${{ steps.cache-sonar-scanner.outputs.cache-hit != 'true' }}
run: |
curl -sSLo sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
unzip -o sonar-scanner.zip -d sonar-scanner/
echo "$(pwd)/sonar-scanner/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
install-sonar-build-wrapper:
runs-on: ubuntu-latest
name: Install sonar-build-wrapper
steps:
- name: Cache sonar-build-wrapper
uses: actions/cache@v2
id: cache-sonar-build-wrapper
with:
path: sonar-build-wrapper
key: ${{ runner.os }}-sonar-build-wrapper
- name: Download and set up build-wrapper (for Sonar)
env:
BUILD_WRAPPER_DOWNLOAD_URL: https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
if: ${{ steps.cache-sonar-build-wrapper.outputs.cache-hit != 'true' }}
run: |
curl -sSLo build-wrapper-linux-x86.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }}
unzip -o build-wrapper-linux-x86.zip -d sonar-build-wrapper/
echo "$(pwd)/sonar-build-wrapper/build-wrapper-linux-x86" >> $GITHUB_PATH
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [feedc0de, comred, comred_new, peter, mick, nofeatures, seatbot, gernot]
name: ${{ matrix.node }}
needs:
- checkout
- install-idf
steps:
- name: Cache repository
uses: actions/cache@v2
id: cache-repository
with:
path: repository
key: ${{ runner.os }}-repository-${{ github.sha }}
- name: Verify that "Cache repostory" had a hit
if: ${{ steps.cache-repository.outputs.cache-hit != 'true' }}
run: exit 1
- name: Get esp-idf release name
id: get-esp-idf-release
uses: 0xFEEDC0DE64/get_latest_tag@main
with:
repo: repository/esp-idf
- name: Cache .espressif
id: cache-espressif
uses: actions/cache@v2
with:
path: ~/.espressif
key: ${{ runner.os }}-espressif-${{ steps.get-esp-idf-release.outputs.tag_name }}
- name: Verify that "Cache .espressif" had a hit
if: ${{ steps.cache-espressif.outputs.cache-hit != 'true' }}
run: |
echo "Cache .espressif did not hit? Did the prepare step run successfully?"
exit 1
- name: Setup ccache
uses: 0xFEEDC0DE64/setup_ccache@main
with:
key: ${{ runner.os }}-ccache-${{ matrix.node }}
- name: Unpack ignore folder
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
if: ${{ matrix.node == 'comred' || matrix.node == 'peter' || matrix.node == 'mick' || matrix.node == 'comred_new' }}
run: |
echo Unpacking ignore folder...
cd repository
tools/bobby-decrypt
- name: Build firmware
run: |
cd repository
export CCACHE_MAXSIZE=1024M CCACHE_BASEDIR="$(pwd)"
./esp-idf/install.sh
. export.sh
./switchconf.sh ${{ matrix.node }}
idf.py --ccache build
ccache -s
- name: Set outputs
id: vars
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- name: Upload Build Artifact
uses: actions/upload-artifact@v2.2.4
with:
name: bobbyquad_${{ matrix.node }}
path: |
repository/build_${{ matrix.node }}/bobbyquad_${{ matrix.node }}.bin
repository/build_${{ matrix.node }}/bobbyquad_${{ matrix.node }}.elf
build-and-analyze:
runs-on: ubuntu-latest
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
SONAR_SCANNER_VERSION: 4.4.0.2170
SONAR_CACHE_DIR: sonar_cache
name: allfeatures
needs:
- checkout-history
- install-idf
- install-sonar-build-wrapper
- install-sonar-scanner
steps:
- name: Cache repository
uses: actions/cache@v2
id: cache-repository
with:
path: repository
key: ${{ runner.os }}-repository-history-${{ github.sha }}
- name: Verify that "Cache repostory" had a hit
if: ${{ steps.cache-repository.outputs.cache-hit != 'true' }}
run: exit 1
- name: Get esp-idf release name
id: get-esp-idf-release
uses: 0xFEEDC0DE64/get_latest_tag@main
with:
repo: repository/esp-idf
- name: Cache .espressif
id: cache-espressif
uses: actions/cache@v2
with:
path: ~/.espressif
key: ${{ runner.os }}-espressif-${{ steps.get-esp-idf-release.outputs.tag_name }}
- name: Verify that "Cache .espressif" had a hit
if: ${{ steps.cache-espressif.outputs.cache-hit != 'true' }}
run: |
echo "Cache .espressif did not hit? Did the prepare step run successfully?"
exit 1
- name: Cache sonar-scanner
uses: actions/cache@v2
id: cache-sonar-scanner
with:
path: sonar-scanner
key: ${{ runner.os }}-sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}
- name: Verify that "Cache sonar-scanner" had a hit
if: ${{ steps.cache-sonar-scanner.outputs.cache-hit != 'true' }}
run: |
echo "Cache sonar-scanner did not hit? Did the prepare step run successfully?"
exit 1
- name: Cache sonar-build-wrapper
uses: actions/cache@v2
id: cache-sonar-build-wrapper
with:
path: sonar-build-wrapper
key: ${{ runner.os }}-sonar-build-wrapper
- name: Verify that "Cache sonar-build-wrapper" had a hit
if: ${{ steps.cache-sonar-build-wrapper.outputs.cache-hit != 'true' }}
run: |
echo "Cache sonar-build-wrapper did not hit? Did the prepare step run successfully?"
exit 1
- name: Cache sonar-build-wrapper-output
uses: actions/cache@v2
id: cache-sonar-build-wrapper-output
with:
path: repository
key: ${{ runner.os }}-sonar-build-wrapper-output-${{ github.sha }}
- name: Set up JDK 11 (for Sonar)
uses: actions/setup-java@v1
with:
java-version: 11
- name: Setup sonar-build-wrapper
run: echo "$(pwd)/sonar-build-wrapper/build-wrapper-linux-x86" >> $GITHUB_PATH
- name: Setup ccache
uses: 0xFEEDC0DE64/setup_ccache@main
with:
key: ${{ runner.os }}-ccache-allfeatures
- name: Build firmware
run: |
cd repository
export CCACHE_MAXSIZE=1024M CCACHE_BASEDIR="$(pwd)"
./esp-idf/install.sh
. export.sh
./switchconf.sh allfeatures
build-wrapper-linux-x86-64 --out-dir "${{ env.BUILD_WRAPPER_OUT_DIR }}" idf.py --ccache build
ccache -s
- name: Set outputs
id: vars
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- name: Upload Build Artifact
uses: actions/upload-artifact@v2.2.4
with:
name: bobbyquad_allfeatures
path: |
repository/build_allfeatures/bobbyquad_allfeatures.bin
repository/build_allfeatures/bobbyquad_allfeatures.elf
- name: Setup sonar-scanner
run: echo "$(pwd)/sonar-scanner/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
- name: Cache sonar-scanner-cache
uses: 0xFEEDC0DE64/cache-with-update@update-cache-on-cachehit
with:
path: ${{ env.SONAR_CACHE_DIR }}
key: ${{ runner.os }}-sonar-scanner-cache-${{ env.SONAR_SCANNER_VERSION }}
- name: Run sonar-scanner
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
cd repository
sonar-scanner \
--define sonar.host.url="https://sonarcloud.io" \
--define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \
--define sonar.cfamily.cache.path="../${{ env.SONAR_CACHE_DIR }}"

8
.gitmodules vendored
View File

@ -60,4 +60,10 @@
url = ../../0xFEEDC0DE64/espconfiglib.git
[submodule "components/QRCode-esp32"]
path = components/QRCode-esp32
url = ../QRCode-esp32.git
url = ../../bobbycar-graz/QRCode-esp32.git
[submodule "components/sunset"]
path = components/sunset
url = ../../bobbycar-graz/sunset.git
[submodule "esp-protocols"]
path = esp-protocols
url = ../../0xFEEDC0DE64/esp-protocols.git

View File

@ -25,6 +25,10 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(EXTRA_COMPONENT_DIRS
esp-protocols/components
)
project(${BOBBY_APP_NAME})
set(expected_build_folder "${CMAKE_CURRENT_SOURCE_DIR}/build")

View File

@ -4,8 +4,7 @@
| Service | Status |
| :--- | ---: |
| Actions (Build) | ![Build Status](https://github.com/bobbycar-graz/bobbycar-boardcomputer-firmware/actions/workflows/userconfigs.yml/badge.svg) |
| Actions (Analysis) | ![Build Status](https://github.com/bobbycar-graz/bobbycar-boardcomputer-firmware/actions/workflows/analysis.yml/badge.svg) |
| Actions (CI) | [![CI](https://github.com/bobbycar-graz/bobbycar-boardcomputer-firmware/actions/workflows/workflow.yml/badge.svg)](https://github.com/bobbycar-graz/bobbycar-boardcomputer-firmware/actions/workflows/workflow.yml) |
| Sonar | [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=bobbycar-graz_bobbycar-boardcomputer-firmware&metric=bugs)](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=bobbycar-graz_bobbycar-boardcomputer-firmware&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=bobbycar-graz_bobbycar-boardcomputer-firmware&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=bobbycar-graz_bobbycar-boardcomputer-firmware&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=bobbycar-graz_bobbycar-boardcomputer-firmware&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=bobbycar-graz_bobbycar-boardcomputer-firmware&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=bobbycar-graz_bobbycar-boardcomputer-firmware&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=bobbycar-graz_bobbycar-boardcomputer-firmware&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=bobbycar-graz_bobbycar-boardcomputer-firmware&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=bobbycar-graz_bobbycar-boardcomputer-firmware&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware) |
## How to clone ? (READ THIS OR YOU WILL FAIL)

1
components/sunset Submodule

Submodule components/sunset added at 0520b0945c

View File

@ -16,108 +16,66 @@ add_definitions(
)
set(BOBBYCAR_BUILDFLAGS
-DFEATURE_ADC_IN
-DPINS_GAS=34
-DPINS_BREMS=35
-DDEFAULT_SWAPSCREENBYTES=false
-DFEATURE_CAN
# -DFEATURE_SERIAL
# -DPINS_RX1=4
# -DPINS_TX1=5
# -DPINS_RX2=22
# -DPINS_TX2=23
-DDEFAULT_INVERTFRONTLEFT=false
-DDEFAULT_INVERTFRONTRIGHT=true
-DDEFAULT_INVERTBACKLEFT=false
-DDEFAULT_INVERTBACKRIGHT=true
-DDEFAULT_WHEELDIAMETER=200
# -DFEATURE_MOSFETS
# -DPINS_MOSFET0=18
# -DPINS_MOSFET1=19
# -DPINS_MOSFET2=21
-DDEFAULT_IMOTMAX=28
-DDEFAULT_IDCMAX=30
-DDEFAULT_NMOTMAX=2000
-DDEFAULT_FIELDWEAKMAX=7
-DDEFAULT_FIELDADVMAX=40
-DDEVICE_PREFIX=bobbyquad
-DAP_PASSWORD=Passwort_123
-DFEATURE_WEBSERVER
-DFEATURE_OTA
-DOTA_USERNAME="allfeatures"
# -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
# 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
# -DDPAD_5WIRESW_UP=1
# -DDPAD_5WIRESW_DOWN=5
# -DDPAD_5WIRESW_CONFIRM=2
# -DDPAD_5WIRESW_BACK=6
# -DDPAD_5WIRESW_PROFILE0=4
# -DDPAD_5WIRESW_PROFILE1=0
# -DDPAD_5WIRESW_PROFILE2=7
# -DDPAD_5WIRESW_PROFILE3=3
# -DDPAD_5WIRESW_DEBUG
# Config flags
-DFEATURE_ADC_IN
-DFEATURE_CAN
# -DFEATURE_SERIAL
# -DFEATURE_MOSFETS
# -DFEATURE_BLUETOOTH
# -DFEATURE_BMS
# -DFEATURE_GAMETRAK
-DFEATURE_POWERSUPPLY
-DFEATURE_LEDBACKLIGHT
-DDPAD_6WIRESW_UP=1
-DDPAD_6WIRESW_DOWN=5
-DDPAD_6WIRESW_CONFIRM=2
-DDPAD_6WIRESW_BACK=6
-DDPAD_6WIRESW_PROFILE0=4
-DDPAD_6WIRESW_PROFILE1=0
-DDPAD_6WIRESW_PROFILE2=7
-DDPAD_6WIRESW_PROFILE3=3
-DDPAD_6WIRESW_BLINK_LEFT=8
-DDPAD_6WIRESW_BLINK_RIGHT=9
# -DDPAD_6WIRESW_DEBUG
-DFEATURE_GSCHISSENE_DIODE
-DLEDBACKLIGHT_INVERTED
-DLEDSTRIP_WRONG_DIRECTION
-DHEAP_LRGST_CRASH_TEXT_FIX
-DDEFAULT_GASMIN=842
-DDEFAULT_GASMAX=2480
-DDEFAULT_BREMSMIN=826
-DDEFAULT_BREMSMAX=2502
-DFEATURE_BLE
# -DFEATURE_BLUETOOTH
# -DFEATURE_BMS
# -DFEATURE_GAMETRAK
# -DPINS_GAMETRAKX=34
# -DPINS_GAMETRAKY=39
# -DPINS_GAMETRAKDIST=36
# -DDEFAULT_GAMETRAKXMIN=0
# -DDEFAULT_GAMETRAKXMAX=4095
# -DDEFAULT_GAMETRAKYMIN=0
# -DDEFAULT_GAMETRAKYMAX=4095
# -DDEFAULT_GAMETRAKDISTMIN=0
# -DDEFAULT_GAMETRAKDISTMAX=4095
-DFEATURE_POWERSUPPLY
-DFEATURE_CLOUD
-DFEATURE_UDPCLOUD
-DFEATURE_LEDBACKLIGHT
-DPINS_LEDBACKLIGHT=23
-DLEDBACKLIGHT_INVERTED
-DFEATURE_GARAGE
-DFEATURE_NTP
-DFEATURE_WIRELESS_CONFIG
-DFEATURE_LEDSTRIP
-DPINS_LEDSTRIP=33
-DLEDSTRIP_LENGTH=288
-DHEAP_LRGST_CRASH_TEXT_FIX
-DLEDSTRIP_WRONG_DIRECTION
-DLEDSTRIP_ANIMATION_DEFAULT=1
-DLEDS_PER_METER=144
-DOLD_NVS
-DFEATURE_DNS_NS
-DSWITCH_BLINK
-DFEATURE_ESPNOW
# 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=7
-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
)

View File

@ -16,114 +16,71 @@ add_definitions(
)
set(BOBBYCAR_BUILDFLAGS
-DFEATURE_ADC_IN
-DPINS_GAS=34
-DPINS_BREMS=35
-DDEFAULT_SWAPSCREENBYTES=false
-DFEATURE_CAN
# -DFEATURE_SERIAL
# -DPINS_RX1=4
# -DPINS_TX1=5
# -DPINS_RX2=22
# -DPINS_TX2=23
-DDEFAULT_INVERTFRONTLEFT=false
-DDEFAULT_INVERTFRONTRIGHT=true
-DDEFAULT_INVERTBACKLEFT=false
-DDEFAULT_INVERTBACKRIGHT=true
-DDEFAULT_WHEELDIAMETER=200
# -DFEATURE_MOSFETS
# -DPINS_MOSFET0=18
# -DPINS_MOSFET1=19
# -DPINS_MOSFET2=21
-DDEFAULT_IMOTMAX=28
-DDEFAULT_IDCMAX=30
-DDEFAULT_NMOTMAX=2000
-DDEFAULT_FIELDWEAKMAX=7
-DDEFAULT_FIELDADVMAX=40
-DDEVICE_PREFIX=comr_bobbyquad
-DAP_PASSWORD=Passwort_123
-DFEATURE_WEBSERVER
-DFEATURE_OTA
-DOTA_USERNAME="comred"
# -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
# 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
# -DDPAD_5WIRESW_UP=1
# -DDPAD_5WIRESW_DOWN=5
# -DDPAD_5WIRESW_CONFIRM=2
# -DDPAD_5WIRESW_BACK=6
# -DDPAD_5WIRESW_PROFILE0=4
# -DDPAD_5WIRESW_PROFILE1=0
# -DDPAD_5WIRESW_PROFILE2=7
# -DDPAD_5WIRESW_PROFILE3=3
# -DDPAD_5WIRESW_DEBUG
# Config flags
-DFEATURE_ADC_IN
-DFEATURE_CAN
# -DFEATURE_SERIAL
# -DFEATURE_MOSFETS
# -DFEATURE_BLUETOOTH
# -DFEATURE_BMS
# -DFEATURE_GAMETRAK
# -DFEATURE_POWERSUPPLY
-DFEATURE_LEDBACKLIGHT
-DDPAD_6WIRESW_UP=1
-DDPAD_6WIRESW_DOWN=5
-DDPAD_6WIRESW_CONFIRM=2
-DDPAD_6WIRESW_BACK=6
-DDPAD_6WIRESW_PROFILE0=4
-DDPAD_6WIRESW_PROFILE1=0
-DDPAD_6WIRESW_PROFILE2=7
-DDPAD_6WIRESW_PROFILE3=3
-DDPAD_6WIRESW_BLINK_LEFT=8
-DDPAD_6WIRESW_BLINK_RIGHT=9
# -DDPAD_6WIRESW_DEBUG
-DFEATURE_GSCHISSENE_DIODE
-DLEDBACKLIGHT_INVERTED
# -DLEDSTRIP_WRONG_DIRECTION
-DHEAP_LRGST_CRASH_TEXT_FIX
-DDEFAULT_GASMIN=842
-DDEFAULT_GASMAX=2480
-DDEFAULT_BREMSMIN=826
-DDEFAULT_BREMSMAX=2502
-DFEATURE_BLE
# -DFEATURE_BLUETOOTH
# -DFEATURE_BMS
# -DFEATURE_GAMETRAK
# -DPINS_GAMETRAKX=34
# -DPINS_GAMETRAKY=39
# -DPINS_GAMETRAKDIST=36
# -DDEFAULT_GAMETRAKXMIN=0
# -DDEFAULT_GAMETRAKXMAX=4095
# -DDEFAULT_GAMETRAKYMIN=0
# -DDEFAULT_GAMETRAKYMAX=4095
# -DDEFAULT_GAMETRAKDISTMIN=0
# -DDEFAULT_GAMETRAKDISTMAX=4095
# -DFEATURE_POWERSUPPLY
# -DFEATURE_CLOUD
-DFEATURE_UDPCLOUD
-DFEATURE_LEDBACKLIGHT
-DPINS_LEDBACKLIGHT=23
-DLEDBACKLIGHT_INVERTED
-DFEATURE_GARAGE
# -DFEATURE_NTP
-DFEATURE_WIRELESS_CONFIG
-DFEATURE_LEDSTRIP
-DPINS_LEDSTRIP=33
-DLEDSTRIP_LENGTH=288
-DHEAP_LRGST_CRASH_TEXT_FIX
# -DLEDSTRIP_WRONG_DIRECTION
-DLEDSTRIP_ANIMATION_DEFAULT=1
-DLEDS_PER_METER=144
-DOLD_NVS
-DFEATURE_DNS_NS
-DSWITCH_BLINK
-DFEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET
-DFEATURE_ESPNOW
# 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
)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
message(WARNING "Including lockscreen_plugin")
message(WARNING "Including plugins")
endif()

93
config_comred_new.cmake Normal file
View File

@ -0,0 +1,93 @@
set(BOBBY_APP_NAME bobbyquad_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
)
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
)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
message(WARNING "Including plugins")
endif()

View File

@ -16,89 +16,65 @@ add_definitions(
)
set(BOBBYCAR_BUILDFLAGS
-DFEATURE_ADC_IN
-DPINS_GAS=34
-DPINS_BREMS=35
-DDEFAULT_SWAPSCREENBYTES=false
-DFEATURE_CAN
# -DFEATURE_SERIAL
# -DPINS_RX1=4
# -DPINS_TX1=5
# -DPINS_RX2=22
# -DPINS_TX2=23
-DDEFAULT_INVERTFRONTLEFT=false
-DDEFAULT_INVERTFRONTRIGHT=true
-DDEFAULT_INVERTBACKLEFT=false
-DDEFAULT_INVERTBACKRIGHT=true
-DDEFAULT_WHEELDIAMETER=255
-DFEATURE_MOSFETS
-DPINS_MOSFET0=4
-DPINS_MOSFET1=5
-DPINS_MOSFET2=25
-DDEFAULT_IMOTMAX=40
-DDEFAULT_IDCMAX=42
-DDEFAULT_NMOTMAX=2000
-DDEFAULT_FIELDWEAKMAX=17
-DDEFAULT_FIELDADVMAX=40
-DDEVICE_PREFIX=bobbyquad
-DAP_PASSWORD=Passwort_123
-DFEATURE_WEBSERVER
-DFEATURE_OTA
-DOTA_USERNAME="feedc0de"
-DFEATURE_DPAD_5WIRESW_2OUT
-DPINS_DPAD_5WIRESW_OUT1=18
-DPINS_DPAD_5WIRESW_OUT2=19
-DPINS_DPAD_5WIRESW_IN1=27
-DPINS_DPAD_5WIRESW_IN2=32
-DPINS_DPAD_5WIRESW_IN3=33
-DDPAD_5WIRESW_UP=2
-DDPAD_5WIRESW_DOWN=11
-DDPAD_5WIRESW_CONFIRM=5
-DDPAD_5WIRESW_BACK=8
-DDPAD_5WIRESW_PROFILE0=4
-DDPAD_5WIRESW_PROFILE1=1
-DDPAD_5WIRESW_PROFILE2=10
-DDPAD_5WIRESW_PROFILE3=7
-DDPAD_5WIRESW_BLINK_LEFT=9
-DDPAD_5WIRESW_BLINK_RIGHT=0
-DDPAD_5WIRESW_QUICKACTION_DOWN=3
-DDPAD_5WIRESW_QUICKACTION_UP=6
# -DDPAD_5WIRESW_DEBUG
-DDEFAULT_GASMIN=200
-DDEFAULT_GASMAX=1070
-DDEFAULT_BREMSMIN=270
-DDEFAULT_BREMSMAX=1800
-DFEATURE_BLE
# -DFEATURE_BLUETOOTH
# -DFEATURE_BMS
# -DFEATURE_GAMETRAK
# -DPINS_GAMETRAKX=34
# -DPINS_GAMETRAKY=39
# -DPINS_GAMETRAKDIST=36
# -DDEFAULT_GAMETRAKXMIN=0
# -DDEFAULT_GAMETRAKXMAX=4095
# -DDEFAULT_GAMETRAKYMIN=0
# -DDEFAULT_GAMETRAKYMAX=4095
# -DDEFAULT_GAMETRAKDISTMIN=0
# -DDEFAULT_GAMETRAKDISTMAX=4095
-DFEATURE_POWERSUPPLY
-DFEATURE_CLOUD
# -DFEATURE_UDPCLOUD
-DFEATURE_LEDBACKLIGHT
-DPINS_LEDBACKLIGHT=23
-DLEDBACKLIGHT_INVERTED
-DFEATURE_GARAGE
-DFEATURE_NTP
-DFEATURE_WIRELESS_CONFIG
-DFEATURE_LEDSTRIP
-DPINS_LEDSTRIP=26
-DLEDSTRIP_LENGTH=200
# -DHEAP_LRGST_CRASH_TEXT_FIX
# -DLEDSTRIP_WRONG_DIRECTION
-DLEDSTRIP_ANIMATION_DEFAULT=0
-DLEDS_PER_METER=144
-DOLD_NVS
# -DFEATURE_DNS_NS
# -DSWITCH_BLINK
# -DFEATURE_ESPNOW
# Pins
-DPINS_GAS=34
-DPINS_BREMS=35
# -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
-DFEATURE_DPAD_5WIRESW_2OUT
-DPINS_DPAD_5WIRESW_OUT1=18
-DPINS_DPAD_5WIRESW_OUT2=19
-DPINS_DPAD_5WIRESW_IN1=27
-DPINS_DPAD_5WIRESW_IN2=32
-DPINS_DPAD_5WIRESW_IN3=33
# -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
)

93
config_gabor.cmake Normal file
View File

@ -0,0 +1,93 @@
set(BOBBY_APP_NAME bobbyquad_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
)
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
)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
message(WARNING "Including plugins")
endif()

85
config_gernot.cmake Normal file
View File

@ -0,0 +1,85 @@
set(BOBBY_APP_NAME bobbyquad_gernot)
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=255
-DDEFAULT_IMOTMAX=28
-DDEFAULT_IDCMAX=30
-DDEFAULT_NMOTMAX=2000
-DDEFAULT_FIELDWEAKMAX=7
-DDEFAULT_FIELDADVMAX=40
# DPAD
# -DFEATURE_DPAD_5WIRESW_2OUT
# -DPINS_DPAD_5WIRESW_OUT1=18
# -DPINS_DPAD_5WIRESW_OUT2=19
# -DPINS_DPAD_5WIRESW_IN1=4
# -DPINS_DPAD_5WIRESW_IN2=5
# -DPINS_DPAD_5WIRESW_IN3=27
# -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
)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
message(WARNING "Including plugins")
endif()

View File

@ -12,86 +12,66 @@ add_definitions(
-DTFT_CS=14
-DTFT_DC=12
-DTFT_RST=2
-DSPI_FREQUENCY=27000000
-DSPI_FREQUENCY=40000000
)
set(BOBBYCAR_BUILDFLAGS
-DFEATURE_ADC_IN
-DPINS_GAS=34
-DPINS_BREMS=35
-DDEFAULT_SWAPSCREENBYTES=false
# -DFEATURE_CAN
# -DFEATURE_SERIAL
# -DPINS_RX1=4
# -DPINS_TX1=5
# -DPINS_RX2=22
# -DPINS_TX2=23
-DDEFAULT_INVERTFRONTLEFT=false
-DDEFAULT_INVERTFRONTRIGHT=true
-DDEFAULT_INVERTBACKLEFT=false
-DDEFAULT_INVERTBACKRIGHT=true
-DDEFAULT_WHEELDIAMETER=200
# -DFEATURE_MOSFETS
# -DPINS_MOSFET0=18
# -DPINS_MOSFET1=19
# -DPINS_MOSFET2=21
-DDEFAULT_IMOTMAX=28
-DDEFAULT_IDCMAX=30
-DDEFAULT_NMOTMAX=2000
-DDEFAULT_FIELDWEAKMAX=7
-DDEFAULT_FIELDADVMAX=40
-DDEVICE_PREFIX=bobbyquad
# -DAP_PASSWORD=Passwort_123
# -DFEATURE_WEBSERVER
# -DFEATURE_OTA
# -DOTA_USERNAME="greyhash"
-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
-DDPAD_5WIRESW_UP=1
-DDPAD_5WIRESW_DOWN=5
-DDPAD_5WIRESW_CONFIRM=2
-DDPAD_5WIRESW_BACK=6
-DDPAD_5WIRESW_PROFILE0=4
-DDPAD_5WIRESW_PROFILE1=0
-DDPAD_5WIRESW_PROFILE2=7
-DDPAD_5WIRESW_PROFILE3=3
# -DDPAD_5WIRESW_DEBUG
-DDEFAULT_GASMIN=842
-DDEFAULT_GASMAX=2480
-DDEFAULT_BREMSMIN=826
-DDEFAULT_BREMSMAX=2502
# -DFEATURE_BLE
# -DFEATURE_BLUETOOTH
# -DFEATURE_BMS
# -DFEATURE_GAMETRAK
# -DPINS_GAMETRAKX=34
# -DPINS_GAMETRAKY=39
# -DPINS_GAMETRAKDIST=36
# -DDEFAULT_GAMETRAKXMIN=0
# -DDEFAULT_GAMETRAKXMAX=4095
# -DDEFAULT_GAMETRAKYMIN=0
# -DDEFAULT_GAMETRAKYMAX=4095
# -DDEFAULT_GAMETRAKDISTMIN=0
# -DDEFAULT_GAMETRAKDISTMAX=4095
# -DFEATURE_POWERSUPPLY
# -DFEATURE_CLOUD
# -DFEATURE_UDPCLOUD
# -DFEATURE_LEDBACKLIGHT
# -DPINS_LEDBACKLIGHT=23
# -DLEDBACKLIGHT_INVERTED
# -DFEATURE_GARAGE
# -DFEATURE_NTP
# -DFEATURE_WIRELESS_CONFIG
# -DFEATURE_LEDSTRIP
# -DPINS_LEDSTRIP=33
# -DLEDSTRIP_LENGTH=121
# -DLEDSTRIP_DEFAULT_BRIGHTNESS=100
# -DLEDSTRIP_WRONG_DIRECTION
# -DLEDSTRIP_ANIMATION_DEFAULT=0
-DOLD_NVS
# -DFEATURE_DNS_NS
# 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_2OUT
-DPINS_DPAD_5WIRESW_OUT1=5
-DPINS_DPAD_5WIRESW_OUT2=4
-DPINS_DPAD_5WIRESW_IN1=27
-DPINS_DPAD_5WIRESW_IN2=19
-DPINS_DPAD_5WIRESW_IN3=18
# -DDPAD_BOARDCOMPUTER_V2
)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
message(WARNING "Including plugins")
endif()

View File

@ -16,86 +16,70 @@ add_definitions(
)
set(BOBBYCAR_BUILDFLAGS
-DFEATURE_ADC_IN
-DPINS_GAS=34
-DPINS_BREMS=35
-DDEFAULT_SWAPSCREENBYTES=false
-DFEATURE_CAN
# -DFEATURE_SERIAL
# -DPINS_RX1=4
# -DPINS_TX1=5
# -DPINS_RX2=22
# -DPINS_TX2=23
-DDEFAULT_INVERTFRONTLEFT=false
-DDEFAULT_INVERTFRONTRIGHT=true
-DDEFAULT_INVERTBACKLEFT=false
-DDEFAULT_INVERTBACKRIGHT=true
-DDEFAULT_WHEELDIAMETER=200
# -DFEATURE_MOSFETS
# -DPINS_MOSFET0=18
# -DPINS_MOSFET1=19
# -DPINS_MOSFET2=21
-DDEFAULT_IMOTMAX=28
-DDEFAULT_IDCMAX=30
-DDEFAULT_NMOTMAX=2000
-DDEFAULT_FIELDWEAKMAX=7
-DDEFAULT_FIELDADVMAX=40
-DDEVICE_PREFIX=bobbyquad
-DAP_PASSWORD=Passwort_123
-DFEATURE_WEBSERVER
# -DFEATURE_OTA
-DOTA_USERNAME="mick"
# -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
# -DDPAD_5WIRESW_UP=1
# -DDPAD_5WIRESW_DOWN=5
# -DDPAD_5WIRESW_CONFIRM=2
# -DDPAD_5WIRESW_BACK=6
# -DDPAD_5WIRESW_PROFILE0=4
# -DDPAD_5WIRESW_PROFILE1=0
# -DDPAD_5WIRESW_PROFILE2=7
# -DDPAD_5WIRESW_PROFILE3=3
# -DDPAD_5WIRESW_DEBUG
-DDEFAULT_GASMIN=184
-DDEFAULT_GASMAX=1329
-DDEFAULT_BREMSMIN=28
-DDEFAULT_BREMSMAX=500
-DFEATURE_BLE
# -DFEATURE_BLUETOOTH
# -DFEATURE_BMS
# -DFEATURE_GAMETRAK
# -DPINS_GAMETRAKX=34
# -DPINS_GAMETRAKY=39
# -DPINS_GAMETRAKDIST=36
# -DDEFAULT_GAMETRAKXMIN=0
# -DDEFAULT_GAMETRAKXMAX=4095
# -DDEFAULT_GAMETRAKYMIN=0
# -DDEFAULT_GAMETRAKYMAX=4095
# -DDEFAULT_GAMETRAKDISTMIN=0
# -DDEFAULT_GAMETRAKDISTMAX=4095
# -DFEATURE_POWERSUPPLY
# -DFEATURE_CLOUD
-DFEATURE_UDPCLOUD
-DFEATURE_LEDBACKLIGHT
-DPINS_LEDBACKLIGHT=23
-DLEDBACKLIGHT_INVERTED
# -DFEATURE_GARAGE
# -DFEATURE_NTP
-DFEATURE_WIRELESS_CONFIG
-DFEATURE_LEDSTRIP
-DLEDSTRIP_LENGTH=288
-DPINS_LEDSTRIP=33
# -DLEDSTRIP_WRONG_DIRECTION
-DLEDSTRIP_ANIMATION_DEFAULT=0
-DOLD_NVS
-DFEATURE_DNS_NS
# 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=7
-DDEFAULT_FIELDADVMAX=40
# DPAD
-DFEATURE_DPAD_5WIRESW_2OUT
-DPINS_DPAD_5WIRESW_OUT1=5
-DPINS_DPAD_5WIRESW_OUT2=19
-DPINS_DPAD_5WIRESW_IN1=4
-DPINS_DPAD_5WIRESW_IN2=18
-DPINS_DPAD_5WIRESW_IN3=27
# -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
)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
message(WARNING "Including lockscreen_plugin")
message(WARNING "Including plugins")
endif()

View File

@ -16,109 +16,65 @@ add_definitions(
)
set(BOBBYCAR_BUILDFLAGS
-DFEATURE_ADC_IN
-DPINS_GAS=34
-DPINS_BREMS=35
-DDEFAULT_SWAPSCREENBYTES=false
-DFEATURE_CAN
# -DFEATURE_SERIAL
# -DPINS_RX1=4
# -DPINS_TX1=5
# -DPINS_RX2=22
# -DPINS_TX2=23
-DDEFAULT_INVERTFRONTLEFT=false
-DDEFAULT_INVERTFRONTRIGHT=true
-DDEFAULT_INVERTBACKLEFT=false
-DDEFAULT_INVERTBACKRIGHT=true
-DDEFAULT_WHEELDIAMETER=200
# -DFEATURE_MOSFETS
# -DPINS_MOSFET0=18
# -DPINS_MOSFET1=19
# -DPINS_MOSFET2=21
-DDEFAULT_IMOTMAX=28
-DDEFAULT_IDCMAX=30
-DDEFAULT_NMOTMAX=2000
-DDEFAULT_FIELDWEAKMAX=7
-DDEFAULT_FIELDADVMAX=40
-DDEVICE_PREFIX=bobbyquad
-DAP_PASSWORD=Passwort_123
# -DFEATURE_WEBSERVER
# -DFEATURE_OTA
-DOTA_USERNAME="nofeatures"
# -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
# 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
# -DDPAD_5WIRESW_UP=1
# -DDPAD_5WIRESW_DOWN=5
# -DDPAD_5WIRESW_CONFIRM=2
# -DDPAD_5WIRESW_BACK=6
# -DDPAD_5WIRESW_PROFILE0=4
# -DDPAD_5WIRESW_PROFILE1=0
# -DDPAD_5WIRESW_PROFILE2=7
# -DDPAD_5WIRESW_PROFILE3=3
# -DDPAD_5WIRESW_DEBUG
# Config flags
# -DFEATURE_ADC_IN
# -DFEATURE_CAN
# -DFEATURE_SERIAL
# -DFEATURE_MOSFETS
# -DFEATURE_BLUETOOTH
# -DFEATURE_BMS
# -DFEATURE_GAMETRAK
# -DFEATURE_POWERSUPPLY
# -DFEATURE_LEDBACKLIGHT
-DDPAD_6WIRESW_UP=1
-DDPAD_6WIRESW_DOWN=5
-DDPAD_6WIRESW_CONFIRM=2
-DDPAD_6WIRESW_BACK=6
-DDPAD_6WIRESW_PROFILE0=4
-DDPAD_6WIRESW_PROFILE1=0
-DDPAD_6WIRESW_PROFILE2=7
-DDPAD_6WIRESW_PROFILE3=3
-DDPAD_6WIRESW_BLINK_LEFT=8
-DDPAD_6WIRESW_BLINK_RIGHT=9
# -DDPAD_6WIRESW_DEBUG
# -DFEATURE_GSCHISSENE_DIODE
# -DLEDBACKLIGHT_INVERTED
# -DLEDSTRIP_WRONG_DIRECTION
# -DHEAP_LRGST_CRASH_TEXT_FIX
-DDEFAULT_GASMIN=842
-DDEFAULT_GASMAX=2480
-DDEFAULT_BREMSMIN=826
-DDEFAULT_BREMSMAX=2502
# -DFEATURE_BLE
# -DFEATURE_BLUETOOTH
# -DFEATURE_BMS
# -DFEATURE_GAMETRAK
# -DPINS_GAMETRAKX=34
# -DPINS_GAMETRAKY=39
# -DPINS_GAMETRAKDIST=36
# -DDEFAULT_GAMETRAKXMIN=0
# -DDEFAULT_GAMETRAKXMAX=4095
# -DDEFAULT_GAMETRAKYMIN=0
# -DDEFAULT_GAMETRAKYMAX=4095
# -DDEFAULT_GAMETRAKDISTMIN=0
# -DDEFAULT_GAMETRAKDISTMAX=4095
# -DFEATURE_POWERSUPPLY
# -DFEATURE_CLOUD
# -DFEATURE_UDPCLOUD
# -DFEATURE_LEDBACKLIGHT
# -DPINS_LEDBACKLIGHT=23
# -DLEDBACKLIGHT_INVERTED
# -DFEATURE_GARAGE
# -DFEATURE_NTP
# -DFEATURE_WIRELESS_CONFIG
# -DFEATURE_LEDSTRIP
# -DPINS_LEDSTRIP=33
# -DLEDSTRIP_LENGTH=288
# -DHEAP_LRGST_CRASH_TEXT_FIX
# -DLEDSTRIP_WRONG_DIRECTION
# -DLEDSTRIP_ANIMATION_DEFAULT=1
# -DLEDS_PER_METER=144
-DOLD_NVS
# -DFEATURE_DNS_NS
# -DSWITCH_BLINK
-DFEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET
# -DFEATURE_ESPNOW
# Default values
-DDEFAULT_SWAPSCREENBYTES=false
-DDEFAULT_INVERTFRONTLEFT=false
-DDEFAULT_INVERTFRONTRIGHT=true
-DDEFAULT_INVERTBACKLEFT=false
-DDEFAULT_INVERTBACKRIGHT=true
-DDEFAULT_WHEELDIAMETER=255
-DDEFAULT_IMOTMAX=28
-DDEFAULT_IDCMAX=30
-DDEFAULT_NMOTMAX=2000
-DDEFAULT_FIELDWEAKMAX=7
-DDEFAULT_FIELDADVMAX=40
# DPAD
# -DFEATURE_DPAD_5WIRESW_2OUT
# -DPINS_DPAD_5WIRESW_OUT1=18
# -DPINS_DPAD_5WIRESW_OUT2=19
# -DPINS_DPAD_5WIRESW_IN1=4
# -DPINS_DPAD_5WIRESW_IN2=5
# -DPINS_DPAD_5WIRESW_IN3=27
# -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
)

View File

@ -16,93 +16,70 @@ add_definitions(
)
set(BOBBYCAR_BUILDFLAGS
-DFEATURE_ADC_IN
-DPINS_GAS=34
-DPINS_BREMS=35
-DDEFAULT_SWAPSCREENBYTES=false
-DFEATURE_CAN
# -DFEATURE_SERIAL
# -DPINS_RX1=4
# -DPINS_TX1=5
# -DPINS_RX2=22
# -DPINS_TX2=23
-DDEFAULT_INVERTFRONTLEFT=false
-DDEFAULT_INVERTFRONTRIGHT=true
-DDEFAULT_INVERTBACKLEFT=false
-DDEFAULT_INVERTBACKRIGHT=true
-DDEFAULT_WHEELDIAMETER=200
# -DFEATURE_MOSFETS
# -DPINS_MOSFET0=18
# -DPINS_MOSFET1=19
# -DPINS_MOSFET2=21
-DDEFAULT_IMOTMAX=28
-DDEFAULT_IDCMAX=30
-DDEFAULT_NMOTMAX=2000
-DDEFAULT_FIELDWEAKMAX=7
-DDEFAULT_FIELDADVMAX=40
-DDEVICE_PREFIX=peter_bobbyquad
-DAP_PASSWORD=Passwort_123
-DFEATURE_WEBSERVER
-DFEATURE_OTA
-DOTA_USERNAME="peter"
-DFEATURE_DPAD_5WIRESW_2OUT
-DPINS_DPAD_5WIRESW_OUT1=18
-DPINS_DPAD_5WIRESW_OUT2=19
-DPINS_DPAD_5WIRESW_IN1=4
-DPINS_DPAD_5WIRESW_IN2=5
-DPINS_DPAD_5WIRESW_IN3=27
-DDPAD_5WIRESW_UP=4
-DDPAD_5WIRESW_DOWN=7
-DDPAD_5WIRESW_CONFIRM=1
-DDPAD_5WIRESW_BACK=10
-DDPAD_5WIRESW_PROFILE0=11
-DDPAD_5WIRESW_PROFILE1=8
-DDPAD_5WIRESW_PROFILE2=5
-DDPAD_5WIRESW_PROFILE3=2
-DDPAD_5WIRESW_BLINK_LEFT=9
-DDPAD_5WIRESW_BLINK_RIGHT=0
-DDPAD_5WIRESW_QUICKACTION_DOWN=3
-DDPAD_5WIRESW_QUICKACTION_UP=6
# -DDPAD_5WIRESW_DEBUG
-DDEFAULT_GASMIN=842
-DDEFAULT_GASMAX=2480
-DDEFAULT_BREMSMIN=826
-DDEFAULT_BREMSMAX=2502
-DFEATURE_BLE
# -DFEATURE_BLUETOOTH
# -DFEATURE_BMS
# -DFEATURE_GAMETRAK
# -DPINS_GAMETRAKX=34
# -DPINS_GAMETRAKY=39
# -DPINS_GAMETRAKDIST=36
# -DDEFAULT_GAMETRAKXMIN=0
# -DDEFAULT_GAMETRAKXMAX=4095
# -DDEFAULT_GAMETRAKYMIN=0
# -DDEFAULT_GAMETRAKYMAX=4095
# -DDEFAULT_GAMETRAKDISTMIN=0
# -DDEFAULT_GAMETRAKDISTMAX=4095
# -DFEATURE_POWERSUPPLY
# -DFEATURE_CLOUD
-DFEATURE_UDPCLOUD
-DFEATURE_LEDBACKLIGHT
-DPINS_LEDBACKLIGHT=23
-DLEDBACKLIGHT_INVERTED
-DFEATURE_GARAGE
#-DFEATURE_NTP
-DFEATURE_WIRELESS_CONFIG
-DFEATURE_LEDSTRIP
-DPINS_LEDSTRIP=33
-DLEDSTRIP_LENGTH=288
# -DLEDSTRIP_WRONG_DIRECTION
-DLEDSTRIP_ANIMATION_DEFAULT=2
-DLEDS_PER_METER=144
-DOLD_NVS
-DFEATURE_DNS_NS
-DFEATURE_ESPNOW
-DFEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET
# 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=255
-DDEFAULT_IMOTMAX=28
-DDEFAULT_IDCMAX=30
-DDEFAULT_NMOTMAX=2000
-DDEFAULT_FIELDWEAKMAX=7
-DDEFAULT_FIELDADVMAX=40
# DPAD
-DFEATURE_DPAD_5WIRESW_2OUT
-DPINS_DPAD_5WIRESW_OUT1=18
-DPINS_DPAD_5WIRESW_OUT2=19
-DPINS_DPAD_5WIRESW_IN1=4
-DPINS_DPAD_5WIRESW_IN2=5
-DPINS_DPAD_5WIRESW_IN3=27
# -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
)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
message(WARNING "Including lockscreen_plugin")
message(WARNING "Including plugins")
endif()

78
config_seatbot.cmake Normal file
View File

@ -0,0 +1,78 @@
set(BOBBY_APP_NAME bobbyquad_seatbot)
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_2OUT
-DPINS_DPAD_5WIRESW_OUT1=4
-DPINS_DPAD_5WIRESW_OUT2=5
-DPINS_DPAD_5WIRESW_IN1=18
-DPINS_DPAD_5WIRESW_IN2=19
-DPINS_DPAD_5WIRESW_IN3=27
# -DDPAD_BOARDCOMPUTER_V2
)
#if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
# include("${CMAKE_CURRENT_SOURCE_DIR}/ignore/lockscreen_plugin.cmake")
# message(WARNING "Including plugins")
#endif()

9
dependencies.lock Normal file
View File

@ -0,0 +1,9 @@
dependencies:
idf:
component_hash: null
source:
type: idf
version: 5.0.0
manifest_hash: 7c3516d5e235caf076ae74598eb0fa0e7367ac4e40a46f5f1c262bd592a127e4
target: esp32
version: 1.0.0

Submodule esp-idf updated: 44475ab503...d0026946cd

1
esp-protocols Submodule

Submodule esp-protocols added at 555cd0ab92

BIN
icons/alert.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

BIN
icons/bms.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
icons/close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

BIN
icons/git.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
icons/hardware.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
icons/shortcircuit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

View File

@ -1,7 +1,10 @@
set(headers
accessorhelpers.h
accessors/globalaccessors.h
accessors/settingsaccessors.h
accessors/wifiaccessors.h
accessors/wifiapconfigaccessors.h
accessors/wifistaconfigaccessors.h
actions/assertaction.h
actions/bluetoothbeginaction.h
actions/bluetoothbeginmasteraction.h
@ -19,7 +22,6 @@ set(headers
actions/ledstripblinkactions.h
actions/loadsettingsaction.h
actions/modesettingsaction.h
actions/multiaction.h
actions/qraction.h
actions/rebootaction.h
actions/savesettingsaction.h
@ -27,6 +29,8 @@ set(headers
actions/tempomatmodeapplycurrentpeedaction.h
actions/updateswapfrontbackaction.h
actions/wifiscanaction.h
actions/wifistascanaction.h
actions/wifistascanclearaction.h
battery.h
ble_bobby.h
bletexthelpers.h
@ -34,44 +38,49 @@ set(headers
bluetoothmode.h
bluetoothtexthelpers.h
bmsutils.h
buildserver.h
buttons.h
bobbyblinker.h
bobbybuttons.h
bobbycheckbox.h
bobbyerrorhandler.h
bobbyhupe.h
bobbyquickactions.h
bobbyschedulertask.h
bobbytypesafeenum.h
buildserver.h
can.h
changevaluedisplay_bluetoothmode.h
changevaluedisplay_bobbyquickactions.h
changevaluedisplay_controlmode.h
changevaluedisplay_controltype.h
changevaluedisplay_handbremsmode.h
changevaluedisplay_larsmmode_mode.h
changevaluedisplay_unifiedmodelmode.h
changevaluedisplay_wifi_mode_t.h
changevaluedisplay_wifi_power_t.h
cloud.h
cloudtexthelpers.h
configutils_bobby.h
controller.h
debugcolorhelpers.h
debuginputhandler.h
debugtexthelpers.h
displays/batterygraphdisplay.h
displays/bmsdisplay.h
displays/bobbychangevaluedisplay.h
displays/bobbydisplay.h
displays/bobbydisplaywithtitle.h
displays/bobbygraphdisplay.h
displays/bobbymenudisplay.h
displays/bobbypopupdisplay.h
displays/bobbysplitgraphdisplay.h
displays/calibratedisplay.h
displays/buttoncalibratedisplay.h
displays/calibratevoltagedisplay.h
displays/qrdisplay.h
displays/dpad5wire2outdebugdisplay.h
displays/dpad5wiredebugdisplay.h
displays/dpad6wiredebugdisplay.h
displays/confiscationdisplay.h
displays/gameoflifedisplay.h
displays/gametrakcalibratedisplay.h
displays/joystickdebugdisplay.h
displays/ledstripcolorsdisplay.h
displays/lockscreen.h
displays/menudisplaywithtime.cpp
displays/menudisplaywithtime.h
displays/menus/aboutmenu.h
displays/menus/accesspointwifisettingsmenu.h
displays/menus/batterydebugmenu.h
displays/menus/batterymenu.h
displays/menus/blesettingsmenu.h
@ -79,6 +88,7 @@ set(headers
displays/menus/bmsmenu.h
displays/menus/boardcomputerhardwaresettingsmenu.h
displays/menus/buzzermenu.h
displays/menus/candebugmenu.h
displays/menus/cloudsettingsmenu.h
displays/menus/commanddebugmenu.h
displays/menus/controllerhardwaresettingsmenu.h
@ -90,51 +100,61 @@ set(headers
displays/menus/enablemenu.h
displays/menus/espnowmenu.h
displays/menus/espnowsettingsmenu.h
displays/menus/extrabuttoncalibratemenu.h
displays/menus/featureflagsmenu.h
displays/menus/feedbackdebugmenu.h
displays/menus/garagenmenu.h
displays/menus/gametrakmodesettingsmenu.h
displays/menus/genericwifisettingsmenu.h
displays/menus/garagemenu.h
displays/menus/gitmenu.h
displays/menus/graphsmenu.h
displays/menus/greenpassmenu.h
displays/menus/handbremssettingsmenu.h
displays/menus/invertmenu.h
displays/menus/larsmmodesettingsmenu.h
displays/menus/ledstripmenu.h
displays/menus/ledstripselectanimationmenu.h
displays/menus/ledstripselectblinkmenu.h
displays/menus/ledstripselectotamode.h
displays/menus/limitssettingsmenu.h
displays/menus/lockscreensettingsmenu.h
displays/menus/mainmenu.h
displays/menus/manageprofilesmenu.h
displays/menus/mickmodesettingsmenu.h
displays/menus/modessettingsmenu.h
displays/menus/mosfetsmenu.h
displays/menus/motorfeedbackdebugmenu.h
displays/menus/motorstatedebugmenu.h
displays/menus/motortestmodesettingsmenu.h
displays/menus/networksettingsmenu.h
displays/menus/otamenu.h
displays/menus/presetsmenu.h
displays/menus/profilesmenu.h
displays/menus/selectbatterytypemenu.h
displays/menus/remotecontrolmodesettingsmenu.h
displays/menus/selectbuildserverbranch.h
displays/menus/selectbuildservermenu.h
displays/menus/selectmodemenu.h
displays/menus/selectotabuildmenu.h
displays/menus/settingsmenu.h
displays/menus/stationwifisettingsmenu.h
displays/menus/setupquickactionsmenu.h
displays/menus/statisticsmenu.h
displays/menus/taskmanagermenu.h
displays/menus/tempomatmodesettingsmenu.h
displays/menus/timersmenu.h
displays/menus/timesettingsmenu.h
displays/menus/typesafeenumchangemenu.h
displays/menus/udpcloudsettingsmenu.h
displays/menus/wifiscanmenu.h
displays/menus/wifisettingsmenu.h
displays/menus/wifiapclientsmenu.h
displays/menus/wifiapsettingsmenu.h
displays/menus/wifistaconfigentrymenu.h
displays/menus/wifistaconfigsmenu.h
displays/menus/wifistascanentrymenu.h
displays/menus/wifistascanmenu.h
displays/menus/wifistasettingsmenu.h
displays/metersdisplay.h
displays/pingpongdisplay.h
displays/popups/alertdisplay.h
displays/potiscalibratedisplay.h
displays/poweroffdisplay.h
displays/powersupplydisplay.h
displays/qrcodedebug.h
displays/qrdisplay.h
displays/qrimportdisplay.h
displays/spirodisplay.h
displays/starfielddisplay.h
@ -146,9 +166,10 @@ set(headers
dpad5wire.h
dpad5wire_2out.h
dpad6wire.h
dpad_boardcomputer_v2.h
drivingstatistics.h
esptexthelpers.h
espnowfunctions.h
esptexthelpers.h
feedbackparser.h
globals.h
handbremse.h
@ -160,6 +181,7 @@ set(headers
icons/buzzer.h
icons/close.h
icons/demos.h
icons/git.h
icons/graph.h
icons/greenpass.h
icons/hardware.h
@ -173,6 +195,7 @@ set(headers
icons/reboot.h
icons/scan.h
icons/settings.h
icons/shortcircuit.h
icons/statistics.h
icons/time.h
icons/update.h
@ -186,26 +209,30 @@ set(headers
modes/gametrakmode.h
modes/ignoreinputmode.h
modes/larsmmode.h
modes/mickmode.h
modes/motortestmode.h
modes/remotecontrolmode.h
modes/tempomatmode.h
modes/wheelchairmode.h
mosfets.h
newsettings.h
ota.h
potis.h
presets.h
profilesettings.h
qrimport.h
rotary.h
screens.h
serial_bobby.h
settings.h
settingspersister.h
settingsutils.h
statistics.h
statustexthelper.h
stringsettings.h
taskmanager.h
texts.h
tempomat.h
texthelpers/networktexthelpers.h
texthelpers/wifiaptexthelpers.h
texthelpers/wifistatexthelpers.h
time_bobbycar.h
types.h
udpcloud.h
@ -215,20 +242,16 @@ set(headers
webserver_displaycontrol.h
webserver_dumpnvs.h
webserver_lock.h
webserver_newsettings.h
webserver_ota.h
webserver_settings.h
webserver_stringsettings.h
webserver_newsettings.h
widgets/doubleprogressbar.h
displays/menudisplaywithtime.h
wifi_bobbycar.h
wifitexthelpers.h
wifiguiutils.h
)
set(sources
accessors/globalaccessors.cpp
accessors/settingsaccessors.cpp
accessors/wifiaccessors.cpp
accessors/wifistaconfigaccessors.cpp
actions/assertaction.cpp
actions/bluetoothbeginaction.cpp
actions/bluetoothbeginmasteraction.cpp
@ -246,7 +269,6 @@ set(sources
actions/ledstripblinkactions.cpp
actions/loadsettingsaction.cpp
actions/modesettingsaction.cpp
actions/multiaction.cpp
actions/qraction.cpp
actions/rebootaction.cpp
actions/savesettingsaction.cpp
@ -254,6 +276,8 @@ set(sources
actions/tempomatmodeapplycurrentpeedaction.cpp
actions/updateswapfrontbackaction.cpp
actions/wifiscanaction.cpp
actions/wifistascanaction.cpp
actions/wifistascanclearaction.cpp
battery.cpp
ble_bobby.cpp
bletexthelpers.cpp
@ -261,43 +285,44 @@ set(sources
bluetoothmode.cpp
bluetoothtexthelpers.cpp
bmsutils.cpp
buildserver.cpp
buttons.cpp
bobbyblinker.cpp
bobbybuttons.cpp
bobbyerrorhandler.cpp
bobbyhupe.cpp
bobbyquickactions.cpp
buildserver.cpp
can.cpp
changevaluedisplay_bluetoothmode.cpp
changevaluedisplay_bobbyquickactions.cpp
changevaluedisplay_controlmode.cpp
changevaluedisplay_controltype.cpp
changevaluedisplay_handbremsmode.cpp
changevaluedisplay_larsmmode_mode.cpp
changevaluedisplay_unifiedmodelmode.cpp
changevaluedisplay_wifi_mode_t.cpp
changevaluedisplay_wifi_power_t.cpp
cloud.cpp
cloudtexthelpers.cpp
configwrapper_bobby.cpp
controller.cpp
debugcolorhelpers.cpp
debuginputhandler.cpp
debugtexthelpers.cpp
displays/batterygraphdisplay.cpp
displays/bmsdisplay.cpp
displays/bobbychangevaluedisplay.cpp
displays/bobbydisplay.cpp
displays/bobbydisplaywithtitle.cpp
displays/bobbygraphdisplay.cpp
displays/bobbymenudisplay.cpp
displays/bobbypopupdisplay.cpp
displays/bobbysplitgraphdisplay.cpp
displays/calibratedisplay.cpp
displays/buttoncalibratedisplay.cpp
displays/calibratevoltagedisplay.cpp
displays/qrdisplay.cpp
displays/dpad5wire2outdebugdisplay.cpp
displays/dpad5wiredebugdisplay.cpp
displays/dpad6wiredebugdisplay.cpp
displays/confiscationdisplay.cpp
displays/gameoflifedisplay.cpp
displays/gametrakcalibratedisplay.cpp
displays/joystickdebugdisplay.cpp
displays/ledstripcolorsdisplay.cpp
displays/lockscreen.cpp
displays/menus/aboutmenu.cpp
displays/menus/accesspointwifisettingsmenu.cpp
displays/menus/batterydebugmenu.cpp
displays/menus/batterymenu.cpp
displays/menus/blesettingsmenu.cpp
@ -305,6 +330,7 @@ set(sources
displays/menus/bmsmenu.cpp
displays/menus/boardcomputerhardwaresettingsmenu.cpp
displays/menus/buzzermenu.cpp
displays/menus/candebugmenu.cpp
displays/menus/cloudsettingsmenu.cpp
displays/menus/commanddebugmenu.cpp
displays/menus/controllerhardwaresettingsmenu.cpp
@ -316,51 +342,61 @@ set(sources
displays/menus/enablemenu.cpp
displays/menus/espnowmenu.cpp
displays/menus/espnowsettingsmenu.cpp
displays/menus/extrabuttoncalibratemenu.cpp
displays/menus/featureflagsmenu.cpp
displays/menus/feedbackdebugmenu.cpp
displays/menus/garagenmenu.cpp
displays/menus/gametrakmodesettingsmenu.cpp
displays/menus/genericwifisettingsmenu.cpp
displays/menus/garagemenu.cpp
displays/menus/gitmenu.cpp
displays/menus/graphsmenu.cpp
displays/menus/greenpassmenu.cpp
displays/menus/handbremssettingsmenu.cpp
displays/menus/invertmenu.cpp
displays/menus/larsmmodesettingsmenu.cpp
displays/menus/ledstripmenu.cpp
displays/menus/ledstripselectanimationmenu.cpp
displays/menus/ledstripselectblinkmenu.cpp
displays/menus/ledstripselectotamode.cpp
displays/menus/limitssettingsmenu.cpp
displays/menus/lockscreensettingsmenu.cpp
displays/menus/mainmenu.cpp
displays/menus/manageprofilesmenu.cpp
displays/menus/mickmodesettingsmenu.cpp
displays/menus/modessettingsmenu.cpp
displays/menus/mosfetsmenu.cpp
displays/menus/motorfeedbackdebugmenu.cpp
displays/menus/motorstatedebugmenu.cpp
displays/menus/motortestmodesettingsmenu.cpp
displays/menus/networksettingsmenu.cpp
displays/menus/otamenu.cpp
displays/menus/presetsmenu.cpp
displays/menus/profilesmenu.cpp
displays/menus/selectbatterytypemenu.cpp
displays/menus/remotecontrolmodesettingsmenu.cpp
displays/menus/selectbuildserverbranch.cpp
displays/menus/selectbuildservermenu.cpp
displays/menus/selectmodemenu.cpp
displays/menus/selectotabuildmenu.cpp
displays/menus/settingsmenu.cpp
displays/menus/stationwifisettingsmenu.cpp
displays/menus/setupquickactionsmenu.cpp
displays/menus/statisticsmenu.cpp
displays/menus/taskmanagermenu.cpp
displays/menus/tempomatmodesettingsmenu.cpp
displays/menus/timersmenu.cpp
displays/menus/timesettingsmenu.cpp
displays/menus/typesafeenumchangemenu.cpp
displays/menus/udpcloudsettingsmenu.cpp
displays/menus/wifiscanmenu.cpp
displays/menus/wifisettingsmenu.cpp
displays/menus/wifiapclientsmenu.cpp
displays/menus/wifiapsettingsmenu.cpp
displays/menus/wifistaconfigentrymenu.cpp
displays/menus/wifistaconfigsmenu.cpp
displays/menus/wifistascanentrymenu.cpp
displays/menus/wifistascanmenu.cpp
displays/menus/wifistasettingsmenu.cpp
displays/metersdisplay.cpp
displays/pingpongdisplay.cpp
displays/popups/alertdisplay.cpp
displays/potiscalibratedisplay.cpp
displays/poweroffdisplay.cpp
displays/powersupplydisplay.cpp
displays/qrcodedebug.cpp
displays/qrdisplay.cpp
displays/qrimportdisplay.cpp
displays/spirodisplay.cpp
displays/starfielddisplay.cpp
@ -372,9 +408,10 @@ set(sources
dpad5wire.cpp
dpad5wire_2out.cpp
dpad6wire.cpp
dpad_boardcomputer_v2.cpp
drivingstatistics.cpp
esptexthelpers.cpp
espnowfunctions.cpp
esptexthelpers.cpp
feedbackparser.cpp
globals.cpp
handbremse.cpp
@ -386,6 +423,7 @@ set(sources
icons/buzzer.cpp
icons/close.cpp
icons/demos.cpp
icons/git.cpp
icons/graph.cpp
icons/greenpass.cpp
icons/hardware.cpp
@ -399,6 +437,7 @@ set(sources
icons/reboot.cpp
icons/scan.cpp
icons/settings.cpp
icons/shortcircuit.cpp
icons/statistics.cpp
icons/time.cpp
icons/update.cpp
@ -413,26 +452,30 @@ set(sources
modes/gametrakmode.cpp
modes/ignoreinputmode.cpp
modes/larsmmode.cpp
modes/mickmode.cpp
modes/motortestmode.cpp
modes/remotecontrolmode.cpp
modes/tempomatmode.cpp
modes/wheelchairmode.cpp
mosfets.cpp
newsettings.cpp
ota.cpp
potis.cpp
presets.cpp
profilesettings.cpp
qrimport.cpp
rotary.cpp
screens.cpp
serial_bobby.cpp
settings.cpp
settingspersister.cpp
settingsutils.cpp
statistics.cpp
statustexthelper.cpp
stringsettings.cpp
taskmanager.cpp
texts.cpp
tempomat.cpp
texthelpers/networktexthelpers.cpp
texthelpers/wifiaptexthelpers.cpp
texthelpers/wifistatexthelpers.cpp
time_bobbycar.cpp
types.cpp
udpcloud.cpp
@ -442,19 +485,18 @@ set(sources
webserver_displaycontrol.cpp
webserver_dumpnvs.cpp
webserver_lock.cpp
webserver_newsettings.cpp
webserver_ota.cpp
webserver_settings.cpp
webserver_stringsettings.cpp
webserver_newsettings.cpp
widgets/doubleprogressbar.cpp
wifi_bobbycar.cpp
wifitexthelpers.cpp
wifiguiutils.cpp
)
set(dependencies
freertos nvs_flash esp_http_server esp_https_ota mdns app_update esp_system esp_websocket_client driver
arduino-esp32 ArduinoJson esp-nimble-cpp FastLED-idf TFT_eSPI QRCode-esp32
bobbycar-protocol cpputils cxx-ring-buffer date
bobbycar-protocol cpputils cxx-ring-buffer date sunset
espasynchttpreq espasyncota espchrono espcpputils espconfiglib esp-gui-lib esphttpdutils espwifistack expected fmt
)
@ -468,6 +510,24 @@ idf_component_register(
${dependencies}
)
execute_process(COMMAND git rev-parse HEAD
OUTPUT_VARIABLE GIT_REV ERROR_QUIET
)
execute_process(
COMMAND git log -1 --pretty=%B
OUTPUT_VARIABLE GIT_MESSAGE ERROR_QUIET
)
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE GIT_BRANCH
)
string(STRIP "${GIT_REV}" GIT_REV)
string(SUBSTRING "${GIT_REV}" 1 7 GIT_SHORT_REV)
string(STRIP "${GIT_MESSAGE}" GIT_MESSAGE)
string(SUBSTRING "${GIT_MESSAGE}" 0 100 GIT_MESSAGE)
string(STRIP "${GIT_BRANCH}" GIT_BRANCH)
target_compile_options(${COMPONENT_TARGET}
PRIVATE
-fstack-reuse=all
@ -477,5 +537,9 @@ target_compile_options(${COMPONENT_TARGET}
-Wno-deprecated-declarations
-Wno-missing-field-initializers
-Wno-parentheses
-DGIT_REV="${GIT_REV}"
-DGIT_SHORT_REV="${GIT_SHORT_REV}"
-DGIT_MESSAGE="${GIT_MESSAGE}"
-DGIT_BRANCH="${GIT_BRANCH}"
${BOBBYCAR_BUILDFLAGS}
)

77
main/accessorhelpers.h Normal file
View File

@ -0,0 +1,77 @@
#pragma once
// system includes
#include <cstdint>
// 3rdparty lib includes
#include <accessorinterface.h>
// local includes
#include "utils.h"
#include "newsettings.h"
//! Special type of RefAccessor that also saves settings after setValue()
template<typename T>
struct RefAccessorSaveSettings : public virtual espgui::RefAccessor<T>
{
typename espgui::AccessorInterface<T>::setter_result_t setValue(T value) override
{
espgui::RefAccessor<T>::setValue(value);
if (!saveProfileSettings())
return tl::make_unexpected("saveProfileSettings() failed!");
return {};
};
};
template<typename T>
struct NewSettingsAccessor : public virtual espgui::AccessorInterface<T>
{
virtual ConfigWrapper<T>& getConfig() const = 0;
T getValue() const override
{
return getConfig().value();
}
typename espgui::AccessorInterface<T>::setter_result_t setValue(T value) override
{
return configs.write_config(getConfig(), value);
}
};
template<typename T>
struct NewSettingsChronoAdaptorAccessor;
template<>
struct NewSettingsChronoAdaptorAccessor<espchrono::minutes32> : public virtual espgui::AccessorInterface<int32_t>
{
virtual ConfigWrapper<espchrono::minutes32>& getConfig() const = 0;
int32_t getValue() const override
{
return getConfig().value().count();
}
typename espgui::AccessorInterface<int32_t>::setter_result_t setValue(int32_t value) override
{
return configs.write_config(getConfig(), espchrono::minutes32{value});
}
};
template<>
struct NewSettingsChronoAdaptorAccessor<espchrono::milliseconds32> : public virtual espgui::AccessorInterface<int32_t>
{
virtual ConfigWrapper<espchrono::milliseconds32>& getConfig() const = 0;
int32_t getValue() const override
{
return getConfig().value().count();
}
typename espgui::AccessorInterface<int32_t>::setter_result_t setValue(int32_t value) override
{
return configs.write_config(getConfig(), espchrono::milliseconds32{value});
}
};

View File

@ -1 +0,0 @@
#include "globalaccessors.h"

View File

@ -1 +0,0 @@
#include "settingsaccessors.h"

View File

@ -6,222 +6,258 @@
// local includes
#include "globals.h"
#include "utils.h"
//! Special type of RefAccessor that also saves settings after setValue()
template<typename T>
struct RefAccessorSaveSettings : public virtual espgui::RefAccessor<T>
{
void setValue(T value) override { espgui::RefAccessor<T>::setValue(value); saveSettings(); };
};
// Bms
#ifdef FEATURE_BMS
struct AutoConnectBmsAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.autoConnectBms; } };
#endif
// Buzzer
struct ReverseBeepAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.buzzer.reverseBeep; } };
struct ReverseBeepFreq0Accessor : public RefAccessorSaveSettings<uint8_t> { uint8_t &getRef() const override { return settings.buzzer.reverseBeepFreq0; } };
struct ReverseBeepFreq1Accessor : public RefAccessorSaveSettings<uint8_t> { uint8_t &getRef() const override { return settings.buzzer.reverseBeepFreq1; } };
struct ReverseBeepDuration0Accessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.buzzer.reverseBeepDuration0; } };
struct ReverseBeepDuration1Accessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.buzzer.reverseBeepDuration1; } };
// Limits
struct IMotMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.limits.iMotMax; } };
struct IDcMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.limits.iDcMax; } };
struct NMotMaxKmhAccessor : public virtual espgui::AccessorInterface<int16_t>
{
int16_t getValue() const override { return convertToKmh(settings.limits.nMotMax); }
void setValue(int16_t value) override { settings.limits.nMotMax = convertFromKmh(value); saveSettings(); }
};
struct NMotMaxRpmAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.limits.nMotMax; } };
struct FieldWeakMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.limits.fieldWeakMax; } };
struct PhaseAdvMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.limits.phaseAdvMax; } };
// WiFi
struct WifiStaEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.wifiSettings.wifiStaEnabled; } };
struct WifiApEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.wifiSettings.wifiApEnabled; } };
#include "accessorhelpers.h"
#include "newsettings.h"
// Bluetooth
#ifdef FEATURE_BLUETOOTH
struct AutoBluetoothModeAccessor : public RefAccessorSaveSettings<BluetoothMode> { BluetoothMode &getRef() const override { return settings.bluetoothSettings.autoBluetoothMode; } };
#endif
struct BluetoothNameAccessor : public NewSettingsAccessor<std::string> { ConfigWrapper<std::string> &getConfig() const override { return configs.bluetoothName; } };
// Buzzer
struct ReverseBeepAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.reverseBeep; } };
struct ReverseBeepFreq0Accessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.reverseBeepFreq0; } };
struct ReverseBeepFreq1Accessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.reverseBeepFreq1; } };
struct ReverseBeepDuration0Accessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.reverseBeepDuration0; } };
struct ReverseBeepDuration1Accessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.reverseBeepDuration1; } };
// Limits
struct IMotMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return profileSettings.limits.iMotMax; } };
struct IDcMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return profileSettings.limits.iDcMax; } };
struct NMotMaxKmhAccessor : public virtual espgui::AccessorInterface<int16_t>
{
int16_t getValue() const override { return convertToKmh(profileSettings.limits.nMotMax); }
espgui::AccessorInterface<int16_t>::setter_result_t setValue(int16_t value) override
{
profileSettings.limits.nMotMax = convertFromKmh(value);
if (!saveProfileSettings())
return tl::make_unexpected("saveProfileSettings() failed!");
return {};
}
};
struct NMotMaxRpmAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return profileSettings.limits.nMotMax; } };
struct FieldWeakMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return profileSettings.limits.fieldWeakMax; } };
struct PhaseAdvMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return profileSettings.limits.phaseAdvMax; } };
// Bluetooth Low Energy
#ifdef FEATURE_BLE
struct BleEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.bleSettings.bleEnabled; } };
#endif
struct BleEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.bleSettings.bleEnabled; } };
// Cloud
#ifdef FEATURE_CLOUD
struct CloudEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.cloudSettings.cloudEnabled; } };
struct CloudTransmitTimeoutAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.cloudSettings.cloudTransmitTimeout; } };
#endif
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; } };
// Time
struct TimezoneOffsetAccessor : public virtual espgui::AccessorInterface<int32_t>
{
int32_t getValue() const override { return settings.timeSettings.timezoneOffset.count(); }
void setValue(int32_t value) override { settings.timeSettings.timezoneOffset = espchrono::minutes32{value}; saveSettings(); }
};
struct DaylightSavingModeAccessor : public RefAccessorSaveSettings<espchrono::DayLightSavingMode> { espchrono::DayLightSavingMode &getRef() const override { return settings.timeSettings.daylightSavingMode; } };
#ifdef FEATURE_NTP
struct TimeServerEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.timeSettings.timeServerEnabled; } };
struct TimeSyncModeAccessor : public RefAccessorSaveSettings<sntp_sync_mode_t> { sntp_sync_mode_t &getRef() const override { return settings.timeSettings.timeSyncMode; } };
struct TimeSyncIntervalAccessor : public virtual espgui::AccessorInterface<int32_t>
{
int32_t getValue() const override { return settings.timeSettings.timeSyncInterval.count(); }
void setValue(int32_t value) override { settings.timeSettings.timeSyncInterval = espchrono::milliseconds32{value}; saveSettings(); }
};
#endif
//struct TimezoneOffsetAccessor : public NewSettingsAccessor<int32_t> { ConfigWrapper<int32_t> &getConfig() const override { return configs.timezoneOffset; } };
struct TimezoneOffsetAccessor : public NewSettingsChronoAdaptorAccessor<espchrono::minutes32> { ConfigWrapper<espchrono::minutes32> &getConfig() const override { return configs.timezoneOffset; } };
struct DaylightSavingModeAccessor : public NewSettingsAccessor<espchrono::DayLightSavingMode> { ConfigWrapper<espchrono::DayLightSavingMode> &getConfig() const override { return configs.timeDst; } };
struct TimeServerEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.timeServerEnabled; } };
struct TimeServerAccessor : public NewSettingsAccessor<std::string> { ConfigWrapper<std::string> &getConfig() const override { return configs.timeServer; } };
struct TimeSyncModeAccessor : public NewSettingsAccessor<sntp_sync_mode_t> { ConfigWrapper<sntp_sync_mode_t> &getConfig() const override { return configs.timeSyncMode; } };
//struct TimeSyncIntervalAccessor : public NewSettingsAccessor<int32_t> { ConfigWrapper<int32_t> &getConfig() const override { return configs.timeSyncInterval; } };
struct TimeSyncIntervalAccessor : public NewSettingsChronoAdaptorAccessor<espchrono::milliseconds32> { ConfigWrapper<espchrono::milliseconds32> &getConfig() const override { return configs.timeSyncInterval; } };
// Controller Hardware
struct FrontLeftEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.controllerHardware.enableFrontLeft; } };
struct FrontRightEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.controllerHardware.enableFrontRight; } };
struct BackLeftEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.controllerHardware.enableBackLeft; } };
struct BackRightEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.controllerHardware.enableBackRight; } };
struct FrontLeftEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return profileSettings.controllerHardware.enableFrontLeft; } };
struct FrontRightEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return profileSettings.controllerHardware.enableFrontRight; } };
struct BackLeftEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return profileSettings.controllerHardware.enableBackLeft; } };
struct BackRightEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return profileSettings.controllerHardware.enableBackRight; } };
struct FrontLeftInvertedAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.controllerHardware.invertFrontLeft; } };
struct FrontRightInvertedAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.controllerHardware.invertFrontRight; } };
struct BackLeftInvertedAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.controllerHardware.invertBackLeft; } };
struct BackRightInvertedAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.controllerHardware.invertBackRight; } };
struct FrontLeftInvertedAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return profileSettings.controllerHardware.invertFrontLeft; } };
struct FrontRightInvertedAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return profileSettings.controllerHardware.invertFrontRight; } };
struct BackLeftInvertedAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return profileSettings.controllerHardware.invertBackLeft; } };
struct BackRightInvertedAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return profileSettings.controllerHardware.invertBackRight; } };
struct WheelDiameterMmAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.controllerHardware.wheelDiameter; } };
struct WheelDiameterMmAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.controllerHardware.wheelDiameter; } };
struct WheelDiameterInchAccessor : public virtual espgui::AccessorInterface<float>
{
float getValue() const override { return convertToInch(settings.controllerHardware.wheelDiameter); }
void setValue(float value) override { settings.controllerHardware.wheelDiameter = convertFromInch(value); saveSettings(); }
float getValue() const override { return convertToInch(configs.controllerHardware.wheelDiameter.value()); }
espgui::AccessorInterface<int16_t>::setter_result_t setValue(float value) override
{
// profileSettings.controllerHardware.wheelDiameter = convertFromInch(value);
// if (!saveProfileSettings())
// return tl::make_unexpected("saveProfileSettings() failed!");
// return {};
return configs.write_config(configs.controllerHardware.wheelDiameter, convertFromInch(value));
}
};
struct NumMagnetPolesAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.controllerHardware.numMagnetPoles; } };
struct SwapFrontBackAccessor : public RefAccessorSaveSettings<bool> {
bool &getRef() const override { return settings.controllerHardware.swapFrontBack; }
struct NumMagnetPolesAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.controllerHardware.numMagnetPoles; } };
struct SwapFrontBackAccessor : public virtual espgui::AccessorInterface<bool> {
bool getValue() const override { return configs.controllerHardware.swapFrontBack.value(); }
setter_result_t setValue(bool value) override
{
const auto err = configs.write_config(configs.controllerHardware.swapFrontBack, value);
#ifdef FEATURE_SERIAL
void setValue(bool value) override { RefAccessorSaveSettings<bool>::setValue(value); updateSwapFrontBack(); };
updateSwapFrontBack();
#endif
return err;
}
};
// CAN
#ifdef FEATURE_CAN
struct SendFrontCanCmdAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.controllerHardware.sendFrontCanCmd; } };
struct SendBackCanCmdAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.controllerHardware.sendBackCanCmd; } };
struct CanTransmitTimeoutAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.controllerHardware.canTransmitTimeout; } };
struct CanReceiveTimeoutAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.controllerHardware.canReceiveTimeout; } };
struct SendFrontCanCmdAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.controllerHardware.sendFrontCanCmd; } };
struct SendBackCanCmdAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.controllerHardware.sendBackCanCmd; } };
struct CanTransmitTimeoutAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.controllerHardware.canTransmitTimeout; } };
struct CanReceiveTimeoutAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.controllerHardware.canReceiveTimeout; } };
#endif
// Input devices
struct SampleCountAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.sampleCount; } };
struct GasMinAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.gasMin; } };
struct GasMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.gasMax; } };
struct BremsMinAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.bremsMin; } };
struct BremsMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.bremsMax; } };
#if defined(FEATURE_DPAD) || defined(FEATURE_DPAD_3WIRESW) || defined(FEATURE_DPAD_5WIRESW) || defined(FEATURE_DPAD_5WIRESW_2OUT) || defined (FEATURE_DPAD_6WIRESW)
struct DPadDebounceAccessor : public RefAccessorSaveSettings<uint8_t> { uint8_t &getRef() const override { return settings.boardcomputerHardware.dpadDebounce; } };
struct SampleCountAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.sampleCount; } };
struct GasMinAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.gasMin; } };
struct GasMaxAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.gasMax; } };
struct BremsMinAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.bremsMin; } };
struct BremsMaxAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.bremsMax; } };
#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)
struct DPadDebounceAccessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadDebounce; } };
struct ButtonDelayAccessor : public NewSettingsAccessor<uint16_t> { ConfigWrapper<uint16_t> &getConfig() const override { return configs.buttonReadDelay; } };
#endif
#ifdef FEATURE_GAMETRAK
struct GametrakXMinAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.gametrakXMin; } };
struct GametrakXMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.gametrakXMax; } };
struct GametrakYMinAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.gametrakYMin; } };
struct GametrakYMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.gametrakYMax; } };
struct GametrakDistMinAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.gametrakDistMin; } };
struct GametrakDistMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.gametrakDistMax; } };
struct GametrakXMinAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.gametrakXMin; } };
struct GametrakXMaxAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.gametrakXMax; } };
struct GametrakYMinAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.gametrakYMin; } };
struct GametrakYMaxAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.gametrakYMax; } };
struct GametrakDistMinAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.gametrakDistMin; } };
struct GametrakDistMaxAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.gametrakDistMax; } };
#endif
struct StatsUpdateRateAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.timersSettings.statsUpdateRate; } };
struct StatsUpdateRateAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.timersSettings.statsUpdateRate; } };
// Cloud
#ifdef FEATURE_CLOUD
struct CloudCollectRateAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.timersSettings.cloudCollectRate; } };
struct CloudSendRateAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.timersSettings.cloudSendRate; } };
#endif
struct CloudCollectRateAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.timersSettings.cloudCollectRate; } };
struct CloudSendRateAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.boardcomputerHardware.timersSettings.cloudSendRate; } };
#ifdef FEATURE_UDPCLOUD
struct UdpCloudSendIntervalAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.timersSettings.udpSendRateMs; } };
struct UdpCloudEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.udpCloudSettings.udpCloudEnabled; } };
struct CloudDebugEnableAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.udpCloudSettings.enableCloudDebug; } };
struct UdpUseStdStringAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.udpCloudSettings.udpUseStdString; } };
#endif
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; } };
// DefaultMode
struct DefaultModeModelModeAccessor : public RefAccessorSaveSettings<UnifiedModelMode> { UnifiedModelMode &getRef() const override { return settings.defaultMode.modelMode; } };
struct DefaultModeHybridModelModeAccessor : public RefAccessorSaveSettings<UnifiedModelMode> { UnifiedModelMode &getRef() const override { return settings.hybrid.hybridMode; } };
struct DefaultModeSquareGasAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.defaultMode.squareGas; } };
struct DefaultModeSquareBremsAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.defaultMode.squareBrems; } };
struct DefaultModeModelModeAccessor : public RefAccessorSaveSettings<UnifiedModelMode> { UnifiedModelMode &getRef() const override { return profileSettings.defaultMode.modelMode; } };
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; } };
struct DefaultModeEnableSmoothingUpAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.defaultMode.enableSmoothingUp; } };
struct DefaultModeEnableSmoothingDownAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.defaultMode.enableSmoothingDown; } };
struct DefaultModeEnableFieldWeakSmoothingUpAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.defaultMode.enableFieldWeakSmoothingUp; } };
struct DefaultModeEnableFieldWeakSmoothingDownAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.defaultMode.enableFieldWeakSmoothingDown; } };
struct DefaultModeEnableFieldWeakSmoothingLowerLimitAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.defaultMode.fwSmoothLowerLimit; } };
struct DefaultModeEnableSmoothingUpAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return profileSettings.defaultMode.enableSmoothingUp; } };
struct DefaultModeEnableSmoothingDownAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return profileSettings.defaultMode.enableSmoothingDown; } };
struct DefaultModeEnableFieldWeakSmoothingUpAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return profileSettings.defaultMode.enableFieldWeakSmoothingUp; } };
struct DefaultModeEnableFieldWeakSmoothingDownAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return profileSettings.defaultMode.enableFieldWeakSmoothingDown; } };
struct DefaultModeEnableFieldWeakSmoothingLowerLimitAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return profileSettings.defaultMode.fwSmoothLowerLimit; } };
struct DefaultModeSmoothingAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.defaultMode.smoothing; } };
struct DefaultModeFrontPercentageAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.defaultMode.frontPercentage; } };
struct DefaultModeBackPercentageAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.defaultMode.backPercentage; } };
struct DefaultModeAddSchwelleAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.defaultMode.add_schwelle; } };
struct DefaultModeGas1WertAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.defaultMode.gas1_wert; } };
struct DefaultModeGas2WertAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.defaultMode.gas2_wert; } };
struct DefaultModeBrems1WertAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.defaultMode.brems1_wert; } };
struct DefaultModeBrems2WertAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.defaultMode.brems2_wert; } };
struct DefaultModeEnableHybridAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.hybrid.enable; } };
struct DefaultModeHybridActivationLimitAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.hybrid.activationLimit; } };
struct DefaultModeHybridDeactivationLimitAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.hybrid.deactivationLimit; } };
struct DefaultModeSmoothingAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return profileSettings.defaultMode.smoothing; } };
struct DefaultModeFrontPercentageAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return profileSettings.defaultMode.frontPercentage; } };
struct DefaultModeBackPercentageAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return profileSettings.defaultMode.backPercentage; } };
struct DefaultModeAddSchwelleAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return profileSettings.defaultMode.add_schwelle; } };
struct DefaultModeGas1WertAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return profileSettings.defaultMode.gas1_wert; } };
struct DefaultModeGas2WertAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return profileSettings.defaultMode.gas2_wert; } };
struct DefaultModeBrems1WertAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return profileSettings.defaultMode.brems1_wert; } };
struct DefaultModeBrems2WertAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return profileSettings.defaultMode.brems2_wert; } };
// TempomatMode
struct TempomatModeModelModeAccessor : public RefAccessorSaveSettings<UnifiedModelMode> { UnifiedModelMode &getRef() const override { return settings.tempomatMode.modelMode; } };
struct TempomatModeModelModeAccessor : public RefAccessorSaveSettings<UnifiedModelMode> { UnifiedModelMode &getRef() const override { return profileSettings.tempomatMode.modelMode; } };
// LarsmMode
struct LarsmModeModelModeAccessor : public RefAccessorSaveSettings<UnifiedModelMode> { UnifiedModelMode &getRef() const override { return settings.larsmMode.modelMode; } };
struct LarsmModeModeAccessor : public RefAccessorSaveSettings<LarsmModeMode> { LarsmModeMode &getRef() const override { return settings.larsmMode.mode; } };
struct LarsmModeIterationsAccessor : public RefAccessorSaveSettings<uint8_t> { uint8_t &getRef() const override { return settings.larsmMode.iterations; } };
struct LarsmModeModelModeAccessor : public RefAccessorSaveSettings<UnifiedModelMode> { UnifiedModelMode &getRef() const override { return profileSettings.larsmMode.modelMode; } };
struct LarsmModeModeAccessor : public RefAccessorSaveSettings<LarsmModeMode> { LarsmModeMode &getRef() const override { return profileSettings.larsmMode.mode; } };
struct LarsmModeIterationsAccessor : public RefAccessorSaveSettings<uint8_t> { uint8_t &getRef() const override { return profileSettings.larsmMode.iterations; } };
// MotortestMode
struct MotortestModeMultiplikatorAccessor : public RefAccessorSaveSettings<uint8_t> { uint8_t &getRef() const override { return settings.motortestMode.multiplikator; } };
struct MotortestMaxPwmAccessor : public RefAccessorSaveSettings<uint16_t> { uint16_t &getRef() const override { return settings.motortestMode.maxPwm; } };
struct MotortestModeMultiplikatorAccessor : public RefAccessorSaveSettings<uint8_t> { uint8_t &getRef() const override { return profileSettings.motortestMode.multiplikator; } };
struct MotortestMaxPwmAccessor : public RefAccessorSaveSettings<uint16_t> { uint16_t &getRef() const override { return profileSettings.motortestMode.maxPwm; } };
// MickMode
struct MickModeModelModeAccessor : public RefAccessorSaveSettings<UnifiedModelMode> { UnifiedModelMode &getRef() const override { return profileSettings.mickMode.modelMode; } };
struct MickModeSmoothingAccessor : public RefAccessorSaveSettings<uint16_t> { uint16_t &getRef() const override { return profileSettings.mickMode.smoothing; } };
// Remote Control Mode
struct RemoteControlModeModelModeAccessor : public RefAccessorSaveSettings<UnifiedModelMode> { UnifiedModelMode &getRef() const override { return profileSettings.remoteControlMode.modelMode; } };
// Ledstrip
#ifdef FEATURE_LEDSTRIP
struct EnableLedAnimationAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.ledstrip.enableLedAnimation; } };
struct EnableBrakeLightsAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.ledstrip.enableBrakeLights; } };
struct LedsCountAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.ledstrip.ledsCount; } };
struct CenterOffsetAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.ledstrip.centerOffset; } };
struct SmallOffsetAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.ledstrip.smallOffset; } };
struct BigOffsetAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.ledstrip.bigOffset; } };
struct DeziampereAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.ledstrip.deziampere; } };
struct EnableBeepWhenBlinkAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.ledstrip.enableBeepWhenBlink; } };
struct EnableFullBlinkAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.ledstrip.enableFullBlink; } };
struct EnableLedstripStVOAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.ledstrip.enableStVO; } };
struct LedsStVOFrontOffsetAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.ledstrip.stvoFrontOffset; } };
struct LedsStVOFrontLengthAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.ledstrip.stvoFrontLength; } };
struct EnableLedstripStVOFrontlight : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.ledstrip.stvoFrontEnable; } };
struct AnimationMultiplierAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.ledstrip.animationMultiplier; } };
struct LedstripBrightnessAccessor : public RefAccessorSaveSettings<uint8_t> { uint8_t &getRef() const override { return settings.ledstrip.brightness; } };
struct LedstripEnableBlinkAnimationAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.ledstrip.enableAnimBlink; } };
#ifdef FEATURE_OTA
struct LedstripOtaAnimationAccessor : public RefAccessorSaveSettings<OtaAnimationModes> { OtaAnimationModes &getRef() const override { return settings.ledstrip.otaMode; } };
#endif
#endif
struct EnableLedAnimationAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.ledstrip.enableLedAnimation; } };
struct EnableBrakeLightsAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.ledstrip.enableBrakeLights; } };
struct LedsCountAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.ledstrip.ledsCount; } };
struct CenterOffsetAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.ledstrip.centerOffset; } };
struct SmallOffsetAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.ledstrip.smallOffset; } };
struct BigOffsetAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.ledstrip.bigOffset; } };
struct LedStripMaxMilliampsAccessor : public NewSettingsAccessor<uint32_t> { ConfigWrapper<uint32_t> &getConfig() const override { return configs.ledstrip.maxMilliamps; } };
struct LedStripMaxAmpereAccessor : public virtual espgui::AccessorInterface<float>
{
float getValue() const override
{
return configs.ledstrip.maxMilliamps.value() / 1000.f;
}
espgui::AccessorInterface<float>::setter_result_t setValue(float value) override
{
return configs.write_config(configs.ledstrip.maxMilliamps, value * 1000);
}
};
struct EnableBeepWhenBlinkAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.ledstrip.enableBeepWhenBlink; } };
struct EnableFullBlinkAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.ledstrip.enableFullBlink; } };
struct EnableLedstripStVOAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.ledstrip.enableStVO; } };
struct LedsStVOFrontOffsetAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.ledstrip.stvoFrontOffset; } };
struct LedsStVOFrontLengthAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.ledstrip.stvoFrontLength; } };
struct EnableLedstripStVOFrontlight : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.ledstrip.stvoFrontEnable; } };
struct AnimationMultiplierAccessor : public NewSettingsAccessor<int16_t> { ConfigWrapper<int16_t> &getConfig() const override { return configs.ledstrip.animationMultiplier; } };
struct LedstripBrightnessAccessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.ledstrip.brightness; } };
struct LedstripEnableBlinkAnimationAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.ledstrip.enableAnimBlink; } };
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; } };
// Battery
struct BatterySeriesCellsAccessor : public RefAccessorSaveSettings<uint8_t> { uint8_t &getRef() const override { return settings.battery.cellsSeries; } };
struct BatteryParallelCellsAccessor : public RefAccessorSaveSettings<uint8_t> { uint8_t &getRef() const override { return settings.battery.cellsParallel; } };
struct BatteryWHperKMAccessor : public RefAccessorSaveSettings<uint16_t> { uint16_t &getRef() const override { return settings.battery.watthoursPerKilometer; } };
struct BatteryApplyCalibrationAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.battery.applyCalibration; } };
struct BatterySeriesCellsAccessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.battery.cellsSeries; } };
struct BatteryParallelCellsAccessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.battery.cellsParallel; } };
struct BatteryWHperKMAccessor : public NewSettingsAccessor<uint16_t> { ConfigWrapper<uint16_t> &getConfig() const override { return configs.battery.watthoursPerKilometer; } };
struct BatteryApplyCalibrationAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.battery.applyCalibration; } };
// Lockscreen
struct LockscreenAllowPresetSwitchAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.lockscreen.allowPresetSwitch; } };
struct LockscreenAllowPresetSwitchAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.lockscreen.allowPresetSwitch; } };
template<uint8_t index>
struct LockscreenPinDigitAccessor : public RefAccessorSaveSettings<int8_t> { int8_t &getRef() const override { return settings.lockscreen.pin[index]; } };
struct LockscreenKeepLockedAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.lockscreen.keepLockedAfterReboot; } };
struct LockscreenPinDigitAccessor : public NewSettingsAccessor<int8_t> { ConfigWrapper<int8_t> &getConfig() const override { return configs.lockscreen.pin[index]; } };
struct LockscreenKeepLockedAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.lockscreen.keepLockedAfterReboot; } };
// Handbremse
struct HandbremsEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.handbremse.enable; } };
struct HandbremsModeAccessor : public RefAccessorSaveSettings<HandbremseMode> { HandbremseMode &getRef() const override { return settings.handbremse.mode; } };
struct HandbremsTimeoutAccessor : public RefAccessorSaveSettings<uint16_t> { uint16_t &getRef() const override { return settings.handbremse.triggerTimeout; } };
struct HandbremsAutomaticAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.handbremse.automatic; } };
struct HandbremsVisualizeAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.handbremse.visualize; } };
struct HandbremsEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.handbremse.enable; } };
struct HandbremsModeAccessor : public NewSettingsAccessor<HandbremseMode> { ConfigWrapper<HandbremseMode> &getConfig() const override { return configs.handbremse.mode; } };
struct HandbremsTimeoutAccessor : public NewSettingsAccessor<uint16_t> { ConfigWrapper<uint16_t> &getConfig() const override { return configs.handbremse.triggerTimeout; } };
struct HandbremsAutomaticAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.handbremse.automatic; } };
struct HandbremsVisualizeAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.handbremse.visualize; } };
// ESP Now
#ifdef FEATURE_ESPNOW
struct ESPNowSyncTimeEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.espnow.syncTime; } };
struct ESPNowSyncTimeWithOthersEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.espnow.syncTimeWithOthers; } };
struct ESPNowSyncBlinkEnabledAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.espnow.syncBlink; } };
#endif
struct ESPNowSyncTimeEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.espnow.syncTime; } };
struct ESPNowSyncTimeWithOthersEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.espnow.syncTimeWithOthers; } };
struct ESPNowSyncBlinkEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.espnow.syncBlink; } };
// Button Mapping accessors
struct ButtonLeftAccessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadMappingLeft; } };
struct ButtonRightAccessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadMappingRight; } };
struct ButtonUpAccessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadMappingUp; } };
struct ButtonDownAccessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadMappingDown; } };
struct ButtonLeft2Accessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadMappingLeft2; } };
struct ButtonRight2Accessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadMappingRight2; } };
struct ButtonUp2Accessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadMappingUp2; } };
struct ButtonDown2Accessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadMappingDown2; } };
struct ButtonProfile0Accessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadMappingProfile0; } };
struct ButtonProfile1Accessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadMappingProfile1; } };
struct ButtonProfile2Accessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadMappingProfile2; } };
struct ButtonProfile3Accessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadMappingProfile3; } };
struct ButtonExtra1Accessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadMappingExtra1; } };
struct ButtonExtra2Accessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadMappingExtra2; } };
struct ButtonExtra3Accessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadMappingExtra3; } };
struct ButtonExtra4Accessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.dpadMappingExtra4; } };
// Can
struct CanResetOnErrorAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.canResetOnError; } };
struct CanReinstallDriverAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.canUninstallOnReset; } };
// Quick Actions
struct QuickActionLeft2Accessor : public NewSettingsAccessor<BobbyQuickActions> { ConfigWrapper<BobbyQuickActions> &getConfig() const override { return configs.quickActionLeft2; } };
struct QuickActionRight2Accessor : public NewSettingsAccessor<BobbyQuickActions> { ConfigWrapper<BobbyQuickActions> &getConfig() const override { return configs.quickActionRight2; } };
struct QuickActionUp2Accessor : public NewSettingsAccessor<BobbyQuickActions> { ConfigWrapper<BobbyQuickActions> &getConfig() const override { return configs.quickActionUp2; } };
struct QuickActionDown2Accessor : public NewSettingsAccessor<BobbyQuickActions> { ConfigWrapper<BobbyQuickActions> &getConfig() const override { return configs.quickActionDown2; } };
struct QuickActionExtra1Accessor : public NewSettingsAccessor<BobbyQuickActions> { ConfigWrapper<BobbyQuickActions> &getConfig() const override { return configs.quickActionExtra1; } };
struct QuickActionExtra2Accessor : public NewSettingsAccessor<BobbyQuickActions> { ConfigWrapper<BobbyQuickActions> &getConfig() const override { return configs.quickActionExtra2; } };
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; } };
// Other
struct AnhaengerIdAccessor : public NewSettingsAccessor<uint16_t> { ConfigWrapper<uint16_t> &getConfig() const override { return configs.anhaenger_id; } };

View File

@ -0,0 +1,15 @@
#pragma once
// local includes
#include "accessorhelpers.h"
#include "newsettings.h"
struct WifiApEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.wifiApEnabled; } };
//struct WifiApDisableWhenOnlineAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.wifiDisableApWhenOnline; } };
struct WifiApSsidAccessor : public NewSettingsAccessor<std::string> { ConfigWrapper<std::string> &getConfig() const override { return configs.wifiApName; } };
struct WifiApKeyAccessor : public NewSettingsAccessor<std::string> { ConfigWrapper<std::string> &getConfig() const override { return configs.wifiApKey; } };
struct WifiApIpAccessor : public NewSettingsAccessor<wifi_stack::ip_address_t> { ConfigWrapper<wifi_stack::ip_address_t> &getConfig() const override { return configs.wifiApIp; } };
struct WifiApMaskAccessor : public NewSettingsAccessor<wifi_stack::ip_address_t> { ConfigWrapper<wifi_stack::ip_address_t> &getConfig() const override { return configs.wifiApMask; } };
struct WifiApChannelAccessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.wifiApChannel; } };
struct WifiApAuthmodeAccessor : public NewSettingsAccessor<wifi_auth_mode_t> { ConfigWrapper<wifi_auth_mode_t> &getConfig() const override { return configs.wifiApAuthmode; } };
struct WiFiApHiddenAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.wifiApHidden; } };

View File

@ -0,0 +1,3 @@
#include "wifistaconfigaccessors.h"

View File

@ -0,0 +1,107 @@
#pragma once
#include "sdkconfig.h"
// system includes
#include <string>
// 3rdparty lib includes
#include <accessorinterface.h>
#include <espwifiutils.h>
// local includes
#include "newsettings.h"
#include "accessorhelpers.h"
struct WifiStaEnabledAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.wifiStaEnabled; } };
struct WifiStaMinRssiAccessor : public NewSettingsAccessor<int8_t> { ConfigWrapper<int8_t> &getConfig() const override { return configs.wifiStaMinRssi; } };
class WifiStaConfigSsidAccessor : public virtual NewSettingsAccessor<std::string>
{
public:
WifiStaConfigSsidAccessor(int index) : m_index{index} {}
ConfigWrapper<std::string>& getConfig() const override { return configs.wifi_configs[m_index].ssid; }
private:
const int m_index;
};
class WifiStaConfigKeyAccessor : public virtual NewSettingsAccessor<std::string>
{
public:
WifiStaConfigKeyAccessor(int index) : m_index{index} {}
ConfigWrapper<std::string>& getConfig() const override { return configs.wifi_configs[m_index].key; }
private:
const int m_index;
};
class WifiStaConfigUseStaticIpAccessor : public virtual NewSettingsAccessor<bool>
{
public:
WifiStaConfigUseStaticIpAccessor(int index) : m_index{index} {}
ConfigWrapper<bool>& getConfig() const override { return configs.wifi_configs[m_index].useStaticIp; }
private:
const int m_index;
};
class WifiStaConfigStaticIpAccessor : public virtual NewSettingsAccessor<wifi_stack::ip_address_t>
{
public:
WifiStaConfigStaticIpAccessor(int index) : m_index{index} {}
ConfigWrapper<wifi_stack::ip_address_t>& getConfig() const override { return configs.wifi_configs[m_index].staticIp; }
private:
const int m_index;
};
class WifiStaConfigStaticSubnetAccessor : public virtual NewSettingsAccessor<wifi_stack::ip_address_t>
{
public:
WifiStaConfigStaticSubnetAccessor(int index) : m_index{index} {}
ConfigWrapper<wifi_stack::ip_address_t>& getConfig() const override { return configs.wifi_configs[m_index].staticSubnet; }
private:
const int m_index;
};
class WifiStaConfigStaticGatewayAccessor : public virtual NewSettingsAccessor<wifi_stack::ip_address_t>
{
public:
WifiStaConfigStaticGatewayAccessor(int index) : m_index{index} {}
ConfigWrapper<wifi_stack::ip_address_t>& getConfig() const override { return configs.wifi_configs[m_index].staticGateway; }
private:
const int m_index;
};
class WifiStaConfigUseStaticDnsAccessor : public virtual NewSettingsAccessor<bool>
{
public:
WifiStaConfigUseStaticDnsAccessor(int index) : m_index{index} {}
ConfigWrapper<bool>& getConfig() const override { return configs.wifi_configs[m_index].useStaticDns; }
private:
const int m_index;
};
class WifiStaConfigStaticDns0Accessor : public virtual NewSettingsAccessor<wifi_stack::ip_address_t>
{
public:
WifiStaConfigStaticDns0Accessor(int index) : m_index{index} {}
ConfigWrapper<wifi_stack::ip_address_t>& getConfig() const override { return configs.wifi_configs[m_index].staticDns0; }
private:
const int m_index;
};
class WifiStaConfigStaticDns1Accessor : public virtual NewSettingsAccessor<wifi_stack::ip_address_t>
{
public:
WifiStaConfigStaticDns1Accessor(int index) : m_index{index} {}
ConfigWrapper<wifi_stack::ip_address_t>& getConfig() const override { return configs.wifi_configs[m_index].staticDns1; }
private:
const int m_index;
};
class WifiStaConfigStaticDns2Accessor : public virtual NewSettingsAccessor<wifi_stack::ip_address_t>
{
public:
WifiStaConfigStaticDns2Accessor(int index) : m_index{index} {}
ConfigWrapper<wifi_stack::ip_address_t>& getConfig() const override { return configs.wifi_configs[m_index].staticDns2; }
private:
const int m_index;
};

View File

@ -2,11 +2,12 @@
// local includes
#include "globals.h"
#include "newsettings.h"
#ifdef FEATURE_BLUETOOTH
void BluetoothBeginAction::triggered()
{
if (!bluetoothSerial.begin(deviceName))
if (!bluetoothSerial.begin(configs.bluetoothName.value.c_str()))
{
//Serial.println("Could not begin bluetooth");
// TODO: better error handling

View File

@ -2,6 +2,7 @@
#include "actioninterface.h"
#include "globals.h"
#include "newsettings.h"
using namespace espgui;
@ -12,7 +13,7 @@ class BluetoothBeginMasterAction : public virtual ActionInterface
public:
void triggered() override
{
if (!bluetoothSerial.begin(deviceName, true))
if (!bluetoothSerial.begin(configs.bluetoothName.value.c_str(), true))
{
//Serial.println("Could not begin bluetooth master");
// TODO: better error handling

View File

@ -24,14 +24,7 @@ public:
//return;
}
settings = presets::defaultSettings;
stringSettings = presets::makeDefaultStringSettings();
if (!settingsPersister.openCommon())
{
ESP_LOGE("BOBBY", "openCommon() failed");
//return;
}
profileSettings = presets::defaultProfileSettings;
if (profile)
{
@ -42,17 +35,11 @@ public:
}
}
if (!settingsPersister.load(settings))
if (!settingsPersister.load(profileSettings))
{
ESP_LOGE("BOBBY", "load() for settings failed");
//return;
}
if (!settingsPersister.load(stringSettings))
{
ESP_LOGE("BOBBY", "load() for stringSettings failed");
//return;
}
}
};
}

View File

@ -0,0 +1,8 @@
#include "ledstripanimationactions.h"
#ifdef FEATURE_LEDSTRIP
void LedStripSetAnimationAction::triggered()
{
if (auto result = configs.write_config(configs.ledstrip.animationType, m_animation); !result)
BobbyErrorHandler{}.errorOccured(std::move(result).error());
}
#endif

View File

@ -1,14 +1,30 @@
#pragma once
// 3rdparty lib includes
#include "actioninterface.h"
#include "ledstrip.h"
// #include "ledstripdefines.h"
#ifdef FEATURE_LEDSTRIP
template<uint16_t type>
// local includes
#include "ledstrip.h"
#include "ledstripdefines.h"
#include "newsettings.h"
#include "bobbyerrorhandler.h"
template<LedstripAnimation type>
class LedStripSetAnimationActionStatic : public virtual espgui::ActionInterface
{
public:
void triggered() override
{
if (auto result = configs.write_config(configs.ledstrip.animationType, type); !result)
BobbyErrorHandler{}.errorOccured(std::move(result).error());
}
};
class LedStripSetAnimationAction : public virtual espgui::ActionInterface
{
public:
void triggered() override { animation_type = type; }
LedStripSetAnimationAction(LedstripAnimation animation) : m_animation{animation} {};
void triggered() override;
private:
const LedstripAnimation m_animation;
};
#endif

View File

@ -1,6 +1,5 @@
#include "ledstripblinkactions.h"
#ifdef FEATURE_LEDSTRIP
#include "ledstrip.h"
#include "ledstripdefines.h"
@ -39,4 +38,3 @@ void LedstripAnimationBlinkBothAction::triggered()
{
blinkAnimation = LEDSTRIP_OVERWRITE_BLINKBOTH;
}
#endif

View File

@ -1,6 +1,5 @@
#pragma once
#ifdef FEATURE_LEDSTRIP
#include "actioninterface.h"
class LedstripAnimationBlinkNoneAction : public virtual espgui::ActionInterface
@ -34,4 +33,3 @@ class LedstripAnimationBlinkBothAction : public virtual espgui::ActionInterface
public:
void triggered() override;
};
#endif

View File

@ -9,6 +9,6 @@ namespace {
class LoadSettingsAction : public virtual ActionInterface
{
public:
void triggered() override { loadSettings(); }
void triggered() override { loadProfileSettings(); }
};
}

View File

@ -0,0 +1,56 @@
#include "modesettingsaction.h"
// 3rdparty lib includes
#include <screenmanager.h>
// local includes
#include "globals.h"
#include "modes/defaultmode.h"
#include "modes/mickmode.h"
#include "modes/tempomatmode.h"
#include "modes/larsmmode.h"
#ifdef FEATURE_GAMETRAK
#include "modes/gametrakmode.h"
#endif
#include "modes/motortestmode.h"
#ifdef FEATURE_JOYSTICK
#include "modes/wheelchairmode.h"
#endif
#include "modes/remotecontrolmode.h"
#include "displays/menus/defaultmodesettingsmenu.h"
#include "displays/menus/tempomatmodesettingsmenu.h"
#include "displays/menus/larsmmodesettingsmenu.h"
#ifdef FEATURE_GAMETRAK
#include "displays/menus/gametrakmodesettingsmenu.h"
#endif
#include "displays/menus/mickmodesettingsmenu.h"
#include "displays/menus/motortestmodesettingsmenu.h"
#include "displays/menus/remotecontrolmodesettingsmenu.h"
void ModeSettingsAction::triggered()
{
if (currentMode == &modes::defaultMode
#ifdef FEATURE_JOYSTICK
|| currentMode == &modes::wheelchairMode
#endif
)
pushScreen<DefaultModeSettingsMenu>();
else if (currentMode == &modes::tempomatMode)
pushScreen<TempomatModeSettingsMenu>();
else if (currentMode == &modes::larsmMode)
pushScreen<LarsmModeSettingsMenu>();
else if (currentMode == &modes::mickMode)
pushScreen<MickModeSettingsMenu>();
else if (currentMode == &modes::motortestMode)
pushScreen<MotortestModeSettingsMenu>();
else if (currentMode == &modes::remoteControlMode)
pushScreen<RemoteControlModeSettingsMenu>();
#ifdef FEATURE_GAMETRAK
else if (currentMode == &modes::gametrakMode)
pushScreen<GametrakModeSettingsMenu>();
#endif
else
{
//Serial.println("Unknown mode, cannot open settings for it");
}
}

View File

@ -1,45 +1,11 @@
#pragma once
#include "actioninterface.h"
#include "globals.h"
#include "modes/defaultmode.h"
#include "modes/tempomatmode.h"
#include "modes/larsmmode.h"
#include "modes/gametrakmode.h"
#include "modes/motortestmode.h"
#include "displays/menus/defaultmodesettingsmenu.h"
#include "displays/menus/tempomatmodesettingsmenu.h"
#include "displays/menus/larsmmodesettingsmenu.h"
#include "displays/menus/gametrakmodesettingsmenu.h"
#include "displays/menus/motortestmodesettingsmenu.h"
#include "screenmanager.h"
using namespace espgui;
namespace {
class ModeSettingsAction : public virtual ActionInterface
{
public:
void triggered() override;
};
void ModeSettingsAction::triggered()
{
if (currentMode == &modes::defaultMode)
switchScreen<DefaultModeSettingsMenu>();
else if (currentMode == &modes::tempomatMode)
switchScreen<TempomatModeSettingsMenu>();
else if (currentMode == &modes::larsmMode)
switchScreen<LarsmModeSettingsMenu>();
else if (currentMode == &modes::motortestMode)
switchScreen<MotortestModeSettingsMenu>();
#ifdef FEATURE_GAMETRAK
else if (currentMode == &modes::gametrakMode)
switchScreen<GametrakModeSettingsMenu>();
#endif
else
{
//Serial.println("Unknown mode, cannot open settings for it");
}
}
}

View File

@ -1,31 +0,0 @@
#pragma once
#include "actioninterface.h"
using namespace espgui;
namespace {
template<typename ...T>
class MultiAction;
template<typename T>
class MultiAction<T> : public virtual ActionInterface
{
public:
void triggered() override
{
T{}.triggered();
}
};
template<typename T, typename ...Tmore>
class MultiAction<T, Tmore...> : public virtual MultiAction<Tmore...>
{
public:
void triggered() override
{
T{}.triggered();
MultiAction<Tmore...>::triggered();
}
};
}

View File

@ -1,23 +1 @@
#include "qraction.h"
#include <actioninterface.h>
#include <string>
#include <screenmanager.h>
#include "displays/qrdisplay.h"
#include "displays/qrimportdisplay.h"
using namespace espgui;
SwitchQrDisplayAction::SwitchQrDisplayAction(qraction::QrMenu qrmenu) : m_msg{qrmenu.message}, m_ver{qrmenu.ver} {}
void SwitchQrDisplayAction::triggered()
{
switchScreen<QrDisplay>(m_msg, m_ver);
}
SwitchQrImportDisplayAction::SwitchQrImportDisplayAction(std::string nvskey) : m_nvskey{nvskey} {}
void SwitchQrImportDisplayAction::triggered()
{
switchScreen<QrImportDisplay>(m_nvskey);
}

View File

@ -1,35 +1,48 @@
#pragma once
#include <actioninterface.h>
// system includes
#include <string>
// 3rdparty lib includes
#include <actioninterface.h>
// local includes
#include "actions/qraction.h"
#include "displays/qrdisplay.h"
#include "displays/qrimportdisplay.h"
namespace qraction {
struct QrMenu {
std::string message;
std::string text;
uint8_t ver;
};
} // namespace
class SwitchQrDisplayAction : public virtual espgui::ActionInterface
class PushQrDisplayAction : public virtual espgui::ActionInterface
{
public:
SwitchQrDisplayAction(qraction::QrMenu qrmenu);
explicit PushQrDisplayAction(const qraction::QrMenu &qrmenu) : m_msg{qrmenu.message} {}
explicit PushQrDisplayAction(qraction::QrMenu &&qrmenu) : m_msg{std::move(qrmenu.message)} {}
void triggered() override;
void triggered() override
{
espgui::pushScreen<QrDisplay>(m_msg);
}
private:
std::string m_msg;
uint8_t m_ver;
};
class SwitchQrImportDisplayAction : public virtual espgui::ActionInterface
template<typename TMenu>
class PushQrImportDisplayAction : public virtual espgui::ActionInterface
{
public:
SwitchQrImportDisplayAction(std::string nvskey);
explicit PushQrImportDisplayAction(const std::string &nvskey) : m_nvskey{nvskey} {}
explicit PushQrImportDisplayAction(std::string &&nvskey) : m_nvskey{std::move(nvskey)} {}
void triggered() override;
void triggered() override
{
espgui::pushScreen<QrImportDisplay<TMenu>>(std::move(m_nvskey));
}
private:
std::string m_nvskey;
};

View File

@ -6,16 +6,12 @@
// 3rdparty lib includes
#include <tftinstance.h>
// local includes
#include "globals.h"
#include "texts.h"
void RebootAction::triggered()
{
espgui::tft.fillScreen(TFT_BLACK);
espgui::tft.setTextColor(TFT_YELLOW);
espgui::tft.drawString(TEXT_REBOOT, 5, 5, 4);
espgui::tft.drawString("Reboot", 5, 5, 4);
espgui::tft.fillRect(0, 34, espgui::tft.width(), 3, TFT_WHITE);

View File

@ -1,9 +1,7 @@
#pragma once
// 3rdparty lib includes
#include "actioninterface.h"
using namespace espgui;
#include <actioninterface.h>
class RebootAction : public virtual espgui::ActionInterface
{

View File

@ -9,6 +9,6 @@ namespace {
class SaveSettingsAction : public virtual ActionInterface
{
public:
void triggered() override { saveSettings(); }
void triggered() override { saveProfileSettings(); }
};
}

View File

@ -0,0 +1,20 @@
#include "wifistascanaction.h"
// esp-idf includes
#include <esp_log.h>
// local includes
#include "wifi_bobbycar.h"
namespace {
constexpr const char * const TAG = "BOBBY";
} // namespace
void WifiStaScanAction::triggered()
{
if (const auto result = wifi_scan(); result != ESP_OK)
{
ESP_LOGE(TAG, "wifi_scan() failed: %s", esp_err_to_name(result));
return;
}
}

View File

@ -0,0 +1,10 @@
#pragma once
// 3rdparty lib includes
#include <actioninterface.h>
class WifiStaScanAction : public virtual espgui::ActionInterface
{
public:
void triggered() override;
};

View File

@ -0,0 +1,9 @@
#include "wifistascanclearaction.h"
// 3rdparty lib includes
#include <espwifistack.h>
void WifiStaScanClearAction::triggered()
{
wifi_stack::delete_scan_result();
}

View File

@ -0,0 +1,10 @@
#pragma once
// 3rdparty lib includes
#include <actioninterface.h>
class WifiStaScanClearAction : public virtual espgui::ActionInterface
{
public:
void triggered() override;
};

View File

@ -7,111 +7,62 @@
// local includes
#include "drivingstatistics.h"
#include "globals.h"
#define CURVE(higherVoltage,lowerVoltage,fromAh,toAh) \
if (cellVoltage >= lowerVoltage && cellVoltage <= higherVoltage) \
return 100 * (expected_ah - cpputils::mapValue<float>(cellVoltage, higherVoltage, lowerVoltage, fromAh, toAh)) / expected_ah;
#include "newsettings.h"
float getBatteryPercentage(float batVoltage, BatteryCellType cellType)
{
const float cellVoltage = batVoltage / settings.battery.cellsSeries;
const float cellVoltage = batVoltage / configs.battery.cellsSeries.value();
switch (cellType)
{
case BatteryCellType::_22P:
{
const float expected_ah = 2.2;
if (cellVoltage > 4.15)
return 100;
CURVE(4.15, 4.04, 0, 0.25)
CURVE(4.04, 3.95, 0.25, 0.5)
CURVE(3.95, 3.86, 0.5, 0.75)
CURVE(3.86, 3.74, 0.75, 1.0)
CURVE(3.74, 3.64, 1.0, 1.25)
CURVE(3.64, 3.59, 1.25, 1.5)
CURVE(3.59, 3.54, 1.5, 1.75)
CURVE(3.54, 3.43, 1.75, 2.0)
CURVE(3.43, 3.35, 2.0, 2.1)
CURVE(3.35, 2.50, 2.1, 2.2)
const float expected_ah = BAT_MIN_AH_22P;
if (cellVoltage > 4.15f)
return 100.f;
BAT_CURVE_22P(PERCENTAGE);
break;
}
case BatteryCellType::MH1:
{
const float expected_ah = 3.2;
if (cellVoltage > 4.15)
return 100;
CURVE(4.15, 4.09, 0, 0.25)
CURVE(4.09, 4.04, 0.25, 0.5)
CURVE(4.04, 3.95, 0.5, 0.75)
CURVE(3.95, 3.88, 0.75, 1.0)
CURVE(3.88, 3.79, 1.0, 1.25)
CURVE(3.79, 3.70, 1.25, 1.5)
CURVE(3.70, 3.65, 1.5, 1.75)
CURVE(3.65, 3.60, 1.75, 2.0)
CURVE(3.60, 3.56, 2.0, 2.25)
CURVE(3.56, 3.50, 2.25, 2.5)
CURVE(3.50, 3.40, 2.5, 2.75)
CURVE(3.40, 3.30, 2.75, 3.0)
CURVE(3.30, 2.5, 3.0, 3.2)
const float expected_ah = BAT_MIN_AH_MH1;
if (cellVoltage > 4.15f)
return 100.f;
BAT_CURVE_MH1(PERCENTAGE);
break;
}
case BatteryCellType::HG2:
{
const float expected_ah = 3.0;
if (cellVoltage > 4.15)
return 100;
CURVE(4.15, 4.08, 0, 0.25)
CURVE(4.08, 4.01, 0.25, 0.5)
CURVE(4.01, 3.92, 0.5, 0.75)
CURVE(3.92, 3.84, 0.75, 1.0)
CURVE(3.84, 3.75, 1.0, 1.25)
CURVE(3.75, 3.67, 1.25, 1.5)
CURVE(3.67, 3.62, 1.5, 1.75)
CURVE(3.62, 3.55, 1.75, 2.0)
CURVE(3.55, 3.44, 2.0, 2.25)
CURVE(3.44, 3.30, 2.25, 2.5)
CURVE(3.30, 3.05, 2.5, 2.75)
CURVE(3.05, 2.50, 2.75, 3.0)
const float expected_ah = BAT_MIN_AH_HG2;
if (cellVoltage > 4.15f)
return 100.f;
BAT_CURVE_HG2(PERCENTAGE);
break;
}
case BatteryCellType::VTC5:
{
const float expected_ah = 2.6;
if (cellVoltage > 4.15)
return 100;
CURVE(4.15, 4.08, 0, 0.25)
CURVE(4.08, 3.98, 0.25, 0.5)
CURVE(3.98, 3.89, 0.5, 0.75)
CURVE(3.89, 3.79, 0.75, 1.0)
CURVE(3.79, 3.71, 1.0, 1.25)
CURVE(3.71, 3.64, 1.25, 1.5)
CURVE(3.64, 3.53, 1.5, 1.75)
CURVE(3.53, 3.44, 1.75, 2.0)
CURVE(3.44, 3.20, 2.0, 2.25)
CURVE(3.20, 2.80, 2.25, 2.5)
CURVE(2.80, 2.50, 2.5, 2.60)
const float expected_ah = BAT_MIN_AH_VTC5;
if (cellVoltage > 4.15f)
return 100.f;
BAT_CURVE_VTC5(PERCENTAGE);
break;
}
case BatteryCellType::BAK_25R:
{
const float expected_ah = 2.5;
if(cellVoltage > 4.15){
return 100;
const float expected_ah = BAT_MIN_AH_BAK_25R;
if(cellVoltage > 4.15f){
return 100.f;
}
CURVE(4.15, 4.06, 0, 0.25)
CURVE(4.06, 3.96, 0.25, 0.5)
CURVE(3.96, 3.88, 0.5, 0.75)
CURVE(3.88, 3.77, 0.75, 1)
CURVE(3.77, 3.68, 1, 1.25)
CURVE(3.68, 3.62, 1.25, 1.5)
CURVE(3.62, 3.56, 1.5, 1.75)
CURVE(3.56, 3.47, 1.75, 2)
CURVE(3.47, 3.31, 2, 2.25)
CURVE(3.31, 2.50, 2.25, 2.5)
BAT_CURVE_25R(PERCENTAGE);
break;
}
case BatteryCellType::HE4:
{
const float expected_ah = BAT_MIN_AH_HE4;
if(cellVoltage > 4.15f){
return 100.f;
}
BAT_CURVE_HE4(PERCENTAGE);
break;
}
}
@ -122,44 +73,46 @@ float getRemainingWattHours()
{
float target_mah = getTarget_mAh();
float avgVoltage = 0;
for (auto &controller : controllers)
if (const auto avgVoltage = controllers.getAvgVoltage(); avgVoltage)
{
avgVoltage += controller.getCalibratedVoltage();
return (target_mah / 1000.f) * 3.7f * configs.battery.cellsParallel.value() * configs.battery.cellsSeries.value() * (getBatteryPercentage(*avgVoltage, BatteryCellType(configs.battery.cellType.value())) / 100);
}
avgVoltage = avgVoltage / controllers.size();
return (target_mah / 1000.f) * 3.7 * settings.battery.cellsParallel * settings.battery.cellsSeries * (getBatteryPercentage(avgVoltage, BatteryCellType(settings.battery.cellType)) / 100);
else
return 0.f;
}
float getPercentageByWh(float wh)
{
const float maxWh = (getTarget_mAh() / 1000.f) * 3.7 * settings.battery.cellsParallel * settings.battery.cellsSeries;
const float maxWh = (getTarget_mAh() / 1000.f) * 3.7f * configs.battery.cellsParallel.value() * configs.battery.cellsSeries.value();
return maxWh / wh;
}
float getBatteryWattHours()
{
return (getTarget_mAh() / 1000.f) * 3.7f * configs.battery.cellsParallel.value() * configs.battery.cellsSeries.value();
}
float getTarget_mAh()
{
float target_mah = 2000; //default
if(BatteryCellType(settings.battery.cellType) == BatteryCellType::_22P) target_mah = 2200;
if(BatteryCellType(settings.battery.cellType) == BatteryCellType::HG2) target_mah = 3000;
if(BatteryCellType(settings.battery.cellType) == BatteryCellType::MH1) target_mah = 3200;
if(BatteryCellType(settings.battery.cellType) == BatteryCellType::VTC5) target_mah = 2600;
if(BatteryCellType(settings.battery.cellType) == BatteryCellType::BAK_25R) target_mah = 2500;
if(BatteryCellType(configs.battery.cellType.value()) == BatteryCellType::_22P) target_mah = 2200;
if(BatteryCellType(configs.battery.cellType.value()) == BatteryCellType::HG2) target_mah = 3000;
if(BatteryCellType(configs.battery.cellType.value()) == BatteryCellType::MH1) target_mah = 3200;
if(BatteryCellType(configs.battery.cellType.value()) == BatteryCellType::VTC5) target_mah = 2600;
if(BatteryCellType(configs.battery.cellType.value()) == BatteryCellType::BAK_25R) target_mah = 2500;
if(BatteryCellType(configs.battery.cellType.value()) == BatteryCellType::HE4) target_mah = 2300;
return target_mah;
}
std::string getBatteryPercentageString()
{
float avgVoltage = 0;
for (auto &controller : controllers)
if (const auto avgVoltage = controllers.getAvgVoltage(); avgVoltage)
{
avgVoltage += controller.getCalibratedVoltage();
std::string output = fmt::format("Battery: {:.1f}%", getBatteryPercentage(*avgVoltage, BatteryCellType(configs.battery.cellType.value())));
return output;
}
avgVoltage = avgVoltage / controllers.size();
std::string output = fmt::format("Battery: {:.1f}%", getBatteryPercentage(avgVoltage, BatteryCellType(settings.battery.cellType)));
return output;
else
return "No Battery.";
}
std::string getBatteryAdvancedPercentageString()
@ -173,27 +126,188 @@ std::string getBatteryRemainingWattHoursString()
return fmt::format("{:.1f}Wh", getRemainingWattHours());
}
std::string getBatteryCellTypeString()
{
return fmt::format("Cells: {}", toString(BatteryCellType(settings.battery.cellType)));
}
std::string getRemainingRangeString()
{
return fmt::format("{:.1f} km", getRemainingWattHours() / settings.battery.watthoursPerKilometer);
return fmt::format("{:.1f} km", getRemainingWattHours() / configs.battery.watthoursPerKilometer.value());
}
std::string getBatteryDebugString()
{
float avgVoltage = 0;
for (auto &controller : controllers)
if (const auto avgVoltage = controllers.getAvgVoltage(); avgVoltage)
{
avgVoltage += controller.getCalibratedVoltage();
return fmt::format("{:.1f}V {}A", *avgVoltage, sumCurrent);
}
avgVoltage = avgVoltage / controllers.size();
return fmt::format("{:.1f}V {}A", avgVoltage, sumCurrent);
return "No Battery";
}
float getMinBatCellVoltage(BatteryCellType cellType) {
float minimumVoltage = std::numeric_limits<float>::max();
switch (cellType)
{
case BatteryCellType::_22P:
{
BAT_CURVE_22P(GET_MINIMUM_BAT_VOLTAGE);
break;
}
case BatteryCellType::HG2:
{
BAT_CURVE_HG2(GET_MINIMUM_BAT_VOLTAGE);
break;
}
case BatteryCellType::MH1:
{
BAT_CURVE_MH1(GET_MINIMUM_BAT_VOLTAGE);
break;
}
case BatteryCellType::VTC5:
{
BAT_CURVE_VTC5(GET_MINIMUM_BAT_VOLTAGE);
break;
}
case BatteryCellType::BAK_25R:
{
BAT_CURVE_25R(GET_MINIMUM_BAT_VOLTAGE);
break;
}
case BatteryCellType::HE4:
{
BAT_CURVE_HE4(GET_MINIMUM_BAT_VOLTAGE);
break;
}
default:
return 0.f;
}
return minimumVoltage;
}
float getMaxBatCellVoltage(BatteryCellType cellType)
{
switch (cellType)
{
case BatteryCellType::_22P:
{
BAT_CURVE_22P(GET_MAXIMUM_BAT_VOLTAGE);
break;
}
case BatteryCellType::HG2:
{
BAT_CURVE_HG2(GET_MAXIMUM_BAT_VOLTAGE);
break;
}
case BatteryCellType::MH1:
{
BAT_CURVE_MH1(GET_MAXIMUM_BAT_VOLTAGE);
break;
}
case BatteryCellType::VTC5:
{
BAT_CURVE_VTC5(GET_MAXIMUM_BAT_VOLTAGE);
break;
}
case BatteryCellType::BAK_25R:
{
BAT_CURVE_25R(GET_MAXIMUM_BAT_VOLTAGE);
break;
}
case BatteryCellType::HE4:
{
BAT_CURVE_HE4(GET_MAXIMUM_BAT_VOLTAGE);
break;
}
}
return 0.f;
}
uint8_t count_curve_points(BatteryCellType cellType)
{
#define COUNT_CURVE_POINTS(higherVoltage,lowerVoltage,fromAh,toAh) \
count++;
uint8_t count = 0;
switch (cellType)
{
case BatteryCellType::_22P:
{
BAT_CURVE_22P(COUNT_CURVE_POINTS);
break;
}
case BatteryCellType::HG2:
{
BAT_CURVE_HG2(COUNT_CURVE_POINTS);
break;
}
case BatteryCellType::MH1:
{
BAT_CURVE_MH1(COUNT_CURVE_POINTS);
break;
}
case BatteryCellType::VTC5:
{
BAT_CURVE_VTC5(COUNT_CURVE_POINTS);
break;
}
case BatteryCellType::BAK_25R:
{
BAT_CURVE_25R(COUNT_CURVE_POINTS);
break;
}
case BatteryCellType::HE4:
{
BAT_CURVE_HE4(COUNT_CURVE_POINTS);
break;
}
}
return count;
}
std::optional<CalibrationPointVoltages> get_point_n_voltages(BatteryCellType cellType, uint8_t num)
{
#define GET_POINT_N_VOLTAGES(higherVoltage,lowerVoltage,fromAh,toAh) \
if (count == num) { \
uint16_t minVoltage = (lowerVoltage) * 100; \
uint16_t maxVoltage = (higherVoltage) * 100; \
return CalibrationPointVoltages{ .minVoltage=minVoltage, .maxVoltage=maxVoltage }; \
} \
count++;
uint8_t count = 0;
switch (cellType)
{
case BatteryCellType::_22P:
{
BAT_CURVE_22P(GET_POINT_N_VOLTAGES);
break;
}
case BatteryCellType::HG2:
{
BAT_CURVE_HG2(GET_POINT_N_VOLTAGES);
break;
}
case BatteryCellType::MH1:
{
BAT_CURVE_MH1(GET_POINT_N_VOLTAGES);
break;
}
case BatteryCellType::VTC5:
{
BAT_CURVE_VTC5(GET_POINT_N_VOLTAGES);
break;
}
case BatteryCellType::BAK_25R:
{
BAT_CURVE_25R(GET_POINT_N_VOLTAGES);
break;
}
case BatteryCellType::HE4:
{
BAT_CURVE_HE4(GET_POINT_N_VOLTAGES);
break;
}
}
return std::nullopt;
}
namespace battery {
float bootBatPercentage{-1};
std::optional<float> bootBatPercentage;
std::optional<float> bootBatWh;
}

View File

@ -2,28 +2,153 @@
// system includes
#include <cstdint>
#include <optional>
// 3rdparty lib includes
#include <cpptypesafeenum.h>
// local includes
#include <bobbytypesafeenum.h>
typedef struct {
uint16_t minVoltage;
uint16_t maxVoltage;
} CalibrationPointVoltages;
// battery curves
#define PERCENTAGE(higherVoltage,lowerVoltage,fromAh,toAh) \
if (cellVoltage >= lowerVoltage && cellVoltage <= higherVoltage) \
return 100 * (expected_ah - cpputils::mapValue<float>(cellVoltage, higherVoltage, lowerVoltage, fromAh, toAh)) / expected_ah;
#define GET_MINIMUM_VOLTAGE(higherVoltage,lowerVoltage,fromAh,toAh) \
if (expected_ah >= toAh) \
return lowerVoltage;
#define GET_MAXIMUM_VOLTAGE(higherVoltage,lowerVoltage,fromAh,toAh) \
if (fromAh == 0) \
return higherVoltage;
#define GET_MINIMUM_BAT_VOLTAGE(higherVoltage,lowerVoltage,fromAh,toAh) \
if (lowerVoltage < minimumVoltage) \
minimumVoltage = lowerVoltage;
#define GET_MAXIMUM_BAT_VOLTAGE(higherVoltage,lowerVoltage,fromAh,toAh) \
if (fromAh == 0) \
return higherVoltage;
// All curves here have to follow the same order (highest-voltage first)
// as some functions require this to display data in correct order
// 22P
#define BAT_MIN_AH_22P 2.2f
#define BAT_CURVE_22P(func) \
func(4.15f, 4.04f, 0.00f, 0.25f) \
func(4.04f, 3.95f, 0.25f, 0.50f) \
func(3.95f, 3.86f, 0.50f, 0.75f) \
func(3.86f, 3.74f, 0.75f, 1.00f) \
func(3.74f, 3.64f, 1.00f, 1.25f) \
func(3.64f, 3.59f, 1.25f, 1.50f) \
func(3.59f, 3.54f, 1.50f, 1.75f) \
func(3.54f, 3.43f, 1.75f, 2.00f) \
func(3.43f, 3.35f, 2.00f, 2.10f) \
func(3.35f, 2.50f, 2.10f, 2.20f)
// MH1
#define BAT_MIN_AH_MH1 3.2f
#define BAT_CURVE_MH1(func) \
func(4.15f, 4.09f, 0.00f, 0.25f) \
func(4.09f, 4.04f, 0.25f, 0.50f) \
func(4.04f, 3.95f, 0.50f, 0.75f) \
func(3.95f, 3.88f, 0.75f, 1.00f) \
func(3.88f, 3.79f, 1.00f, 1.25f) \
func(3.79f, 3.70f, 1.25f, 1.50f) \
func(3.70f, 3.65f, 1.50f, 1.75f) \
func(3.65f, 3.60f, 1.75f, 2.00f) \
func(3.60f, 3.56f, 2.00f, 2.25f) \
func(3.56f, 3.50f, 2.25f, 2.50f) \
func(3.50f, 3.40f, 2.50f, 2.75f) \
func(3.40f, 3.30f, 2.75f, 3.00f) \
func(3.30f, 2.50f, 3.00f, 3.20f)
// HG2
#define BAT_MIN_AH_HG2 3.0f
#define BAT_CURVE_HG2(func) \
func(4.15f, 4.08f, 0.00f, 0.25f) \
func(4.08f, 4.01f, 0.25f, 0.50f) \
func(4.01f, 3.92f, 0.50f, 0.75f) \
func(3.92f, 3.84f, 0.75f, 1.00f) \
func(3.84f, 3.75f, 1.00f, 1.25f) \
func(3.75f, 3.67f, 1.25f, 1.50f) \
func(3.67f, 3.62f, 1.50f, 1.75f) \
func(3.62f, 3.55f, 1.75f, 2.00f) \
func(3.55f, 3.44f, 2.00f, 2.25f) \
func(3.44f, 3.30f, 2.25f, 2.50f) \
func(3.30f, 3.05f, 2.50f, 2.75f) \
func(3.05f, 2.50f, 2.75f, 3.00f)
// VTC5
#define BAT_MIN_AH_VTC5 2.6f
#define BAT_CURVE_VTC5(func) \
func(4.15f, 4.08f, 0.00f, 0.25f) \
func(4.08f, 3.98f, 0.25f, 0.50f) \
func(3.98f, 3.89f, 0.50f, 0.75f) \
func(3.89f, 3.79f, 0.75f, 1.00f) \
func(3.79f, 3.71f, 1.00f, 1.25f) \
func(3.71f, 3.64f, 1.25f, 1.50f) \
func(3.64f, 3.53f, 1.50f, 1.75f) \
func(3.53f, 3.44f, 1.75f, 2.00f) \
func(3.44f, 3.20f, 2.00f, 2.25f) \
func(3.20f, 2.80f, 2.25f, 2.50f) \
func(2.80f, 2.50f, 2.50f, 2.60f)
// BAK_25R
#define BAT_MIN_AH_BAK_25R 2.5f
#define BAT_CURVE_25R(func) \
func(4.15f, 4.06f, 0.00f, 0.25f) \
func(4.06f, 3.96f, 0.25f, 0.50f) \
func(3.96f, 3.88f, 0.50f, 0.75f) \
func(3.88f, 3.77f, 0.75f, 1.00f) \
func(3.77f, 3.68f, 1.00f, 1.25f) \
func(3.68f, 3.62f, 1.25f, 1.50f) \
func(3.62f, 3.56f, 1.50f, 1.75f) \
func(3.56f, 3.47f, 1.75f, 2.00f) \
func(3.47f, 3.31f, 2.00f, 2.25f) \
func(3.31f, 2.50f, 2.25f, 2.50f)
// HE4
#define BAT_MIN_AH_HE4 2.3f
#define BAT_CURVE_HE4(func) \
func(4.15f, 4.02f, 0.00f, 0.25f) \
func(4.02f, 3.91f, 0.25f, 0.50f) \
func(3.91f, 3.81f, 0.50f, 0.75f) \
func(3.81f, 3.72f, 0.75f, 1.00f) \
func(3.72f, 3.61f, 1.00f, 1.25f) \
func(3.61f, 3.62f, 1.25f, 1.50f) \
func(3.62f, 3.53f, 1.50f, 1.75f) \
func(3.53f, 3.45f, 1.75f, 2.00f) \
func(3.45f, 3.21f, 2.00f, 2.25f) \
func(3.21f, 2.80f, 2.25f, 2.30f)
#define BatteryCellTypeValues(x) \
x(_22P) \
x(HG2) \
x(MH1) \
x(VTC5) \
x(BAK_25R)
DECLARE_TYPESAFE_ENUM(BatteryCellType, : uint8_t, BatteryCellTypeValues)
x(BAK_25R) \
x(HE4)
DECLARE_BOBBYTYPESAFE_ENUM(BatteryCellType, : uint8_t, BatteryCellTypeValues)
float getBatteryPercentage(float batVoltage, BatteryCellType cellType);
float getRemainingWattHours();
float getBatteryWattHours();
float getMinBatCellVoltage(BatteryCellType cellType);
float getMaxBatCellVoltage(BatteryCellType cellType);
std::string getBatteryPercentageString();
std::string getBatteryRemainingWattHoursString();
std::string getBatteryCellTypeString();
std::string getRemainingRangeString();
std::string getBatteryDebugString();
@ -33,6 +158,11 @@ std::string getBatteryAdvancedPercentageString();
float getPercentageByWh(float wh);
float getTarget_mAh();
uint8_t count_curve_points(BatteryCellType cellType);
std::optional<CalibrationPointVoltages> get_point_n_voltages(BatteryCellType cellType, uint8_t num);
namespace battery {
extern float bootBatPercentage;
extern std::optional<float> bootBatPercentage;
extern std::optional<float> bootBatWh;
}

View File

@ -3,33 +3,59 @@
// esp-idf includes
#include <esp_log.h>
// 3rdparty lib includes
#include <ArduinoJson.h>
#include <wifi_bobbycar.h>
#include <futurecpp.h>
// local includes
#include "ledstrip.h"
#include "globals.h"
#include "modes/remotecontrolmode.h"
#include "utils.h"
#include "newsettings.h"
namespace {
constexpr const char * const TAG = "BOBBYBLE";
class RemoteControlCallbacks : public NimBLECharacteristicCallbacks
{
public:
void onWrite(NimBLECharacteristic* pCharacteristic) override;
};
class WirelessSettingsCallbacks : public NimBLECharacteristicCallbacks
{
public:
void onWrite(NimBLECharacteristic* pCharacteristic) override;
};
class WiFiListCallbacks : public NimBLECharacteristicCallbacks
{
public:
void onRead(NimBLECharacteristic* pCharacteristic) override;
};
} // namespace
#ifdef FEATURE_BLE
BLEServer *pServer{};
BLEService *pService{};
BLECharacteristic *livestatsCharacteristic{};
BLECharacteristic *remotecontrolCharacteristic{};
#ifdef FEATURE_WIRELESS_CONFIG
BLECharacteristic *wirelessConfig{};
BLECharacteristic *getwifilist{};
#endif
RemoteControlCallbacks bleRemoteCallbacks;
#ifdef FEATURE_WIRELESS_CONFIG
WirelessSettingsCallbacks bleWirelessSettingsCallbacks;
WiFiListCallbacks bleWiFiListCallbacks;
#endif
namespace {
RemoteControlCallbacks bleRemoteCallbacks;
WirelessSettingsCallbacks bleWirelessSettingsCallbacks;
WiFiListCallbacks bleWiFiListCallbacks;
void createBle()
{
ESP_LOGI("BOBBY", "called");
BLEDevice::init(deviceName);
BLEDevice::init(configs.bluetoothName.value());
const auto serviceUuid{"0335e46c-f355-4ce6-8076-017de08cee98"};
@ -40,12 +66,11 @@ void createBle()
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);
#ifdef FEATURE_WIRELESS_CONFIG
wirelessConfig = pService->createCharacteristic("4201def1-a264-43e6-946b-6b2d9612dfed", NIMBLE_PROPERTY::WRITE);
wirelessConfig->setCallbacks(&bleWirelessSettingsCallbacks);
getwifilist = pService->createCharacteristic("4201def2-a264-43e6-946b-6b2d9612dfed", NIMBLE_PROPERTY::READ);
getwifilist->setCallbacks(&bleWiFiListCallbacks);
#endif
pService->start();
@ -65,23 +90,24 @@ void destroyBle()
pService = {};
livestatsCharacteristic = {};
remotecontrolCharacteristic = {};
#ifdef FEATURE_WIRELESS_CONFIG
wirelessConfig = {};
getwifilist = {};
#endif
}
} // namespace
void initBle()
{
if (settings.bleSettings.bleEnabled)
if (configs.bleSettings.bleEnabled.value())
createBle();
}
void handleBle()
{
if (settings.bleSettings.bleEnabled)
if (!configs.feature.ble.isEnabled.value())
return;
if (configs.bleSettings.bleEnabled.value())
{
if (!pServer)
createBle();
@ -141,8 +167,8 @@ void handleBle()
auto arr = doc.createNestedArray("s");
if (controllers.front.feedbackValid)
{
arr.add(convertToKmh(controllers.front.feedback.left.speed * (settings.controllerHardware.invertFrontLeft ? -1 : 1)));
arr.add(convertToKmh(controllers.front.feedback.right.speed * (settings.controllerHardware.invertFrontRight ? -1 : 1)));
arr.add(convertToKmh(controllers.front.feedback.left.speed * (profileSettings.controllerHardware.invertFrontLeft ? -1 : 1)));
arr.add(convertToKmh(controllers.front.feedback.right.speed * (profileSettings.controllerHardware.invertFrontRight ? -1 : 1)));
}
else
{
@ -151,8 +177,8 @@ void handleBle()
}
if (controllers.back.feedbackValid)
{
arr.add(convertToKmh(controllers.back.feedback.left.speed * (settings.controllerHardware.invertBackLeft ? -1 : 1)));
arr.add(convertToKmh(controllers.back.feedback.right.speed * (settings.controllerHardware.invertBackRight ? -1 : 1)));
arr.add(convertToKmh(controllers.back.feedback.left.speed * (profileSettings.controllerHardware.invertBackLeft ? -1 : 1)));
arr.add(convertToKmh(controllers.back.feedback.right.speed * (profileSettings.controllerHardware.invertBackRight ? -1 : 1)));
}
else
{
@ -198,6 +224,8 @@ void handleBle()
}
}
namespace {
void RemoteControlCallbacks::onWrite(NimBLECharacteristic* pCharacteristic)
{
const auto &val = pCharacteristic->getValue();
@ -209,12 +237,13 @@ void RemoteControlCallbacks::onWrite(NimBLECharacteristic* pCharacteristic)
return;
}
#ifdef FEATURE_LEDSTRIP
auto newBlinkAnimation = doc["anim"].as<int16_t>();
if (blinkAnimation != newBlinkAnimation) blinkAnimation = newBlinkAnimation;
#endif
if (configs.feature.ledstrip.isEnabled.value())
{
const auto newBlinkAnimation = doc["anim"].as<int16_t>();
if (blinkAnimation != newBlinkAnimation) blinkAnimation = newBlinkAnimation;
}
const bool isInverted = (settings.controllerHardware.invertFrontLeft && !settings.controllerHardware.invertFrontRight);
const bool isInverted = (profileSettings.controllerHardware.invertFrontLeft && !profileSettings.controllerHardware.invertFrontRight);
if (!simplified)
{
@ -227,7 +256,6 @@ void RemoteControlCallbacks::onWrite(NimBLECharacteristic* pCharacteristic)
}
}
#ifdef FEATURE_WIRELESS_CONFIG
void WirelessSettingsCallbacks::onWrite(NimBLECharacteristic* pCharacteristic)
{
const auto &val = pCharacteristic->getValue();
@ -244,28 +272,26 @@ 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*>());
stringSettings.wifis[index].ssid = doc["wifi_ssid"].as<std::string>();
stringSettings.wifis[index].key = doc["wifi_pass"].as<std::string>();
saveSettings();
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 {
const auto deserialized = deserializeJson(doc, val);
ESP_LOGW(TAG, "Unkown type %s -> json: %.*s %s", doc["type"].as<const char*>(), val.size(), val.data(), deserialized.c_str());
}
}
void WiFiListCallbacks::onRead(NimBLECharacteristic *pCharacteristic) {
void WiFiListCallbacks::onRead(NimBLECharacteristic *pCharacteristic)
{
StaticJsonDocument<768> responseDoc;
auto wifis = stringSettings.wifis;
auto wifiArray = responseDoc.createNestedArray("wifis");
ESP_LOGI(TAG, "[ble_wifilist] Got request for listing wifi ssids.");
for (unsigned int index = 0; index < wifis.size(); index++) {
wifiArray.add(wifis[index].ssid);
for (const auto &wifi : configs.wifi_configs)
{
wifiArray.add(wifi.ssid.value());
}
responseDoc["wifi_count"] = wifis.size();
responseDoc["wifi_count"] = configs.wifi_configs.size();
std::string json;
serializeJson(responseDoc, json);
pCharacteristic->setValue(json);
}
#endif
#endif
} // namespace

View File

@ -1,62 +1,15 @@
#pragma once
// 3rdparty lib includes
#include <ArduinoJson.h>
#ifdef FEATURE_BLE
// esp-idf includes
#include <NimBLEDevice.h>
#endif
#ifdef FEATURE_LEDSTRIP
#include "ledstrip.h"
#endif
// local includes
#include "globals.h"
#include "futurecpp.h"
#include "modes/remotecontrolmode.h"
#include "utils.h"
//wifistack
#include "wifi_bobbycar.h"
#ifdef FEATURE_BLE
extern BLEServer *pServer;
extern BLEService *pService;
extern BLECharacteristic *livestatsCharacteristic;
extern BLECharacteristic *remotecontrolCharacteristic;
#ifdef FEATURE_WIRELESS_CONFIG
extern BLECharacteristic *wirelessConfig;
extern BLECharacteristic *getwifilist;
#endif
class RemoteControlCallbacks : public NimBLECharacteristicCallbacks
{
public:
void onWrite(NimBLECharacteristic* pCharacteristic) override;
};
#ifdef FEATURE_WIRELESS_CONFIG
class WirelessSettingsCallbacks : public NimBLECharacteristicCallbacks
{
public:
void onWrite(NimBLECharacteristic* pCharacteristic) override;
};
class WiFiListCallbacks : public NimBLECharacteristicCallbacks
{
public:
void onRead(NimBLECharacteristic* pCharacteristic) override;
};
#endif
extern RemoteControlCallbacks bleRemoteCallbacks;
#ifdef FEATURE_WIRELESS_CONFIG
extern WirelessSettingsCallbacks bleWirelessSettingsCallbacks;
extern WiFiListCallbacks bleWiFiListCallbacks;
#endif
void initBle();
void handleBle();
#endif

View File

@ -4,7 +4,6 @@
#include "textinterface.h"
#include "ble_bobby.h"
#ifdef FEATURE_BLE
struct BleServerPeerDevicesText : public virtual espgui::TextInterface {
public:
std::string text() const override
@ -26,4 +25,3 @@ public:
return text;
}
};
#endif

View File

@ -1,5 +1,7 @@
#include "bluetooth_bobby.h"
// compilation will be broken as there is no config parameter
// local includes
#ifdef FEATURE_BLUETOOTH
#include "actions/bluetoothbeginaction.h"
@ -7,24 +9,25 @@
#ifdef FEATURE_BMS
#include "actions/bluetoothconnectbmsaction.h"
#endif
#include "bluetoothmode.h"
#endif
#ifdef FEATURE_BLUETOOTH
void bluetooth_init()
{
if (settings.bluetoothSettings.autoBluetoothMode == BluetoothMode::Master)
if (configs.bluetooth.autoBluetoothMode.value == BluetoothMode::Master)
{
bootLabel.redraw("bluetooth begin master");
BluetoothBeginMasterAction{}.triggered();
#ifdef FEATURE_BMS
if (settings.autoConnectBms)
if (configs.autoConnectBms.value)
{
bootLabel.redraw("connect BMS");
BluetoothConnectBmsAction{}.triggered();
}
#endif
}
else if (settings.bluetoothSettings.autoBluetoothMode == BluetoothMode::Slave)
else if (configs.bluetooth.autoBluetoothMode.value == BluetoothMode::Slave)
{
bootLabel.redraw("bluetooth begin");
BluetoothBeginAction{}.triggered();

View File

@ -1,12 +1,9 @@
#pragma once
#include <cstdint>
#ifdef FEATURE_BLUETOOTH
enum class BluetoothMode : uint8_t
{
Off,
Master,
Slave
};
#endif

83
main/bobbyblinker.cpp Normal file
View File

@ -0,0 +1,83 @@
#include "bobbyblinker.h"
// system includes
#include <esp_log.h>
// 3rdparty lib includes
#include <cpputils.h>
// local includes
#include "globals.h"
#include "espnowfunctions.h"
#include "ledstrip.h"
using namespace std::chrono_literals;
namespace {
constexpr const char * const TAG = "BOBBY_BLINKER";
void sendState(const std::string& state)
{
if (const auto error = espnow::send_espnow_message(fmt::format("{}:{}:{}", state, espchrono::utc_clock::now().time_since_epoch().count(), configs.anhaenger_id.value())); error != ESP_OK)
{
ESP_LOGE(TAG, "Error sending blinker message: %s", esp_err_to_name(error));
}
}
bool brakeLightsOffSent{false};
} // namespace
namespace bobbyblinker {
std::optional<espchrono::millis_clock::time_point> blinker_last_time_sent;
std::optional<espchrono::millis_clock::time_point> brake_last_time_sent;
void handle_blinker()
{
if (!configs.espnow.syncBlink.value())
return;
const bool blinker_state = (cpputils::is_in(blinkAnimation, LEDSTRIP_OVERWRITE_BLINKLEFT, LEDSTRIP_OVERWRITE_BLINKRIGHT, LEDSTRIP_OVERWRITE_BLINKBOTH));
if ((blinker_state && !blinker_last_time_sent) || (blinker_state && blinker_last_time_sent && espchrono::ago(*blinker_last_time_sent) > 500ms))
{
blinker_last_time_sent = espchrono::millis_clock::now();
if (blinkAnimation == LEDSTRIP_OVERWRITE_BLINKLEFT)
{
sendState("BLINKLEFT");
}
else if (blinkAnimation == LEDSTRIP_OVERWRITE_BLINKRIGHT)
{
sendState("BLINKRIGHT");
}
else if (blinkAnimation == LEDSTRIP_OVERWRITE_BLINKBOTH)
{
sendState("BLINKBOTH");
}
}
else if (!blinker_state && blinker_last_time_sent)
{
blinker_last_time_sent = std::nullopt;
sendState("BLINKOFF");
}
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)
{
sendState("BRAKELIGHTSON");
brakeLightsOffSent = false;
}
else if (!brakeLightsOffSent && avgPwm > -1.f)
{
sendState("BRAKELIGHTSOFF");
brakeLightsOffSent = true;
}
}
}
} // namespace bobbyblinker

13
main/bobbyblinker.h Normal file
View File

@ -0,0 +1,13 @@
#pragma once
// system includes
#include <optional>
// 3rdparty lib includes
#include <espchrono.h>
namespace bobbyblinker {
extern std::optional<espchrono::millis_clock::time_point> blinker_last_time_sent;
extern std::optional<espchrono::millis_clock::time_point> brake_last_time_sent;
void handle_blinker();
} // namespace bobbyhupe

View File

@ -1,65 +1,137 @@
#include "bobbybuttons.h"
// esp-idf includes
#include <esp_log.h>
// local includes
#include "newsettings.h"
#include "settingsutils.h"
#include "modes/defaultmode.h"
#include "ledstripdefines.h"
#include "ledstrip.h"
#include "bobbyquickactions.h"
namespace {
constexpr const char TAG[] = "BUTTONS";
} // namespace
[[nodiscard]] std::optional<espgui::Button> translateRawButton(uint8_t button)
{
// Invalid
if (button == INPUT_MAPPING_NONE)
return std::nullopt;
using espgui::Button;
if (configs.dpadMappingLeft.value() == button)
return Button::Left;
if (configs.dpadMappingRight.value() == button)
return Button::Right;
if (configs.dpadMappingUp.value() == button)
return Button::Up;
if (configs.dpadMappingDown.value() == button)
return Button::Down;
if (configs.dpadMappingProfile0.value() == button)
return Button(BobbyButton::Profile0);
if (configs.dpadMappingProfile1.value() == button)
return Button(BobbyButton::Profile1);
if (configs.dpadMappingProfile2.value() == button)
return Button(BobbyButton::Profile2);
if (configs.dpadMappingProfile3.value() == button)
return Button(BobbyButton::Profile3);
if (configs.dpadMappingLeft2.value() == button)
return Button(BobbyButton::Left2);
if (configs.dpadMappingRight2.value() == button)
return Button(BobbyButton::Right2);
if (configs.dpadMappingUp2.value() == button)
return Button(BobbyButton::Up2);
if (configs.dpadMappingDown2.value() == button)
return Button(BobbyButton::Down2);
if (configs.dpadMappingExtra1.value() == button)
return Button(BobbyButton::Extra1);
if (configs.dpadMappingExtra2.value() == button)
return Button(BobbyButton::Extra2);
if (configs.dpadMappingExtra3.value() == button)
return Button(BobbyButton::Extra3);
if (configs.dpadMappingExtra4.value() == button)
return Button(BobbyButton::Extra4);
ESP_LOGW(TAG, "unknown raw button %hhu", button);
return std::nullopt;
}
void buttonPressedCommon(espgui::Button button)
{
switch (BobbyButton(button))
{
case BobbyButton::Profile0:
settingsutils::switchProfile(0);
break;
case BobbyButton::Profile1:
settingsutils::switchProfile(1);
break;
case BobbyButton::Profile2:
settingsutils::switchProfile(2);
break;
case BobbyButton::Profile3:
settingsutils::switchProfile(3);
break;
case BobbyButton::Left2:
case BobbyButton::Right2:
case BobbyButton::Up2:
case BobbyButton::Down2:
case BobbyButton::Extra1:
case BobbyButton::Extra2:
case BobbyButton::Extra3:
case BobbyButton::Extra4:
quickactions::handle_bobby_quickaction(button);
break;
default:;
}
}
void buttonReleasedCommon(espgui::Button button)
{
switch (BobbyButton(button))
{
case BobbyButton::Left2:
case BobbyButton::Right2:
case BobbyButton::Up2:
case BobbyButton::Down2:
case BobbyButton::Extra1:
case BobbyButton::Extra2:
case BobbyButton::Extra3:
case BobbyButton::Extra4:
quickactions::handle_bobby_quickaction(button, false);
break;
default:;
}
}
void BobbyButtons::rawButtonPressed(uint8_t button)
{
//Base::rawButtonPressed(button);
switch (button)
{
using espgui::Button;
case 0: buttonPressed(Button::Left); break;
case 1: buttonPressed(Button::Right); break;
case 2: buttonPressed(Button::Up); break;
case 3: buttonPressed(Button::Down); break;
case 4: buttonPressed(Button(BobbyButton::Profile0)); break;
case 5: buttonPressed(Button(BobbyButton::Profile1)); break;
case 6: buttonPressed(Button(BobbyButton::Profile2)); break;
case 7: buttonPressed(Button(BobbyButton::Profile3)); break;
case 8: buttonPressed(Button(BobbyButton::Left2)); break;
case 9: buttonPressed(Button(BobbyButton::Right2)); break;
case 10: buttonPressed(Button(BobbyButton::Up2)); break;
case 11: buttonPressed(Button(BobbyButton::Down2)); break;
}
if (const auto translated = translateRawButton(button))
buttonPressed(*translated);
}
void BobbyButtons::rawButtonReleased(uint8_t button)
{
//Base::rawButtonReleased(button);
switch (button)
{
using espgui::Button;
case 0: buttonReleased(Button::Left); break;
case 1: buttonReleased(Button::Right); break;
case 2: buttonReleased(Button::Up); break;
case 3: buttonReleased(Button::Down); break;
case 4: buttonReleased(Button(BobbyButton::Profile0)); break;
case 5: buttonReleased(Button(BobbyButton::Profile1)); break;
case 6: buttonReleased(Button(BobbyButton::Profile2)); break;
case 7: buttonReleased(Button(BobbyButton::Profile3)); break;
case 8: buttonReleased(Button(BobbyButton::Left2)); break;
case 9: buttonReleased(Button(BobbyButton::Right2)); break;
case 10: buttonReleased(Button(BobbyButton::Up2)); break;
case 11: buttonReleased(Button(BobbyButton::Down2)); break;
}
if (const auto translated = translateRawButton(button))
buttonReleased(*translated);
}
void BobbyButtons::buttonPressed(espgui::Button button)
{
//Base::buttonPressed(button);
switch (BobbyButton(button))
{
case BobbyButton::Profile0: /* TODO */ break;
case BobbyButton::Profile1: /* TODO */ break;
case BobbyButton::Profile2: /* TODO */ break;
case BobbyButton::Profile3: /* TODO */ break;
case BobbyButton::Left2: /* TODO */ break;
case BobbyButton::Right2: /* TODO */ break;
case BobbyButton::Up2: /* TODO */ break;
case BobbyButton::Down2: /* TODO */ break;
default:;
}
buttonPressedCommon(button);
}
void BobbyButtons::buttonReleased(espgui::Button button)
{
//Base::buttonReleased(button);
buttonReleasedCommon(button);
}

View File

@ -1,5 +1,8 @@
#pragma once
// system includes
#include <optional>
// 3rdparty lib includes
#include "buttonsinterface.h"
@ -13,10 +16,18 @@ enum BobbyButton
Right2,
Up2,
Down2,
Extra1,
Extra2,
Extra3,
Extra4,
Confirm = espgui::Button::Right,
Back = espgui::Button::Left
};
[[nodiscard]] std::optional<espgui::Button> translateRawButton(uint8_t button);
void buttonPressedCommon(espgui::Button button);
void buttonReleasedCommon(espgui::Button button);
class BobbyButtons : public virtual espgui::ButtonsInterface
{
public:

15
main/bobbycheckbox.h Normal file
View File

@ -0,0 +1,15 @@
#pragma once
// 3rdparty lib includes
#include <actions/toggleboolaction.h>
#include <checkboxicon.h>
// local includes
#include "bobbyerrorhandler.h"
class BobbyCheckbox :
public virtual espgui::ToggleBoolAction,
public virtual espgui::CheckboxIcon,
public virtual BobbyErrorHandler
{
};

View File

@ -0,0 +1,14 @@
#include "bobbyerrorhandler.h"
// 3rdparty lib includes
#include <screenmanager.h>
// local includes
#include "displays/bobbypopupdisplay.h"
void BobbyErrorHandler::errorOccured(std::string &&error)
{
auto newDisplay = std::make_unique<BobbyPopupDisplay>(std::move(error), std::move(espgui::currentDisplay));
newDisplay->initOverlay();
espgui::currentDisplay = std::move(newDisplay);
}

9
main/bobbyerrorhandler.h Normal file
View File

@ -0,0 +1,9 @@
#pragma once
// 3rdparty lib includes
#include <errorhandlerinterface.h>
struct BobbyErrorHandler : public virtual espgui::ErrorHandlerInterface
{
void errorOccured(std::string &&error) override;
};

65
main/bobbyhupe.cpp Normal file
View File

@ -0,0 +1,65 @@
#include "bobbyhupe.h"
// system includes
#include <esp_log.h>
// local includes
#include "espnowfunctions.h"
using namespace std::chrono_literals;
namespace {
constexpr const char * const TAG = "BOBBY_HUPE";
void sendState(const std::string& state)
{
if (const auto error = espnow::send_espnow_message(fmt::format("{}:0:0", state)); error != ESP_OK)
{
ESP_LOGE(TAG, "Error sending hupe message: %s", esp_err_to_name(error));
}
}
} // namespace
namespace bobbyhupe {
bool hupe_state{false};
std::optional<espchrono::millis_clock::time_point> hupe_last_time_sent;
void activate_hupe()
{
hupe_state = true;
}
void deactivate_hupe()
{
hupe_state = false;
}
void activate_compressor()
{
sendState("COMPRESSOR_AN");
}
void deactivate_compressor()
{
sendState("COMPRESSOR_AUS");
}
void toggle_compressor()
{
sendState("COMPRESSOR_TOGGLE");
}
void handle_hupe()
{
if ((hupe_state && !hupe_last_time_sent) || (hupe_state && hupe_last_time_sent && espchrono::ago(*hupe_last_time_sent) > 1s))
{
hupe_last_time_sent = espchrono::millis_clock::now();
sendState("BOBBYHUPE_AN");
}
else if (!hupe_state && hupe_last_time_sent)
{
hupe_last_time_sent = std::nullopt;
sendState("BOBBYHUPE_AUS");
}
}
} // namespace bobbyhupe

18
main/bobbyhupe.h Normal file
View File

@ -0,0 +1,18 @@
#pragma once
// system includes
#include <optional>
// 3rdparty lib includes
#include <espchrono.h>
namespace bobbyhupe {
extern bool hupe_state;
extern std::optional<espchrono::millis_clock::time_point> hupe_last_time_sent;
void handle_hupe();
void activate_hupe();
void deactivate_hupe();
void activate_compressor();
void deactivate_compressor();
void toggle_compressor();
} // namespace bobbyhupe

178
main/bobbyquickactions.cpp Normal file
View File

@ -0,0 +1,178 @@
#include "bobbyquickactions.h"
// local includes
#include "espnowfunctions.h"
#include "handbremse.h"
#include "newsettings.h"
#include "tempomat.h"
#include "wifi_bobbycar.h"
#include "bobbyhupe.h"
namespace quickactions {
void handle_bobby_quickaction(espgui::Button button, bool pressed)
{
espconfig::ConfigWrapper<BobbyQuickActions> *config = nullptr;
switch (BobbyButton(button))
{
case Left2:
config = &configs.quickActionLeft2;
break;
case Right2:
config = &configs.quickActionRight2;
break;
case Up2:
config = &configs.quickActionUp2;
break;
case Down2:
config = &configs.quickActionDown2;
break;
case Extra1:
config = &configs.quickActionExtra1;
break;
case Extra2:
config = &configs.quickActionExtra2;
break;
case Extra3:
config = &configs.quickActionExtra3;
break;
case Extra4:
config = &configs.quickActionExtra4;
break;
default:
return;
}
if (pressed)
{
switch (config->value()) {
case BobbyQuickActions::BLINK_LEFT:
blink_left();
break;
case BobbyQuickActions::BLINK_RIGHT:
blink_right();
break;
case BobbyQuickActions::HANDBREMSE:
handle_handbremse();
break;
case BobbyQuickActions::OPEN_GARAGE:
open_garage();
break;
case BobbyQuickActions::WIFI_SCAN:
action_wifi_scan();
break;
case BobbyQuickActions::PWMOMAT:
handle_pwmomat();
break;
case BobbyQuickActions::HUPE:
bobbyhupe::activate_hupe();
break;
case BobbyQuickActions::COMPRESSOR_TOGGLE:
bobbyhupe::toggle_compressor();
break;
default:
return;
}
}
else
{
switch (config->value()) {
case BobbyQuickActions::HUPE:
bobbyhupe::deactivate_hupe();
break;
default:
return;
}
}
}
void open_garage()
{
if (!configs.feature.esp_now.isEnabled.value())
return;
if (!espnow::espnow_init_allowed())
return;
for (const auto &config : configs.wireless_door_configs)
{
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));
continue;
}
}
}
void action_wifi_scan()
{
if (const auto result = wifi_scan(); result != ESP_OK)
{
ESP_LOGE("BOBBY", "wifi_scan() failed with %s", esp_err_to_name(result));
return;
}
}
void blink_left()
{
if (configs.feature.ledstrip.isEnabled.value())
{
if (blinkAnimation == LEDSTRIP_OVERWRITE_NONE) //transition from off to left
{
blinkAnimation = LEDSTRIP_OVERWRITE_BLINKLEFT;
}
else if (blinkAnimation == LEDSTRIP_OVERWRITE_BLINKRIGHT) // transition to warning
{
blinkAnimation = LEDSTRIP_OVERWRITE_BLINKBOTH;
}
else // transition to off
{
blinkAnimation = LEDSTRIP_OVERWRITE_NONE;
}
}
}
void blink_right()
{
if(configs.feature.ledstrip.isEnabled.value())
{
if (blinkAnimation == LEDSTRIP_OVERWRITE_NONE) //transition from off to right
{
blinkAnimation = LEDSTRIP_OVERWRITE_BLINKRIGHT;
}
else if (blinkAnimation == LEDSTRIP_OVERWRITE_BLINKLEFT) // transition to warning
{
blinkAnimation = LEDSTRIP_OVERWRITE_BLINKBOTH;
}
else // transition to off
{
blinkAnimation = LEDSTRIP_OVERWRITE_NONE;
}
}
}
void handle_handbremse()
{
if (configs.handbremse.enable.value())
{
using StateWish = handbremse::StateWish;
if (handbremse::stateWish == StateWish::brake || handbremse::angezogen)
handbremse::stateWish = StateWish::release;
else
handbremse::stateWish = StateWish::brake;
handbremse::wishTimer = espchrono::millis_clock::now();
}
}
void handle_pwmomat()
{
if (pwmomat::tempomat_pwm)
{
pwmomat::wish = pwmomat::WISH::WISH_DISABLE;
}
else
{
pwmomat::wish = pwmomat::WISH::WISH_ENABLE;
}
}
} // namespace quickactions

35
main/bobbyquickactions.h Normal file
View File

@ -0,0 +1,35 @@
#pragma once
// 3rdparty lib includes
#include <buttonsinterface.h>
#include <cpptypesafeenum.h>
// local includes
#include "bobbybuttons.h"
#define BobbyQuickActionsValues(x) \
x(NONE) \
x(BLINK_LEFT) \
x(BLINK_RIGHT) \
x(HANDBREMSE) \
x(OPEN_GARAGE) \
x(WIFI_SCAN) \
x(PWMOMAT) \
x(HUPE) \
x(COMPRESSOR_TOGGLE)
DECLARE_TYPESAFE_ENUM(BobbyQuickActions, : uint8_t, BobbyQuickActionsValues)
namespace quickactions {
void handle_bobby_quickaction(espgui::Button button, bool pressed = true);
// functions
void open_garage();
void blink_left();
void blink_right();
void handle_handbremse();
void action_wifi_scan();
void handle_pwmomat();
} // namespace quickactions

13
main/bobbyschedulertask.h Normal file
View File

@ -0,0 +1,13 @@
#pragma once
// 3rdparty lib includes
#include <schedulertask.h>
class BobbySchedulerTask : public espcpputils::SchedulerTask {
public:
using SchedulerTask::SchedulerTask;
void setup() const { SchedulerTask::setup(); m_wasInitialized = true; }
bool isInitialized() const { return m_wasInitialized; }
private:
mutable bool m_wasInitialized{false};
};

19
main/bobbytypesafeenum.h Normal file
View File

@ -0,0 +1,19 @@
#pragma once
// 3rdparty lib includes
#include <cpptypesafeenum.h>
template<typename T>
struct iterateEnum;
#define DECLARE_BOBBYTYPESAFE_ENUM(Name, Derivation, Values) \
DECLARE_TYPESAFE_ENUM(Name, Derivation, Values) \
\
template<> \
struct iterateEnum<Name> { \
template<typename T> \
static void iterate(T&&cb) \
{ \
return iterate##Name(std::forward<T>(cb)); \
} \
};

View File

@ -1,30 +1,28 @@
#include "buildserver.h"
#include <ArduinoJson.h>
#include <cpputils.h>
#include <cleanuphelper.h>
// esp-idf
#include "esp_http_client.h"
#include "esp_log.h"
// 3rdparty lib includes
#include <asynchttprequest.h>
#include <delayedconstruction.h>
#include <ArduinoJson.h>
#include <cpputils.h>
#include <cleanuphelper.h>
#include "fmt/core.h"
// local includes
#include "globals.h"
#include "esp_log.h"
#include "fmt/core.h"
// esp-idf
#include "esp_http_client.h"
#ifdef FEATURE_OTA
#include "newsettings.h"
namespace buildserver {
uint16_t count_available_buildserver()
{
uint16_t count = 0;
for (const auto &otaServer : stringSettings.otaServers) {
if (!otaServer.url.empty()) count++;
for (const auto &otaServer : configs.otaServers) {
if (!otaServer.url.value().empty()) count++;
}
return count;
}
@ -52,7 +50,7 @@ namespace buildserver {
return;
}
const auto url = fmt::format("{}/otaDescriptor?username={}&branches", server_base_url, OTA_USERNAME);
const auto url = fmt::format("{}/otaDescriptor?username={}&branches", server_base_url, configs.otaUsername.value());
ESP_LOGD("BOBBY", "requesting data...");
if (const auto result = request->start(url); !result)
{
@ -135,12 +133,12 @@ namespace buildserver {
std::string get_ota_url_from_index(uint16_t index)
{
if (index < stringSettings.otaServers.size())
if (index < configs.otaServers.size())
{
auto otaServer = stringSettings.otaServers[index];
if (!otaServer.url.empty())
const auto &otaServer = configs.otaServers[index];
if (!otaServer.url.value().empty())
{
return otaServer.url;
return otaServer.url.value();
}
else
{
@ -167,10 +165,10 @@ namespace buildserver {
std::string get_descriptor_url(std::string base_url)
{
if (stringSettings.otaServerBranch.empty())
return fmt::format("{}/otaDescriptor?username={}", base_url, OTA_USERNAME);
if (configs.otaServerBranch.value().empty())
return fmt::format("{}/otaDescriptor?username={}", base_url, configs.otaUsername.value());
else
return fmt::format("{}/otaDescriptor?username={}&branch={}", base_url, OTA_USERNAME, stringSettings.otaServerBranch);
return fmt::format("{}/otaDescriptor?username={}&branch={}", base_url, configs.otaUsername.value(), configs.otaServerBranch.value());
}
void parse_response_into_variables(std::string response)
@ -198,8 +196,8 @@ namespace buildserver {
index = 0;
url_for_latest = fmt::format("{}{}", stringSettings.otaServerUrl, doc["latest"].as<std::string>());
url_for_hashes = fmt::format("{}{}", stringSettings.otaServerUrl, doc["url"].as<std::string>());
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>());
parsing_finished = true;
}
@ -271,4 +269,3 @@ namespace buildserver {
}
} // namespace SelectBuild
} // namespace buildserver
#endif

View File

@ -6,7 +6,6 @@
#include <asynchttprequest.h>
#include <delayedconstruction.h>
#ifdef FEATURE_OTA
namespace buildserver {
uint16_t count_available_buildserver();
@ -48,4 +47,3 @@ namespace SelectBuild {
bool get_request_running();
} // namespace SelectBuild
} // namespace buildserver
#endif

View File

@ -1,191 +0,0 @@
#include "buttons.h"
#include "modes/defaultmode.h"
using namespace std::chrono_literals;
int rotated{};
bool requestFullRedraw{};
bool confirmButtonPressed{};
bool confirmButtonLongPressed{};
bool backButtonPressed{};
bool backButtonLongPressed{};
bool profileButtonDisabled{};
std::optional<espchrono::millis_clock::time_point> upPressedSince;
int upPressRepeat{};
std::optional<espchrono::millis_clock::time_point> downPressedSince;
int downPressRepeat{};
void InputDispatcher::init()
{
}
void InputDispatcher::update()
{
if (upPressedSince && espchrono::ago(*upPressedSince) > (upPressRepeat > 2 ? 50ms : 400ms))
{
upPressedSince = espchrono::millis_clock::now();
upPressRepeat++;
rotated -= 1;
}
if (downPressedSince && espchrono::ago(*downPressedSince) > (downPressRepeat > 2 ? 50ms : 400ms))
{
downPressedSince = espchrono::millis_clock::now();
downPressRepeat++;
rotated += 1;
}
}
void InputDispatcher::rotate(int offset)
{
rotated += offset;
}
void InputDispatcher::upButton(bool pressed)
{
if (pressed)
{
upPressedSince = espchrono::millis_clock::now();
upPressRepeat = 0;
rotated -= 1;
}
else
{
upPressedSince = std::nullopt;
}
}
void InputDispatcher::downButton(bool pressed)
{
if (pressed)
{
downPressedSince = espchrono::millis_clock::now();
downPressRepeat = 0;
rotated += 1;
}
else
{
downPressedSince = std::nullopt;
}
}
void InputDispatcher::confirmButton(bool pressed)
{
static espchrono::millis_clock::time_point pressBegin{};
const auto now = espchrono::millis_clock::now();
if (pressed)
pressBegin = now;
else
{
const auto duration = now - pressBegin;
if (duration < 500ms)
confirmButtonPressed = true;
else if (duration < 2000ms)
confirmButtonLongPressed = true;
else
requestFullRedraw = true;
pressBegin = {};
}
}
void InputDispatcher::backButton(bool pressed)
{
static espchrono::millis_clock::time_point pressBegin{};
const auto now = espchrono::millis_clock::now();
if (pressed)
pressBegin = now;
else
{
const auto duration = now - pressBegin;
if (duration < 500ms)
backButtonPressed = true;
else
backButtonLongPressed = true;
pressBegin = {};
}
}
void InputDispatcher::profileButton(uint8_t index, bool pressed)
{
if (!pressed)
return;
if (profileButtonDisabled)
return;
settingsutils::switchProfile(index);
}
#ifdef SWITCH_BLINK
void InputDispatcher::blinkRightButton(bool pressed)
#else
void InputDispatcher::blinkLeftButton(bool pressed)
#endif
{
if(!pressed)return;
#ifdef FEATURE_LEDSTRIP
if(blinkAnimation == LEDSTRIP_OVERWRITE_NONE){ //transition from off to left
blinkAnimation = LEDSTRIP_OVERWRITE_BLINKLEFT;
}
else if(blinkAnimation == LEDSTRIP_OVERWRITE_BLINKRIGHT){ // transition to warning
blinkAnimation = LEDSTRIP_OVERWRITE_BLINKBOTH;
}
else{ // transition to off
blinkAnimation = LEDSTRIP_OVERWRITE_NONE;
}
#endif
}
#ifndef SWITCH_BLINK
void InputDispatcher::blinkRightButton(bool pressed)
#else
void InputDispatcher::blinkLeftButton(bool pressed)
#endif
{
if(!pressed)return;
#ifdef FEATURE_LEDSTRIP
if(blinkAnimation == LEDSTRIP_OVERWRITE_NONE){ //transition from off to right
blinkAnimation = LEDSTRIP_OVERWRITE_BLINKRIGHT;
}
else if(blinkAnimation == LEDSTRIP_OVERWRITE_BLINKLEFT){ // transition to warning
blinkAnimation = LEDSTRIP_OVERWRITE_BLINKBOTH;
}
else{ // transition to off
blinkAnimation = LEDSTRIP_OVERWRITE_NONE;
}
#endif
}
void InputDispatcher::quickActionButtonDown(bool pressed)
{
using namespace handbremse;
if(!pressed)return;
if (settings.handbremse.enable)
{
if (stateWish == StateWish::brake || angezogen)
stateWish = StateWish::release;
else
stateWish = StateWish::brake;
wishTimer = espchrono::millis_clock::now();
}
}
void InputDispatcher::quickActionButtonUp(bool pressed)
{
}

View File

@ -1,58 +0,0 @@
#pragma once
// system includes
#include <optional>
// 3rdparty lib includes
#include <espchrono.h>
// local includes
#include "settingsutils.h"
#include "ledstripdefines.h"
#ifdef FEATURE_LEDSTRIP
#include "ledstrip.h"
#endif
extern int rotated;
extern bool requestFullRedraw;
extern bool confirmButtonPressed;
extern bool confirmButtonLongPressed;
extern bool backButtonPressed;
extern bool backButtonLongPressed;
extern bool profileButtonDisabled;
extern std::optional<espchrono::millis_clock::time_point> upPressedSince;
extern int upPressRepeat;
extern std::optional<espchrono::millis_clock::time_point> downPressedSince;
extern int downPressRepeat;
class InputDispatcher
{
public:
static void init();
static void update();
static void rotate(int offset);
static void upButton(bool pressed);
static void downButton(bool pressed);
static void confirmButton(bool pressed);
static void backButton(bool pressed);
static void profileButton(uint8_t index, bool pressed);
static void blinkLeftButton(bool pressed);
static void blinkRightButton(bool pressed);
static void quickActionButtonDown(bool pressed);
static void quickActionButtonUp(bool pressed);
};

View File

@ -6,29 +6,34 @@
#include <optional>
// esp-idf
#include <driver/gpio.h>
#include <driver/twai.h>
#include <driver/gpio.h>
#include <esp_log.h>
// 3rdparty lib includes
#include <espchrono.h>
#include <tickchrono.h>
#include <screenmanager.h>
#include <futurecpp.h>
// local includes
#include "bobbycar-can.h"
#include "globals.h"
#include "buttons.h"
#include "newsettings.h"
#include "bobbybuttons.h"
using namespace std::chrono_literals;
namespace can {
uint32_t can_total_error_cnt;
namespace {
constexpr const char * const TAG = "BOBBYCAN";
bool tryParseCanInput();
} // namespace
std::optional<int16_t> can_gas, can_brems;
espchrono::millis_clock::time_point last_can_gas{}, last_can_brems{};
CanButtonsState lastButtonsState;
void initCan()
{
@ -75,6 +80,13 @@ void initCan()
}
}
void updateCan()
{
for (int i = 0; i < 4; i++)
if (!tryParseCanInput())
break;
}
namespace {
template<bool isBack>
@ -159,65 +171,39 @@ bool parseBoardcomputerCanMessage(const twai_message_t &message)
switch (message.identifier)
{
using namespace bobbycar::protocol::can;
case Boardcomputer::Command::ButtonPress:
{
const auto canButtonBits = *((uint16_t*)message.data);
CanButtonsState newState {
.up = bool(canButtonBits & Boardcomputer::ButtonUp),
.down = bool(canButtonBits & Boardcomputer::ButtonDown),
.confirm = bool(canButtonBits & Boardcomputer::ButtonConfirm),
.back = bool(canButtonBits & Boardcomputer::ButtonBack),
.profile0 = bool(canButtonBits & Boardcomputer::ButtonProfile0),
.profile1 = bool(canButtonBits & Boardcomputer::ButtonProfile1),
.profile2 = bool(canButtonBits & Boardcomputer::ButtonProfile2),
.profile3 = bool(canButtonBits & Boardcomputer::ButtonProfile3),
};
if (lastButtonsState.up != newState.up)
InputDispatcher::upButton(newState.up);
if (lastButtonsState.down != newState.down)
InputDispatcher::downButton(newState.down);
if (lastButtonsState.confirm != newState.confirm)
InputDispatcher::confirmButton(newState.confirm);
if (lastButtonsState.back != newState.back)
InputDispatcher::backButton(newState.back);
if (lastButtonsState.profile0 != newState.profile0)
InputDispatcher::profileButton(0, newState.profile0);
if (lastButtonsState.profile1 != newState.profile1)
InputDispatcher::profileButton(1, newState.profile1);
if (lastButtonsState.profile2 != newState.profile2)
InputDispatcher::profileButton(2, newState.profile2);
if (lastButtonsState.profile3 != newState.profile3)
InputDispatcher::profileButton(3, newState.profile3);
lastButtonsState = newState;
break;
}
case Boardcomputer::Command::RawButtonPressed:
if (espgui::currentDisplay)
espgui::currentDisplay->rawButtonPressed(*((const uint8_t*)message.data));
return true;
case Boardcomputer::Command::RawButtonReleased:
if (espgui::currentDisplay)
espgui::currentDisplay->rawButtonReleased(*((const uint8_t*)message.data));
return true;
case Boardcomputer::Command::ButtonPressed:
if (espgui::currentDisplay)
espgui::currentDisplay->buttonPressed(espgui::Button(*((const uint8_t*)message.data)));
return true;
case Boardcomputer::Command::ButtonReleased:
if (espgui::currentDisplay)
espgui::currentDisplay->buttonReleased(espgui::Button(*((const uint8_t*)message.data)));
return true;
case Boardcomputer::Command::RawGas:
can_gas = *((int16_t*)message.data);
last_can_gas = espchrono::millis_clock::now();
break;
return true;
case Boardcomputer::Command::RawBrems:
can_brems = *((int16_t*)message.data);
last_can_brems = espchrono::millis_clock::now();
break;
return true;
}
return false;
}
} // namespace
bool tryParseCanInput()
{
twai_message_t message;
const auto timeout = std::chrono::ceil<espcpputils::ticks>(espchrono::milliseconds32{settings.controllerHardware.canReceiveTimeout}).count();
const auto timeout = std::chrono::ceil<espcpputils::ticks>(espchrono::milliseconds32{configs.controllerHardware.canReceiveTimeout.value()}).count();
if (const auto result = twai_receive(&message, timeout); result != ESP_OK)
{
if (result != ESP_ERR_TIMEOUT)
@ -234,8 +220,8 @@ bool tryParseCanInput()
return false;
}
Controller &front = settings.controllerHardware.swapFrontBack ? controllers.back : controllers.front;
Controller &back = settings.controllerHardware.swapFrontBack ? controllers.front : controllers.back;
Controller &front = configs.controllerHardware.swapFrontBack.value() ? controllers.back : controllers.front;
Controller &back = configs.controllerHardware.swapFrontBack.value() ? controllers.front : controllers.back;
if (parseMotorControllerCanMessage<false>(message, front))
{
@ -272,57 +258,115 @@ bool tryParseCanInput()
return true;
}
void parseCanInput()
{
for (int i = 0; i < 4; i++)
if (!tryParseCanInput())
break;
}
} // namespace
void sendCanCommands()
{
static uint32_t can_sequential_error_cnt = 0;
static uint32_t can_sequential_bus_errors = 0;
constexpr auto send = [](uint32_t addr, auto value){
twai_message_t message;
twai_status_info_t status_info;
message.identifier = addr;
message.flags = TWAI_MSG_FLAG_SS;
message.data_length_code = sizeof(value);
std::fill(std::begin(message.data), std::end(message.data), 0);
std::memcpy(message.data, &value, sizeof(value));
const auto timeout = std::chrono::ceil<espcpputils::ticks>(espchrono::milliseconds32{settings.controllerHardware.canTransmitTimeout}).count();
const auto timeout = std::chrono::ceil<espcpputils::ticks>(espchrono::milliseconds32{configs.controllerHardware.canTransmitTimeout.value()}).count();
const auto timestamp_before = espchrono::millis_clock::now();
const auto result = twai_transmit(&message, timeout);
if (result != ESP_OK && result != ESP_ERR_TIMEOUT)
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))
{
ESP_LOGE(TAG, "ERROR: twai_transmit() failed with %s", esp_err_to_name(result));
++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);
}
else if (result != ESP_OK)
{
ESP_LOGD(TAG, "ERROR: twai_transmit() failed after %lldms with %s",
(timestamp_after - timestamp_before).count(),
esp_err_to_name(result));
}
else
{
can_sequential_error_cnt = 0;
}
if (can_sequential_error_cnt > 3)
{
can_sequential_error_cnt = 0;
if (configs.canResetOnError.value())
{
ESP_LOGW(TAG, "WARNING: 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));
}
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));
}
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));
}
}
if (const auto err = twai_start(); err != ESP_OK)
{
ESP_LOGE(TAG, "ERROR: twai_start() failed with %s", esp_err_to_name(err));
}
}
}
return result;
};
const bool swap = settings.controllerHardware.swapFrontBack;
const bool swap = configs.controllerHardware.swapFrontBack.value();
const Controller *front =
(swap ? settings.controllerHardware.sendBackCanCmd : settings.controllerHardware.sendFrontCanCmd ) ?
(swap ? configs.controllerHardware.sendBackCanCmd.value() : configs.controllerHardware.sendFrontCanCmd.value() ) ?
(swap ? &controllers.back : &controllers.front) :
nullptr;
const Controller *back =
(swap ? settings.controllerHardware.sendFrontCanCmd : settings.controllerHardware.sendBackCanCmd ) ?
(swap ? configs.controllerHardware.sendFrontCanCmd.value() : configs.controllerHardware.sendBackCanCmd.value() ) ?
(swap ? &controllers.front : &controllers.back) :
nullptr;
using namespace bobbycar::protocol::can;
#ifdef HAS_SIMPLIFIED
SIMPLIFIED_PWM
#else
if (front) send(MotorController<false, false>::Command::InpTgt, front->command.left.pwm);
if (front) send(MotorController<false, true>::Command::InpTgt, front->command.right.pwm);
if (back) send(MotorController<true, false>::Command::InpTgt, back->command.left.pwm);
if (back) send(MotorController<true, true>::Command::InpTgt, back->command.right.pwm);
#endif
uint16_t buttonLeds{};
if (const auto index = settingsPersister.currentlyOpenProfileIndex())
switch (*index)
{
case 0: buttonLeds |= Boardcomputer::ButtonProfile0; break;
case 1: buttonLeds |= Boardcomputer::ButtonProfile1; break;
case 2: buttonLeds |= Boardcomputer::ButtonProfile2; break;
case 3: buttonLeds |= Boardcomputer::ButtonProfile3; break;
case 0: buttonLeds |= std::to_underlying(Boardcomputer::Button::Profile0); break;
case 1: buttonLeds |= std::to_underlying(Boardcomputer::Button::Profile1); break;
case 2: buttonLeds |= std::to_underlying(Boardcomputer::Button::Profile2); break;
case 3: buttonLeds |= std::to_underlying(Boardcomputer::Button::Profile3); break;
}
static struct {
@ -330,7 +374,7 @@ void sendCanCommands()
uint8_t freq = 0;
uint8_t pattern = 0;
} front, back;
uint16_t buttonLeds{};
std::underlying_type_t<Boardcomputer::Button> buttonLeds{};
} lastValues;
static int i{};
@ -352,12 +396,18 @@ void sendCanCommands()
if (back) send(MotorController<true, true>::Command::Enable, back->command.right.enable);
break;
case 1:
#ifdef HAS_SIMPLIFIED
SIMPLIFIED_CONTROLTYPE
#endif
if (front) send(MotorController<false, false>::Command::CtrlTyp, front->command.left.ctrlTyp);
if (front) send(MotorController<false, true>::Command::CtrlTyp, front->command.right.ctrlTyp);
if (back) send(MotorController<true, false>::Command::CtrlTyp, back->command.left.ctrlTyp);
if (back) send(MotorController<true, true>::Command::CtrlTyp, back->command.right.ctrlTyp);
break;
case 2:
#ifdef HAS_SIMPLIFIED
SIMPLIFIED_CONTROLMODE
#endif
if (front) send(MotorController<false, false>::Command::CtrlMod, front->command.left.ctrlMod);
if (front) send(MotorController<false, true>::Command::CtrlMod, front->command.right.ctrlMod);
if (back) send(MotorController<true, false>::Command::CtrlMod, back->command.left.ctrlMod);
@ -365,7 +415,7 @@ void sendCanCommands()
handbremse::finishedMotorUpdate = true;
break;
case 3:
#if defined(HAS_SIMPLIFIED)
#ifdef HAS_SIMPLIFIED
SIMPLIFIED_IMOTMAX
#endif
if (front) send(MotorController<false, false>::Command::IMotMax, front->command.left.iMotMax);
@ -374,7 +424,7 @@ void sendCanCommands()
if (back) send(MotorController<true, true>::Command::IMotMax, back->command.right.iMotMax);
break;
case 4:
#if defined(HAS_SIMPLIFIED)
#ifdef HAS_SIMPLIFIED
SIMPLIFIED_IDCMAX
#endif
if (front) send(MotorController<false, false>::Command::IDcMax, front->command.left.iDcMax);
@ -383,7 +433,7 @@ void sendCanCommands()
if (back) send(MotorController<true, true>::Command::IDcMax, back->command.right.iDcMax);
break;
case 5:
#if defined(HAS_SIMPLIFIED)
#ifdef HAS_SIMPLIFIED
SIMPLIFIED_NMOTMAX
#endif
if (front) send(MotorController<false, false>::Command::NMotMax, front->command.left.nMotMax);
@ -392,7 +442,7 @@ void sendCanCommands()
if (back) send(MotorController<true, true>::Command::NMotMax, back->command.right.nMotMax);
break;
case 6:
#if defined(HAS_SIMPLIFIED)
#ifdef HAS_SIMPLIFIED
SIMPLIFIED_FIELDWEAKMAX
#endif
if (front) send(MotorController<false, false>::Command::FieldWeakMax, front->command.left.fieldWeakMax);

View File

@ -9,31 +9,17 @@
#include <espchrono.h>
#ifdef CAN_PLUGIN
#pragma message "Activating Can Plugin"
#include CAN_PLUGIN
#endif
namespace can {
extern uint32_t can_total_error_cnt;
extern std::optional<int16_t> can_gas, can_brems;
extern espchrono::millis_clock::time_point last_can_gas, last_can_brems;
struct CanButtonsState
{
bool up{};
bool down{};
bool confirm{};
bool back{};
bool profile0{};
bool profile1{};
bool profile2{};
bool profile3{};
};
extern CanButtonsState lastButtonsState;
void initCan();
bool tryParseCanInput();
void parseCanInput();
void updateCan();
void sendCanCommands();
} // namespace can
#endif

View File

@ -7,7 +7,6 @@
#include "actions/setvalueaction.h"
#include "actions/backproxyaction.h"
#include "icons/back.h"
#include "texts.h"
#ifdef FEATURE_BLUETOOTH
#include "bluetoothmode.h"
#endif

View File

@ -0,0 +1,66 @@
#include "changevaluedisplay_bobbyquickactions.h"
// esp-idf includes
#include <esp_log.h>
// 3rdparty lib includes
#include <actions/setvalueaction.h>
#include <actions/backproxyaction.h>
#include <icons/back.h>
#include <futurecpp.h>
// local includes
#include "utils.h"
namespace espgui {
namespace {
constexpr const char * const TAG = "ESPGUI";
constexpr char TEXT_QUICKACTION_NONE[] = "None";
constexpr char TEXT_QUICKACTION_BLINK_LEFT[] = "Blink Left";
constexpr char TEXT_QUICKACTION_BLINK_RIGHT[] = "Blink Right";
constexpr char TEXT_QUICKACTION_HANDBREMSE[] = "Handbremse";
constexpr char TEXT_QUICKACTION_OPEN_GARAGE[] = "Open Garage";
constexpr char TEXT_QUICKACTION_WIFI_SCAN[] = "Wifi Scan";
constexpr char TEXT_QUICKACTION_TEMPOMAT[] = "Toggle PWM-Omat";
constexpr char TEXT_QUICKACTION_COMPRESSOR[] = "Remote-Compressor";
constexpr char TEXT_QUICKACTION_HUPE[] = "Remote-Hupe";
constexpr char TEXT_BACK[] = "Back";
} // namespace
ChangeValueDisplay<BobbyQuickActions>::ChangeValueDisplay()
{
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<BobbyQuickActions>, StaticText<TEXT_QUICKACTION_NONE>>>(BobbyQuickActions::NONE, *this, *this, *this);
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<BobbyQuickActions>, StaticText<TEXT_QUICKACTION_BLINK_LEFT>>>(BobbyQuickActions::BLINK_LEFT, *this, *this, *this);
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<BobbyQuickActions>, StaticText<TEXT_QUICKACTION_BLINK_RIGHT>>>(BobbyQuickActions::BLINK_RIGHT, *this, *this, *this);
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<BobbyQuickActions>, StaticText<TEXT_QUICKACTION_HANDBREMSE>>>(BobbyQuickActions::HANDBREMSE, *this, *this, *this);
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<BobbyQuickActions>, StaticText<TEXT_QUICKACTION_OPEN_GARAGE>>>(BobbyQuickActions::OPEN_GARAGE, *this, *this, *this);
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<BobbyQuickActions>, StaticText<TEXT_QUICKACTION_WIFI_SCAN>>>(BobbyQuickActions::WIFI_SCAN, *this, *this, *this);
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<BobbyQuickActions>, StaticText<TEXT_QUICKACTION_TEMPOMAT>>>(BobbyQuickActions::PWMOMAT, *this, *this, *this);
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<BobbyQuickActions>, StaticText<TEXT_QUICKACTION_COMPRESSOR>>>(BobbyQuickActions::COMPRESSOR_TOGGLE, *this, *this, *this);
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<BobbyQuickActions>, StaticText<TEXT_QUICKACTION_HUPE>>>(BobbyQuickActions::HUPE, *this, *this, *this);
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&espgui::icons::back>>>(*this);
}
void ChangeValueDisplay<BobbyQuickActions>::start()
{
Base::start();
switch (const auto value = getValue())
{
case BobbyQuickActions::NONE: setSelectedIndex(0); break;
case BobbyQuickActions::BLINK_LEFT: setSelectedIndex(1); break;
case BobbyQuickActions::BLINK_RIGHT: setSelectedIndex(2); break;
case BobbyQuickActions::HANDBREMSE: setSelectedIndex(3); break;
case BobbyQuickActions::OPEN_GARAGE: setSelectedIndex(4); break;
case BobbyQuickActions::WIFI_SCAN: setSelectedIndex(5); break;
case BobbyQuickActions::PWMOMAT: setSelectedIndex(6); break;
case BobbyQuickActions::COMPRESSOR_TOGGLE: setSelectedIndex(7); break;
case BobbyQuickActions::HUPE: setSelectedIndex(8); break;
default:
ESP_LOGW(TAG, "Unknown BobbyQuickActions: %i", std::to_underlying(value));
setSelectedIndex(9);
}
}
} // namespace espgui

Some files were not shown because too many files have changed in this diff Show More