Compare commits
436 Commits
relay_boar
...
gabor-test
Author | SHA1 | Date | |
---|---|---|---|
a6e08af976 | |||
c6879016b1 | |||
eb94c1912d | |||
f6bc1f5dbd | |||
a9905232c6 | |||
a1d51c3f2a | |||
b08572d503 | |||
460f40ce47 | |||
c42e44c40b | |||
2a157f32ec | |||
aea4533893 | |||
039b97e5c1 | |||
5288efe0ef | |||
f29f8308d1 | |||
ed149bf287 | |||
4ac8896591 | |||
89e5428af2 | |||
7bb09e4085 | |||
4ccfc4340a | |||
6a189e2d06 | |||
ab02a1c437 | |||
f4ac629823 | |||
5f4627ffb9 | |||
f7def7cf2c | |||
86cae5d564 | |||
5bba53bfb9 | |||
5eac6fd671 | |||
840c43ef0e | |||
3c10185e5e | |||
b6be6e6a83 | |||
30832a42f7 | |||
c90ad518c5 | |||
a5bfab2df7 | |||
349ffafedf | |||
a3a7868988 | |||
8c0addd600 | |||
884ac87314 | |||
b7b86a5e8a | |||
9190cb6634 | |||
3818e50eab | |||
5f27748675 | |||
367907d432 | |||
873e3a027a | |||
230a9614d9 | |||
304b7225df | |||
f9760528ca | |||
d692f0261c | |||
4c7e438c18 | |||
d277202fa3 | |||
ed4444ad93 | |||
ee294392fc | |||
91880608dc | |||
84a1cd40e9 | |||
71624b99b6 | |||
e9de923224 | |||
4b8848d464 | |||
a58a8d1344 | |||
8c884c0b4e | |||
950d46b109 | |||
4540a2afbf | |||
1268887c37 | |||
143a3d37e6 | |||
e7ac8b47e3 | |||
d85a67c05b | |||
f5a7f9bcbe | |||
1a1882d825 | |||
efb593c8aa | |||
d47bd7f095 | |||
5043788aef | |||
4f6b98a27b | |||
cf14e94647 | |||
f188b42987 | |||
78d8255b62 | |||
d40f5e71a4 | |||
e4b8622fed | |||
c0f911ce05 | |||
c18403a30f | |||
b9cb7835a1 | |||
e8217bb038 | |||
0bef65c4d0 | |||
9f36056177 | |||
1f6eb46771 | |||
c0f8197262 | |||
d5e863eb6b | |||
48f9e32cd4 | |||
eb3e1862b2 | |||
936408a17a | |||
5ad64d81d0 | |||
989da449b0 | |||
e20176f3ad | |||
39500ef59c | |||
673e304641 | |||
b3e30780a1 | |||
4765b97a70 | |||
c7ca2846c7 | |||
15108bf277 | |||
f2f479e1a6 | |||
7be54d20c8 | |||
3bd0a4b010 | |||
255d09b06e | |||
41a39be51f | |||
562554f6d6 | |||
8310fe64c9 | |||
d77390e521 | |||
33731a5408 | |||
c7a8f5e974 | |||
3b4b117219 | |||
d1c0497dc2 | |||
4617f5f26d | |||
886a5f32e5 | |||
f236d4bf03 | |||
1040ebe4a1 | |||
c7573b90a6 | |||
56996b50a1 | |||
48cfe3edbc | |||
0b17b4ffd1 | |||
b75af48353 | |||
7664e409d4 | |||
3bbc916348 | |||
631eb0edad | |||
5bdb0fabce | |||
2e57c93252 | |||
924d35ee6a | |||
7db77cc25b | |||
8a670cf608 | |||
ce9d9d840b | |||
e7730d0a20 | |||
8c69ab02d5 | |||
37961639d1 | |||
5f23b8dec5 | |||
64a7ac0018 | |||
2c339b9273 | |||
19ea4ebec9 | |||
7ad56840be | |||
c284ac9416 | |||
813abbefd6 | |||
605cd12c8b | |||
81d467e69f | |||
bda9707638 | |||
af255ec098 | |||
e4daf6cf3c | |||
e40253c70f | |||
a222d68264 | |||
177220df6b | |||
cb1065ccb4 | |||
b48a40742e | |||
7f6fa967c8 | |||
73d01e8516 | |||
9dc4ff7d4e | |||
11a461bfdd | |||
689d7221a1 | |||
c3cf4a74b0 | |||
e7379fd3df | |||
080ba7dfe0 | |||
89f1a0b7a3 | |||
4bc93579fb | |||
1564820f24 | |||
a496c3ab49 | |||
f98147295b | |||
db898c38f5 | |||
d15b974a21 | |||
ba0c0acef2 | |||
401a1db42c | |||
2e8feaf2b5 | |||
db4c76ef5c | |||
3908772345 | |||
f627c8d993 | |||
e6c3357788 | |||
9bb26252c5 | |||
cc591cebc2 | |||
7222211c08 | |||
ca9cf65d66 | |||
6b0260b2c5 | |||
4db8690677 | |||
168baeac83 | |||
2adccba813 | |||
97c9ecec4d | |||
e17e7ba5f8 | |||
89779c4648 | |||
ade3117303 | |||
ddc1b64b20 | |||
887e55aa3d | |||
b5aba26f9b | |||
0f03c0f88b | |||
1febc69583 | |||
fecdbc2944 | |||
06f8bd2ac1 | |||
d29514a167 | |||
fb0bed29bf | |||
25a6479887 | |||
31a0b64377 | |||
2033448f65 | |||
dbaf7ddc71 | |||
72b7dc3826 | |||
377564ff34 | |||
a66d48de7d | |||
eb8cacec5a | |||
5e242eb098 | |||
d202a5a350 | |||
5908e2c4ca | |||
c4451bf1cb | |||
55c9e4ac93 | |||
21dfe01f0c | |||
55db6f4090 | |||
bebdf0046e | |||
dbabd70ad4 | |||
4a47deccb8 | |||
18ba362d61 | |||
7140e1baf9 | |||
359facce64 | |||
22896d0fb9 | |||
3cab7f2cf7 | |||
3b5538363f | |||
8a0f642324 | |||
3ccccc81a9 | |||
777134eaf1 | |||
1411a8847c | |||
43c0f6e374 | |||
65308be33d | |||
9890c9fb24 | |||
ffd98375cc | |||
7a551c14d0 | |||
6f1633d713 | |||
8e3397c6e5 | |||
c44e683941 | |||
fa4aeac27d | |||
1a5df4e877 | |||
9640b3fcd3 | |||
2117be359c | |||
0415d90d1b | |||
1fe69c9161 | |||
144ff531a4 | |||
bf42fe05f4 | |||
fc2d7c511e | |||
d40cc5d71d | |||
9125a968d5 | |||
cb11ca3c9e | |||
0d366881b2 | |||
e52cf82218 | |||
a87599c7ea | |||
3322120464 | |||
f10cb18dc4 | |||
79f7efeaf9 | |||
62f91ae0a6 | |||
c589295e30 | |||
6fe397a103 | |||
598f74f8a3 | |||
9ac7f3fdc7 | |||
ab85b87d29 | |||
3b45dc8b16 | |||
28ebb57cf3 | |||
e187f2fa77 | |||
6a1dfc3b91 | |||
3665ac1bd4 | |||
8a1051d91b | |||
98ef64d82e | |||
cfa278a4b1 | |||
bc8cc945e3 | |||
e3640046c0 | |||
23e94b213f | |||
fef3c2d5af | |||
62987cb374 | |||
8bbb098945 | |||
003e961c19 | |||
976fc7cf2f | |||
44293a7a32 | |||
25a0077b88 | |||
5d4bd322dc | |||
eed2ee4b23 | |||
299729a272 | |||
4d61959c5b | |||
b27cf645e6 | |||
bc340a3319 | |||
d8c97d7f20 | |||
40918ec32a | |||
5a034278f4 | |||
e23de353aa | |||
4ea3550d54 | |||
c3d364365a | |||
5b132cbac3 | |||
e611ac0b6d | |||
395f7a1829 | |||
9ffc85ddec | |||
6d30549264 | |||
f1b4ef9b06 | |||
8b91e63f47 | |||
940c076977 | |||
2f13a1b8b1 | |||
592974935e | |||
9421847f9b | |||
e6ab721546 | |||
626d44894d | |||
9992bc7286 | |||
11972b31dd | |||
27e6ff0c67 | |||
1a5d1e7af5 | |||
d5f4e1a9a2 | |||
bd8c32b856 | |||
6f7fb5817d | |||
eaa2951845 | |||
a5e41c44a9 | |||
6b42f5093c | |||
10501dacf6 | |||
280263c145 | |||
64adfc6cb3 | |||
508134f0da | |||
dc33a88316 | |||
a0254e36bf | |||
802d91deb9 | |||
215061d721 | |||
a3957d0514 | |||
795a46e54d | |||
dc15d48f36 | |||
ce3885b7e0 | |||
68b15c0dbe | |||
78512b17dc | |||
914a1dc60c | |||
0c77d459a5 | |||
f7f9c180af | |||
5ed4146341 | |||
03aeee7a22 | |||
c8e36dda17 | |||
5f9638449a | |||
1a5ed56788 | |||
515c373827 | |||
c0178f2026 | |||
d0a4ac2d4c | |||
6498723c4d | |||
bc83dc5b5a | |||
8579dd1ca8 | |||
a3e719bd81 | |||
64a6c14d82 | |||
2bad15978d | |||
7e5f9b53ad | |||
6c251fc566 | |||
bdbfde6868 | |||
483b5ee4e3 | |||
41b54a2a5f | |||
2f0f5357ad | |||
2dce835d17 | |||
b3ed07aad1 | |||
4298710f19 | |||
6e224443c3 | |||
0eb3165216 | |||
da10c84210 | |||
eed4f541ec | |||
7466a2c3d2 | |||
55496ce87f | |||
654bed2827 | |||
afe7201d00 | |||
691363129b | |||
ade2da7fd2 | |||
7f924d8cc2 | |||
d276cadc33 | |||
97d14fda0e | |||
7c1efb1342 | |||
116f343523 | |||
37336d70e5 | |||
45cd8903df | |||
a4a530b2a3 | |||
b9bc5806ed | |||
911a843a39 | |||
cdf4d6d5ae | |||
702e4a7f41 | |||
e5ac773e39 | |||
ba92deb4a9 | |||
048e1d9482 | |||
e2547867b3 | |||
0bd64fd40e | |||
607e6ef2c2 | |||
bde4524086 | |||
2c91b399b5 | |||
dca82df270 | |||
3081fc553b | |||
0288ac93a3 | |||
97c12b103c | |||
e8a4a9f4b8 | |||
0a35bfb77d | |||
b1de1de93a | |||
973fb66985 | |||
c2a5044667 | |||
8619dfff1f | |||
e1a44e0138 | |||
7536e1be9a | |||
f099d15707 | |||
d5b9c1142f | |||
81701b4096 | |||
68e8c9ea4a | |||
4a37f53929 | |||
da1927776e | |||
4b9a36f507 | |||
855dbca1ca | |||
3cd17b6479 | |||
9540898ced | |||
f50f6eaf1e | |||
bce81b363b | |||
96c22bb2e6 | |||
94b47df7dd | |||
535e643c24 | |||
aeb89a8d96 | |||
2c1aca079f | |||
6138c187f4 | |||
47233e5ad6 | |||
e1066f4eae | |||
4e1943dbc8 | |||
b013bbd693 | |||
1aa556dca1 | |||
c025001d86 | |||
c7fb30a870 | |||
3b73865000 | |||
dfd2f45828 | |||
d9f41eb016 | |||
6f1a69432d | |||
23c5393ca7 | |||
66f5ed4137 | |||
8de0c1309a | |||
d8219a7bcf | |||
d2fe70fbe4 | |||
aa3552e3b4 | |||
a5831c2ab6 | |||
412d82caeb | |||
a8a28081d6 | |||
23736348d3 | |||
29c2dc7f1d | |||
e74bb68456 | |||
1fe9ff26a6 | |||
4b5c2a2be1 | |||
eedecad2a0 | |||
309e829f1f | |||
189535b059 | |||
b9c48fe886 | |||
6ce5ca3927 | |||
3f6eeca8d6 | |||
86e5e9cf0e | |||
4f665bc6fb | |||
67249cfb2f |
89
.github/workflows/analysis.yml
vendored
89
.github/workflows/analysis.yml
vendored
@ -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 }}"
|
67
.github/workflows/userconfigs.yml
vendored
67
.github/workflows/userconfigs.yml
vendored
@ -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
363
.github/workflows/workflow.yml
vendored
Normal 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
8
.gitmodules
vendored
@ -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
|
||||
|
@ -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")
|
||||
|
@ -4,8 +4,7 @@
|
||||
|
||||
| Service | Status |
|
||||
| :--- | ---: |
|
||||
| Actions (Build) |  |
|
||||
| Actions (Analysis) |  |
|
||||
| Actions (CI) | [](https://github.com/bobbycar-graz/bobbycar-boardcomputer-firmware/actions/workflows/workflow.yml) |
|
||||
| Sonar | [](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware)<br />[](https://sonarcloud.io/summary/new_code?id=bobbycar-graz_bobbycar-boardcomputer-firmware) |
|
||||
## How to clone ? (READ THIS OR YOU WILL FAIL)
|
||||
|
||||
|
Submodule components/FastLED-idf updated: 5a3c3866d1...76e19791f9
Submodule components/TFT_eSPI updated: 7f378c458f...5ca80d8cf8
Submodule components/arduino-esp32 updated: 6c49028af8...2b2f7cd936
Submodule components/bobbycar-protocol updated: a331746ede...a74791e2aa
Submodule components/cpputils updated: 92c54c9dbb...2a957fb627
Submodule components/cxx-ring-buffer updated: c204c20888...c9f273b51a
Submodule components/esp-gui-lib updated: 3d01a04aa4...bb02a6c267
Submodule components/espasynchttpreq updated: 1c21c48e40...4719a27c5d
Submodule components/espasyncota updated: ebfbee903b...1cc204f1af
Submodule components/espchrono updated: eff113c393...b83cc027cd
Submodule components/espconfiglib updated: 0b138ba5b7...3ca0eb09d6
Submodule components/espcpputils updated: 5ade7d0292...a155041878
Submodule components/esphttpdutils updated: bcf49369fd...c095443979
Submodule components/espwifistack updated: ea56b58a23...4749a9db5c
Submodule components/expected updated: 30ee4ea505...ce14a0fc6e
Submodule components/fmt updated: d3c349f69d...7b25dd172b
1
components/sunset
Submodule
1
components/sunset
Submodule
Submodule components/sunset added at 0520b0945c
@ -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
|
||||
)
|
||||
|
@ -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
93
config_comred_new.cmake
Normal 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()
|
@ -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
93
config_gabor.cmake
Normal 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
85
config_gernot.cmake
Normal 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()
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
)
|
||||
|
@ -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
78
config_seatbot.cmake
Normal 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
9
dependencies.lock
Normal 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
|
2
esp-idf
2
esp-idf
Submodule esp-idf updated: 44475ab503...d0026946cd
1
esp-protocols
Submodule
1
esp-protocols
Submodule
Submodule esp-protocols added at 555cd0ab92
BIN
icons/alert.png
Normal file
BIN
icons/alert.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.4 KiB |
BIN
icons/bms.png
Normal file
BIN
icons/bms.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
BIN
icons/close.png
Normal file
BIN
icons/close.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.0 KiB |
BIN
icons/git.png
Normal file
BIN
icons/git.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
BIN
icons/hardware.png
Normal file
BIN
icons/hardware.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
icons/shortcircuit.png
Normal file
BIN
icons/shortcircuit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
Binary file not shown.
@ -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
77
main/accessorhelpers.h
Normal 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});
|
||||
}
|
||||
};
|
@ -1 +0,0 @@
|
||||
#include "globalaccessors.h"
|
@ -1 +0,0 @@
|
||||
#include "settingsaccessors.h"
|
@ -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; } };
|
||||
|
15
main/accessors/wifiapconfigaccessors.h
Normal file
15
main/accessors/wifiapconfigaccessors.h
Normal 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; } };
|
3
main/accessors/wifistaconfigaccessors.cpp
Normal file
3
main/accessors/wifistaconfigaccessors.cpp
Normal file
@ -0,0 +1,3 @@
|
||||
#include "wifistaconfigaccessors.h"
|
||||
|
||||
|
107
main/accessors/wifistaconfigaccessors.h
Normal file
107
main/accessors/wifistaconfigaccessors.h
Normal 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;
|
||||
};
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -9,6 +9,6 @@ namespace {
|
||||
class LoadSettingsAction : public virtual ActionInterface
|
||||
{
|
||||
public:
|
||||
void triggered() override { loadSettings(); }
|
||||
void triggered() override { loadProfileSettings(); }
|
||||
};
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
};
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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);
|
||||
|
||||
|
@ -1,9 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include "actioninterface.h"
|
||||
|
||||
using namespace espgui;
|
||||
#include <actioninterface.h>
|
||||
|
||||
class RebootAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
|
@ -9,6 +9,6 @@ namespace {
|
||||
class SaveSettingsAction : public virtual ActionInterface
|
||||
{
|
||||
public:
|
||||
void triggered() override { saveSettings(); }
|
||||
void triggered() override { saveProfileSettings(); }
|
||||
};
|
||||
}
|
||||
|
20
main/actions/wifistascanaction.cpp
Normal file
20
main/actions/wifistascanaction.cpp
Normal 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;
|
||||
}
|
||||
}
|
10
main/actions/wifistascanaction.h
Normal file
10
main/actions/wifistascanaction.h
Normal file
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <actioninterface.h>
|
||||
|
||||
class WifiStaScanAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
public:
|
||||
void triggered() override;
|
||||
};
|
9
main/actions/wifistascanclearaction.cpp
Normal file
9
main/actions/wifistascanclearaction.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include "wifistascanclearaction.h"
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <espwifistack.h>
|
||||
|
||||
void WifiStaScanClearAction::triggered()
|
||||
{
|
||||
wifi_stack::delete_scan_result();
|
||||
}
|
10
main/actions/wifistascanclearaction.h
Normal file
10
main/actions/wifistascanclearaction.h
Normal file
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <actioninterface.h>
|
||||
|
||||
class WifiStaScanClearAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
public:
|
||||
void triggered() override;
|
||||
};
|
336
main/battery.cpp
336
main/battery.cpp
@ -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;
|
||||
}
|
||||
|
144
main/battery.h
144
main/battery.h
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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
83
main/bobbyblinker.cpp
Normal 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
13
main/bobbyblinker.h
Normal 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
|
@ -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);
|
||||
}
|
||||
|
@ -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
15
main/bobbycheckbox.h
Normal 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
|
||||
{
|
||||
};
|
14
main/bobbyerrorhandler.cpp
Normal file
14
main/bobbyerrorhandler.cpp
Normal 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
9
main/bobbyerrorhandler.h
Normal 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
65
main/bobbyhupe.cpp
Normal 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
18
main/bobbyhupe.h
Normal 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
178
main/bobbyquickactions.cpp
Normal 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
35
main/bobbyquickactions.h
Normal 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
13
main/bobbyschedulertask.h
Normal 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
19
main/bobbytypesafeenum.h
Normal 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)); \
|
||||
} \
|
||||
};
|
@ -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
|
||||
|
@ -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
|
||||
|
191
main/buttons.cpp
191
main/buttons.cpp
@ -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)
|
||||
{
|
||||
|
||||
}
|
@ -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);
|
||||
};
|
192
main/can.cpp
192
main/can.cpp
@ -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);
|
||||
|
20
main/can.h
20
main/can.h
@ -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
|
||||
|
@ -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
|
||||
|
66
main/changevaluedisplay_bobbyquickactions.cpp
Normal file
66
main/changevaluedisplay_bobbyquickactions.cpp
Normal 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
Reference in New Issue
Block a user