mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-15 07:12:34 +00:00
Compare commits
1540 Commits
v2.0.6.97f
...
v2.2.16.1c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c6acfd734 | ||
|
|
c6ae66dcaa | ||
|
|
fc365a1fee | ||
|
|
6c1db94ae7 | ||
|
|
ded1cbf4dd | ||
|
|
399b9f8f6d | ||
|
|
4720b2874f | ||
|
|
1af3e0ddaa | ||
|
|
9f85279e74 | ||
|
|
dd96848bec | ||
|
|
4932e277f1 | ||
|
|
dad05d7873 | ||
|
|
4b7fbeca29 | ||
|
|
2ebaea317a | ||
|
|
d14d2c89c3 | ||
|
|
35938392f1 | ||
|
|
d952da8b1e | ||
|
|
385b29c977 | ||
|
|
dc309f61e8 | ||
|
|
512399c8f5 | ||
|
|
5d94bb601a | ||
|
|
796592b586 | ||
|
|
d552ee3556 | ||
|
|
14b31d4d14 | ||
|
|
4de6eb2e1d | ||
|
|
abaa37133d | ||
|
|
5eac227550 | ||
|
|
671112f47d | ||
|
|
8ea19d665a | ||
|
|
8f57cfaaf4 | ||
|
|
a54e3826e9 | ||
|
|
9188a9a1f2 | ||
|
|
17f1a450b2 | ||
|
|
ba021c97b2 | ||
|
|
b4ad6b0f41 | ||
|
|
28502a762f | ||
|
|
89f0464233 | ||
|
|
46d02affe8 | ||
|
|
62329ad11f | ||
|
|
72b4fe51b1 | ||
|
|
07fc5df9c1 | ||
|
|
1c22d2c885 | ||
|
|
1f931a5e55 | ||
|
|
31c4693c66 | ||
|
|
6ff61b3e04 | ||
|
|
9e90b4af02 | ||
|
|
2544733ad4 | ||
|
|
1b6c11c5f1 | ||
|
|
4c69d06ac0 | ||
|
|
85cbde75fe | ||
|
|
5e70fb9851 | ||
|
|
6e967421a5 | ||
|
|
a05bab35ad | ||
|
|
ac506a581c | ||
|
|
def4ec5822 | ||
|
|
209fb585b0 | ||
|
|
fb89482129 | ||
|
|
8e742f2f80 | ||
|
|
238cf8cdeb | ||
|
|
5df7f07f95 | ||
|
|
6fa026a78b | ||
|
|
39743832ad | ||
|
|
bd2675caf1 | ||
|
|
c489c251ab | ||
|
|
14d03a2bda | ||
|
|
423b8ad603 | ||
|
|
ce8342d3e5 | ||
|
|
57227c0f85 | ||
|
|
1ca2923658 | ||
|
|
d10b1e1d00 | ||
|
|
d3e64350d9 | ||
|
|
102efd4954 | ||
|
|
18cf8ca4fa | ||
|
|
c7f6071f70 | ||
|
|
c7e3485dd7 | ||
|
|
603e564db3 | ||
|
|
ac318a9850 | ||
|
|
1feb74f525 | ||
|
|
d6fc1c314f | ||
|
|
b3852322ef | ||
|
|
cbb8eb65ba | ||
|
|
4712b1ca65 | ||
|
|
57542ce9e6 | ||
|
|
1b20a82b55 | ||
|
|
195706e0e5 | ||
|
|
c1f5878648 | ||
|
|
7380f3b170 | ||
|
|
a9d846c1b3 | ||
|
|
cfb09ee115 | ||
|
|
8f0ce606db | ||
|
|
d04ff29c2a | ||
|
|
8e92754b59 | ||
|
|
dad824c0e9 | ||
|
|
31d7c6826d | ||
|
|
d33521ee86 | ||
|
|
5ad12fed60 | ||
|
|
4af90eeb39 | ||
|
|
08297bb0b7 | ||
|
|
16ef40b21f | ||
|
|
7ef4abb974 | ||
|
|
297267d037 | ||
|
|
f8e766ebc7 | ||
|
|
7bd2b07024 | ||
|
|
b6ddbd0087 | ||
|
|
dc8903ec42 | ||
|
|
46bd6ca7ba | ||
|
|
9d4af1146e | ||
|
|
5ce6ca25f2 | ||
|
|
f2210d8f8d | ||
|
|
5d917885df | ||
|
|
e99ae64ece | ||
|
|
61f888e952 | ||
|
|
a144d5d6cc | ||
|
|
c3e3569c14 | ||
|
|
b1b5bafdda | ||
|
|
91e399a2b6 | ||
|
|
8b16367597 | ||
|
|
0b9accc3b6 | ||
|
|
590b0bbff4 | ||
|
|
19be230b24 | ||
|
|
8df16ad6a6 | ||
|
|
2d62f00ac3 | ||
|
|
9f93b9ab9d | ||
|
|
fc3200134d | ||
|
|
470264b7f9 | ||
|
|
600541ac25 | ||
|
|
298b383127 | ||
|
|
f57020412e | ||
|
|
4a6cc8fd8c | ||
|
|
45c5e0e730 | ||
|
|
527bffb7e0 | ||
|
|
4c35a7fb7d | ||
|
|
0f9936a0e0 | ||
|
|
40395bef01 | ||
|
|
8b8fffda81 | ||
|
|
4052194dfe | ||
|
|
b36ffe5200 | ||
|
|
a60b4d08bf | ||
|
|
227467f638 | ||
|
|
092e6f2424 | ||
|
|
e6b20bff77 | ||
|
|
2c625f6ba1 | ||
|
|
142d56c663 | ||
|
|
f4b40562d3 | ||
|
|
9e203532d0 | ||
|
|
8bd7b5e779 | ||
|
|
1af970765f | ||
|
|
def55ec063 | ||
|
|
092c6cac66 | ||
|
|
e39f129bd6 | ||
|
|
9d1fe8c245 | ||
|
|
786248a6b1 | ||
|
|
d1ac2dc6ea | ||
|
|
87396d9105 | ||
|
|
b388f8edcd | ||
|
|
10265aabd5 | ||
|
|
8780d93941 | ||
|
|
54f0c045e4 | ||
|
|
3ddad671a5 | ||
|
|
dc6f0b8e0b | ||
|
|
33f28c3d56 | ||
|
|
ef1d8c8eee | ||
|
|
950d5f0946 | ||
|
|
fc06754e1f | ||
|
|
fbf74fc0b2 | ||
|
|
7cebd79475 | ||
|
|
aa38f53aed | ||
|
|
2a6c8be684 | ||
|
|
37c3d15978 | ||
|
|
f301e236eb | ||
|
|
94c2ade272 | ||
|
|
a6e4402e41 | ||
|
|
50db2d0e9b | ||
|
|
5ecdbd0dbb | ||
|
|
47c6738c0d | ||
|
|
1552aa0081 | ||
|
|
6ebec8fcd9 | ||
|
|
e9215a5d70 | ||
|
|
5075849ec0 | ||
|
|
7f16b6b342 | ||
|
|
4e3576ae48 | ||
|
|
98290e5d7b | ||
|
|
ad529924f1 | ||
|
|
07d51a2ca4 | ||
|
|
47301a5ac0 | ||
|
|
0d023ea215 | ||
|
|
b5e952db24 | ||
|
|
a1c433748a | ||
|
|
04b2ab82dc | ||
|
|
e96ba7cbcf | ||
|
|
61f6fb22c5 | ||
|
|
db7b77c76e | ||
|
|
350090ec0d | ||
|
|
cdac643749 | ||
|
|
1a2c7f00e1 | ||
|
|
7eff5e7bcb | ||
|
|
17207681ef | ||
|
|
94f7c7e472 | ||
|
|
0a12d67d19 | ||
|
|
3175a3d630 | ||
|
|
4e9bf75340 | ||
|
|
e8970ad66b | ||
|
|
f737ee59ec | ||
|
|
6d211815d9 | ||
|
|
1bae926576 | ||
|
|
a1514b8b64 | ||
|
|
8b82ae6fe3 | ||
|
|
822c150e0d | ||
|
|
0731902744 | ||
|
|
b53cb38a09 | ||
|
|
b02dd0e964 | ||
|
|
c608f0ba81 | ||
|
|
e1839e33f2 | ||
|
|
d6d51bc3f4 | ||
|
|
44a77a10e1 | ||
|
|
8255128eae | ||
|
|
d7a98519f4 | ||
|
|
e256520336 | ||
|
|
fcf798df98 | ||
|
|
dcdf9b64de | ||
|
|
fd563e41f1 | ||
|
|
0fa3685161 | ||
|
|
899f9dd7bf | ||
|
|
9af4ecf48f | ||
|
|
cfb6a1394c | ||
|
|
1254031f7d | ||
|
|
c91e306659 | ||
|
|
4ff343b20f | ||
|
|
134fc75b67 | ||
|
|
fb23e479ac | ||
|
|
5a61695016 | ||
|
|
3bcab0e223 | ||
|
|
17617ce031 | ||
|
|
97f0c734e0 | ||
|
|
e943fffe8c | ||
|
|
ffcb131171 | ||
|
|
bb1fe7cad3 | ||
|
|
ad40493a39 | ||
|
|
ac62330e1c | ||
|
|
53f6a43661 | ||
|
|
7ad94da1c6 | ||
|
|
ecdb75aae0 | ||
|
|
7c98445ca3 | ||
|
|
b21368ecfa | ||
|
|
1a178c7d33 | ||
|
|
5d6f0ea6c4 | ||
|
|
5bd861f3d8 | ||
|
|
6d93fab495 | ||
|
|
6803fd7949 | ||
|
|
a61f969773 | ||
|
|
79cfc4b725 | ||
|
|
cf762bbd42 | ||
|
|
3d2c419d0d | ||
|
|
903f619609 | ||
|
|
2e3f762d3d | ||
|
|
a42266f74b | ||
|
|
a605c69eb4 | ||
|
|
282cc0b16a | ||
|
|
4ab67f3668 | ||
|
|
312028b161 | ||
|
|
ecd48db69c | ||
|
|
03dc36ea12 | ||
|
|
c2ae38405e | ||
|
|
2a1d8c40b4 | ||
|
|
e2441c425a | ||
|
|
00ffe73ebd | ||
|
|
3355019de3 | ||
|
|
5bb207d88b | ||
|
|
5453e4d123 | ||
|
|
7f1b58a222 | ||
|
|
39357b2686 | ||
|
|
d6b629ae04 | ||
|
|
7b1aeb60cd | ||
|
|
5c7c1cd253 | ||
|
|
8cfe130df3 | ||
|
|
feef86942d | ||
|
|
5f3a8b4924 | ||
|
|
0fcaaf39b0 | ||
|
|
a55eac5c20 | ||
|
|
b47c9c165a | ||
|
|
ecceb10910 | ||
|
|
6fc76103a0 | ||
|
|
f35c7be917 | ||
|
|
364364263b | ||
|
|
ef957bfac5 | ||
|
|
5d78795065 | ||
|
|
2dbdda204f | ||
|
|
4767bd5497 | ||
|
|
05efd68097 | ||
|
|
a90eef432f | ||
|
|
762166495f | ||
|
|
929b8f6209 | ||
|
|
5d76771fab | ||
|
|
91eb64d7b7 | ||
|
|
03fe4c629a | ||
|
|
144dfe9805 | ||
|
|
18899fd168 | ||
|
|
fcfd83bc89 | ||
|
|
a3d2b6166c | ||
|
|
fb5f2e48a5 | ||
|
|
d29c975e3c | ||
|
|
00ea6ef5ad | ||
|
|
c44986127e | ||
|
|
6e0b6684ee | ||
|
|
84ddfea491 | ||
|
|
3d6fb13f9a | ||
|
|
54c48329c8 | ||
|
|
ede31a2080 | ||
|
|
9470d4694b | ||
|
|
2074c76780 | ||
|
|
b5b66f43f2 | ||
|
|
9f6584bd67 | ||
|
|
dd69de9f32 | ||
|
|
616553ed72 | ||
|
|
1986267d65 | ||
|
|
1d0ac2caf7 | ||
|
|
746d7268a2 | ||
|
|
9a7777dbdb | ||
|
|
0fe99b0caa | ||
|
|
f9798b7dda | ||
|
|
23fb377fd7 | ||
|
|
4808a5c57f | ||
|
|
d25c368985 | ||
|
|
a5f3dea40b | ||
|
|
f026c3308c | ||
|
|
ed4e7a4cee | ||
|
|
95f67d70ea | ||
|
|
e3260c1d19 | ||
|
|
98f3be0665 | ||
|
|
dc31024764 | ||
|
|
5bbcb40f7a | ||
|
|
8218a729e0 | ||
|
|
cbc3e605dd | ||
|
|
94c41a4fed | ||
|
|
1afe9f75bd | ||
|
|
402f8ba524 | ||
|
|
04bbdc6b8a | ||
|
|
0084c0881d | ||
|
|
8552cc44b9 | ||
|
|
684cce7640 | ||
|
|
114eb0c952 | ||
|
|
bed2bfa074 | ||
|
|
0aef8703b6 | ||
|
|
f5d323fdd3 | ||
|
|
568cc259af | ||
|
|
42039e27e7 | ||
|
|
400b71c152 | ||
|
|
b1f6ff1280 | ||
|
|
cfe5c7f31d | ||
|
|
1e71d346ae | ||
|
|
4e54bec525 | ||
|
|
e0bf15b80e | ||
|
|
26264fd908 | ||
|
|
794948d7e4 | ||
|
|
e9cbe54eca | ||
|
|
641d117106 | ||
|
|
5f38e79b8f | ||
|
|
b238aebe38 | ||
|
|
e05c8e60d9 | ||
|
|
f1bcc300d9 | ||
|
|
06a6a992c2 | ||
|
|
11be856507 | ||
|
|
7fe815a327 | ||
|
|
191a69dd26 | ||
|
|
9eeec6c083 | ||
|
|
919b2d1e48 | ||
|
|
c4474a7b99 | ||
|
|
0821cff1c8 | ||
|
|
b799b7bf62 | ||
|
|
90ec8eae6c | ||
|
|
ba172aae32 | ||
|
|
26338b8f2b | ||
|
|
939a359e7e | ||
|
|
5a5af4707c | ||
|
|
ef5e21d3da | ||
|
|
8a49221b7f | ||
|
|
76dc805184 | ||
|
|
297708a50b | ||
|
|
a61a4fad3e | ||
|
|
c66b68b0cc | ||
|
|
97d7a89644 | ||
|
|
04cba45c60 | ||
|
|
502a6596a3 | ||
|
|
5aedd84c7d | ||
|
|
b9c9f0f865 | ||
|
|
ffcc1a0275 | ||
|
|
3d697f8cf4 | ||
|
|
38c9a1ea07 | ||
|
|
0eefd0912f | ||
|
|
0cda8e6087 | ||
|
|
2cf648928a | ||
|
|
3cd7d8d6af | ||
|
|
702a83b525 | ||
|
|
32246850aa | ||
|
|
74650ca276 | ||
|
|
0141bbe772 | ||
|
|
049c587ca2 | ||
|
|
1a28225cd5 | ||
|
|
6bd870c454 | ||
|
|
c782380373 | ||
|
|
4fd756acd8 | ||
|
|
0b509c7e79 | ||
|
|
86af578df9 | ||
|
|
ff11506922 | ||
|
|
f35b422365 | ||
|
|
08f1ac785a | ||
|
|
146ed067a1 | ||
|
|
bdcf17a3f7 | ||
|
|
81edf363d7 | ||
|
|
96c6a20e03 | ||
|
|
3fbe2d771c | ||
|
|
ac9c81f6d1 | ||
|
|
2e7c95a110 | ||
|
|
490abdac96 | ||
|
|
b17436a023 | ||
|
|
b9ae63cb3c | ||
|
|
55701692fd | ||
|
|
171cca435e | ||
|
|
470363d294 | ||
|
|
fb21bfe0f5 | ||
|
|
0739bc0cea | ||
|
|
3a24882e76 | ||
|
|
1c74479555 | ||
|
|
084ad1b722 | ||
|
|
2486892e6d | ||
|
|
77efbb3f5d | ||
|
|
eb7025f1b1 | ||
|
|
69beef8310 | ||
|
|
468807466c | ||
|
|
8927cffd64 | ||
|
|
5995c7060d | ||
|
|
541291cc70 | ||
|
|
41b07de5a2 | ||
|
|
4306c32349 | ||
|
|
491fe52841 | ||
|
|
ad5de5a724 | ||
|
|
ab32503601 | ||
|
|
e4e26a819b | ||
|
|
6d97d5dfa2 | ||
|
|
c75965480f | ||
|
|
003047baaf | ||
|
|
4ace59fc18 | ||
|
|
aa0b56e947 | ||
|
|
42d79d012e | ||
|
|
d3e7e45ded | ||
|
|
0cca7751cd | ||
|
|
de53280ffc | ||
|
|
65aafe7ea1 | ||
|
|
6e96216ba3 | ||
|
|
da389eb787 | ||
|
|
d8ad2b3f48 | ||
|
|
97606cd382 | ||
|
|
5c34e36bec | ||
|
|
9c141919f6 | ||
|
|
b9ad274104 | ||
|
|
4ef61f0f15 | ||
|
|
1745722dac | ||
|
|
c120549215 | ||
|
|
7ca2e818df | ||
|
|
f02923435b | ||
|
|
849599cd8e | ||
|
|
eb0a96a79e | ||
|
|
e878f55ed3 | ||
|
|
bfc567ad89 | ||
|
|
b665786c77 | ||
|
|
9e2b86b92c | ||
|
|
d0cf70c8b3 | ||
|
|
44a906dd01 | ||
|
|
ccb682bbb8 | ||
|
|
e60a5f1cf2 | ||
|
|
6bdf67c9be | ||
|
|
bbfd62c47e | ||
|
|
e677a02273 | ||
|
|
47168d5063 | ||
|
|
a07e30544d | ||
|
|
5591b9b9f5 | ||
|
|
a2c5b92840 | ||
|
|
9716bd8bec | ||
|
|
685d27f566 | ||
|
|
c2168dd450 | ||
|
|
f71869215d | ||
|
|
66c71250b8 | ||
|
|
81f80546b4 | ||
|
|
44a54278b3 | ||
|
|
5c438ae792 | ||
|
|
194833d77f | ||
|
|
207d421fca | ||
|
|
fb14487f2f | ||
|
|
365a91f3d9 | ||
|
|
cdf44ce7fa | ||
|
|
d70bd23260 | ||
|
|
5edc872c31 | ||
|
|
b42ead4400 | ||
|
|
cd787232ca | ||
|
|
344baf7ffc | ||
|
|
a491ceefcd | ||
|
|
b2704a0082 | ||
|
|
1524c2365f | ||
|
|
9b94701699 | ||
|
|
9d3dc9283c | ||
|
|
61661aed50 | ||
|
|
b1398d0770 | ||
|
|
3a25d6d3b3 | ||
|
|
fd4e9daa7f | ||
|
|
110ec85137 | ||
|
|
99a31c1fad | ||
|
|
b6f7b7fa47 | ||
|
|
113026c372 | ||
|
|
a92a960682 | ||
|
|
3bc82e59dc | ||
|
|
24bb52e83f | ||
|
|
68ef27df8b | ||
|
|
9ddbfc0e3e | ||
|
|
e699427bfc | ||
|
|
696afeef41 | ||
|
|
35ee12cb4c | ||
|
|
94f5c04e19 | ||
|
|
5d2ab65a81 | ||
|
|
f3b7f7251c | ||
|
|
fbcd6743fd | ||
|
|
1b35cc018f | ||
|
|
f18b8328a2 | ||
|
|
d241a010aa | ||
|
|
78af6e2ed8 | ||
|
|
7475c8647c | ||
|
|
f3af3c1c33 | ||
|
|
a583163766 | ||
|
|
e943fc6b8a | ||
|
|
f2cf0ed315 | ||
|
|
59b1adf12f | ||
|
|
1ae77d198d | ||
|
|
2728e86aab | ||
|
|
f8cba0e7f2 | ||
|
|
e5b049d2e2 | ||
|
|
52df85c338 | ||
|
|
2f60bbe5f2 | ||
|
|
0261754269 | ||
|
|
1dfa8f2d9e | ||
|
|
4f0922ec2b | ||
|
|
d74cbdaa8b | ||
|
|
3a5b79e4c1 | ||
|
|
eb916da8ce | ||
|
|
1b68408f2f | ||
|
|
9bee35118f | ||
|
|
e6fc2af21f | ||
|
|
a9fed83d9a | ||
|
|
c0979e29ff | ||
|
|
9878ff3836 | ||
|
|
3219ad33ef | ||
|
|
6113a1fb70 | ||
|
|
d11bcda292 | ||
|
|
ae41944a89 | ||
|
|
508cdf6060 | ||
|
|
0009b98996 | ||
|
|
62259583e6 | ||
|
|
c5d87fe581 | ||
|
|
77dace1043 | ||
|
|
e02720b29b | ||
|
|
ffa85ebccd | ||
|
|
f9b2556cd4 | ||
|
|
9c683f4c87 | ||
|
|
cf07d2dbcd | ||
|
|
7711b03bd8 | ||
|
|
c52fddac53 | ||
|
|
b0c3816a8b | ||
|
|
6cdf2817f4 | ||
|
|
f7e1f4cea6 | ||
|
|
75504793e8 | ||
|
|
80f029aa32 | ||
|
|
4029f731c9 | ||
|
|
666a1f3401 | ||
|
|
70dc13a998 | ||
|
|
9841d49fb8 | ||
|
|
28ec4e35ec | ||
|
|
55cef30f93 | ||
|
|
0e15d6a5c2 | ||
|
|
29199e4732 | ||
|
|
6fc061fa43 | ||
|
|
c14b075996 | ||
|
|
6963e43e9f | ||
|
|
1d90096cba | ||
|
|
c1a1b450e3 | ||
|
|
f7041994af | ||
|
|
5037a50059 | ||
|
|
b75aa79da5 | ||
|
|
2e915e782b | ||
|
|
e761631d5e | ||
|
|
19a310e196 | ||
|
|
5ec624d9c3 | ||
|
|
b4ff37104a | ||
|
|
81bfd69a41 | ||
|
|
57aaf7f6ee | ||
|
|
9b6ac98ae0 | ||
|
|
e1c4968c58 | ||
|
|
694fd04367 | ||
|
|
cdc8bf44e9 | ||
|
|
09d48f659e | ||
|
|
46e29402a6 | ||
|
|
10f41e376c | ||
|
|
39aa756100 | ||
|
|
17e25babb1 | ||
|
|
7c9d0a022a | ||
|
|
313860c8a4 | ||
|
|
e360c62480 | ||
|
|
973b30fc0b | ||
|
|
a6385a522d | ||
|
|
6aa9e37872 | ||
|
|
5afa92395d | ||
|
|
b6ff80f0b7 | ||
|
|
7ef12c77a8 | ||
|
|
a27d354364 | ||
|
|
49febc0d9d | ||
|
|
6e26f95df9 | ||
|
|
5dfb5172c2 | ||
|
|
85818b8dfd | ||
|
|
e0bb95ca94 | ||
|
|
1621fbb5ab | ||
|
|
ac40f77694 | ||
|
|
9700fa55a3 | ||
|
|
87c59d7d61 | ||
|
|
584615bb4b | ||
|
|
c452c2ab40 | ||
|
|
d43ddc9ec2 | ||
|
|
a76cb94851 | ||
|
|
da75ae21ff | ||
|
|
a30c07e6b4 | ||
|
|
309d4fc7f2 | ||
|
|
a13775bd70 | ||
|
|
b43a5bc4f8 | ||
|
|
ec44ca49fd | ||
|
|
5d41e9fe9d | ||
|
|
7bd836673e | ||
|
|
e0da661632 | ||
|
|
a9ce4338ff | ||
|
|
a284439d7e | ||
|
|
10fac072bb | ||
|
|
d60ccb42da | ||
|
|
3598351689 | ||
|
|
74ed166ff0 | ||
|
|
0afeba0c86 | ||
|
|
ee971e376a | ||
|
|
eeeb7c5080 | ||
|
|
f526c4cc5a | ||
|
|
a9eb19fc62 | ||
|
|
29c13b5c30 | ||
|
|
f0c4c18a79 | ||
|
|
320bf57687 | ||
|
|
4b89f7dfcb | ||
|
|
43cff7adc9 | ||
|
|
d4e42898b1 | ||
|
|
82ab38d3e6 | ||
|
|
aa96ea02c6 | ||
|
|
242f880764 | ||
|
|
de08360271 | ||
|
|
990d418dc8 | ||
|
|
7d299b06a7 | ||
|
|
f8db02c622 | ||
|
|
fc8d16bb08 | ||
|
|
af65013e49 | ||
|
|
b1937e03ac | ||
|
|
23e6bc32c0 | ||
|
|
bd1e747fc9 | ||
|
|
3c0817340a | ||
|
|
9a42861766 | ||
|
|
038ff0f6cb | ||
|
|
918b509be8 | ||
|
|
9239698004 | ||
|
|
71479a6b17 | ||
|
|
14080d4667 | ||
|
|
b4bcae98cd | ||
|
|
294771cb44 | ||
|
|
1398611276 | ||
|
|
fbc3b2beee | ||
|
|
6bf538e26f | ||
|
|
713b5fbe96 | ||
|
|
ed96321406 | ||
|
|
39d8ae64e7 | ||
|
|
3f07251d23 | ||
|
|
657f22d058 | ||
|
|
bf1fbc6c0d | ||
|
|
5679a82195 | ||
|
|
2edc35d34b | ||
|
|
26d18244f0 | ||
|
|
82ba59765c | ||
|
|
7930aa1635 | ||
|
|
c55751964e | ||
|
|
b9b1cce6a5 | ||
|
|
044ef75fef | ||
|
|
9f940139a0 | ||
|
|
fdb09d4fba | ||
|
|
1968f3c45b | ||
|
|
790df42987 | ||
|
|
9a9279dd78 | ||
|
|
1e54a5d45c | ||
|
|
23272daffe | ||
|
|
6e685b0a54 | ||
|
|
8a806efb95 | ||
|
|
1af7e48136 | ||
|
|
eda00b7b9c | ||
|
|
1898fe850e | ||
|
|
15dbe5da97 | ||
|
|
8f736c8ecc | ||
|
|
8a81f190b8 | ||
|
|
1425657a3c | ||
|
|
02041cb605 | ||
|
|
1f130d671b | ||
|
|
d62e56f428 | ||
|
|
5ac24bb33b | ||
|
|
2c259b8464 | ||
|
|
9d6e1ce8e5 | ||
|
|
958d2cf630 | ||
|
|
5cb1f96240 | ||
|
|
78522e750c | ||
|
|
75db8c2d2e | ||
|
|
ef2d0cb830 | ||
|
|
91be22b341 | ||
|
|
cc64c3d61a | ||
|
|
36b00dba86 | ||
|
|
3bb8cd7613 | ||
|
|
8c68d888c8 | ||
|
|
1f99d4756a | ||
|
|
7bbfa48b5d | ||
|
|
5e779bfb33 | ||
|
|
b398f31b64 | ||
|
|
e03a2f8f7f | ||
|
|
d92a003d8e | ||
|
|
8db7316ae1 | ||
|
|
3c2e615650 | ||
|
|
6d202158ba | ||
|
|
c288974b67 | ||
|
|
9b1d461567 | ||
|
|
210e3e09d5 | ||
|
|
0d001423c8 | ||
|
|
a83d5ada86 | ||
|
|
4573db4665 | ||
|
|
d2c72fae00 | ||
|
|
c9686d2f62 | ||
|
|
634251834f | ||
|
|
6d443d2c67 | ||
|
|
9cadc0a16f | ||
|
|
2e3b86608a | ||
|
|
dc2ca9c32b | ||
|
|
e0a6a37bef | ||
|
|
57fc9baafc | ||
|
|
033e988e6f | ||
|
|
fddc49273e | ||
|
|
e737a22120 | ||
|
|
a8f2e3ddbd | ||
|
|
67be6aa53b | ||
|
|
68e17ab905 | ||
|
|
a56403987b | ||
|
|
7acacb3bba | ||
|
|
e6d69e2b67 | ||
|
|
9150c2e568 | ||
|
|
944d5066e9 | ||
|
|
a538a96c90 | ||
|
|
31ef82557f | ||
|
|
9d440b7dba | ||
|
|
267db05d69 | ||
|
|
20bcf310d1 | ||
|
|
331a1afc37 | ||
|
|
321e41a3aa | ||
|
|
3ca1e62b1f | ||
|
|
5044169e8d | ||
|
|
8e197fc35b | ||
|
|
f63505038f | ||
|
|
a95b6aff01 | ||
|
|
b249970a12 | ||
|
|
fe926eedba | ||
|
|
4a0dfb5401 | ||
|
|
4355f51a90 | ||
|
|
ecd67f0a85 | ||
|
|
0940c6462b | ||
|
|
498964e04e | ||
|
|
a47364f07b | ||
|
|
eb4ab26e1f | ||
|
|
8c059a8a9e | ||
|
|
7bb281d5c5 | ||
|
|
214feb1f21 | ||
|
|
d17aafa91a | ||
|
|
2fe5eae183 | ||
|
|
9008c75517 | ||
|
|
408c555f0f | ||
|
|
c9ae90f03c | ||
|
|
fbfd0f12b5 | ||
|
|
9650adb616 | ||
|
|
a3f1e53017 | ||
|
|
0243922d64 | ||
|
|
baeb2807a4 | ||
|
|
9a8bfa113d | ||
|
|
82b14fe07c | ||
|
|
fab5e4c5cc | ||
|
|
46fa08dc33 | ||
|
|
48a407bf5c | ||
|
|
05b1fc83bd | ||
|
|
2475debb2a | ||
|
|
7d0bea267a | ||
|
|
568899031d | ||
|
|
f1c457f0c3 | ||
|
|
c8399b7256 | ||
|
|
63005a94fd | ||
|
|
9b4a59f92d | ||
|
|
2472d0947f | ||
|
|
a92b2ec6ca | ||
|
|
548bec026a | ||
|
|
ce882b389a | ||
|
|
25fd9d2d1d | ||
|
|
83a201fe86 | ||
|
|
462ee3d921 | ||
|
|
0104246067 | ||
|
|
3f5c0cb6ac | ||
|
|
fa371bc844 | ||
|
|
090f42f51f | ||
|
|
c2ff6f2f7c | ||
|
|
9fc18c2a19 | ||
|
|
d830398fc5 | ||
|
|
2e80a4ed87 | ||
|
|
e1924f188f | ||
|
|
732caff2b8 | ||
|
|
c60c00ba85 | ||
|
|
83e6cea280 | ||
|
|
f8498ba03f | ||
|
|
f83adf1796 | ||
|
|
73c1c5913b | ||
|
|
fd1c54fd15 | ||
|
|
95bbcd2cb7 | ||
|
|
187f3969c2 | ||
|
|
15458309f8 | ||
|
|
253d133319 | ||
|
|
7264621149 | ||
|
|
27d93c5f66 | ||
|
|
b33632f21a | ||
|
|
89f06d6b40 | ||
|
|
7102fec7b3 | ||
|
|
ed1aa9ddb0 | ||
|
|
181832aedd | ||
|
|
4967a16abe | ||
|
|
c39645419a | ||
|
|
6f4ac904a5 | ||
|
|
643237162e | ||
|
|
cef11968eb | ||
|
|
5c72967aa5 | ||
|
|
8aede61adb | ||
|
|
07b90a61e1 | ||
|
|
221a145d2d | ||
|
|
b3fac71a8d | ||
|
|
2e6e0644d4 | ||
|
|
b78e0dce46 | ||
|
|
3ae1fdf661 | ||
|
|
cbfa2dcc0e | ||
|
|
2aabeafefe | ||
|
|
b7895f7038 | ||
|
|
3f4780479f | ||
|
|
5ca3d9169a | ||
|
|
c834252f1c | ||
|
|
16852da8d4 | ||
|
|
2d2633d4cf | ||
|
|
5f28ef6814 | ||
|
|
5cadcd355f | ||
|
|
40d98b9d8d | ||
|
|
0f47584a50 | ||
|
|
dbb827e5e0 | ||
|
|
f95061b965 | ||
|
|
4061870841 | ||
|
|
abf3a5840b | ||
|
|
7063acdda6 | ||
|
|
97c1cf628a | ||
|
|
03f584a5ab | ||
|
|
680550b76c | ||
|
|
a280d7f796 | ||
|
|
09f2ea8938 | ||
|
|
fcbeeac28f | ||
|
|
7100416142 | ||
|
|
e2f5e9206d | ||
|
|
57b8e3732e | ||
|
|
f0d27f896a | ||
|
|
e74b180655 | ||
|
|
88a44eede0 | ||
|
|
83e309f3bf | ||
|
|
97a0b164be | ||
|
|
dc6f6af7fb | ||
|
|
aaba99f792 | ||
|
|
4375a0101e | ||
|
|
b1677e0312 | ||
|
|
0c240a1dff | ||
|
|
b24376b1fc | ||
|
|
bcaf834853 | ||
|
|
1c3970efab | ||
|
|
79850c6d03 | ||
|
|
82706a961f | ||
|
|
440074af62 | ||
|
|
dc23096723 | ||
|
|
3209aeabb8 | ||
|
|
42b496b0db | ||
|
|
a5b99ee5d5 | ||
|
|
4a0c341438 | ||
|
|
afc75b2552 | ||
|
|
9522d4d2f5 | ||
|
|
7ddd8c9930 | ||
|
|
23e1c0b7a8 | ||
|
|
631699bfd7 | ||
|
|
4ac0de21ab | ||
|
|
4ede8ab9de | ||
|
|
b952c35da6 | ||
|
|
a3dbac73fe | ||
|
|
fb611ef986 | ||
|
|
b07904fe77 | ||
|
|
9e1f7c4f56 | ||
|
|
af11c5aa80 | ||
|
|
829318046a | ||
|
|
405430fd96 | ||
|
|
8630e420a7 | ||
|
|
b70af5cc78 | ||
|
|
b9516154d4 | ||
|
|
21443dab05 | ||
|
|
1748db3160 | ||
|
|
d83a0b1818 | ||
|
|
18442816ef | ||
|
|
c28d469fc6 | ||
|
|
d97a09ba1f | ||
|
|
22500a6c34 | ||
|
|
bba4de3ec7 | ||
|
|
1a7991c606 | ||
|
|
490ef459e5 | ||
|
|
40b7d783ed | ||
|
|
6a2583e872 | ||
|
|
3a3451129a | ||
|
|
81d2486cf4 | ||
|
|
9d420f403a | ||
|
|
c82d1de9ce | ||
|
|
9a950afd2a | ||
|
|
ab77772e0c | ||
|
|
ac90c27ae8 | ||
|
|
d6de042783 | ||
|
|
2b15d951cf | ||
|
|
0414ca2dc0 | ||
|
|
7a50934185 | ||
|
|
1fa2ca6a14 | ||
|
|
51521462c4 | ||
|
|
4aaf162700 | ||
|
|
5794a9ae06 | ||
|
|
835e6ab85e | ||
|
|
b97e61d8f8 | ||
|
|
d9031610ab | ||
|
|
a8dd497575 | ||
|
|
971ecd117c | ||
|
|
e8e04d23d7 | ||
|
|
3c6bbff4f9 | ||
|
|
f6c6c2912f | ||
|
|
a13adfb598 | ||
|
|
06a1b079da | ||
|
|
56afed84df | ||
|
|
945fd7a05c | ||
|
|
e9a55fc296 | ||
|
|
472c43aace | ||
|
|
8734afa7be | ||
|
|
5b75abc6f7 | ||
|
|
e4d455640f | ||
|
|
090d399843 | ||
|
|
c908e61611 | ||
|
|
3dda6e14f7 | ||
|
|
f0f819f403 | ||
|
|
39bb9f21ac | ||
|
|
7750dd2d46 | ||
|
|
d34f6d0f68 | ||
|
|
d02588ad85 | ||
|
|
e4342d9715 | ||
|
|
1f0e64e794 | ||
|
|
e1914dd464 | ||
|
|
04add9b91e | ||
|
|
5e1c39eb0f | ||
|
|
661894f9f9 | ||
|
|
5d1c06b72f | ||
|
|
1407952410 | ||
|
|
860aca9335 | ||
|
|
104ffe36b2 | ||
|
|
5c22901ff1 | ||
|
|
27bd4fa32e | ||
|
|
2be805ce81 | ||
|
|
0a3e512387 | ||
|
|
7b249deb26 | ||
|
|
7aa4e94e45 | ||
|
|
dab2bb3bcc | ||
|
|
afcd7acfab | ||
|
|
0188edb342 | ||
|
|
cd6d8e519b | ||
|
|
02f49d5347 | ||
|
|
2242b68d13 | ||
|
|
a6416f4f08 | ||
|
|
a1d8960f38 | ||
|
|
b1656893ac | ||
|
|
8c0060ecd7 | ||
|
|
0633b2f238 | ||
|
|
ec1358b050 | ||
|
|
cd35e92471 | ||
|
|
76df5265cb | ||
|
|
5f7adf27c3 | ||
|
|
c3d08df18c | ||
|
|
0b84c7c0f3 | ||
|
|
cf5485112b | ||
|
|
43096fb474 | ||
|
|
27b1428d6e | ||
|
|
915404dbe5 | ||
|
|
ab6402e4f4 | ||
|
|
00196ab7e7 | ||
|
|
14831e597c | ||
|
|
c499302092 | ||
|
|
9c7a4aab9e | ||
|
|
7ed39d27e4 | ||
|
|
0e6cfcd48a | ||
|
|
aafbde0f10 | ||
|
|
f29beeb748 | ||
|
|
75ea6fd704 | ||
|
|
171c1df3fa | ||
|
|
e05a007fc6 | ||
|
|
30a1810e12 | ||
|
|
bdf3fe3f5c | ||
|
|
d9af4f46fa | ||
|
|
9d2fbec511 | ||
|
|
f45a25b358 | ||
|
|
92a43685a8 | ||
|
|
103f1992dd | ||
|
|
e229a67d25 | ||
|
|
a7153a7aa9 | ||
|
|
14372c7e35 | ||
|
|
a5f80167e0 | ||
|
|
654d38ed3f | ||
|
|
e01e830c0e | ||
|
|
db192481bd | ||
|
|
e8908784f9 | ||
|
|
de82119415 | ||
|
|
cda7e8b6a5 | ||
|
|
96f763dfa3 | ||
|
|
57b47cf1e1 | ||
|
|
7950739d85 | ||
|
|
2baaad8298 | ||
|
|
2e8832babb | ||
|
|
ed155476ac | ||
|
|
61028293b8 | ||
|
|
708327240e | ||
|
|
d14bd652eb | ||
|
|
cb3d5a5748 | ||
|
|
d51aa60864 | ||
|
|
9b18d5d85f | ||
|
|
25096c5c63 | ||
|
|
f1fd41a378 | ||
|
|
65c0b8e33b | ||
|
|
ca91447c0e | ||
|
|
d876a5254e | ||
|
|
4a0f3f31cb | ||
|
|
f07963e802 | ||
|
|
c7937e73a4 | ||
|
|
cb8532f2df | ||
|
|
747292e1e5 | ||
|
|
0b1e1687ae | ||
|
|
91575e6241 | ||
|
|
006cddd5cb | ||
|
|
4d7e3329d9 | ||
|
|
9e8342eb8f | ||
|
|
afb4d141dc | ||
|
|
19d864b5ce | ||
|
|
e8186f7dba | ||
|
|
81854a173a | ||
|
|
083dcef9d6 | ||
|
|
5f0662d47d | ||
|
|
76022b65c6 | ||
|
|
2df81810ec | ||
|
|
efa1445df4 | ||
|
|
53d096b58e | ||
|
|
4da1fb8e27 | ||
|
|
8e0dcb09e8 | ||
|
|
014946ad0e | ||
|
|
3aebb1ffb3 | ||
|
|
3b80421403 | ||
|
|
255d433ebf | ||
|
|
2c1b7840c5 | ||
|
|
e9acf413fb | ||
|
|
7c60896072 | ||
|
|
1941d196bb | ||
|
|
3120744716 | ||
|
|
2ecf273cf3 | ||
|
|
50cee4a6c8 | ||
|
|
ac6d4e33d4 | ||
|
|
4c9f0b2646 | ||
|
|
fab663d1b7 | ||
|
|
fc5e80a5cc | ||
|
|
266c61065d | ||
|
|
e2e7658789 | ||
|
|
a421edce49 | ||
|
|
3f3a4ce44c | ||
|
|
8aab63dace | ||
|
|
aac9b5db30 | ||
|
|
6f30a84afc | ||
|
|
c53c87499b | ||
|
|
cdf379616c | ||
|
|
6fdb93cd16 | ||
|
|
ab3446faed | ||
|
|
9ebe24e680 | ||
|
|
811ac15a81 | ||
|
|
51b2c431d9 | ||
|
|
6cf18b7d07 | ||
|
|
52e8dc7317 | ||
|
|
d8e644191b | ||
|
|
fdc47728af | ||
|
|
54b4b67e5c | ||
|
|
bcf24b8187 | ||
|
|
c628c70db2 | ||
|
|
7f9e638140 | ||
|
|
5a2ad03294 | ||
|
|
a584cac827 | ||
|
|
8f5338dc85 | ||
|
|
8c434c7084 | ||
|
|
88c84dd806 | ||
|
|
f9f083da51 | ||
|
|
481880872c | ||
|
|
0eaf0747f4 | ||
|
|
9a7121d8c9 | ||
|
|
cbd6a0065b | ||
|
|
50f72b0ea0 | ||
|
|
74ec5e8a5c | ||
|
|
bec0cda175 | ||
|
|
ca298d8a7d | ||
|
|
3eaa054c68 | ||
|
|
48ea836a5c | ||
|
|
fda1e29c4d | ||
|
|
836559cda1 | ||
|
|
c04980084a | ||
|
|
111ec56028 | ||
|
|
384eac9a87 | ||
|
|
6a5e0edb60 | ||
|
|
9d47f7a531 | ||
|
|
660a73d58c | ||
|
|
412fbea978 | ||
|
|
293625924d | ||
|
|
8984989412 | ||
|
|
4cfedc4b57 | ||
|
|
cd57df3f4f | ||
|
|
db729eb707 | ||
|
|
6c41960919 | ||
|
|
ff029ad752 | ||
|
|
202223236d | ||
|
|
48609b5bdd | ||
|
|
dad8e2bf6a | ||
|
|
9cda2e9058 | ||
|
|
fdf7c3a812 | ||
|
|
72dad37138 | ||
|
|
ee25a488ef | ||
|
|
9046dacec8 | ||
|
|
f86eef66c8 | ||
|
|
b218ea9ec7 | ||
|
|
6f70d39bae | ||
|
|
80f259cc6c | ||
|
|
36b3bf2211 | ||
|
|
92525587e1 | ||
|
|
5189e328b6 | ||
|
|
4d4af7de59 | ||
|
|
1b932c6bbe | ||
|
|
4065fb1709 | ||
|
|
cf39628222 | ||
|
|
d7fa8fea8d | ||
|
|
db3d66544d | ||
|
|
0a2539650e | ||
|
|
d35b619063 | ||
|
|
0e51a42ce2 | ||
|
|
d5f7d741c3 | ||
|
|
cc0cccbd1b | ||
|
|
6c388e0da8 | ||
|
|
9f3c09cf40 | ||
|
|
34b2d51113 | ||
|
|
1dbd0f8dd1 | ||
|
|
0f4306158c | ||
|
|
d5a3acb83a | ||
|
|
efbdb273c3 | ||
|
|
011013ab1a | ||
|
|
49279e56d0 | ||
|
|
1cfda77356 | ||
|
|
f4779bd93f | ||
|
|
e95db927ac | ||
|
|
a4d3fa55db | ||
|
|
59ee0fb012 | ||
|
|
5831124f1d | ||
|
|
2b9f01f0e4 | ||
|
|
aca1241a7f | ||
|
|
da0440ba17 | ||
|
|
85dd606423 | ||
|
|
7e27729dae | ||
|
|
d49f19a67c | ||
|
|
5520d68b34 | ||
|
|
c33569f833 | ||
|
|
8db3f317ab | ||
|
|
a3636ae8a1 | ||
|
|
7936c7c8ae | ||
|
|
2f3f19fda7 | ||
|
|
c89ca50cc4 | ||
|
|
867e55b9e7 | ||
|
|
28b1616630 | ||
|
|
42122f3d0f | ||
|
|
f905763161 | ||
|
|
bd2b766a36 | ||
|
|
bd51cbd721 | ||
|
|
5e66dd0dad | ||
|
|
80d1a993dd | ||
|
|
e3fd17772d | ||
|
|
440b965e71 | ||
|
|
cf0fb13a12 | ||
|
|
c0166773e8 | ||
|
|
fc775012ea | ||
|
|
d7a71e46aa | ||
|
|
721f87af7e | ||
|
|
a354cebd88 | ||
|
|
97680ca730 | ||
|
|
17a2589b35 | ||
|
|
4f71ab07c9 | ||
|
|
1f6a8eae86 | ||
|
|
ab9d0ba543 | ||
|
|
e13fb9919e | ||
|
|
a3b93a4dcf | ||
|
|
6b0f18e1e4 | ||
|
|
312ef790fc | ||
|
|
713f7d5996 | ||
|
|
3985008e06 | ||
|
|
8f2155f8f9 | ||
|
|
1fc5d70221 | ||
|
|
e7d425ef6e | ||
|
|
c63536d948 | ||
|
|
9c1cfe9358 | ||
|
|
971565aed3 | ||
|
|
3a6e3464e6 | ||
|
|
0181e186ac | ||
|
|
86748bf88e | ||
|
|
5fd00b2538 | ||
|
|
5cec370cf5 | ||
|
|
fce52e16e3 | ||
|
|
0e7797f3bb | ||
|
|
81ee6dd799 | ||
|
|
49172e416e | ||
|
|
57f185c26b | ||
|
|
3a8ffe7ac2 | ||
|
|
d8b85f9a09 | ||
|
|
4d7402839e | ||
|
|
8465467aa8 | ||
|
|
2a0b8093ea | ||
|
|
96fa5dafb8 | ||
|
|
be2d3f7769 | ||
|
|
b283e526bf | ||
|
|
03c5dfc7a8 | ||
|
|
52cfd62031 | ||
|
|
c98dc4cae0 | ||
|
|
f21212dd3e | ||
|
|
0e0ccad489 | ||
|
|
9f1c77da76 | ||
|
|
7c1c49b8ab | ||
|
|
f4099261df | ||
|
|
450e7362f6 | ||
|
|
0b9c8e62ea | ||
|
|
8b5937892b | ||
|
|
09efbb75b1 | ||
|
|
e5d9f1f946 | ||
|
|
2400dd43b3 | ||
|
|
988d5af69b | ||
|
|
78b6916b1b | ||
|
|
9740f0a505 | ||
|
|
b64a74c0c5 | ||
|
|
d9f0dc7ea4 | ||
|
|
30ae4c2a38 | ||
|
|
d077be1496 | ||
|
|
4f26a2a74a | ||
|
|
41f9636ba3 | ||
|
|
b544163c3f | ||
|
|
6d989a29dd | ||
|
|
8914d1a184 | ||
|
|
1cfc7b800b | ||
|
|
cab5fcf5ae | ||
|
|
cad5c9b70c | ||
|
|
5867038abf | ||
|
|
42b24d4510 | ||
|
|
d750109d00 | ||
|
|
7f0a8d329f | ||
|
|
64895cc7eb | ||
|
|
52903f83e3 | ||
|
|
e0002ef2d5 | ||
|
|
021fc8235c | ||
|
|
0305c7394f | ||
|
|
bca70d10d0 | ||
|
|
1077846e8d | ||
|
|
63c8ca9ca5 | ||
|
|
523b132100 | ||
|
|
2d62cbe345 | ||
|
|
b55fe549e3 | ||
|
|
8c20fe5ec4 | ||
|
|
9a04aaa811 | ||
|
|
092a753a6f | ||
|
|
8a9af37d82 | ||
|
|
74e6eb34bd | ||
|
|
11f1508d85 | ||
|
|
19436b7d54 | ||
|
|
69ff724f0f | ||
|
|
3d3aba584e | ||
|
|
ef1fb877ba | ||
|
|
f1cdfd163d | ||
|
|
8364c2b147 | ||
|
|
8193215294 | ||
|
|
e73ae7cdac | ||
|
|
65aad62702 | ||
|
|
3eefd46ca1 | ||
|
|
115cb05d3b | ||
|
|
44d5c69ba8 | ||
|
|
5ccd66864b | ||
|
|
0b5cae5393 | ||
|
|
be91b08b3e | ||
|
|
c7c5671cca | ||
|
|
979d12d607 | ||
|
|
110c80d045 | ||
|
|
38a1315599 | ||
|
|
8ebe0edc5a | ||
|
|
a8f93d5f47 | ||
|
|
96c272d3d1 | ||
|
|
45e6e86ff9 | ||
|
|
f73b8661de | ||
|
|
3c5710e65b | ||
|
|
4e4a74379e | ||
|
|
41a1dfec79 | ||
|
|
1a949b7ca6 | ||
|
|
840079c25b | ||
|
|
887405cc08 | ||
|
|
d633212f70 | ||
|
|
02def448bc | ||
|
|
7baf30dcb8 | ||
|
|
e09b12ca58 | ||
|
|
1736dada7d | ||
|
|
7f3a624ee3 | ||
|
|
475c87b0e4 | ||
|
|
541f4aa998 | ||
|
|
ab6c4e61a6 | ||
|
|
6ea0963f4b | ||
|
|
259d442d8f | ||
|
|
b134f0bb46 | ||
|
|
63cf01223c | ||
|
|
2505bdbc21 | ||
|
|
d9d8c7eb74 | ||
|
|
3b19040590 | ||
|
|
14be4ee9f0 | ||
|
|
94cb100e3f | ||
|
|
f632933b93 | ||
|
|
e25d05689b | ||
|
|
5c859da4e4 | ||
|
|
6c5602e88d | ||
|
|
b4735f4224 | ||
|
|
3b9b33a5ee | ||
|
|
430908f5d6 | ||
|
|
6f6ca64cfd | ||
|
|
d0243d2cd0 | ||
|
|
796e58161d | ||
|
|
e56f17c658 | ||
|
|
b808ffa9ab | ||
|
|
506bae4a8b | ||
|
|
f6ee6265e6 | ||
|
|
7539d92857 | ||
|
|
21fff392b4 | ||
|
|
580ec590fa | ||
|
|
5c9996dfa1 | ||
|
|
34f9324766 | ||
|
|
3f988c8b69 | ||
|
|
2ac2b6d1b6 | ||
|
|
b8657158be | ||
|
|
70f5f8301b | ||
|
|
adb8d773d4 | ||
|
|
a289406863 | ||
|
|
1a3f2a8ab5 | ||
|
|
23d6b815f5 | ||
|
|
e1feb5eb30 | ||
|
|
cb8247559d | ||
|
|
28b954017f | ||
|
|
16d826d6c7 | ||
|
|
2f7c18303d | ||
|
|
b9df41c55f | ||
|
|
4801260440 | ||
|
|
606262e55d | ||
|
|
0064d18e64 | ||
|
|
6f5a6d5cb4 | ||
|
|
e0194528dd | ||
|
|
30240ac14b | ||
|
|
090e1660fe | ||
|
|
92c9b34d4f | ||
|
|
fb41b0f5c8 | ||
|
|
3f50371ff3 | ||
|
|
812b321154 | ||
|
|
815f9bfc5f | ||
|
|
86ff23d13c | ||
|
|
201b786f77 | ||
|
|
8074955841 | ||
|
|
0992093f4d | ||
|
|
6978e57991 | ||
|
|
755c0b7008 | ||
|
|
7396d0f241 | ||
|
|
220859d0aa | ||
|
|
941786669b | ||
|
|
4eb620d47b | ||
|
|
9794995d7a | ||
|
|
055146602a | ||
|
|
86d7860d86 | ||
|
|
0f2d0d1f07 | ||
|
|
ab6a5a5e07 | ||
|
|
44a33ed463 | ||
|
|
fab08b6451 | ||
|
|
d9cd3dd3e1 | ||
|
|
c75ea87f6b | ||
|
|
706ddf6e95 | ||
|
|
aec091e7aa | ||
|
|
cea8393a7f | ||
|
|
8f94463eac | ||
|
|
a0f5e44967 | ||
|
|
feb7181767 | ||
|
|
a0c1e9cdc6 | ||
|
|
7d1b6f63b5 | ||
|
|
ab6b6514cb | ||
|
|
0e6285edf2 | ||
|
|
8b58eaac20 | ||
|
|
8cbf292373 | ||
|
|
80d0b63c3a | ||
|
|
f5120a29ec | ||
|
|
efc3f4c0ee | ||
|
|
bd2bfd6822 | ||
|
|
e40625d2ad | ||
|
|
eae347ddac | ||
|
|
ae2ca1d89c | ||
|
|
34c73da886 | ||
|
|
88c3ab2636 | ||
|
|
6a5dd26907 | ||
|
|
4de557b4db | ||
|
|
d9eb9758e2 | ||
|
|
d566457f0c | ||
|
|
79ff0659c0 | ||
|
|
af9d4328eb | ||
|
|
8c66940b78 | ||
|
|
c577e09183 | ||
|
|
4a6f269b4b | ||
|
|
bbaeeb7ce9 | ||
|
|
54686905dc | ||
|
|
3cde75f97b | ||
|
|
6c84b3f01c | ||
|
|
68f6cfde0c | ||
|
|
1c8181dc75 | ||
|
|
270746e303 | ||
|
|
72f1416b30 | ||
|
|
a788f16e91 | ||
|
|
f2229e6977 | ||
|
|
05f81922e6 | ||
|
|
06be74ae7c | ||
|
|
72504a5e8b | ||
|
|
e8c034e988 | ||
|
|
aa19718ba4 | ||
|
|
088ab106dd | ||
|
|
110c3f619a | ||
|
|
d1cc503ca8 | ||
|
|
eae7f8a786 | ||
|
|
bb24b86018 | ||
|
|
d3b3a4c148 | ||
|
|
46f1cee2a8 | ||
|
|
0386af721d | ||
|
|
de6b752db8 | ||
|
|
92fd5511ec | ||
|
|
8507125e98 | ||
|
|
59ec7f31ab | ||
|
|
627b21f3f2 | ||
|
|
64cc6e0b91 | ||
|
|
779d2352bd | ||
|
|
0162db12b8 | ||
|
|
91ff7b9032 | ||
|
|
643f99f577 | ||
|
|
152288b4cc | ||
|
|
45b518baf2 | ||
|
|
24cc479f95 | ||
|
|
5fbc630061 | ||
|
|
0c65c73f90 | ||
|
|
95eca75336 | ||
|
|
0f0dbc3274 | ||
|
|
edb674759f | ||
|
|
e3d8c5c7a6 | ||
|
|
f3d6f26a28 | ||
|
|
1a0d51495d | ||
|
|
32d9a397aa | ||
|
|
60e6dc1134 | ||
|
|
06d34daeab | ||
|
|
a00187b97f | ||
|
|
ba1f68d758 | ||
|
|
d4c0977a70 | ||
|
|
1a19d71e95 | ||
|
|
21c10934fc | ||
|
|
13cca91097 | ||
|
|
b335b1c66b | ||
|
|
a42a9bf4fe | ||
|
|
cc2653bfb5 | ||
|
|
fc5bf5a68f | ||
|
|
0f7e6b8964 | ||
|
|
63d7338311 | ||
|
|
37f716d27b | ||
|
|
03bfdec1e1 | ||
|
|
0f2a835359 | ||
|
|
2a84d39e40 | ||
|
|
b14289e976 | ||
|
|
1fef6f0656 | ||
|
|
183ec2124f | ||
|
|
aeb9bfa063 | ||
|
|
b84c7ae49b | ||
|
|
61598c5942 | ||
|
|
a3a24e0216 | ||
|
|
31ec2da0e9 | ||
|
|
53da7cb036 | ||
|
|
911083c49d | ||
|
|
27a10b395f | ||
|
|
b1f3e117d1 | ||
|
|
7570cdbd22 | ||
|
|
28ff2efdef | ||
|
|
bb1a9192eb | ||
|
|
1787e2c775 | ||
|
|
470e711383 | ||
|
|
eb4f682ad1 | ||
|
|
4b63730efb | ||
|
|
c857474116 | ||
|
|
8ff5dacc3c | ||
|
|
fb89828990 | ||
|
|
c7529f9a3e | ||
|
|
dbefa71bc8 | ||
|
|
7907404028 | ||
|
|
72e17b558c | ||
|
|
628028475c | ||
|
|
05e992ad67 | ||
|
|
bba6bf387e | ||
|
|
4d32f7c5ad | ||
|
|
0dff05e881 | ||
|
|
f3c5a01daf | ||
|
|
7ca104cef6 | ||
|
|
fe95247d56 | ||
|
|
f1179d31ba | ||
|
|
c7681cb24d | ||
|
|
abe60b96f1 | ||
|
|
206520f179 | ||
|
|
330ac3be68 | ||
|
|
3b1e34efa1 |
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
* text=auto eol=lf
|
||||||
|
*.{cmd,[cC][mM][dD]} text eol=crlf
|
||||||
|
*.{bat,[bB][aA][tT]} text eol=crlf
|
||||||
|
*.{sh,[sS][hH]} text eol=lf
|
||||||
8
.github/ISSUE_TEMPLATE/Bug Report.yml
vendored
8
.github/ISSUE_TEMPLATE/Bug Report.yml
vendored
@@ -32,16 +32,24 @@ body:
|
|||||||
options:
|
options:
|
||||||
- Not Applicable
|
- Not Applicable
|
||||||
- T-Beam
|
- T-Beam
|
||||||
|
- T-Beam S3
|
||||||
- T-Beam 0.7
|
- T-Beam 0.7
|
||||||
- T-Lora v1
|
- T-Lora v1
|
||||||
- T-Lora v1.3
|
- T-Lora v1.3
|
||||||
- T-Lora v2 1.6
|
- T-Lora v2 1.6
|
||||||
|
- T-Deck
|
||||||
- T-Echo
|
- T-Echo
|
||||||
|
- T-Watch
|
||||||
- Rak4631
|
- Rak4631
|
||||||
- Rak11200
|
- Rak11200
|
||||||
|
- Rak11310
|
||||||
- Heltec v1
|
- Heltec v1
|
||||||
- Heltec v2
|
- Heltec v2
|
||||||
- Heltec v2.1
|
- Heltec v2.1
|
||||||
|
- Heltec V3
|
||||||
|
- Heltec Wireless Paper
|
||||||
|
- Heltec Wireless Tracker
|
||||||
|
- Raspberry Pi Pico (W)
|
||||||
- Relay v1
|
- Relay v1
|
||||||
- Relay v2
|
- Relay v2
|
||||||
- DIY
|
- DIY
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/New Board.yml
vendored
2
.github/ISSUE_TEMPLATE/New Board.yml
vendored
@@ -28,7 +28,7 @@ body:
|
|||||||
description: What LoRa IC does the board have?
|
description: What LoRa IC does the board have?
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
- type: input
|
- type: input
|
||||||
id: link
|
id: link
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
8
.github/actions/setup-base/action.yml
vendored
8
.github/actions/setup-base/action.yml
vendored
@@ -1,5 +1,5 @@
|
|||||||
name: 'Setup Build Base Composite Action'
|
name: "Setup Build Base Composite Action"
|
||||||
description: 'Base build actions for Meshtastic Platform IO steps'
|
description: "Base build actions for Meshtastic Platform IO steps"
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
@@ -10,7 +10,7 @@ runs:
|
|||||||
submodules: "recursive"
|
submodules: "recursive"
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
- name: Install cppcheck
|
- name: Install cppcheck
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -38,4 +38,4 @@ runs:
|
|||||||
- name: Upgrade platformio
|
- name: Upgrade platformio
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
pio upgrade
|
pio upgrade
|
||||||
|
|||||||
5
.github/pull_request_template.md
vendored
5
.github/pull_request_template.md
vendored
@@ -7,7 +7,8 @@
|
|||||||
is appreciated." This will allow other devs to potentially save you time by not accidentially duplicating work etc...
|
is appreciated." This will allow other devs to potentially save you time by not accidentially duplicating work etc...
|
||||||
- Please do not check in files that don't have real changes
|
- Please do not check in files that don't have real changes
|
||||||
- Please do not reformat lines that you didn't have to change the code on
|
- Please do not reformat lines that you didn't have to change the code on
|
||||||
- We recommend using the [Visual Studio Code](https://platformio.org/install/ide?install=vscode) editor and the 'clang-format' extension,
|
- We recommend using the [Visual Studio Code](https://platformio.org/install/ide?install=vscode) editor along with the ['Trunk Check' extension](https://marketplace.visualstudio.com/items?itemName=trunk.io) (In beta for windows, WSL2 for the linux version),
|
||||||
because automatically follows our indentation rules and it's auto reformatting will not cause spurious changes to lines.
|
because it automatically follows our indentation rules and its auto reformatting will not cause spurious changes to lines.
|
||||||
- If your PR fixes a bug, mention "fixes #bugnum" somewhere in your pull request description.
|
- If your PR fixes a bug, mention "fixes #bugnum" somewhere in your pull request description.
|
||||||
- If your other co-developers have comments on your PR please tweak as needed.
|
- If your other co-developers have comments on your PR please tweak as needed.
|
||||||
|
- Please also enable "Allow edits by maintainers".
|
||||||
|
|||||||
27
.github/workflows/build_esp32.yml
vendored
27
.github/workflows/build_esp32.yml
vendored
@@ -7,7 +7,7 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-esp32:
|
build-esp32:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -17,11 +17,11 @@ jobs:
|
|||||||
uses: ./.github/actions/setup-base
|
uses: ./.github/actions/setup-base
|
||||||
|
|
||||||
- name: Pull web ui
|
- name: Pull web ui
|
||||||
uses: dsaltares/fetch-gh-release-asset@master
|
uses: dsaltares/fetch-gh-release-asset@a40c8b4a0471f9ab81bdf73a010f74cc51476ad4
|
||||||
with:
|
with:
|
||||||
repo: "meshtastic/web"
|
repo: meshtastic/web
|
||||||
file: "build.tar"
|
file: build.tar
|
||||||
target: "build.tar"
|
target: build.tar
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Unpack web ui
|
- name: Unpack web ui
|
||||||
@@ -29,17 +29,24 @@ jobs:
|
|||||||
tar -xf build.tar -C data/static
|
tar -xf build.tar -C data/static
|
||||||
rm build.tar
|
rm build.tar
|
||||||
|
|
||||||
|
- name: Remove debug flags for release
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
|
run: |
|
||||||
|
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32.ini
|
||||||
|
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32s2.ini
|
||||||
|
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32s3.ini
|
||||||
|
|
||||||
- name: Build ESP32
|
- name: Build ESP32
|
||||||
run: bin/build-esp32.sh ${{ inputs.board }}
|
run: bin/build-esp32.sh ${{ inputs.board }}
|
||||||
|
|
||||||
- name: Pull OTA Firmware
|
- name: Pull OTA Firmware
|
||||||
uses: dsaltares/fetch-gh-release-asset@master
|
uses: dsaltares/fetch-gh-release-asset@a40c8b4a0471f9ab81bdf73a010f74cc51476ad4
|
||||||
with:
|
with:
|
||||||
repo: "meshtastic/firmware-ota"
|
repo: meshtastic/firmware-ota
|
||||||
file: "firmware.bin"
|
file: firmware.bin
|
||||||
target: "release/bleota.bin"
|
target: release/bleota.bin
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
|
|||||||
59
.github/workflows/build_esp32_s3.yml
vendored
Normal file
59
.github/workflows/build_esp32_s3.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
name: Build ESP32-S3
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
board:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-esp32-s3:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Build base
|
||||||
|
id: base
|
||||||
|
uses: ./.github/actions/setup-base
|
||||||
|
|
||||||
|
- name: Pull web ui
|
||||||
|
uses: dsaltares/fetch-gh-release-asset@a40c8b4a0471f9ab81bdf73a010f74cc51476ad4
|
||||||
|
with:
|
||||||
|
repo: meshtastic/web
|
||||||
|
file: build.tar
|
||||||
|
target: build.tar
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Unpack web ui
|
||||||
|
run: |
|
||||||
|
tar -xf build.tar -C data/static
|
||||||
|
rm build.tar
|
||||||
|
- name: Remove debug flags for release
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
|
run: |
|
||||||
|
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32.ini
|
||||||
|
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32s2.ini
|
||||||
|
sed -i '/DDEBUG_HEAP/d' ./arch/esp32/esp32s3.ini
|
||||||
|
- name: Build ESP32
|
||||||
|
run: bin/build-esp32.sh ${{ inputs.board }}
|
||||||
|
|
||||||
|
- name: Pull OTA Firmware
|
||||||
|
uses: dsaltares/fetch-gh-release-asset@a40c8b4a0471f9ab81bdf73a010f74cc51476ad4
|
||||||
|
with:
|
||||||
|
repo: meshtastic/firmware-ota
|
||||||
|
file: firmware-s3.bin
|
||||||
|
target: release/bleota-s3.bin
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
shell: bash
|
||||||
|
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
|
id: version
|
||||||
|
|
||||||
|
- name: Store binaries as an artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
|
||||||
|
path: |
|
||||||
|
release/*.bin
|
||||||
|
release/*.elf
|
||||||
4
.github/workflows/build_nrf52.yml
vendored
4
.github/workflows/build_nrf52.yml
vendored
@@ -7,7 +7,7 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-nrf52:
|
build-nrf52:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -30,4 +30,4 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
release/*.uf2
|
release/*.uf2
|
||||||
release/*.elf
|
release/*.elf
|
||||||
release/*.zip
|
release/*.zip
|
||||||
|
|||||||
45
.github/workflows/build_raspbian.yml
vendored
Normal file
45
.github/workflows/build_raspbian.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
name: Build Raspbian
|
||||||
|
|
||||||
|
on: workflow_call
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-raspbian:
|
||||||
|
runs-on: [self-hosted, linux, ARM64]
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
|
- name: Upgrade python tools
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -U platformio adafruit-nrfutil
|
||||||
|
pip install -U meshtastic --pre
|
||||||
|
|
||||||
|
- name: Upgrade platformio
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
pio upgrade
|
||||||
|
|
||||||
|
- name: Build Raspbian
|
||||||
|
run: bin/build-native.sh
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
|
id: version
|
||||||
|
|
||||||
|
- name: Store binaries as an artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: firmware-raspbian-${{ steps.version.outputs.version }}.zip
|
||||||
|
path: |
|
||||||
|
release/meshtasticd_linux_arm64
|
||||||
|
bin/config-dist.yaml
|
||||||
4
.github/workflows/build_rpi2040.yml
vendored
4
.github/workflows/build_rpi2040.yml
vendored
@@ -7,7 +7,7 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-rpi2040:
|
build-rpi2040:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -29,4 +29,4 @@ jobs:
|
|||||||
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
|
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
|
||||||
path: |
|
path: |
|
||||||
release/*.uf2
|
release/*.uf2
|
||||||
release/*.elf
|
release/*.elf
|
||||||
|
|||||||
144
.github/workflows/main_matrix.yml
vendored
144
.github/workflows/main_matrix.yml
vendored
@@ -1,4 +1,7 @@
|
|||||||
name: CI
|
name: CI
|
||||||
|
#concurrency:
|
||||||
|
# group: ${{ github.ref }}
|
||||||
|
# cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||||
on:
|
on:
|
||||||
# # Triggers the workflow on push but only for the master branch
|
# # Triggers the workflow on push but only for the master branch
|
||||||
push:
|
push:
|
||||||
@@ -23,15 +26,19 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- board: rak11200
|
- board: rak11200
|
||||||
- board: tlora-v2-1-1.6
|
- board: tlora-v2-1-1_6
|
||||||
- board: tbeam
|
- board: tbeam
|
||||||
- board: heltec-v2.1
|
- board: heltec-v2_1
|
||||||
- board: meshtastic-diy-v1
|
- board: meshtastic-diy-v1
|
||||||
- board: rak4631
|
- board: rak4631
|
||||||
- board: t-echo
|
- board: t-echo
|
||||||
- board: station-g1
|
- board: station-g1
|
||||||
- board: m5stack-coreink
|
- board: m5stack-coreink
|
||||||
- board: tbeam-s3-core
|
- board: tbeam-s3-core
|
||||||
|
- board: tlora-t3s3-v1
|
||||||
|
- board: t-watch-s3
|
||||||
|
- board: t-deck
|
||||||
|
#- board: rak11310
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -40,6 +47,10 @@ jobs:
|
|||||||
id: base
|
id: base
|
||||||
uses: ./.github/actions/setup-base
|
uses: ./.github/actions/setup-base
|
||||||
|
|
||||||
|
- name: Trunk Check
|
||||||
|
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||||
|
uses: trunk-io/trunk-action@782e83f803ca6e369f035d64c6ba2768174ba61b
|
||||||
|
|
||||||
- name: Check ${{ matrix.board }}
|
- name: Check ${{ matrix.board }}
|
||||||
run: bin/check-all.sh ${{ matrix.board }}
|
run: bin/check-all.sh ${{ matrix.board }}
|
||||||
|
|
||||||
@@ -52,36 +63,56 @@ jobs:
|
|||||||
- board: tlora-v2
|
- board: tlora-v2
|
||||||
- board: tlora-v1
|
- board: tlora-v1
|
||||||
- board: tlora_v1_3
|
- board: tlora_v1_3
|
||||||
- board: tlora-v2-1-1.6
|
- board: tlora-v2-1-1_6
|
||||||
|
- board: tlora-v2-1-1_8
|
||||||
- board: tbeam
|
- board: tbeam
|
||||||
|
- board: heltec-ht62-esp32c3-sx1262
|
||||||
- board: heltec-v1
|
- board: heltec-v1
|
||||||
- board: heltec-v2.0
|
- board: heltec-v2_0
|
||||||
- board: heltec-v2.1
|
- board: heltec-v2_1
|
||||||
- board: heltec-v3
|
- board: tbeam0_7
|
||||||
- board: heltec-wsl-v3
|
|
||||||
- board: tbeam0.7
|
|
||||||
- board: meshtastic-diy-v1
|
- board: meshtastic-diy-v1
|
||||||
|
- board: hydra
|
||||||
- board: meshtastic-dr-dev
|
- board: meshtastic-dr-dev
|
||||||
- board: nano-g1
|
- board: nano-g1
|
||||||
- board: station-g1
|
- board: station-g1
|
||||||
- board: m5stack-core
|
- board: m5stack-core
|
||||||
- board: m5stack-coreink
|
- board: m5stack-coreink
|
||||||
- board: tbeam-s3-core
|
- board: nano-g1-explorer
|
||||||
uses: ./.github/workflows/build_esp32.yml
|
uses: ./.github/workflows/build_esp32.yml
|
||||||
with:
|
with:
|
||||||
board: ${{ matrix.board }}
|
board: ${{ matrix.board }}
|
||||||
|
|
||||||
|
build-esp32-s3:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- board: heltec-v3
|
||||||
|
- board: heltec-wsl-v3
|
||||||
|
- board: heltec-wireless-tracker
|
||||||
|
- board: heltec-wireless-paper
|
||||||
|
- board: tbeam-s3-core
|
||||||
|
- board: tlora-t3s3-v1
|
||||||
|
- board: t-watch-s3
|
||||||
|
- board: t-deck
|
||||||
|
- board: picomputer-s3
|
||||||
|
uses: ./.github/workflows/build_esp32_s3.yml
|
||||||
|
with:
|
||||||
|
board: ${{ matrix.board }}
|
||||||
|
|
||||||
build-nrf52:
|
build-nrf52:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
max-parallel: 2
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- board: rak4631
|
- board: rak4631
|
||||||
- board: rak4631_eink
|
- board: rak4631_eink
|
||||||
|
- board: monteops_hw1
|
||||||
- board: t-echo
|
- board: t-echo
|
||||||
- board: pca10059_diy_eink
|
- board: pca10059_diy_eink
|
||||||
- board: feather_diy
|
- board: feather_diy
|
||||||
|
- board: nano-g2-ultra
|
||||||
uses: ./.github/workflows/build_nrf52.yml
|
uses: ./.github/workflows/build_nrf52.yml
|
||||||
with:
|
with:
|
||||||
board: ${{ matrix.board }}
|
board: ${{ matrix.board }}
|
||||||
@@ -93,10 +124,22 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- board: pico
|
- board: pico
|
||||||
|
- board: picow
|
||||||
|
- board: rak11310
|
||||||
|
- board: senselora_rp2040
|
||||||
uses: ./.github/workflows/build_rpi2040.yml
|
uses: ./.github/workflows/build_rpi2040.yml
|
||||||
with:
|
with:
|
||||||
board: ${{ matrix.board }}
|
board: ${{ matrix.board }}
|
||||||
|
|
||||||
|
build-raspbian:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
max-parallel: 1
|
||||||
|
uses: ./.github/workflows/build_raspbian.yml
|
||||||
|
|
||||||
|
package-raspbian:
|
||||||
|
uses: ./.github/workflows/package_raspbian.yml
|
||||||
|
|
||||||
build-native:
|
build-native:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -106,14 +149,14 @@ jobs:
|
|||||||
uses: ./.github/actions/setup-base
|
uses: ./.github/actions/setup-base
|
||||||
|
|
||||||
# We now run integration test before other build steps (to quickly see runtime failures)
|
# We now run integration test before other build steps (to quickly see runtime failures)
|
||||||
- name: Build for native
|
#- name: Build for native
|
||||||
run: platformio run -e native
|
# run: platformio run -e native
|
||||||
- name: Integration test
|
#- name: Integration test
|
||||||
run: |
|
# run: |
|
||||||
.pio/build/native/program &
|
#.pio/build/native/program
|
||||||
sleep 20 # 5 seconds was not enough
|
#& sleep 20 # 5 seconds was not enough
|
||||||
echo "Simulator started, launching python test..."
|
#echo "Simulator started, launching python test..."
|
||||||
python3 -c 'from meshtastic.test import testSimulator; testSimulator()'
|
#python3 -c 'from meshtastic.test import testSimulator; testSimulator()'
|
||||||
|
|
||||||
- name: Build Native
|
- name: Build Native
|
||||||
run: bin/build-native.sh
|
run: bin/build-native.sh
|
||||||
@@ -129,27 +172,36 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
release/device-*.sh
|
release/device-*.sh
|
||||||
release/device-*.bat
|
release/device-*.bat
|
||||||
|
|
||||||
- name: Docker login
|
- name: Docker login
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: meshtastic
|
username: meshtastic
|
||||||
password: ${{ secrets.DOCKER_TOKEN }}
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
|
|
||||||
- name: Docker setup
|
- name: Docker setup
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Docker build and push
|
- name: Docker build and push tagged versions
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: meshtastic/device-simulator:${{ steps.version.outputs.version }}
|
||||||
|
|
||||||
|
- name: Docker build and push
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: meshtastic/device-simulator:latest
|
tags: meshtastic/device-simulator:latest
|
||||||
|
|
||||||
after-checks:
|
after-checks:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [check]
|
needs: [check]
|
||||||
@@ -161,8 +213,20 @@ jobs:
|
|||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
gather-artifacts:
|
gather-artifacts:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build-esp32, build-nrf52, build-native, build-rpi2040]
|
needs:
|
||||||
|
[
|
||||||
|
build-esp32,
|
||||||
|
build-esp32-s3,
|
||||||
|
build-nrf52,
|
||||||
|
build-raspbian,
|
||||||
|
build-native,
|
||||||
|
build-rpi2040,
|
||||||
|
package-raspbian,
|
||||||
|
]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -174,12 +238,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: ./
|
path: ./
|
||||||
|
|
||||||
|
- name: Display structure of downloaded files
|
||||||
|
run: ls -R
|
||||||
|
|
||||||
- name: Get release version string
|
- name: Get release version string
|
||||||
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
|
|
||||||
- name: Move files up
|
- name: Move files up
|
||||||
run: mv -b -t ./ ./*tbeam-2*/littlefs*.bin ./*tbeam-2*/bleota.bin ./**/firmware*.bin ./*t-echo*/Meshtastic_nRF52_factory_erase.uf2 ./**/firmware-*.uf2 ./**/firmware-*-ota.zip ./**/*.elf ./*native*/*device-*.sh ./*native*/*device-*.bat
|
run: mv -b -t ./ ./*tbeam-2*/littlefs*.bin ./*tbeam-2*/bleota.bin ./*tbeam-s3*/bleota-s3.bin ./**/firmware*.bin ./*t-echo*/Meshtastic_nRF52_factory_erase.uf2 ./**/firmware-*.uf2 ./**/firmware-*-ota.zip ./**/*.elf ./*native*/*device-*.sh ./*native*/*device-*.bat ./firmware-raspbian-*/release/meshtasticd_linux_arm64 ./firmware-raspbian-*/bin/config-dist.yaml
|
||||||
|
|
||||||
- name: Repackage in single firmware zip
|
- name: Repackage in single firmware zip
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
@@ -191,6 +258,8 @@ jobs:
|
|||||||
./firmware-*-ota.zip
|
./firmware-*-ota.zip
|
||||||
./device-*.sh
|
./device-*.sh
|
||||||
./device-*.bat
|
./device-*.bat
|
||||||
|
./meshtasticd_linux_arm64
|
||||||
|
./config-dist.yaml
|
||||||
retention-days: 90
|
retention-days: 90
|
||||||
|
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
@@ -218,15 +287,15 @@ jobs:
|
|||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
- name: Create request artifacts
|
- name: Create request artifacts
|
||||||
|
continue-on-error: true # FIXME: Why are we getting 502, but things still work?
|
||||||
if: ${{ github.event_name == 'pull_request_target' || github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request_target' || github.event_name == 'pull_request' }}
|
||||||
uses: gavv/pull-request-artifacts@v1.0.0
|
uses: gavv/pull-request-artifacts@v2.1.0
|
||||||
with:
|
with:
|
||||||
commit: ${{ (github.event.pull_request_target || github.event.pull_request).head.sha }}
|
commit: ${{ (github.event.pull_request_target || github.event.pull_request).head.sha }}
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
artifacts-token: ${{ secrets.ARTIFACTS_TOKEN }}
|
artifacts-token: ${{ secrets.ARTIFACTS_TOKEN }}
|
||||||
artifacts-repo: meshtastic/artifacts
|
artifacts-repo: meshtastic/artifacts
|
||||||
artifacts-branch: device
|
artifacts-branch: device
|
||||||
artifacts-dir: pr
|
|
||||||
artifacts: ./firmware-${{ steps.version.outputs.version }}.zip
|
artifacts: ./firmware-${{ steps.version.outputs.version }}.zip
|
||||||
|
|
||||||
release-artifacts:
|
release-artifacts:
|
||||||
@@ -251,6 +320,13 @@ jobs:
|
|||||||
name: firmware-${{ steps.version.outputs.version }}
|
name: firmware-${{ steps.version.outputs.version }}
|
||||||
path: ./output
|
path: ./output
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: artifact-deb
|
||||||
|
|
||||||
|
- name: Display structure of downloaded files
|
||||||
|
run: ls -R
|
||||||
|
|
||||||
- name: Device scripts permissions
|
- name: Device scripts permissions
|
||||||
run: |
|
run: |
|
||||||
chmod +x ./output/device-install.sh
|
chmod +x ./output/device-install.sh
|
||||||
@@ -277,7 +353,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: true
|
prerelease: true
|
||||||
release_name: Meshtastic Firmware ${{ steps.version.outputs.version }}
|
release_name: Meshtastic Firmware ${{ steps.version.outputs.version }} Alpha
|
||||||
tag_name: v${{ steps.version.outputs.version }}
|
tag_name: v${{ steps.version.outputs.version }}
|
||||||
body: |
|
body: |
|
||||||
Autogenerated by github action, developer should edit as required before publishing...
|
Autogenerated by github action, developer should edit as required before publishing...
|
||||||
@@ -304,6 +380,16 @@ jobs:
|
|||||||
asset_name: debug-elfs-${{ steps.version.outputs.version }}.zip
|
asset_name: debug-elfs-${{ steps.version.outputs.version }}.zip
|
||||||
asset_content_type: application/zip
|
asset_content_type: application/zip
|
||||||
|
|
||||||
|
- name: Add raspbian .deb
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./meshtasticd_${{ steps.version.outputs.version }}_arm64.deb
|
||||||
|
asset_name: meshtasticd_${{ steps.version.outputs.version }}_arm64.deb
|
||||||
|
asset_content_type: application/vnd.debian.binary-package
|
||||||
|
|
||||||
- name: Bump version.properties
|
- name: Bump version.properties
|
||||||
run: >-
|
run: >-
|
||||||
bin/bump_version.py
|
bin/bump_version.py
|
||||||
|
|||||||
19
.github/workflows/nightly.yml
vendored
Normal file
19
.github/workflows/nightly.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Nightly
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: 0 8 * * 1-5
|
||||||
|
workflow_dispatch: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
trunk_check:
|
||||||
|
name: Trunk Check Upload
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Trunk Check
|
||||||
|
uses: trunk-io/trunk-action@782e83f803ca6e369f035d64c6ba2768174ba61b
|
||||||
|
with:
|
||||||
|
trunk-token: ${{ secrets.TRUNK_TOKEN }}
|
||||||
62
.github/workflows/package_raspbian.yml
vendored
Normal file
62
.github/workflows/package_raspbian.yml
vendored
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
name: Package Raspbian
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-raspbian:
|
||||||
|
uses: ./.github/workflows/build_raspbian.yml
|
||||||
|
|
||||||
|
package-raspbian:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build-raspbian
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
|
- name: Get release version string
|
||||||
|
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
||||||
|
id: version
|
||||||
|
|
||||||
|
- name: Download artifacts
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: firmware-raspbian-${{ steps.version.outputs.version }}.zip
|
||||||
|
|
||||||
|
- name: Display structure of downloaded files
|
||||||
|
run: ls -R
|
||||||
|
|
||||||
|
- name: build .debpkg
|
||||||
|
run: |
|
||||||
|
mkdir -p .debpkg/usr/sbin
|
||||||
|
mkdir -p .debpkg/etc/meshtasticd
|
||||||
|
mkdir -p .debpkg/usr/lib/systemd/system/
|
||||||
|
cp release/meshtasticd_linux_arm64 .debpkg/usr/sbin/meshtasticd
|
||||||
|
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
|
||||||
|
chmod +x .debpkg/usr/sbin/meshtasticd
|
||||||
|
cp bin/meshtasticd.service .debpkg/usr/lib/systemd/system/meshtasticd.service
|
||||||
|
|
||||||
|
- uses: jiro4989/build-deb-action@v3
|
||||||
|
with:
|
||||||
|
package: meshtasticd
|
||||||
|
package_root: .debpkg
|
||||||
|
maintainer: Jonathan Bennett
|
||||||
|
version: ${{ steps.version.outputs.version }} # refs/tags/v*.*.*
|
||||||
|
arch: arm64
|
||||||
|
depends: libyaml-cpp0.7
|
||||||
|
desc: Native Linux Meshtastic binary.
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: artifact-deb
|
||||||
|
path: |
|
||||||
|
./*.deb
|
||||||
48
.github/workflows/sec_sast_flawfinder.yml
vendored
48
.github/workflows/sec_sast_flawfinder.yml
vendored
@@ -10,31 +10,31 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
flawfinder:
|
flawfinder:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Flawfinder
|
name: Flawfinder
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# step 1
|
# step 1
|
||||||
- name: clone application source code
|
- name: clone application source code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
# step 2
|
# step 2
|
||||||
- name: flawfinder_scan
|
- name: flawfinder_scan
|
||||||
uses: david-a-wheeler/flawfinder@2.0.19
|
uses: david-a-wheeler/flawfinder@2.0.19
|
||||||
with:
|
with:
|
||||||
arguments: '--sarif ./'
|
arguments: "--sarif ./"
|
||||||
output: 'flawfinder_report.sarif'
|
output: "flawfinder_report.sarif"
|
||||||
|
|
||||||
# step 3
|
# step 3
|
||||||
- name: save report as pipeline artifact
|
- name: save report as pipeline artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: flawfinder_report.sarif
|
name: flawfinder_report.sarif
|
||||||
path: flawfinder_report.sarif
|
path: flawfinder_report.sarif
|
||||||
|
|
||||||
# step 4
|
# step 4
|
||||||
- name: publish code scanning alerts
|
- name: publish code scanning alerts
|
||||||
uses: github/codeql-action/upload-sarif@v2
|
uses: github/codeql-action/upload-sarif@v2
|
||||||
with:
|
with:
|
||||||
sarif_file: flawfinder_report.sarif
|
sarif_file: flawfinder_report.sarif
|
||||||
category: flawfinder
|
category: flawfinder
|
||||||
|
|||||||
56
.github/workflows/sec_sast_semgrep_cron.yml
vendored
56
.github/workflows/sec_sast_semgrep_cron.yml
vendored
@@ -6,39 +6,37 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 1 * * 6'
|
- cron: "0 1 * * 6"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
semgrep-full:
|
semgrep-full:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: returntocorp/semgrep
|
image: returntocorp/semgrep
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
# step 1
|
||||||
|
- name: clone application source code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
# step 1
|
# step 2
|
||||||
- name: clone application source code
|
- name: full scan
|
||||||
uses: actions/checkout@v3
|
run: |
|
||||||
|
semgrep \
|
||||||
|
--sarif --output report.sarif \
|
||||||
|
--metrics=off \
|
||||||
|
--config="p/default"
|
||||||
|
|
||||||
# step 2
|
# step 3
|
||||||
- name: full scan
|
- name: save report as pipeline artifact
|
||||||
run: |
|
uses: actions/upload-artifact@v3
|
||||||
semgrep \
|
with:
|
||||||
--sarif --output report.sarif \
|
name: report.sarif
|
||||||
--metrics=off \
|
path: report.sarif
|
||||||
--config="p/default"
|
|
||||||
|
|
||||||
# step 3
|
# step 4
|
||||||
- name: save report as pipeline artifact
|
- name: publish code scanning alerts
|
||||||
uses: actions/upload-artifact@v3
|
uses: github/codeql-action/upload-sarif@v2
|
||||||
with:
|
with:
|
||||||
name: report.sarif
|
sarif_file: report.sarif
|
||||||
path: report.sarif
|
category: semgrep
|
||||||
|
|
||||||
# step 4
|
|
||||||
- name: publish code scanning alerts
|
|
||||||
uses: github/codeql-action/upload-sarif@v2
|
|
||||||
with:
|
|
||||||
sarif_file: report.sarif
|
|
||||||
category: semgrep
|
|
||||||
|
|||||||
5
.github/workflows/sec_sast_semgrep_pull.yml
vendored
5
.github/workflows/sec_sast_semgrep_pull.yml
vendored
@@ -1,17 +1,14 @@
|
|||||||
---
|
---
|
||||||
name: Semgrep Differential Scan
|
name: Semgrep Differential Scan
|
||||||
on:
|
on: pull_request
|
||||||
pull_request
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
semgrep-diff:
|
semgrep-diff:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: returntocorp/semgrep
|
image: returntocorp/semgrep
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
# step 1
|
# step 1
|
||||||
- name: clone application source code
|
- name: clone application source code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|||||||
22
.github/workflows/trunk-check.yml
vendored
Normal file
22
.github/workflows/trunk-check.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
name: Pull Request
|
||||||
|
on: [pull_request]
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
trunk_check:
|
||||||
|
name: Trunk Check Runner
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
checks: write # For trunk to post annotations
|
||||||
|
contents: read # For repo checkout
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Trunk Check
|
||||||
|
uses: trunk-io/trunk-action@v1
|
||||||
6
.github/workflows/update_protobufs.yml
vendored
6
.github/workflows/update_protobufs.yml
vendored
@@ -17,9 +17,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Download nanopb
|
- name: Download nanopb
|
||||||
run: |
|
run: |
|
||||||
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.6-linux-x86.tar.gz
|
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.7-linux-x86.tar.gz
|
||||||
tar xvzf nanopb-0.4.6-linux-x86.tar.gz
|
tar xvzf nanopb-0.4.7-linux-x86.tar.gz
|
||||||
mv nanopb-0.4.6-linux-x86 nanopb-0.4.6
|
mv nanopb-0.4.7-linux-x86 nanopb-0.4.7
|
||||||
|
|
||||||
- name: Re-generate protocol buffers
|
- name: Re-generate protocol buffers
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -29,3 +29,5 @@ __pycache__
|
|||||||
|
|
||||||
venv/
|
venv/
|
||||||
release/
|
release/
|
||||||
|
.vscode/extensions.json
|
||||||
|
/compile_commands.json
|
||||||
|
|||||||
8
.trunk/.gitignore
vendored
Normal file
8
.trunk/.gitignore
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
*out
|
||||||
|
*logs
|
||||||
|
*actions
|
||||||
|
*notifications
|
||||||
|
*tools
|
||||||
|
plugins
|
||||||
|
user_trunk.yaml
|
||||||
|
user.yaml
|
||||||
3
.trunk/configs/.flake8
Normal file
3
.trunk/configs/.flake8
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Autoformatter friendly flake8 config (all formatting rules disabled)
|
||||||
|
[flake8]
|
||||||
|
extend-ignore = D1, D2, E1, E2, E3, E501, W1, W2, W3, W5
|
||||||
4
.trunk/configs/.hadolint.yaml
Normal file
4
.trunk/configs/.hadolint.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# Following source doesn't work in most setups
|
||||||
|
ignored:
|
||||||
|
- SC1090
|
||||||
|
- SC1091
|
||||||
2
.trunk/configs/.isort.cfg
Normal file
2
.trunk/configs/.isort.cfg
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[settings]
|
||||||
|
profile=black
|
||||||
10
.trunk/configs/.markdownlint.yaml
Normal file
10
.trunk/configs/.markdownlint.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Autoformatter friendly markdownlint config (all formatting rules disabled)
|
||||||
|
default: true
|
||||||
|
blank_lines: false
|
||||||
|
bullet: false
|
||||||
|
html: false
|
||||||
|
indentation: false
|
||||||
|
line_length: false
|
||||||
|
spaces: false
|
||||||
|
url: false
|
||||||
|
whitespace: false
|
||||||
10
.trunk/configs/.shellcheckrc
Normal file
10
.trunk/configs/.shellcheckrc
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
enable=all
|
||||||
|
source-path=SCRIPTDIR
|
||||||
|
disable=SC2154
|
||||||
|
disable=SC2248
|
||||||
|
disable=SC2250
|
||||||
|
|
||||||
|
# If you're having issues with shellcheck following source, disable the errors via:
|
||||||
|
# disable=SC1090
|
||||||
|
# disable=SC1091
|
||||||
|
#
|
||||||
10
.trunk/configs/.yamllint.yaml
Normal file
10
.trunk/configs/.yamllint.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
rules:
|
||||||
|
quoted-strings:
|
||||||
|
required: only-when-needed
|
||||||
|
extra-allowed: ["{|}"]
|
||||||
|
empty-values:
|
||||||
|
forbid-in-block-mappings: false
|
||||||
|
forbid-in-flow-mappings: true
|
||||||
|
key-duplicates: {}
|
||||||
|
octal-values:
|
||||||
|
forbid-implicit-octal: true
|
||||||
5
.trunk/configs/ruff.toml
Normal file
5
.trunk/configs/ruff.toml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Generic, formatter-friendly config.
|
||||||
|
select = ["B", "D3", "D4", "E", "F"]
|
||||||
|
|
||||||
|
# Never enforce `E501` (line length violations). This should be handled by formatters.
|
||||||
|
ignore = ["E501"]
|
||||||
14
.trunk/configs/svgo.config.js
Normal file
14
.trunk/configs/svgo.config.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
plugins: [
|
||||||
|
{
|
||||||
|
name: "preset-default",
|
||||||
|
params: {
|
||||||
|
overrides: {
|
||||||
|
removeViewBox: false, // https://github.com/svg/svgo/issues/1128
|
||||||
|
sortAttrs: true,
|
||||||
|
removeOffCanvasPaths: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
43
.trunk/trunk.yaml
Normal file
43
.trunk/trunk.yaml
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
version: 0.1
|
||||||
|
cli:
|
||||||
|
version: 1.17.2
|
||||||
|
plugins:
|
||||||
|
sources:
|
||||||
|
- id: trunk
|
||||||
|
ref: v1.3.0
|
||||||
|
uri: https://github.com/trunk-io/plugins
|
||||||
|
lint:
|
||||||
|
enabled:
|
||||||
|
- bandit@1.7.5
|
||||||
|
- checkov@3.1.9
|
||||||
|
- terrascan@1.18.5
|
||||||
|
- trivy@0.47.0
|
||||||
|
#- trufflehog@3.63.2-rc0
|
||||||
|
- taplo@0.8.1
|
||||||
|
- ruff@0.1.6
|
||||||
|
- isort@5.12.0
|
||||||
|
- markdownlint@0.37.0
|
||||||
|
- oxipng@9.0.0
|
||||||
|
- svgo@3.0.5
|
||||||
|
- actionlint@1.6.26
|
||||||
|
- flake8@6.1.0
|
||||||
|
- hadolint@2.12.0
|
||||||
|
- shfmt@3.6.0
|
||||||
|
- shellcheck@0.9.0
|
||||||
|
- black@23.9.1
|
||||||
|
- git-diff-check
|
||||||
|
- gitleaks@8.18.1
|
||||||
|
- clang-format@16.0.3
|
||||||
|
- prettier@3.1.0
|
||||||
|
runtimes:
|
||||||
|
enabled:
|
||||||
|
- python@3.10.8
|
||||||
|
- go@1.21.0
|
||||||
|
- node@18.12.1
|
||||||
|
actions:
|
||||||
|
disabled:
|
||||||
|
- trunk-announce
|
||||||
|
enabled:
|
||||||
|
- trunk-fmt-pre-commit
|
||||||
|
- trunk-check-pre-push
|
||||||
|
- trunk-upgrade-available
|
||||||
8
.vscode/extensions.json
vendored
8
.vscode/extensions.json
vendored
@@ -2,10 +2,8 @@
|
|||||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||||
// for the documentation about the extensions.json format
|
// for the documentation about the extensions.json format
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
|
"ms-vscode.cpptools",
|
||||||
"platformio.platformio-ide",
|
"platformio.platformio-ide",
|
||||||
"xaver.clang-format"
|
"trunk.io"
|
||||||
],
|
],
|
||||||
"unwantedRecommendations": [
|
}
|
||||||
"ms-vscode.cpptools-extension-pack"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
83
.vscode/settings.json
vendored
83
.vscode/settings.json
vendored
@@ -1,80 +1,5 @@
|
|||||||
{
|
{
|
||||||
"files.associations": {
|
"editor.formatOnSave": true,
|
||||||
"type_traits": "cpp",
|
"editor.defaultFormatter": "trunk.io",
|
||||||
"array": "cpp",
|
"trunk.enableWindows": true
|
||||||
"*.tcc": "cpp",
|
}
|
||||||
"cctype": "cpp",
|
|
||||||
"clocale": "cpp",
|
|
||||||
"cmath": "cpp",
|
|
||||||
"cstdarg": "cpp",
|
|
||||||
"cstddef": "cpp",
|
|
||||||
"cstdint": "cpp",
|
|
||||||
"cstdio": "cpp",
|
|
||||||
"cstdlib": "cpp",
|
|
||||||
"cstring": "cpp",
|
|
||||||
"ctime": "cpp",
|
|
||||||
"cwchar": "cpp",
|
|
||||||
"cwctype": "cpp",
|
|
||||||
"deque": "cpp",
|
|
||||||
"unordered_map": "cpp",
|
|
||||||
"unordered_set": "cpp",
|
|
||||||
"vector": "cpp",
|
|
||||||
"exception": "cpp",
|
|
||||||
"algorithm": "cpp",
|
|
||||||
"functional": "cpp",
|
|
||||||
"system_error": "cpp",
|
|
||||||
"tuple": "cpp",
|
|
||||||
"fstream": "cpp",
|
|
||||||
"initializer_list": "cpp",
|
|
||||||
"iomanip": "cpp",
|
|
||||||
"iosfwd": "cpp",
|
|
||||||
"istream": "cpp",
|
|
||||||
"limits": "cpp",
|
|
||||||
"memory": "cpp",
|
|
||||||
"new": "cpp",
|
|
||||||
"ostream": "cpp",
|
|
||||||
"numeric": "cpp",
|
|
||||||
"sstream": "cpp",
|
|
||||||
"stdexcept": "cpp",
|
|
||||||
"streambuf": "cpp",
|
|
||||||
"cinttypes": "cpp",
|
|
||||||
"utility": "cpp",
|
|
||||||
"typeinfo": "cpp",
|
|
||||||
"string": "cpp",
|
|
||||||
"*.xbm": "cpp",
|
|
||||||
"list": "cpp",
|
|
||||||
"atomic": "cpp",
|
|
||||||
"memory_resource": "cpp",
|
|
||||||
"optional": "cpp",
|
|
||||||
"string_view": "cpp",
|
|
||||||
"cassert": "cpp",
|
|
||||||
"iterator": "cpp",
|
|
||||||
"shared_mutex": "cpp",
|
|
||||||
"iostream": "cpp",
|
|
||||||
"esp_nimble_hci.h": "c",
|
|
||||||
"map": "cpp",
|
|
||||||
"random": "cpp",
|
|
||||||
"*.tpp": "cpp"
|
|
||||||
},
|
|
||||||
"cSpell.words": [
|
|
||||||
"Blox",
|
|
||||||
"EINK",
|
|
||||||
"HFSR",
|
|
||||||
"Meshtastic",
|
|
||||||
"NEMAGPS",
|
|
||||||
"NMEAGPS",
|
|
||||||
"RDEF",
|
|
||||||
"Ublox",
|
|
||||||
"bkpt",
|
|
||||||
"cfsr",
|
|
||||||
"descs",
|
|
||||||
"ocrypto",
|
|
||||||
"protobufs",
|
|
||||||
"wifi"
|
|
||||||
],
|
|
||||||
"C_Cpp.dimInactiveRegions": true,
|
|
||||||
"cmake.configureOnOpen": true,
|
|
||||||
"protoc": {
|
|
||||||
"compile_on_save": false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
30
.vscode/tasks.json
vendored
30
.vscode/tasks.json
vendored
@@ -1,17 +1,15 @@
|
|||||||
{
|
{
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"tasks": [
|
"tasks": [
|
||||||
{
|
{
|
||||||
"type": "PlatformIO",
|
"type": "PlatformIO",
|
||||||
"task": "Build",
|
"task": "Build",
|
||||||
"problemMatcher": [
|
"problemMatcher": ["$platformio"],
|
||||||
"$platformio"
|
"group": {
|
||||||
],
|
"kind": "build",
|
||||||
"group": {
|
"isDefault": true
|
||||||
"kind": "build",
|
},
|
||||||
"isDefault": true
|
"label": "PlatformIO: Build"
|
||||||
},
|
}
|
||||||
"label": "PlatformIO: Build"
|
]
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Meshtastic Firmware
|
# Meshtastic Firmware
|
||||||
|
|
||||||

|

|
||||||
[](https://github.com/meshtastic/firmware/actions/workflows/main_matrix.yml)
|
[](https://github.com/meshtastic/firmware/actions/workflows/ci.yml)
|
||||||
[](https://cla-assistant.io/meshtastic/firmware)
|
[](https://cla-assistant.io/meshtastic/firmware)
|
||||||
[](https://opencollective.com/meshtastic/)
|
[](https://opencollective.com/meshtastic/)
|
||||||
[](https://vercel.com?utm_source=meshtastic&utm_campaign=oss)
|
[](https://vercel.com?utm_source=meshtastic&utm_campaign=oss)
|
||||||
@@ -10,8 +10,8 @@
|
|||||||
|
|
||||||
This repository contains the device firmware for the Meshtastic project.
|
This repository contains the device firmware for the Meshtastic project.
|
||||||
|
|
||||||
**[Building Instructions](https://meshtastic.org/docs/development/firmware/build)**
|
- **[Building Instructions](https://meshtastic.org/docs/development/firmware/build)**
|
||||||
**[Flashing Instructions](https://meshtastic.org/docs/getting-started/flashing-firmware/)**
|
- **[Flashing Instructions](https://meshtastic.org/docs/getting-started/flashing-firmware/)**
|
||||||
|
|
||||||
## Stats
|
## Stats
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
; Common settings for ESP targes, mixin with extends = esp32_base
|
; Common settings for ESP targes, mixin with extends = esp32_base
|
||||||
[esp32_base]
|
[esp32_base]
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
platform = platformio/espressif32@^5.2.0
|
platform = platformio/espressif32@6.3.2 # This is a temporary fix to the S3-based devices bluetooth issues until we can determine what within ESP-IDF changed and can develop a suitable patch.
|
||||||
|
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2040> -<mesh/eth/>
|
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2040> -<mesh/eth/>
|
||||||
|
|
||||||
upload_speed = 921600
|
upload_speed = 921600
|
||||||
debug_init_break = tbreak setup
|
debug_init_break = tbreak setup
|
||||||
monitor_filters = esp32_exception_decoder
|
monitor_filters = esp32_exception_decoder
|
||||||
|
|
||||||
board_build.filesystem = littlefs
|
board_build.filesystem = littlefs
|
||||||
|
|
||||||
# Remove -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL for low level BLE logging.
|
# Remove -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL for low level BLE logging.
|
||||||
@@ -25,15 +28,19 @@ build_flags =
|
|||||||
-DCONFIG_BT_NIMBLE_ENABLED
|
-DCONFIG_BT_NIMBLE_ENABLED
|
||||||
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
|
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
|
||||||
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
|
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
|
||||||
|
-DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=5120
|
||||||
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
||||||
|
-DSERIAL_BUFFER_SIZE=4096
|
||||||
|
;-DDEBUG_HEAP
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${arduino_base.lib_deps}
|
${arduino_base.lib_deps}
|
||||||
${networking_base.lib_deps}
|
${networking_base.lib_deps}
|
||||||
${environmental_base.lib_deps}
|
${environmental_base.lib_deps}
|
||||||
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
||||||
h2zero/NimBLE-Arduino@^1.4.0
|
h2zero/NimBLE-Arduino@^1.4.1
|
||||||
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
|
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
|
||||||
|
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
||||||
|
|
||||||
lib_ignore =
|
lib_ignore =
|
||||||
segger_rtt
|
segger_rtt
|
||||||
@@ -49,4 +56,4 @@ lib_ignore =
|
|||||||
|
|
||||||
; customize the partition table
|
; customize the partition table
|
||||||
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
|
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
|
||||||
board_build.partitions = partition-table.csv
|
board_build.partitions = partition-table.csv
|
||||||
5
arch/esp32/esp32c3.ini
Normal file
5
arch/esp32/esp32c3.ini
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[esp32c3_base]
|
||||||
|
extends = esp32_base
|
||||||
|
|
||||||
|
monitor_speed = 115200
|
||||||
|
monitor_filters = esp32_c3_exception_decoder
|
||||||
16
arch/esp32/esp32s2.ini
Normal file
16
arch/esp32/esp32s2.ini
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
[esp32s2_base]
|
||||||
|
extends = esp32_base
|
||||||
|
|
||||||
|
build_src_filter =
|
||||||
|
${esp32_base.build_src_filter} -<nimble/>
|
||||||
|
|
||||||
|
monitor_speed = 115200
|
||||||
|
|
||||||
|
build_flags =
|
||||||
|
${esp32_base.build_flags}
|
||||||
|
-DHAS_BLUETOOTH=0
|
||||||
|
|
||||||
|
lib_ignore =
|
||||||
|
${esp32_base.lib_ignore}
|
||||||
|
NimBLE-Arduino
|
||||||
|
|
||||||
@@ -1,45 +1,5 @@
|
|||||||
[esp32s3_base]
|
[esp32s3_base]
|
||||||
extends = arduino_base
|
extends = esp32_base
|
||||||
platform = platformio/espressif32@^5.2.0
|
|
||||||
build_src_filter =
|
|
||||||
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2040> -<mesh/eth/>
|
|
||||||
upload_speed = 961200
|
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
debug_init_break = tbreak setup
|
|
||||||
monitor_filters = esp32_exception_decoder
|
|
||||||
board_build.filesystem = littlefs
|
|
||||||
|
|
||||||
# Remove -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL for low level BLE logging.
|
|
||||||
# See library directory for BLE logging possible values: .pio/libdeps/tbeam/NimBLE-Arduino/src/log_common/log_common.h
|
|
||||||
# This overrides the BLE logging default of LOG_LEVEL_INFO (1) from: .pio/libdeps/tbeam/NimBLE-Arduino/src/esp_nimble_cfg.h
|
|
||||||
build_flags =
|
|
||||||
${arduino_base.build_flags}
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Isrc/platform/esp32
|
|
||||||
-std=c++11
|
|
||||||
-DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG
|
|
||||||
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
|
|
||||||
-DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL
|
|
||||||
-DAXP_DEBUG_PORT=Serial
|
|
||||||
-DCONFIG_BT_NIMBLE_ENABLED
|
|
||||||
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
|
|
||||||
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
|
|
||||||
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
|
||||||
|
|
||||||
lib_deps =
|
|
||||||
${arduino_base.lib_deps}
|
|
||||||
${networking_base.lib_deps}
|
|
||||||
${environmental_base.lib_deps}
|
|
||||||
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
|
||||||
h2zero/NimBLE-Arduino@^1.4.0
|
|
||||||
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
|
|
||||||
|
|
||||||
lib_ignore =
|
|
||||||
segger_rtt
|
|
||||||
ESP32 BLE Arduino
|
|
||||||
|
|
||||||
; customize the partition table
|
|
||||||
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
|
|
||||||
board_build.partitions = partition-table.csv
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
[nrf52_base]
|
[nrf52_base]
|
||||||
; Instead of the standard nordicnrf52 platform, we use our fork which has our added variant files
|
; Instead of the standard nordicnrf52 platform, we use our fork which has our added variant files
|
||||||
platform = platformio/nordicnrf52@^9.4.0
|
platform = platformio/nordicnrf52@^10.1.0
|
||||||
|
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
|
|
||||||
build_type = debug ; I'm debugging with ICE a lot now
|
build_type = debug ; I'm debugging with ICE a lot now
|
||||||
build_flags =
|
build_flags =
|
||||||
${arduino_base.build_flags} -Wno-unused-variable
|
${arduino_base.build_flags}
|
||||||
|
-DSERIAL_BUFFER_SIZE=1024
|
||||||
|
-Wno-unused-variable
|
||||||
-Isrc/platform/nrf52
|
-Isrc/platform/nrf52
|
||||||
|
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
${arduino_base.build_src_filter} -<platform/esp32/> -<platform/stm32wl> -<nimble/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mqtt/> -<platform/rp2040> -<mesh/eth/>
|
${arduino_base.build_src_filter} -<platform/esp32/> -<platform/stm32wl> -<nimble/> -<mesh/wifi/> -<mesh/api/> -<mesh/http/> -<modules/esp32> -<platform/rp2040> -<mesh/eth/>
|
||||||
|
|
||||||
|
lib_deps=
|
||||||
|
${arduino_base.lib_deps}
|
||||||
|
|
||||||
lib_ignore =
|
lib_ignore =
|
||||||
BluetoothOTA
|
BluetoothOTA
|
||||||
|
|
||||||
; Note: By default no lora device is created for this build - it uses a simulated interface
|
|
||||||
[env:feather_nrf52832]
|
|
||||||
extends = nrf52_base
|
|
||||||
board = adafruit_feather_nrf52832
|
|
||||||
7
arch/nrf52/nrf52832.ini
Normal file
7
arch/nrf52/nrf52832.ini
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[nrf52832_base]
|
||||||
|
extends = nrf52_base
|
||||||
|
|
||||||
|
build_flags = ${nrf52_base.build_flags}
|
||||||
|
|
||||||
|
lib_deps =
|
||||||
|
${nrf52_base.lib_deps}
|
||||||
@@ -1,14 +1,9 @@
|
|||||||
[nrf52840_base]
|
[nrf52840_base]
|
||||||
extends = nrf52_base
|
extends = nrf52_base
|
||||||
|
|
||||||
build_flags = ${nrf52_base.build_flags}
|
build_flags = ${nrf52_base.build_flags}
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${arduino_base.lib_deps}
|
${nrf52_base.lib_deps}
|
||||||
${environmental_base.lib_deps}
|
${environmental_base.lib_deps}
|
||||||
https://github.com/Kongduino/Adafruit_nRFCrypto.git#e31a8825ea3300b163a0a3c1ddd5de34e10e1371
|
https://github.com/Kongduino/Adafruit_nRFCrypto.git#e31a8825ea3300b163a0a3c1ddd5de34e10e1371
|
||||||
|
|
||||||
; Note: By default no lora device is created for this build - it uses a simulated interface
|
|
||||||
[env:nrf52840dk]
|
|
||||||
extends = nrf52840_base
|
|
||||||
board = nrf52840_dk
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
; The Portduino based sim environment on top of any host OS, all hardware will be simulated
|
; The Portduino based sim environment on top of any host OS, all hardware will be simulated
|
||||||
[portduino_base]
|
[portduino_base]
|
||||||
platform = https://github.com/meshtastic/platform-native.git#096b3c3e9c5c8e19d4c3b6cd803fffef2a9be4c5
|
platform = https://github.com/meshtastic/platform-native.git#8a66ef82cf38a4135d85cbb5043d0e8ebbb8ba17
|
||||||
framework = arduino
|
framework = arduino
|
||||||
|
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
${env.build_src_filter}
|
${env.build_src_filter}
|
||||||
-<platform/esp32/>
|
-<platform/esp32/>
|
||||||
@@ -9,13 +10,22 @@ build_src_filter =
|
|||||||
-<platform/nrf52/>
|
-<platform/nrf52/>
|
||||||
-<platform/stm32wl/>
|
-<platform/stm32wl/>
|
||||||
-<platform/rp2040>
|
-<platform/rp2040>
|
||||||
|
-<mesh/wifi/>
|
||||||
-<mesh/http/>
|
-<mesh/http/>
|
||||||
-<mesh/eth/>
|
-<mesh/eth/>
|
||||||
-<modules/esp32>
|
-<modules/esp32>
|
||||||
-<modules/Telemetry>
|
-<modules/Telemetry/EnvironmentTelemetry.cpp>
|
||||||
|
-<modules/Telemetry/AirQualityTelemetry.cpp>
|
||||||
|
-<modules/Telemetry/Sensor>
|
||||||
+<../variants/portduino>
|
+<../variants/portduino>
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
${networking_base.lib_deps}
|
${networking_base.lib_deps}
|
||||||
rweather/Crypto@^0.4.0
|
rweather/Crypto@^0.4.0
|
||||||
build_flags = ${arduino_base.build_flags} -Isrc/platform/portduino
|
|
||||||
|
build_flags =
|
||||||
|
${arduino_base.build_flags}
|
||||||
|
-fPIC
|
||||||
|
-Isrc/platform/portduino
|
||||||
|
-DRADIOLIB_EEPROM_UNSUPPORTED
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
; Common settings for rp2040 Processor based targets
|
; Common settings for rp2040 Processor based targets
|
||||||
[rp2040_base]
|
[rp2040_base]
|
||||||
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#5ce1a228e7cae453f366deb8962252b9b7356bbc
|
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#612de5399d68b359053f1307ed223d400aea975c
|
||||||
extends = arduino_base
|
extends = arduino_base
|
||||||
|
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#3.6.2
|
||||||
|
|
||||||
board_build.core = earlephilhower
|
board_build.core = earlephilhower
|
||||||
board_build.filesystem_size = 0.5m
|
board_build.filesystem_size = 0.5m
|
||||||
build_flags =
|
build_flags =
|
||||||
@@ -10,10 +12,12 @@ build_flags =
|
|||||||
-D__PLAT_RP2040__
|
-D__PLAT_RP2040__
|
||||||
# -D _POSIX_THREADS
|
# -D _POSIX_THREADS
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mqtt/> -<platform/nrf52/> -<platform/stm32wl> -<mesh/eth/>
|
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<modules/esp32> -<platform/nrf52/> -<platform/stm32wl> -<mesh/eth/> -<mesh/wifi/> -<mesh/http/>
|
||||||
|
|
||||||
lib_ignore =
|
lib_ignore =
|
||||||
BluetoothOTA
|
BluetoothOTA
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${arduino_base.lib_deps}
|
${arduino_base.lib_deps}
|
||||||
${environmental_base.lib_deps}
|
${environmental_base.lib_deps}
|
||||||
https://github.com/kokke/tiny-AES-c.git#f06ac37fc31dfdaca2e0d9bec83f90d5663c319b
|
rweather/Crypto
|
||||||
@@ -1,18 +1,28 @@
|
|||||||
[stm32wl5e_base]
|
[stm32wl5e_base]
|
||||||
platform = platformio/ststm32@^15.4.1
|
platform_packages = platformio/framework-arduinoststm32 @ https://github.com/stm32duino/Arduino_Core_STM32.git#6e3f9910d0122e82a6c3438507dfac3d2fd80a39
|
||||||
|
platform = ststm32
|
||||||
board = generic_wl5e
|
board = generic_wl5e
|
||||||
framework = arduino
|
framework = arduino
|
||||||
|
|
||||||
build_type = debug
|
build_type = debug
|
||||||
|
|
||||||
build_flags =
|
build_flags =
|
||||||
${arduino_base.build_flags}
|
${arduino_base.build_flags}
|
||||||
-Isrc/platform/stm32wl -g
|
-Isrc/platform/stm32wl -g
|
||||||
-DHAL_SUBGHZ_MODULE_ENABLED
|
-DconfigUSE_CMSIS_RTOS_V2=1
|
||||||
# Arduino/PlatformIO framework-arduinoststm32 package does not presently have SUBGHZSPI support
|
-DVECT_TAB_OFFSET=0x08000000
|
||||||
# -DPIN_SPI_MOSI=PINSUBGHZSPIMOSI -DPIN_SPI_MISO=PINSUBGHZSPIMISO -DPIN_SPI_SCK=PINSUBGHZSPISCK
|
|
||||||
build_src_filter =
|
build_src_filter =
|
||||||
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mesh/eth/> -<mqtt/> -<graphics> -<input> -<buzz> -<modules/Telemetry> -<platform/nrf52> -<platform/portduino> -<platform/rp2040>
|
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/api/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mesh/eth/> -<input> -<buzz> -<modules/Telemetry> -<platform/nrf52> -<platform/portduino> -<platform/rp2040>
|
||||||
|
|
||||||
|
board_upload.offset_address = 0x08000000
|
||||||
|
upload_protocol = stlink
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
https://github.com/kokke/tiny-AES-c.git#f06ac37fc31dfdaca2e0d9bec83f90d5663c319b
|
https://github.com/kokke/tiny-AES-c.git#f06ac37fc31dfdaca2e0d9bec83f90d5663c319b
|
||||||
lib_ignore =
|
https://github.com/littlefs-project/littlefs.git#v2.5.1
|
||||||
mathertel/OneButton@^2.0.3
|
https://github.com/stm32duino/STM32FreeRTOS.git#10.3.1
|
||||||
|
|
||||||
|
lib_ignore =
|
||||||
|
mathertel/OneButton
|
||||||
@@ -34,7 +34,7 @@ SRCBIN=.pio/build/$1/firmware.bin
|
|||||||
cp $SRCBIN $OUTDIR/$basename-update.bin
|
cp $SRCBIN $OUTDIR/$basename-update.bin
|
||||||
|
|
||||||
echo "Building Filesystem for ESP32 targets"
|
echo "Building Filesystem for ESP32 targets"
|
||||||
pio run --environment tbeam -t buildfs
|
pio run --environment $1 -t buildfs
|
||||||
cp .pio/build/tbeam/littlefs.bin $OUTDIR/littlefs-$VERSION.bin
|
cp .pio/build/$1/littlefs.bin $OUTDIR/littlefs-$VERSION.bin
|
||||||
cp bin/device-install.* $OUTDIR
|
cp bin/device-install.* $OUTDIR
|
||||||
cp bin/device-update.* $OUTDIR
|
cp bin/device-update.* $OUTDIR
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
VERSION=`bin/buildinfo.py long`
|
VERSION=$(bin/buildinfo.py long)
|
||||||
SHORT_VERSION=`bin/buildinfo.py short`
|
SHORT_VERSION=$(bin/buildinfo.py short)
|
||||||
|
|
||||||
OUTDIR=release/
|
OUTDIR=release/
|
||||||
|
|
||||||
@@ -13,11 +13,15 @@ mkdir -p $OUTDIR/
|
|||||||
rm -r $OUTDIR/* || true
|
rm -r $OUTDIR/* || true
|
||||||
|
|
||||||
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
|
||||||
platformio pkg update
|
platformio pkg update
|
||||||
|
|
||||||
pio run --environment native
|
if command -v raspi-config &>/dev/null; then
|
||||||
cp .pio/build/native/program $OUTDIR/meshtasticd_linux_amd64
|
pio run --environment raspbian
|
||||||
|
cp .pio/build/raspbian/program $OUTDIR/meshtasticd_linux_arm64
|
||||||
|
else
|
||||||
|
pio run --environment native
|
||||||
|
cp .pio/build/native/program $OUTDIR/meshtasticd_linux_amd64
|
||||||
|
fi
|
||||||
|
|
||||||
cp bin/device-install.* $OUTDIR
|
cp bin/device-install.* $OUTDIR
|
||||||
cp bin/device-update.* $OUTDIR
|
cp bin/device-update.* $OUTDIR
|
||||||
|
|
||||||
|
|||||||
@@ -4,23 +4,23 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
VERSION=`bin/buildinfo.py long`
|
VERSION=$(bin/buildinfo.py long)
|
||||||
|
|
||||||
# The shell vars the build tool expects to find
|
# The shell vars the build tool expects to find
|
||||||
export APP_VERSION=$VERSION
|
export APP_VERSION=$VERSION
|
||||||
|
|
||||||
if [[ $# -gt 0 ]]; then
|
if [[ $# -gt 0 ]]; then
|
||||||
# can override which environment by passing arg
|
# can override which environment by passing arg
|
||||||
BOARDS="$@"
|
BOARDS="$@"
|
||||||
else
|
else
|
||||||
BOARDS="tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec-v1 heltec-v2.0 heltec-v2.1 tbeam0.7 meshtastic-diy-v1 rak4631 rak4631_eink rak11200 t-echo pca10059_diy_eink"
|
BOARDS="tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec-v1 heltec-v2.0 heltec-v2.1 tbeam0.7 meshtastic-diy-v1 rak4631 rak4631_eink rak11200 t-echo pca10059_diy_eink"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "BOARDS:${BOARDS}"
|
echo "BOARDS:${BOARDS}"
|
||||||
|
|
||||||
CHECK=""
|
CHECK=""
|
||||||
for BOARD in $BOARDS; do
|
for BOARD in $BOARDS; do
|
||||||
CHECK="${CHECK} -e ${BOARD}"
|
CHECK="${CHECK} -e ${BOARD}"
|
||||||
done
|
done
|
||||||
|
|
||||||
pio check --flags "-DAPP_VERSION=${APP_VERSION} --suppressions-list=suppressions.txt" $CHECK --skip-packages --pattern="src/" --fail-on-defect=low --fail-on-defect=medium --fail-on-defect=high
|
pio check --flags "-DAPP_VERSION=${APP_VERSION} --suppressions-list=suppressions.txt" $CHECK --skip-packages --pattern="src/" --fail-on-defect=medium --fail-on-defect=high
|
||||||
|
|||||||
64
bin/config-dist.yaml
Normal file
64
bin/config-dist.yaml
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
### Define your devices here using Broadcom pin numbering
|
||||||
|
### Uncomment the block that corresponds to your hardware
|
||||||
|
---
|
||||||
|
Lora:
|
||||||
|
# Module: sx1262 # Waveshare SX126X XXXM
|
||||||
|
# DIO2_AS_RF_SWITCH: true
|
||||||
|
# CS: 21
|
||||||
|
# IRQ: 16
|
||||||
|
# Busy: 20
|
||||||
|
# Reset: 18
|
||||||
|
|
||||||
|
# Module: sx1262 # Waveshare SX1302 LISTEN ONLY AT THIS TIME!
|
||||||
|
# CS: 7
|
||||||
|
# IRQ: 17
|
||||||
|
# Reset: 22
|
||||||
|
|
||||||
|
# Module: RF95 # Adafruit RFM9x
|
||||||
|
# Reset: 25
|
||||||
|
# CS: 7
|
||||||
|
# IRQ: 22
|
||||||
|
# Busy: 23
|
||||||
|
|
||||||
|
# Module: RF95 # Elecrow Lora RFM95 IOT https://www.elecrow.com/lora-rfm95-iot-board-for-rpi.html
|
||||||
|
# Reset: 22
|
||||||
|
# CS: 7
|
||||||
|
# IRQ: 25
|
||||||
|
|
||||||
|
### Set gpio chip to use in /dev/. Defaults to 0.
|
||||||
|
### Notably the Raspberry Pi 5 puts the GPIO header on gpiochip4
|
||||||
|
# gpiochip: 4
|
||||||
|
|
||||||
|
### Define GPIO buttons here:
|
||||||
|
|
||||||
|
GPIO:
|
||||||
|
# User: 6
|
||||||
|
|
||||||
|
### Define GPS
|
||||||
|
|
||||||
|
GPS:
|
||||||
|
# SerialPath: /dev/ttyS0
|
||||||
|
|
||||||
|
### Set up SPI displays here. Note that I2C displays are generally auto-detected.
|
||||||
|
|
||||||
|
Display:
|
||||||
|
|
||||||
|
### Waveshare 2.8inch RPi LCD
|
||||||
|
# Panel: ST7789
|
||||||
|
# CS: 8
|
||||||
|
# DC: 22 # Data/Command pin
|
||||||
|
# Backlight: 18
|
||||||
|
# Width: 240
|
||||||
|
# Height: 320
|
||||||
|
# Reset: 27
|
||||||
|
# Rotate: true
|
||||||
|
|
||||||
|
Touchscreen:
|
||||||
|
# Module: XPT2046
|
||||||
|
# CS: 7
|
||||||
|
# IRQ: 17
|
||||||
|
|
||||||
|
### Configure device for direct keyboard input
|
||||||
|
|
||||||
|
Input:
|
||||||
|
# KeyboardDevice: /dev/input/event0
|
||||||
@@ -30,7 +30,13 @@ IF EXIST %FILENAME% IF x%FILENAME:update=%==x%FILENAME% (
|
|||||||
echo Trying to flash update %FILENAME%, but first erasing and writing system information"
|
echo Trying to flash update %FILENAME%, but first erasing and writing system information"
|
||||||
%PYTHON% -m esptool --baud 115200 erase_flash
|
%PYTHON% -m esptool --baud 115200 erase_flash
|
||||||
%PYTHON% -m esptool --baud 115200 write_flash 0x00 %FILENAME%
|
%PYTHON% -m esptool --baud 115200 write_flash 0x00 %FILENAME%
|
||||||
%PYTHON% -m esptool --baud 115200 write_flash 0x260000 bleota.bin
|
|
||||||
|
@REM Account for S3 board's different OTA partition
|
||||||
|
IF x%FILENAME:s3=%==x%FILENAME% IF x%FILENAME:v3=%==x%FILENAME% IF x%FILENAME:t-deck=%==x%FILENAME% IF x%FILENAME:wireless-paper=%==x%FILENAME% IF x%FILENAME:wireless-tracker=%==x%FILENAME% (
|
||||||
|
%PYTHON% -m esptool --baud 115200 write_flash 0x260000 bleota.bin
|
||||||
|
) else (
|
||||||
|
%PYTHON% -m esptool --baud 115200 write_flash 0x260000 bleota-s3.bin
|
||||||
|
)
|
||||||
for %%f in (littlefs-*.bin) do (
|
for %%f in (littlefs-*.bin) do (
|
||||||
%PYTHON% -m esptool --baud 115200 write_flash 0x300000 %%f
|
%PYTHON% -m esptool --baud 115200 write_flash 0x300000 %%f
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -45,11 +45,16 @@ shift "$((OPTIND-1))"
|
|||||||
shift
|
shift
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -f "${FILENAME}" ] && [[ "${FILENAME}" != *"update"* ]]; then
|
if [ -f "${FILENAME}" ] && [ ! -z "${FILENAME##*"update"*}" ]; then
|
||||||
echo "Trying to flash ${FILENAME}, but first erasing and writing system information"
|
echo "Trying to flash ${FILENAME}, but first erasing and writing system information"
|
||||||
"$PYTHON" -m esptool erase_flash
|
"$PYTHON" -m esptool erase_flash
|
||||||
"$PYTHON" -m esptool write_flash 0x00 ${FILENAME}
|
"$PYTHON" -m esptool write_flash 0x00 ${FILENAME}
|
||||||
"$PYTHON" -m esptool write_flash 0x260000 bleota.bin
|
# Account for S3 board's different OTA partition
|
||||||
|
if [ ! -z "${FILENAME##*"s3"*}" ] && [ ! -z "${FILENAME##*"-v3"*}" ] && [ ! -z "${FILENAME##*"t-deck"*}" ] && [ ! -z "${FILENAME##*"wireless-paper"*}" ] && [ ! -z "${FILENAME##*"wireless-tracker"*}" ]; then
|
||||||
|
"$PYTHON" -m esptool write_flash 0x260000 bleota.bin
|
||||||
|
else
|
||||||
|
"$PYTHON" -m esptool write_flash 0x260000 bleota-s3.bin
|
||||||
|
fi
|
||||||
"$PYTHON" -m esptool write_flash 0x300000 littlefs-*.bin
|
"$PYTHON" -m esptool write_flash 0x300000 littlefs-*.bin
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ shift "$((OPTIND-1))"
|
|||||||
shift
|
shift
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -f "${FILENAME}" ] && [[ $FILENAME == *"update"* ]]; then
|
if [ -f "${FILENAME}" ] && [ -z "${FILENAME##*"update"*}" ]; then
|
||||||
printf "Trying to flash update ${FILENAME}"
|
printf "Trying to flash update ${FILENAME}"
|
||||||
$PYTHON -m esptool --baud 115200 write_flash 0x10000 ${FILENAME}
|
$PYTHON -m esptool --baud 115200 write_flash 0x10000 ${FILENAME}
|
||||||
else
|
else
|
||||||
|
|||||||
38
bin/generate_ci_matrix.py
Executable file
38
bin/generate_ci_matrix.py
Executable file
@@ -0,0 +1,38 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
"""Generate the CI matrix"""
|
||||||
|
|
||||||
|
import configparser
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
rootdir = "variants/"
|
||||||
|
|
||||||
|
options = sys.argv[1:]
|
||||||
|
|
||||||
|
outlist = []
|
||||||
|
|
||||||
|
if len(options) < 1:
|
||||||
|
print(json.dumps(outlist))
|
||||||
|
exit()
|
||||||
|
|
||||||
|
for subdir, dirs, files in os.walk(rootdir):
|
||||||
|
for file in files:
|
||||||
|
if file == "platformio.ini":
|
||||||
|
config = configparser.ConfigParser()
|
||||||
|
config.read(subdir + "/" + file)
|
||||||
|
for c in config.sections():
|
||||||
|
if c.startswith("env:"):
|
||||||
|
section = config[c].name[4:]
|
||||||
|
if "extends" in config[config[c].name]:
|
||||||
|
if config[config[c].name]["extends"] == options[0] + "_base":
|
||||||
|
if "board_level" in config[config[c].name]:
|
||||||
|
if (
|
||||||
|
config[config[c].name]["board_level"] == "extra"
|
||||||
|
) & ("extra" in options):
|
||||||
|
outlist.append(section)
|
||||||
|
else:
|
||||||
|
outlist.append(section)
|
||||||
|
|
||||||
|
print(json.dumps(outlist))
|
||||||
12
bin/meshtasticd.service
Normal file
12
bin/meshtasticd.service
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Meshtastic Native Daemon
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=root
|
||||||
|
Group=root
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/sbin/meshtasticd
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
10
bin/native-install.sh
Executable file
10
bin/native-install.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
cp release/meshtasticd_linux_arm64 /usr/sbin/meshtasticd
|
||||||
|
mkdir /etc/meshtasticd
|
||||||
|
if [[ -f "/etc/meshtasticd/config.yaml" ]]; then
|
||||||
|
cp bin/config-dist.yaml /etc/meshtasticd/config-upgrade.yaml
|
||||||
|
else
|
||||||
|
cp bin/config-dist.yaml /etc/meshtasticd/config.yaml
|
||||||
|
fi
|
||||||
|
cp bin/meshtasticd.service /usr/lib/systemd/system/meshtasticd.service
|
||||||
@@ -22,9 +22,9 @@ def readProps(prefsLoc):
|
|||||||
isDirty = subprocess.check_output(
|
isDirty = subprocess.check_output(
|
||||||
['git', 'diff', 'HEAD']).decode("utf-8").strip()
|
['git', 'diff', 'HEAD']).decode("utf-8").strip()
|
||||||
suffix = sha
|
suffix = sha
|
||||||
if isDirty:
|
# if isDirty:
|
||||||
# short for 'dirty', we want to keep our verstrings source for protobuf reasons
|
# # short for 'dirty', we want to keep our verstrings source for protobuf reasons
|
||||||
suffix = sha + "-d"
|
# suffix = sha + "-d"
|
||||||
verObj['long'] = "{}.{}.{}.{}".format(
|
verObj['long'] = "{}.{}.{}.{}".format(
|
||||||
version["major"], version["minor"], version["build"], suffix)
|
version["major"], version["minor"], version["build"], suffix)
|
||||||
except:
|
except:
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
cd protobufs && ..\nanopb-0.4.6\generator-bin\protoc.exe --nanopb_out=-v:..\src\mesh\generated -I=..\protobufs *.proto
|
cd protobufs && ..\nanopb-0.4.7\generator-bin\protoc.exe --experimental_allow_proto3_optional --nanopb_out=-v:..\src\mesh\generated -I=..\protobufs ..\protobufs\meshtastic\*.proto
|
||||||
|
|||||||
@@ -2,13 +2,18 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "This script requires https://jpa.kapsi.fi/nanopb/download/ version 0.4.6 to be located in the"
|
echo "This script requires https://jpa.kapsi.fi/nanopb/download/ version 0.4.7 to be located in the"
|
||||||
echo "firmware root directory if the following step fails, you should download the correct"
|
echo "firmware root directory if the following step fails, you should download the correct"
|
||||||
echo "prebuilt binaries for your computer into nanopb-0.4.6"
|
echo "prebuilt binaries for your computer into nanopb-0.4.7"
|
||||||
|
|
||||||
# the nanopb tool seems to require that the .options file be in the current directory!
|
# the nanopb tool seems to require that the .options file be in the current directory!
|
||||||
cd protobufs
|
cd protobufs
|
||||||
../nanopb-0.4.6/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated -I=../protobufs *.proto
|
../nanopb-0.4.7/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated/ -I=../protobufs meshtastic/*.proto --experimental_allow_proto3_optional
|
||||||
|
|
||||||
|
# cd ../src/mesh/generated/meshtastic
|
||||||
|
# sed -i 's/#include "meshtastic/#include "./g' -- *
|
||||||
|
|
||||||
|
# sed -i 's/meshtastic_//g' -- *
|
||||||
|
|
||||||
#echo "Regenerating protobuf documentation - if you see an error message"
|
#echo "Regenerating protobuf documentation - if you see an error message"
|
||||||
#echo "you can ignore it unless doing a new protobuf release to github."
|
#echo "you can ignore it unless doing a new protobuf release to github."
|
||||||
|
|||||||
36
boards/bpi_picow_esp32_s3.json
Normal file
36
boards/bpi_picow_esp32_s3.json
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
|
"-DARDUINO_USB_MODE=0",
|
||||||
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
|
"-DARDUINO_EVENT_RUNNING_CORE=1",
|
||||||
|
"-DBOARD_HAS_PSRAM"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "dio",
|
||||||
|
"hwids": [["0x303A", "0x1001"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "bpi_picow_esp32_s3"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi"],
|
||||||
|
"debug": {
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "espidf"],
|
||||||
|
"name": "BPI-PicoW-S3 (8 MB FLASH, 2 MB PSRAM)",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "8MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 8388608,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "https://wiki.banana-pi.org/BPI-PicoW-S3",
|
||||||
|
"vendor": "BPI"
|
||||||
|
}
|
||||||
@@ -7,12 +7,7 @@
|
|||||||
"cpu": "cortex-m4",
|
"cpu": "cortex-m4",
|
||||||
"extra_flags": "-DARDUINO_NRF52840_TTGO_EINK -DNRF52840_XXAA",
|
"extra_flags": "-DARDUINO_NRF52840_TTGO_EINK -DNRF52840_XXAA",
|
||||||
"f_cpu": "64000000L",
|
"f_cpu": "64000000L",
|
||||||
"hwids": [
|
"hwids": [["0x239A", "0x4405"]],
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x4405"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"usb_product": "TTGO_eink",
|
"usb_product": "TTGO_eink",
|
||||||
"mcu": "nrf52840",
|
"mcu": "nrf52840",
|
||||||
"variant": "eink0.1",
|
"variant": "eink0.1",
|
||||||
@@ -30,19 +25,13 @@
|
|||||||
"settings_addr": "0xFF000"
|
"settings_addr": "0xFF000"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"connectivity": ["bluetooth"],
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
"debug": {
|
||||||
"jlink_device": "nRF52840_xxAA",
|
"jlink_device": "nRF52840_xxAA",
|
||||||
"onboard_tools": [
|
"onboard_tools": ["jlink"],
|
||||||
"jlink"
|
|
||||||
],
|
|
||||||
"svd_path": "nrf52840.svd"
|
"svd_path": "nrf52840.svd"
|
||||||
},
|
},
|
||||||
"frameworks": [
|
"frameworks": ["arduino"],
|
||||||
"arduino"
|
|
||||||
],
|
|
||||||
"name": "TTGO eink (Adafruit BSP)",
|
"name": "TTGO eink (Adafruit BSP)",
|
||||||
"upload": {
|
"upload": {
|
||||||
"maximum_ram_size": 248832,
|
"maximum_ram_size": 248832,
|
||||||
@@ -50,12 +39,8 @@
|
|||||||
"require_upload_port": true,
|
"require_upload_port": true,
|
||||||
"speed": 115200,
|
"speed": 115200,
|
||||||
"protocol": "jlink",
|
"protocol": "jlink",
|
||||||
"protocols": [
|
"protocols": ["jlink", "nrfjprog", "stlink"]
|
||||||
"jlink",
|
|
||||||
"nrfjprog",
|
|
||||||
"stlink"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"url": "FIXME",
|
"url": "FIXME",
|
||||||
"vendor": "TTGO"
|
"vendor": "TTGO"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,9 +9,7 @@
|
|||||||
"product_line": "STM32WLE5xx"
|
"product_line": "STM32WLE5xx"
|
||||||
},
|
},
|
||||||
"debug": {
|
"debug": {
|
||||||
"default_tools": [
|
"default_tools": ["stlink"],
|
||||||
"stlink"
|
|
||||||
],
|
|
||||||
"jlink_device": "STM32WLE5CC",
|
"jlink_device": "STM32WLE5CC",
|
||||||
"openocd_target": "stm32wlx",
|
"openocd_target": "stm32wlx",
|
||||||
"svd_path": "STM32WLE5_CM4.svd"
|
"svd_path": "STM32WLE5_CM4.svd"
|
||||||
@@ -22,9 +20,7 @@
|
|||||||
"maximum_ram_size": 65536,
|
"maximum_ram_size": 65536,
|
||||||
"maximum_size": 262144,
|
"maximum_size": 262144,
|
||||||
"protocol": "cmsis-dap",
|
"protocol": "cmsis-dap",
|
||||||
"protocols": [
|
"protocols": ["cmsis-dap", "stlink"]
|
||||||
"cmsis-dap"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"url": "https://www.st.com/en/microcontrollers-microprocessors/stm32wl-series.html",
|
"url": "https://www.st.com/en/microcontrollers-microprocessors/stm32wl-series.html",
|
||||||
"vendor": "ST"
|
"vendor": "ST"
|
||||||
|
|||||||
38
boards/heltec_wireless_tracker.json
Normal file
38
boards/heltec_wireless_tracker.json
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld",
|
||||||
|
"partitions": "default_8MB.csv"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DHELTEC_WIRELESS_TRACKER",
|
||||||
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
|
"-DARDUINO_USB_MODE=0",
|
||||||
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
|
"-DARDUINO_EVENT_RUNNING_CORE=1"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "qio",
|
||||||
|
"hwids": [["0x303A", "0x1001"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "heltec_wireless_tracker"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi", "bluetooth", "lora"],
|
||||||
|
"debug": {
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "espidf"],
|
||||||
|
"name": "Heltec Wireless Tracker",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "8MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 8388608,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "https://heltec.org/project/wireless-tracker/",
|
||||||
|
"vendor": "Heltec"
|
||||||
|
}
|
||||||
@@ -19,16 +19,12 @@
|
|||||||
"sd_fwid": "0x00B7"
|
"sd_fwid": "0x00B7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"connectivity": ["bluetooth"],
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
"debug": {
|
||||||
"jlink_device": "nRF52832_xxAA",
|
"jlink_device": "nRF52832_xxAA",
|
||||||
"svd_path": "nrf52.svd"
|
"svd_path": "nrf52.svd"
|
||||||
},
|
},
|
||||||
"frameworks": [
|
"frameworks": ["arduino"],
|
||||||
"arduino"
|
|
||||||
],
|
|
||||||
"name": "lora ISP4520",
|
"name": "lora ISP4520",
|
||||||
"upload": {
|
"upload": {
|
||||||
"maximum_ram_size": 65536,
|
"maximum_ram_size": 65536,
|
||||||
@@ -36,13 +32,8 @@
|
|||||||
"require_upload_port": true,
|
"require_upload_port": true,
|
||||||
"speed": 115200,
|
"speed": 115200,
|
||||||
"protocol": "nrfutil",
|
"protocol": "nrfutil",
|
||||||
"protocols": [
|
"protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"]
|
||||||
"jlink",
|
|
||||||
"nrfjprog",
|
|
||||||
"nrfutil",
|
|
||||||
"stlink"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"url": "",
|
"url": "",
|
||||||
"vendor": "PsiSoft"
|
"vendor": "PsiSoft"
|
||||||
}
|
}
|
||||||
|
|||||||
41
boards/my-esp32s3-diy-oled.json
Normal file
41
boards/my-esp32s3-diy-oled.json
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld",
|
||||||
|
"memory_type": "qio_opi"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DBOARD_HAS_PSRAM",
|
||||||
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
|
"-DARDUINO_USB_MODE=0",
|
||||||
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
|
"-DARDUINO_EVENT_RUNNING_CORE=0"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "qio",
|
||||||
|
"hwids": [["0x303A", "0x1001"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "my-esp32s3-diy-oled"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi"],
|
||||||
|
"debug": {
|
||||||
|
"default_tool": "esp-builtin",
|
||||||
|
"onboard_tools": ["esp-builtin"],
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "espidf"],
|
||||||
|
"name": "Clone ESP32-S3-DevKitC-1 v1.1 (16 MB FLASH, 8 MB PSRAM)",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "16MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 16777216,
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html",
|
||||||
|
"vendor": "Espressif"
|
||||||
|
}
|
||||||
41
boards/my_esp32s3_diy_eink.json
Normal file
41
boards/my_esp32s3_diy_eink.json
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld",
|
||||||
|
"memory_type": "qio_opi"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DBOARD_HAS_PSRAM",
|
||||||
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
|
"-DARDUINO_USB_MODE=0",
|
||||||
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
|
"-DARDUINO_EVENT_RUNNING_CORE=0"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "qio",
|
||||||
|
"hwids": [["0x303A", "0x1001"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "my_esp32s3_diy_eink"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi"],
|
||||||
|
"debug": {
|
||||||
|
"default_tool": "esp-builtin",
|
||||||
|
"onboard_tools": ["esp-builtin"],
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "espidf"],
|
||||||
|
"name": "Clone ESP32-S3-DevKitC-1 v1.1 (16 MB FLASH, 8 MB PSRAM)",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "16MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 16777216,
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html",
|
||||||
|
"vendor": "Espressif"
|
||||||
|
}
|
||||||
51
boards/nano-g2-ultra.json
Normal file
51
boards/nano-g2-ultra.json
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "nrf52840_s140_v6.ld"
|
||||||
|
},
|
||||||
|
"core": "nRF5",
|
||||||
|
"cpu": "cortex-m4",
|
||||||
|
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
|
||||||
|
"f_cpu": "64000000L",
|
||||||
|
"hwids": [
|
||||||
|
["0x239A", "0x8029"],
|
||||||
|
["0x239A", "0x0029"],
|
||||||
|
["0x239A", "0x002A"],
|
||||||
|
["0x239A", "0x802A"]
|
||||||
|
],
|
||||||
|
"usb_product": "BQ nRF52840",
|
||||||
|
"mcu": "nrf52840",
|
||||||
|
"variant": "nano-g2-ultra",
|
||||||
|
"bsp": {
|
||||||
|
"name": "adafruit"
|
||||||
|
},
|
||||||
|
"softdevice": {
|
||||||
|
"sd_flags": "-DS140",
|
||||||
|
"sd_name": "s140",
|
||||||
|
"sd_version": "6.1.1",
|
||||||
|
"sd_fwid": "0x00B6"
|
||||||
|
},
|
||||||
|
"bootloader": {
|
||||||
|
"settings_addr": "0xFF000"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"connectivity": ["bluetooth"],
|
||||||
|
"debug": {
|
||||||
|
"jlink_device": "nRF52840_xxAA",
|
||||||
|
"svd_path": "nrf52840.svd"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino"],
|
||||||
|
"name": "BQ nRF52840",
|
||||||
|
"upload": {
|
||||||
|
"maximum_ram_size": 248832,
|
||||||
|
"maximum_size": 815104,
|
||||||
|
"speed": 115200,
|
||||||
|
"protocol": "nrfutil",
|
||||||
|
"protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"],
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"wait_for_upload_port": true
|
||||||
|
},
|
||||||
|
"url": "https://wiki.uniteng.com/en/meshtastic/nano-g2-ultra",
|
||||||
|
"vendor": "BQ Consulting"
|
||||||
|
}
|
||||||
@@ -1,72 +1,51 @@
|
|||||||
{
|
{
|
||||||
"build": {
|
"build": {
|
||||||
"arduino": {
|
"arduino": {
|
||||||
"ldscript": "nrf52840_s140_v6.ld"
|
"ldscript": "nrf52840_s140_v6.ld"
|
||||||
},
|
|
||||||
"core": "nRF5",
|
|
||||||
"cpu": "cortex-m4",
|
|
||||||
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
|
|
||||||
"f_cpu": "64000000L",
|
|
||||||
"hwids": [
|
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x8029"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x0029"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x002A"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x802A"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"usb_product": "PCA10059",
|
|
||||||
"mcu": "nrf52840",
|
|
||||||
"variant": "nRF52840 Dongle",
|
|
||||||
"bsp": {
|
|
||||||
"name": "adafruit"
|
|
||||||
},
|
|
||||||
"softdevice": {
|
|
||||||
"sd_flags": "-DS140",
|
|
||||||
"sd_name": "s140",
|
|
||||||
"sd_version": "6.1.1",
|
|
||||||
"sd_fwid": "0x00B6"
|
|
||||||
},
|
|
||||||
"bootloader": {
|
|
||||||
"settings_addr": "0xFF000"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"core": "nRF5",
|
||||||
"bluetooth"
|
"cpu": "cortex-m4",
|
||||||
|
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
|
||||||
|
"f_cpu": "64000000L",
|
||||||
|
"hwids": [
|
||||||
|
["0x239A", "0x8029"],
|
||||||
|
["0x239A", "0x0029"],
|
||||||
|
["0x239A", "0x002A"],
|
||||||
|
["0x239A", "0x802A"]
|
||||||
],
|
],
|
||||||
"debug": {
|
"usb_product": "PCA10059",
|
||||||
"jlink_device": "nRF52840_xxAA",
|
"mcu": "nrf52840",
|
||||||
"svd_path": "nrf52840.svd"
|
"variant": "nRF52840 Dongle",
|
||||||
|
"bsp": {
|
||||||
|
"name": "adafruit"
|
||||||
},
|
},
|
||||||
"frameworks": [
|
"softdevice": {
|
||||||
"arduino"
|
"sd_flags": "-DS140",
|
||||||
],
|
"sd_name": "s140",
|
||||||
"name": "nRF52840 Dongle",
|
"sd_version": "6.1.1",
|
||||||
"upload": {
|
"sd_fwid": "0x00B6"
|
||||||
"maximum_ram_size": 248832,
|
|
||||||
"maximum_size": 815104,
|
|
||||||
"speed": 115200,
|
|
||||||
"protocol": "nrfutil",
|
|
||||||
"protocols": [
|
|
||||||
"jlink",
|
|
||||||
"nrfjprog",
|
|
||||||
"nrfutil",
|
|
||||||
"stlink"
|
|
||||||
],
|
|
||||||
"use_1200bps_touch": true,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"wait_for_upload_port": true
|
|
||||||
},
|
},
|
||||||
"url": "https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle",
|
"bootloader": {
|
||||||
"vendor": "Nordic Semiconductor"
|
"settings_addr": "0xFF000"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"connectivity": ["bluetooth"],
|
||||||
|
"debug": {
|
||||||
|
"jlink_device": "nRF52840_xxAA",
|
||||||
|
"svd_path": "nrf52840.svd"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino"],
|
||||||
|
"name": "nRF52840 Dongle",
|
||||||
|
"upload": {
|
||||||
|
"maximum_ram_size": 248832,
|
||||||
|
"maximum_size": 815104,
|
||||||
|
"speed": 115200,
|
||||||
|
"protocol": "nrfutil",
|
||||||
|
"protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"],
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"wait_for_upload_port": true
|
||||||
|
},
|
||||||
|
"url": "https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle",
|
||||||
|
"vendor": "Nordic Semiconductor"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,47 +1,46 @@
|
|||||||
{
|
{
|
||||||
"build": {
|
"build": {
|
||||||
"arduino": {
|
"arduino": {
|
||||||
"ldscript": "nrf52840_s140_v6.ld"
|
"ldscript": "nrf52840_s140_v6.ld"
|
||||||
},
|
|
||||||
"core": "nRF5",
|
|
||||||
"cpu": "cortex-m4",
|
|
||||||
"extra_flags": "-DARDUINO_NRF52840_PCA10056 -DNRF52840_XXAA",
|
|
||||||
"f_cpu": "64000000L",
|
|
||||||
"hwids": [["0x239A", "0x4404"]],
|
|
||||||
"usb_product": "nrf52840dk",
|
|
||||||
"mcu": "nrf52840",
|
|
||||||
"variant": "pca10056",
|
|
||||||
"variants_dir": "variants",
|
|
||||||
"bsp": {
|
|
||||||
"name": "adafruit"
|
|
||||||
},
|
|
||||||
"softdevice": {
|
|
||||||
"sd_flags": "-DS140",
|
|
||||||
"sd_name": "s140",
|
|
||||||
"sd_version": "6.1.1",
|
|
||||||
"sd_fwid": "0x00B6"
|
|
||||||
},
|
|
||||||
"bootloader": {
|
|
||||||
"settings_addr": "0xFF000"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"connectivity": ["bluetooth"],
|
"core": "nRF5",
|
||||||
"debug": {
|
"cpu": "cortex-m4",
|
||||||
"jlink_device": "nRF52840_xxAA",
|
"extra_flags": "-DARDUINO_NRF52840_PCA10056 -DNRF52840_XXAA",
|
||||||
"onboard_tools": ["jlink"],
|
"f_cpu": "64000000L",
|
||||||
"svd_path": "nrf52840.svd"
|
"hwids": [["0x239A", "0x4404"]],
|
||||||
|
"usb_product": "nrf52840dk",
|
||||||
|
"mcu": "nrf52840",
|
||||||
|
"variant": "pca10056",
|
||||||
|
"variants_dir": "variants",
|
||||||
|
"bsp": {
|
||||||
|
"name": "adafruit"
|
||||||
},
|
},
|
||||||
"frameworks": ["arduino"],
|
"softdevice": {
|
||||||
"name": "A modified NRF52840-DK devboard (Adafruit BSP)",
|
"sd_flags": "-DS140",
|
||||||
"upload": {
|
"sd_name": "s140",
|
||||||
"maximum_ram_size": 248832,
|
"sd_version": "6.1.1",
|
||||||
"maximum_size": 815104,
|
"sd_fwid": "0x00B6"
|
||||||
"require_upload_port": true,
|
|
||||||
"speed": 115200,
|
|
||||||
"protocol": "jlink",
|
|
||||||
"protocols": ["jlink", "nrfjprog", "stlink"]
|
|
||||||
},
|
},
|
||||||
"url": "https://meshtastic.org/",
|
"bootloader": {
|
||||||
"vendor": "Nordic Semi"
|
"settings_addr": "0xFF000"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"connectivity": ["bluetooth"],
|
||||||
|
"debug": {
|
||||||
|
"jlink_device": "nRF52840_xxAA",
|
||||||
|
"onboard_tools": ["jlink"],
|
||||||
|
"svd_path": "nrf52840.svd"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino"],
|
||||||
|
"name": "A modified NRF52840-DK devboard (Adafruit BSP)",
|
||||||
|
"upload": {
|
||||||
|
"maximum_ram_size": 248832,
|
||||||
|
"maximum_size": 815104,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 115200,
|
||||||
|
"protocol": "jlink",
|
||||||
|
"protocols": ["jlink", "nrfjprog", "stlink"]
|
||||||
|
},
|
||||||
|
"url": "https://meshtastic.org/",
|
||||||
|
"vendor": "Nordic Semi"
|
||||||
|
}
|
||||||
|
|||||||
41
boards/t-deck.json
Normal file
41
boards/t-deck.json
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld",
|
||||||
|
"memory_type": "qio_opi"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DBOARD_HAS_PSRAM",
|
||||||
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
|
"-DARDUINO_USB_MODE=0",
|
||||||
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
|
"-DARDUINO_EVENT_RUNNING_CORE=0"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "qio",
|
||||||
|
"hwids": [["0x303A", "0x1001"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "t-deck"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi", "bluetooth", "lora"],
|
||||||
|
"debug": {
|
||||||
|
"default_tool": "esp-builtin",
|
||||||
|
"onboard_tools": ["esp-builtin"],
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "espidf"],
|
||||||
|
"name": "Espressif Systems LilyGO T-Deck (16 MB FLASH, 8 MB PSRAM)",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "16MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 16777216,
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "https://www.lilygo.cc/en-pl/products/t-deck",
|
||||||
|
"vendor": "LilyGO"
|
||||||
|
}
|
||||||
@@ -8,10 +8,8 @@
|
|||||||
"extra_flags": "-DARDUINO_NRF52840_TTGO_EINK -DNRF52840_XXAA",
|
"extra_flags": "-DARDUINO_NRF52840_TTGO_EINK -DNRF52840_XXAA",
|
||||||
"f_cpu": "64000000L",
|
"f_cpu": "64000000L",
|
||||||
"hwids": [
|
"hwids": [
|
||||||
[
|
["0x239A", "0x4405"],
|
||||||
"0x239A",
|
["0x239A", "0x002A"]
|
||||||
"0x4405"
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
"usb_product": "TTGO_eink",
|
"usb_product": "TTGO_eink",
|
||||||
"mcu": "nrf52840",
|
"mcu": "nrf52840",
|
||||||
@@ -30,35 +28,24 @@
|
|||||||
"settings_addr": "0xFF000"
|
"settings_addr": "0xFF000"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"connectivity": ["bluetooth"],
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
"debug": {
|
||||||
"jlink_device": "nRF52840_xxAA",
|
"jlink_device": "nRF52840_xxAA",
|
||||||
"onboard_tools": [
|
"onboard_tools": ["jlink"],
|
||||||
"jlink"
|
|
||||||
],
|
|
||||||
"svd_path": "nrf52840.svd"
|
"svd_path": "nrf52840.svd"
|
||||||
},
|
},
|
||||||
"frameworks": [
|
"frameworks": ["arduino"],
|
||||||
"arduino"
|
|
||||||
],
|
|
||||||
"name": "TTGO eink (Adafruit BSP)",
|
"name": "TTGO eink (Adafruit BSP)",
|
||||||
"upload": {
|
"upload": {
|
||||||
"maximum_ram_size": 248832,
|
"maximum_ram_size": 248832,
|
||||||
"maximum_size": 815104,
|
"maximum_size": 815104,
|
||||||
"speed": 115200,
|
"speed": 115200,
|
||||||
"protocol": "nrfutil",
|
"protocol": "nrfutil",
|
||||||
"protocols": [
|
"protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"],
|
||||||
"jlink",
|
"use_1200bps_touch": true,
|
||||||
"nrfjprog",
|
"require_upload_port": true,
|
||||||
"nrfutil",
|
"wait_for_upload_port": true
|
||||||
"stlink"
|
|
||||||
],
|
|
||||||
"use_1200bps_touch": true,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"wait_for_upload_port": true
|
|
||||||
},
|
},
|
||||||
"url": "FIXME",
|
"url": "FIXME",
|
||||||
"vendor": "TTGO"
|
"vendor": "TTGO"
|
||||||
}
|
}
|
||||||
|
|||||||
40
boards/t-watch-s3.json
Normal file
40
boards/t-watch-s3.json
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld",
|
||||||
|
"memory_type": "qio_opi"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DBOARD_HAS_PSRAM",
|
||||||
|
"-DT_WATCH_S3",
|
||||||
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
|
"-DARDUINO_USB_MODE=0",
|
||||||
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
|
"-DARDUINO_EVENT_RUNNING_CORE=1"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "qio",
|
||||||
|
"hwids": [["0x303A", "0x1001"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "t-watch-s3"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi"],
|
||||||
|
"debug": {
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino"],
|
||||||
|
"name": "LilyGo T-Watch 2020 V3",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "8MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 8388608,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "https://www.lilygo.cc/en-pl/products/t-watch-s3",
|
||||||
|
"vendor": "LilyGo"
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"build": {
|
"build": {
|
||||||
"arduino":{
|
"arduino": {
|
||||||
"ldscript": "esp32s3_out.ld"
|
"ldscript": "esp32s3_out.ld"
|
||||||
},
|
},
|
||||||
"core": "esp32",
|
"core": "esp32",
|
||||||
@@ -8,33 +8,22 @@
|
|||||||
"-DBOARD_HAS_PSRAM",
|
"-DBOARD_HAS_PSRAM",
|
||||||
"-DLILYGO_TBEAM_S3_CORE",
|
"-DLILYGO_TBEAM_S3_CORE",
|
||||||
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
"-DARDUINO_USB_DFU_ON_BOOT=1",
|
"-DARDUINO_USB_MODE=0",
|
||||||
"-DARDUINO_USB_MSC_ON_BOOT=1",
|
|
||||||
"-DARDUINO_USB_MODE=1",
|
|
||||||
"-DARDUINO_RUNNING_CORE=1",
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
"-DARDUINO_EVENT_RUNNING_CORE=1"
|
"-DARDUINO_EVENT_RUNNING_CORE=1"
|
||||||
],
|
],
|
||||||
"f_cpu": "240000000L",
|
"f_cpu": "240000000L",
|
||||||
"f_flash": "80000000L",
|
"f_flash": "80000000L",
|
||||||
"flash_mode": "dio",
|
"flash_mode": "dio",
|
||||||
"hwids": [
|
"hwids": [["0x303A", "0x1001"]],
|
||||||
[
|
|
||||||
"0X303A",
|
|
||||||
"0x1001"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"mcu": "esp32s3",
|
"mcu": "esp32s3",
|
||||||
"variant": "tbeam-s3-core"
|
"variant": "tbeam-s3-core"
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"connectivity": ["wifi"],
|
||||||
"wifi"
|
|
||||||
],
|
|
||||||
"debug": {
|
"debug": {
|
||||||
"openocd_target": "esp32s3.cfg"
|
"openocd_target": "esp32s3.cfg"
|
||||||
},
|
},
|
||||||
"frameworks": [
|
"frameworks": ["arduino"],
|
||||||
"arduino"
|
|
||||||
],
|
|
||||||
"name": "LilyGo TBeam-S3-Core",
|
"name": "LilyGo TBeam-S3-Core",
|
||||||
"upload": {
|
"upload": {
|
||||||
"flash_size": "8MB",
|
"flash_size": "8MB",
|
||||||
|
|||||||
38
boards/tlora-t3s3-v1.json
Normal file
38
boards/tlora-t3s3-v1.json
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "esp32s3_out.ld"
|
||||||
|
},
|
||||||
|
"core": "esp32",
|
||||||
|
"extra_flags": [
|
||||||
|
"-DLILYGO_T3S3_V1",
|
||||||
|
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||||
|
"-DARDUINO_USB_MODE=0",
|
||||||
|
"-DARDUINO_RUNNING_CORE=1",
|
||||||
|
"-DARDUINO_EVENT_RUNNING_CORE=1",
|
||||||
|
"-DBOARD_HAS_PSRAM"
|
||||||
|
],
|
||||||
|
"f_cpu": "240000000L",
|
||||||
|
"f_flash": "80000000L",
|
||||||
|
"flash_mode": "dio",
|
||||||
|
"hwids": [["0x303A", "0x1001"]],
|
||||||
|
"mcu": "esp32s3",
|
||||||
|
"variant": "tlora-t3s3-v1"
|
||||||
|
},
|
||||||
|
"connectivity": ["wifi"],
|
||||||
|
"debug": {
|
||||||
|
"openocd_target": "esp32s3.cfg"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino", "espidf"],
|
||||||
|
"name": "LilyGo TLora-T3S3-V1",
|
||||||
|
"upload": {
|
||||||
|
"flash_size": "4MB",
|
||||||
|
"maximum_ram_size": 327680,
|
||||||
|
"maximum_size": 4194304,
|
||||||
|
"wait_for_upload_port": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"speed": 921600
|
||||||
|
},
|
||||||
|
"url": "http://www.lilygo.cn/",
|
||||||
|
"vendor": "LilyGo"
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"build": {
|
"build": {
|
||||||
"arduino":{
|
"arduino": {
|
||||||
"ldscript": "esp32_out.ld"
|
"ldscript": "esp32_out.ld"
|
||||||
},
|
},
|
||||||
"core": "esp32",
|
"core": "esp32",
|
||||||
@@ -11,26 +11,14 @@
|
|||||||
"mcu": "esp32",
|
"mcu": "esp32",
|
||||||
"variant": "WisCore_RAK11200_Board"
|
"variant": "WisCore_RAK11200_Board"
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"connectivity": ["wifi", "bluetooth", "ethernet", "can"],
|
||||||
"wifi",
|
"frameworks": ["arduino", "espidf"],
|
||||||
"bluetooth",
|
|
||||||
"ethernet",
|
|
||||||
"can"
|
|
||||||
],
|
|
||||||
"frameworks": [
|
|
||||||
"arduino",
|
|
||||||
"espidf"
|
|
||||||
],
|
|
||||||
"name": "WisCore RAK11200 Board",
|
"name": "WisCore RAK11200 Board",
|
||||||
"upload": {
|
"upload": {
|
||||||
"flash_size": "4MB",
|
"flash_size": "4MB",
|
||||||
"maximum_ram_size": 327680,
|
"maximum_ram_size": 327680,
|
||||||
"maximum_size": 4194304,
|
"maximum_size": 4194304,
|
||||||
"protocols": [
|
"protocols": ["esptool", "espota", "ftdi"],
|
||||||
"esptool",
|
|
||||||
"espota",
|
|
||||||
"ftdi"
|
|
||||||
],
|
|
||||||
"require_upload_port": true,
|
"require_upload_port": true,
|
||||||
"speed": 460800
|
"speed": 460800
|
||||||
},
|
},
|
||||||
|
|||||||
40
boards/wiscore_rak11300.json
Normal file
40
boards/wiscore_rak11300.json
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"earlephilhower": {
|
||||||
|
"boot2_source": "boot2_w25q080_2_padded_checksum.S",
|
||||||
|
"usb_vid": "0x2E8A",
|
||||||
|
"usb_pid": "0x000A"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"core": "earlephilhower",
|
||||||
|
"cpu": "cortex-m0plus",
|
||||||
|
"extra_flags": "-DARDUINO_GENERIC_RP2040 -DRASPBERRY_PI_PICO -DARDUINO_ARCH_RP2040 -DUSBD_MAX_POWER_MA=250",
|
||||||
|
"f_cpu": "133000000L",
|
||||||
|
"hwids": [
|
||||||
|
["0x2E8A", "0x00C0"],
|
||||||
|
["0x2E8A", "0x000A"]
|
||||||
|
],
|
||||||
|
"mcu": "rp2040",
|
||||||
|
"variant": "WisBlock_RAK11300_Board"
|
||||||
|
},
|
||||||
|
"debug": {
|
||||||
|
"jlink_device": "RP2040_M0_0",
|
||||||
|
"openocd_target": "rp2040.cfg",
|
||||||
|
"svd_path": "rp2040.svd"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino"],
|
||||||
|
"name": "WisBlock RAK11300",
|
||||||
|
"upload": {
|
||||||
|
"maximum_ram_size": 270336,
|
||||||
|
"maximum_size": 2097152,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"native_usb": true,
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"wait_for_upload_port": false,
|
||||||
|
"protocol": "picotool",
|
||||||
|
"protocols": ["cmsis-dap", "raspberrypi-swd", "picotool", "picoprobe"]
|
||||||
|
},
|
||||||
|
"url": "https://docs.rakwireless.com/",
|
||||||
|
"vendor": "RAKwireless"
|
||||||
|
}
|
||||||
@@ -8,22 +8,10 @@
|
|||||||
"extra_flags": "-DNRF52832_XXAA -DNRF52",
|
"extra_flags": "-DNRF52832_XXAA -DNRF52",
|
||||||
"f_cpu": "64000000L",
|
"f_cpu": "64000000L",
|
||||||
"hwids": [
|
"hwids": [
|
||||||
[
|
["0x239A", "0x8029"],
|
||||||
"0x239A",
|
["0x239A", "0x0029"],
|
||||||
"0x8029"
|
["0x239A", "0x002A"],
|
||||||
],
|
["0x239A", "0x802A"]
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x0029"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x002A"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x802A"
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
"usb_product": "Feather nRF52832 Express",
|
"usb_product": "Feather nRF52832 Express",
|
||||||
"mcu": "nrf52832",
|
"mcu": "nrf52832",
|
||||||
@@ -41,17 +29,12 @@
|
|||||||
"variant": "nrf52_adafruit_feather"
|
"variant": "nrf52_adafruit_feather"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"connectivity": ["bluetooth"],
|
||||||
"bluetooth"
|
|
||||||
],
|
|
||||||
"debug": {
|
"debug": {
|
||||||
"jlink_device": "nRF52832_xxAA",
|
"jlink_device": "nRF52832_xxAA",
|
||||||
"svd_path": "nrf52.svd"
|
"svd_path": "nrf52.svd"
|
||||||
},
|
},
|
||||||
"frameworks": [
|
"frameworks": ["arduino", "zephyr"],
|
||||||
"arduino",
|
|
||||||
"zephyr"
|
|
||||||
],
|
|
||||||
"name": "Adafruit Bluefruit nRF52832 Feather",
|
"name": "Adafruit Bluefruit nRF52832 Feather",
|
||||||
"upload": {
|
"upload": {
|
||||||
"maximum_ram_size": 65536,
|
"maximum_ram_size": 65536,
|
||||||
@@ -59,13 +42,8 @@
|
|||||||
"require_upload_port": true,
|
"require_upload_port": true,
|
||||||
"speed": 115200,
|
"speed": 115200,
|
||||||
"protocol": "nrfutil",
|
"protocol": "nrfutil",
|
||||||
"protocols": [
|
"protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"]
|
||||||
"jlink",
|
|
||||||
"nrfjprog",
|
|
||||||
"nrfutil",
|
|
||||||
"stlink"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"url": "https://www.adafruit.com/product/3406",
|
"url": "https://www.adafruit.com/product/3406",
|
||||||
"vendor": "Adafruit"
|
"vendor": "Adafruit"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,72 +1,51 @@
|
|||||||
{
|
{
|
||||||
"build": {
|
"build": {
|
||||||
"arduino": {
|
"arduino": {
|
||||||
"ldscript": "nrf52840_s140_v6.ld"
|
"ldscript": "nrf52840_s140_v6.ld"
|
||||||
},
|
|
||||||
"core": "nRF5",
|
|
||||||
"cpu": "cortex-m4",
|
|
||||||
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
|
|
||||||
"f_cpu": "64000000L",
|
|
||||||
"hwids": [
|
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x8029"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x0029"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x002A"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"0x239A",
|
|
||||||
"0x802A"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"usb_product": "WisCore RAK4631 Board",
|
|
||||||
"mcu": "nrf52840",
|
|
||||||
"variant": "WisCore_RAK4631_Board",
|
|
||||||
"bsp": {
|
|
||||||
"name": "adafruit"
|
|
||||||
},
|
|
||||||
"softdevice": {
|
|
||||||
"sd_flags": "-DS140",
|
|
||||||
"sd_name": "s140",
|
|
||||||
"sd_version": "6.1.1",
|
|
||||||
"sd_fwid": "0x00B6"
|
|
||||||
},
|
|
||||||
"bootloader": {
|
|
||||||
"settings_addr": "0xFF000"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"core": "nRF5",
|
||||||
"bluetooth"
|
"cpu": "cortex-m4",
|
||||||
|
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
|
||||||
|
"f_cpu": "64000000L",
|
||||||
|
"hwids": [
|
||||||
|
["0x239A", "0x8029"],
|
||||||
|
["0x239A", "0x0029"],
|
||||||
|
["0x239A", "0x002A"],
|
||||||
|
["0x239A", "0x802A"]
|
||||||
],
|
],
|
||||||
"debug": {
|
"usb_product": "WisCore RAK4631 Board",
|
||||||
"jlink_device": "nRF52840_xxAA",
|
"mcu": "nrf52840",
|
||||||
"svd_path": "nrf52840.svd"
|
"variant": "WisCore_RAK4631_Board",
|
||||||
|
"bsp": {
|
||||||
|
"name": "adafruit"
|
||||||
},
|
},
|
||||||
"frameworks": [
|
"softdevice": {
|
||||||
"arduino"
|
"sd_flags": "-DS140",
|
||||||
],
|
"sd_name": "s140",
|
||||||
"name": "WisCore RAK4631 Board",
|
"sd_version": "6.1.1",
|
||||||
"upload": {
|
"sd_fwid": "0x00B6"
|
||||||
"maximum_ram_size": 248832,
|
|
||||||
"maximum_size": 815104,
|
|
||||||
"speed": 115200,
|
|
||||||
"protocol": "nrfutil",
|
|
||||||
"protocols": [
|
|
||||||
"jlink",
|
|
||||||
"nrfjprog",
|
|
||||||
"nrfutil",
|
|
||||||
"stlink"
|
|
||||||
],
|
|
||||||
"use_1200bps_touch": true,
|
|
||||||
"require_upload_port": true,
|
|
||||||
"wait_for_upload_port": true
|
|
||||||
},
|
},
|
||||||
"url": "https://www.rakwireless.com",
|
"bootloader": {
|
||||||
"vendor": "RAKwireless"
|
"settings_addr": "0xFF000"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"connectivity": ["bluetooth"],
|
||||||
|
"debug": {
|
||||||
|
"jlink_device": "nRF52840_xxAA",
|
||||||
|
"svd_path": "nrf52840.svd"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino"],
|
||||||
|
"name": "WisCore RAK4631 Board",
|
||||||
|
"upload": {
|
||||||
|
"maximum_ram_size": 248832,
|
||||||
|
"maximum_size": 815104,
|
||||||
|
"speed": 115200,
|
||||||
|
"protocol": "nrfutil",
|
||||||
|
"protocols": ["jlink", "nrfjprog", "nrfutil", "stlink"],
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"wait_for_upload_port": true
|
||||||
|
},
|
||||||
|
"url": "https://www.rakwireless.com",
|
||||||
|
"vendor": "RAKwireless"
|
||||||
|
}
|
||||||
|
|||||||
57
boards/xiao_ble_sense.json
Normal file
57
boards/xiao_ble_sense.json
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"arduino": {
|
||||||
|
"ldscript": "nrf52840_s140_v7.ld"
|
||||||
|
},
|
||||||
|
"core": "nRF5",
|
||||||
|
"cpu": "cortex-m4",
|
||||||
|
"extra_flags": "-DARDUINO_MDBT50Q_RX -DNRF52840_XXAA",
|
||||||
|
"f_cpu": "64000000L",
|
||||||
|
"hwids": [
|
||||||
|
["0x239A", "0x810B"],
|
||||||
|
["0x239A", "0x010B"],
|
||||||
|
["0x239A", "0x810C"]
|
||||||
|
],
|
||||||
|
"usb_product": "XIAO-BOOT",
|
||||||
|
"mcu": "nrf52840",
|
||||||
|
"variant": "Seeed_XIAO_nRF52840_Sense",
|
||||||
|
"bsp": {
|
||||||
|
"name": "adafruit"
|
||||||
|
},
|
||||||
|
"softdevice": {
|
||||||
|
"sd_flags": "-DS140",
|
||||||
|
"sd_name": "s140",
|
||||||
|
"sd_version": "7.3.0",
|
||||||
|
"sd_fwid": "0x0123"
|
||||||
|
},
|
||||||
|
"bootloader": {
|
||||||
|
"settings_addr": "0xFF000"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"connectivity": ["bluetooth"],
|
||||||
|
"debug": {
|
||||||
|
"jlink_device": "nRF52840_xxAA",
|
||||||
|
"svd_path": "nrf52840.svd"
|
||||||
|
},
|
||||||
|
"frameworks": ["arduino"],
|
||||||
|
"name": "Seeed Xiao BLE Sense",
|
||||||
|
"upload": {
|
||||||
|
"maximum_ram_size": 248832,
|
||||||
|
"maximum_size": 815104,
|
||||||
|
"speed": 115200,
|
||||||
|
"protocol": "nrfutil",
|
||||||
|
"protocols": [
|
||||||
|
"jlink",
|
||||||
|
"nrfjprog",
|
||||||
|
"nrfutil",
|
||||||
|
"stlink",
|
||||||
|
"cmsis-dap",
|
||||||
|
"blackmagic"
|
||||||
|
],
|
||||||
|
"use_1200bps_touch": true,
|
||||||
|
"require_upload_port": true,
|
||||||
|
"wait_for_upload_port": true
|
||||||
|
},
|
||||||
|
"url": "https://www.seeedstudio.com/Seeed-XIAO-BLE-Sense-nRF52840-p-5253.html",
|
||||||
|
"vendor": "Seeed Studio"
|
||||||
|
}
|
||||||
@@ -8,6 +8,6 @@ services:
|
|||||||
replicas: 4
|
replicas: 4
|
||||||
networks:
|
networks:
|
||||||
- mesh
|
- mesh
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
mesh:
|
mesh:
|
||||||
|
|||||||
155
monitor/filter_c3_exception_decoder.py
Normal file
155
monitor/filter_c3_exception_decoder.py
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from platformio.project.exception import PlatformioException
|
||||||
|
from platformio.public import (
|
||||||
|
DeviceMonitorFilterBase,
|
||||||
|
load_build_metadata,
|
||||||
|
)
|
||||||
|
|
||||||
|
# By design, __init__ is called inside miniterm and we can't pass context to it.
|
||||||
|
# pylint: disable=attribute-defined-outside-init
|
||||||
|
|
||||||
|
IS_WINDOWS = sys.platform.startswith("win")
|
||||||
|
|
||||||
|
|
||||||
|
class Esp32C3ExceptionDecoder(DeviceMonitorFilterBase):
|
||||||
|
NAME = "esp32_c3_exception_decoder"
|
||||||
|
|
||||||
|
PCADDR_PATTERN = re.compile(r'0x4[0-9a-f]{7}', re.IGNORECASE)
|
||||||
|
|
||||||
|
def __call__(self):
|
||||||
|
self.buffer = ""
|
||||||
|
self.pcaddr_re = self.PCADDR_PATTERN
|
||||||
|
|
||||||
|
self.firmware_path = None
|
||||||
|
self.addr2line_path = None
|
||||||
|
self.enabled = self.setup_paths()
|
||||||
|
|
||||||
|
if self.config.get("env:" + self.environment, "build_type") != "debug":
|
||||||
|
print(
|
||||||
|
"""
|
||||||
|
Please build project in debug configuration to get more details about an exception.
|
||||||
|
See https://docs.platformio.org/page/projectconf/build_configurations.html
|
||||||
|
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
return self
|
||||||
|
|
||||||
|
def setup_paths(self):
|
||||||
|
self.project_dir = os.path.abspath(self.project_dir)
|
||||||
|
try:
|
||||||
|
data = load_build_metadata(self.project_dir, self.environment)
|
||||||
|
self.firmware_path = data["prog_path"]
|
||||||
|
if not os.path.isfile(self.firmware_path):
|
||||||
|
sys.stderr.write(
|
||||||
|
"%s: disabling, firmware at %s does not exist, rebuild the project?\n"
|
||||||
|
% (self.__class__.__name__, self.firmware_path)
|
||||||
|
)
|
||||||
|
return False
|
||||||
|
|
||||||
|
if self.addr2line_path is None:
|
||||||
|
cc_path = data.get("cc_path", "")
|
||||||
|
if "-gcc" in cc_path:
|
||||||
|
self.addr2line_path = cc_path.replace("-gcc", "-addr2line")
|
||||||
|
else:
|
||||||
|
sys.stderr.write(
|
||||||
|
"%s: disabling, failed to find addr2line.\n"
|
||||||
|
% self.__class__.__name__
|
||||||
|
)
|
||||||
|
return False
|
||||||
|
|
||||||
|
if not os.path.isfile(self.addr2line_path):
|
||||||
|
sys.stderr.write(
|
||||||
|
"%s: disabling, addr2line at %s does not exist\n"
|
||||||
|
% (self.__class__.__name__, self.addr2line_path)
|
||||||
|
)
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
except PlatformioException as e:
|
||||||
|
sys.stderr.write(
|
||||||
|
"%s: disabling, exception while looking for addr2line: %s\n"
|
||||||
|
% (self.__class__.__name__, e)
|
||||||
|
)
|
||||||
|
return False
|
||||||
|
|
||||||
|
def rx(self, text):
|
||||||
|
if not self.enabled:
|
||||||
|
return text
|
||||||
|
|
||||||
|
last = 0
|
||||||
|
while True:
|
||||||
|
idx = text.find("\n", last)
|
||||||
|
if idx == -1:
|
||||||
|
if len(self.buffer) < 4096:
|
||||||
|
self.buffer += text[last:]
|
||||||
|
break
|
||||||
|
|
||||||
|
line = text[last:idx]
|
||||||
|
if self.buffer:
|
||||||
|
line = self.buffer + line
|
||||||
|
self.buffer = ""
|
||||||
|
last = idx + 1
|
||||||
|
|
||||||
|
# Output each trace on a separate line below ours
|
||||||
|
# Logic identical to https://github.com/espressif/esp-idf/blob/master/tools/idf_monitor_base/logger.py#L131
|
||||||
|
for m in re.finditer(self.pcaddr_re, line):
|
||||||
|
if m is None:
|
||||||
|
continue
|
||||||
|
|
||||||
|
trace = self.get_backtrace(m)
|
||||||
|
if len(trace) != "":
|
||||||
|
text = text[: last] + trace + text[last :]
|
||||||
|
last += len(trace)
|
||||||
|
|
||||||
|
return text
|
||||||
|
|
||||||
|
def get_backtrace(self, match):
|
||||||
|
trace = "\n"
|
||||||
|
enc = "mbcs" if IS_WINDOWS else "utf-8"
|
||||||
|
args = [self.addr2line_path, u"-fipC", u"-e", self.firmware_path]
|
||||||
|
try:
|
||||||
|
addr = match.group()
|
||||||
|
output = (
|
||||||
|
subprocess.check_output(args + [addr])
|
||||||
|
.decode(enc)
|
||||||
|
.strip()
|
||||||
|
)
|
||||||
|
output = output.replace(
|
||||||
|
"\n", "\n "
|
||||||
|
) # newlines happen with inlined methods
|
||||||
|
output = self.strip_project_dir(output)
|
||||||
|
# Output the trace in yellow color so that it is easier to spot
|
||||||
|
trace += "\033[33m=> %s: %s\033[0m\n" % (addr, output)
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
sys.stderr.write(
|
||||||
|
"%s: failed to call %s: %s\n"
|
||||||
|
% (self.__class__.__name__, self.addr2line_path, e)
|
||||||
|
)
|
||||||
|
return trace
|
||||||
|
|
||||||
|
def strip_project_dir(self, trace):
|
||||||
|
while True:
|
||||||
|
idx = trace.find(self.project_dir)
|
||||||
|
if idx == -1:
|
||||||
|
break
|
||||||
|
trace = trace[:idx] + trace[idx + len(self.project_dir) + 1 :]
|
||||||
|
return trace
|
||||||
@@ -7,13 +7,14 @@
|
|||||||
;default_envs = tbeam-s3-core
|
;default_envs = tbeam-s3-core
|
||||||
;default_envs = tbeam0.7
|
;default_envs = tbeam0.7
|
||||||
;default_envs = heltec-v1
|
;default_envs = heltec-v1
|
||||||
;default_envs = heltec-v2.0
|
;default_envs = heltec-v2_0
|
||||||
;default_envs = heltec-v2.1
|
;default_envs = heltec-v2_1
|
||||||
;default_envs = tlora-v1
|
;default_envs = heltec-wireless-tracker
|
||||||
;default_envs = tlora-v1
|
;default_envs = tlora-v1
|
||||||
;default_envs = tlora_v1_3
|
;default_envs = tlora_v1_3
|
||||||
;default_envs = tlora-v2
|
;default_envs = tlora-v2
|
||||||
;default_envs = tlora-v2-1-1.6
|
;default_envs = tlora-v2-1-1_6
|
||||||
|
;default_envs = tlora-t3s3-v1
|
||||||
;default_envs = lora-relay-v1 # nrf board
|
;default_envs = lora-relay-v1 # nrf board
|
||||||
;default_envs = t-echo
|
;default_envs = t-echo
|
||||||
;default_envs = nrf52840dk-geeksville
|
;default_envs = nrf52840dk-geeksville
|
||||||
@@ -21,17 +22,19 @@
|
|||||||
;default_envs = nano-g1
|
;default_envs = nano-g1
|
||||||
;default_envs = pca10059_diy_eink
|
;default_envs = pca10059_diy_eink
|
||||||
;default_envs = meshtastic-diy-v1
|
;default_envs = meshtastic-diy-v1
|
||||||
;default_envs = meshtastic-diy-v1.1
|
;default_envs = meshtastic-diy-v1_1
|
||||||
;default_envs = meshtastic-dr-dev
|
;default_envs = meshtastic-dr-dev
|
||||||
;default_envs = m5stack-coreink
|
;default_envs = m5stack-coreink
|
||||||
;default_envs = rak4631
|
;default_envs = rak4631
|
||||||
|
;default_envs = rak10701
|
||||||
|
default_envs = wio-e5
|
||||||
|
|
||||||
extra_configs =
|
extra_configs =
|
||||||
arch/*/*.ini
|
arch/*/*.ini
|
||||||
variants/*/platformio.ini
|
variants/*/platformio.ini
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
extra_scripts = bin/platformio-custom.py
|
extra_scripts = bin/platformio-custom.py
|
||||||
|
|
||||||
; note: we add src to our include search path so that lmic_project_config can override
|
; note: we add src to our include search path so that lmic_project_config can override
|
||||||
; note: TINYGPS_OPTION_NO_CUSTOM_FIELDS is VERY important. We don't use custom fields and somewhere in that pile
|
; note: TINYGPS_OPTION_NO_CUSTOM_FIELDS is VERY important. We don't use custom fields and somewhere in that pile
|
||||||
@@ -39,8 +42,8 @@ extra_scripts = bin/platformio-custom.py
|
|||||||
; FIXME: fix lib/BluetoothOTA dependency back on src/ so we can remove -Isrc
|
; FIXME: fix lib/BluetoothOTA dependency back on src/ so we can remove -Isrc
|
||||||
; The Radiolib stuff will speed up building considerably. Exclud all the stuff we dont need.
|
; The Radiolib stuff will speed up building considerably. Exclud all the stuff we dont need.
|
||||||
build_flags = -Wno-missing-field-initializers
|
build_flags = -Wno-missing-field-initializers
|
||||||
-Wno-format
|
-Wno-format
|
||||||
-Isrc -Isrc/mesh -Isrc/gps -Isrc/buzz -Wl,-Map,.pio/build/output.map
|
-Isrc -Isrc/mesh -Isrc/mesh/generated -Isrc/gps -Isrc/buzz -Wl,-Map,.pio/build/output.map
|
||||||
-DUSE_THREAD_NAMES
|
-DUSE_THREAD_NAMES
|
||||||
-DTINYGPS_OPTION_NO_CUSTOM_FIELDS
|
-DTINYGPS_OPTION_NO_CUSTOM_FIELDS
|
||||||
-DPB_ENABLE_MALLOC=1
|
-DPB_ENABLE_MALLOC=1
|
||||||
@@ -55,18 +58,24 @@ build_flags = -Wno-missing-field-initializers
|
|||||||
-DRADIOLIB_EXCLUDE_MORSE
|
-DRADIOLIB_EXCLUDE_MORSE
|
||||||
-DRADIOLIB_EXCLUDE_RTTY
|
-DRADIOLIB_EXCLUDE_RTTY
|
||||||
-DRADIOLIB_EXCLUDE_SSTV
|
-DRADIOLIB_EXCLUDE_SSTV
|
||||||
|
-DRADIOLIB_EXCLUDE_AX25
|
||||||
|
-DRADIOLIB_EXCLUDE_DIRECT_RECEIVE
|
||||||
|
-DRADIOLIB_EXCLUDE_BELL
|
||||||
|
-DRADIOLIB_EXCLUDE_PAGER
|
||||||
|
-DRADIOLIB_EXCLUDE_FSK4
|
||||||
|
-DRADIOLIB_EXCLUDE_APRS
|
||||||
|
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
https://github.com/meshtastic/esp8266-oled-ssd1306.git#53580644255b48ebb7a737343c6b4e71c7e11cf2 ; ESP8266_SSD1306
|
jgromes/RadioLib@^6.3.0
|
||||||
mathertel/OneButton@^2.0.3 ; OneButton library for non-blocking button debounce
|
https://github.com/meshtastic/esp8266-oled-ssd1306.git#b38094e03dfa964fbc0e799bc374e91a605c1223 ; ESP8266_SSD1306
|
||||||
|
mathertel/OneButton@^2.5.0 ; OneButton library for non-blocking button debounce
|
||||||
https://github.com/meshtastic/arduino-fsm.git#7db3702bf0cfe97b783d6c72595e3f38e0b19159
|
https://github.com/meshtastic/arduino-fsm.git#7db3702bf0cfe97b783d6c72595e3f38e0b19159
|
||||||
https://github.com/meshtastic/TinyGPSPlus.git#127ad674ef85f0201cb68a065879653ed94792c4
|
https://github.com/meshtastic/TinyGPSPlus.git#076e8d2c8fb702d9be5b08c55b93ff76f8af7e61
|
||||||
https://github.com/meshtastic/ArduinoThread.git#72921ac222eed6f526ba1682023cee290d9aa1b3
|
https://github.com/meshtastic/ArduinoThread.git#72921ac222eed6f526ba1682023cee290d9aa1b3
|
||||||
nanopb/Nanopb@^0.4.6
|
nanopb/Nanopb@^0.4.7
|
||||||
erriez/ErriezCRC32@^1.0.1
|
erriez/ErriezCRC32@^1.0.1
|
||||||
jgromes/RadioLib@^5.5.0
|
|
||||||
|
|
||||||
; Used for the code analysis in PIO Home / Inspect
|
; Used for the code analysis in PIO Home / Inspect
|
||||||
check_tool = cppcheck
|
check_tool = cppcheck
|
||||||
@@ -81,29 +90,38 @@ check_flags =
|
|||||||
framework = arduino
|
framework = arduino
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
mprograms/QMC5883LCompass@^1.1.1
|
mprograms/QMC5883LCompass@^1.2.0
|
||||||
https://github.com/meshtastic/SparkFun_ATECCX08a_Arduino_Library.git#52b5282639d08a8cbd4b748363089eed6102dc76
|
end2endzone/NonBlockingRTTTL@^1.3.0
|
||||||
|
https://github.com/meshtastic/SparkFun_ATECCX08a_Arduino_Library.git#5cf62b36c6f30bc72a07bdb2c11fc9a22d1e31da
|
||||||
|
|
||||||
build_flags = ${env.build_flags} -Os -DRADIOLIB_SPI_PARANOID=0
|
build_flags = ${env.build_flags} -Os
|
||||||
build_src_filter = ${env.build_src_filter} -<platform/portduino/>
|
build_src_filter = ${env.build_src_filter} -<platform/portduino/>
|
||||||
|
|
||||||
; Common libs for communicating over TCP/IP networks such as MQTT
|
; Common libs for communicating over TCP/IP networks such as MQTT
|
||||||
[networking_base]
|
[networking_base]
|
||||||
lib_deps =
|
lib_deps =
|
||||||
knolleary/PubSubClient@^2.8
|
knolleary/PubSubClient@^2.8
|
||||||
arduino-libraries/NTPClient@^3.1.0
|
arduino-libraries/NTPClient@^3.1.0
|
||||||
|
arcao/Syslog@^2.0.0
|
||||||
|
|
||||||
; Common libs for environmental measurements in telemetry module
|
; Common libs for environmental measurements in telemetry module
|
||||||
; (not included in native / portduino)
|
; (not included in native / portduino)
|
||||||
[environmental_base]
|
[environmental_base]
|
||||||
lib_deps =
|
lib_deps =
|
||||||
adafruit/Adafruit BusIO@^1.11.4
|
adafruit/Adafruit BusIO@^1.11.4
|
||||||
adafruit/Adafruit Unified Sensor@^1.1.4
|
adafruit/Adafruit Unified Sensor@^1.1.11
|
||||||
adafruit/Adafruit BMP280 Library@^2.6.6
|
adafruit/Adafruit BMP280 Library@^2.6.8
|
||||||
adafruit/Adafruit BME280 Library@^2.2.2
|
adafruit/Adafruit BME280 Library@^2.2.2
|
||||||
adafruit/Adafruit BME680 Library@^2.0.1
|
https://github.com/boschsensortec/Bosch-BSEC2-Library#v1.5.2400
|
||||||
|
boschsensortec/BME68x Sensor Library@^1.1.40407
|
||||||
adafruit/Adafruit MCP9808 Library@^2.0.0
|
adafruit/Adafruit MCP9808 Library@^2.0.0
|
||||||
|
https://github.com/Tinyu-Zhao/INA3221@^0.0.1
|
||||||
adafruit/Adafruit INA260 Library@^1.5.0
|
adafruit/Adafruit INA260 Library@^1.5.0
|
||||||
adafruit/Adafruit INA219@^1.2.0
|
adafruit/Adafruit INA219@^1.2.0
|
||||||
adafruit/Adafruit SHTC3 Library@^1.0.0
|
adafruit/Adafruit SHTC3 Library@^1.0.0
|
||||||
adafruit/Adafruit LPS2X@^2.0.4
|
adafruit/Adafruit LPS2X@^2.0.4
|
||||||
|
adafruit/Adafruit SHT31 Library@^2.2.2
|
||||||
|
adafruit/Adafruit PM25 AQI Sensor@^1.0.6
|
||||||
|
adafruit/Adafruit MPU6050@^2.2.4
|
||||||
|
adafruit/Adafruit LIS3DH@^1.2.4
|
||||||
|
https://github.com/lewisxhe/BMA423_Library@^0.0.1
|
||||||
|
|||||||
Submodule protobufs updated: afa4605699...a34b2c680e
174
src/AccelerometerThread.h
Normal file
174
src/AccelerometerThread.h
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
#include "PowerFSM.h"
|
||||||
|
#include "concurrency/OSThread.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "power.h"
|
||||||
|
|
||||||
|
#include <Adafruit_LIS3DH.h>
|
||||||
|
#include <Adafruit_MPU6050.h>
|
||||||
|
#include <Arduino.h>
|
||||||
|
#include <Wire.h>
|
||||||
|
#include <bma.h>
|
||||||
|
|
||||||
|
BMA423 bmaSensor;
|
||||||
|
bool BMA_IRQ = false;
|
||||||
|
|
||||||
|
#define ACCELEROMETER_CHECK_INTERVAL_MS 100
|
||||||
|
#define ACCELEROMETER_CLICK_THRESHOLD 40
|
||||||
|
|
||||||
|
uint16_t readRegister(uint8_t address, uint8_t reg, uint8_t *data, uint16_t len)
|
||||||
|
{
|
||||||
|
Wire.beginTransmission(address);
|
||||||
|
Wire.write(reg);
|
||||||
|
Wire.endTransmission();
|
||||||
|
Wire.requestFrom((uint8_t)address, (uint8_t)len);
|
||||||
|
uint8_t i = 0;
|
||||||
|
while (Wire.available()) {
|
||||||
|
data[i++] = Wire.read();
|
||||||
|
}
|
||||||
|
return 0; // Pass
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t writeRegister(uint8_t address, uint8_t reg, uint8_t *data, uint16_t len)
|
||||||
|
{
|
||||||
|
Wire.beginTransmission(address);
|
||||||
|
Wire.write(reg);
|
||||||
|
Wire.write(data, len);
|
||||||
|
return (0 != Wire.endTransmission());
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace concurrency
|
||||||
|
{
|
||||||
|
class AccelerometerThread : public concurrency::OSThread
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit AccelerometerThread(ScanI2C::DeviceType type) : OSThread("AccelerometerThread")
|
||||||
|
{
|
||||||
|
if (accelerometer_found.port == ScanI2C::I2CPort::NO_I2C) {
|
||||||
|
LOG_DEBUG("AccelerometerThread disabling due to no sensors found\n");
|
||||||
|
disable();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!config.display.wake_on_tap_or_motion && !config.device.double_tap_as_button_press) {
|
||||||
|
LOG_DEBUG("AccelerometerThread disabling due to no interested configurations\n");
|
||||||
|
disable();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
acceleremoter_type = type;
|
||||||
|
LOG_DEBUG("AccelerometerThread initializing\n");
|
||||||
|
|
||||||
|
if (acceleremoter_type == ScanI2C::DeviceType::MPU6050 && mpu.begin(accelerometer_found.address)) {
|
||||||
|
LOG_DEBUG("MPU6050 initializing\n");
|
||||||
|
// setup motion detection
|
||||||
|
mpu.setHighPassFilter(MPU6050_HIGHPASS_0_63_HZ);
|
||||||
|
mpu.setMotionDetectionThreshold(1);
|
||||||
|
mpu.setMotionDetectionDuration(20);
|
||||||
|
mpu.setInterruptPinLatch(true); // Keep it latched. Will turn off when reinitialized.
|
||||||
|
mpu.setInterruptPinPolarity(true);
|
||||||
|
} else if (acceleremoter_type == ScanI2C::DeviceType::LIS3DH && lis.begin(accelerometer_found.address)) {
|
||||||
|
LOG_DEBUG("LIS3DH initializing\n");
|
||||||
|
lis.setRange(LIS3DH_RANGE_2_G);
|
||||||
|
// Adjust threshold, higher numbers are less sensitive
|
||||||
|
lis.setClick(config.device.double_tap_as_button_press ? 2 : 1, ACCELEROMETER_CLICK_THRESHOLD);
|
||||||
|
} else if (acceleremoter_type == ScanI2C::DeviceType::BMA423 && bmaSensor.begin(readRegister, writeRegister, delay)) {
|
||||||
|
LOG_DEBUG("BMA423 initializing\n");
|
||||||
|
Acfg cfg;
|
||||||
|
cfg.odr = BMA4_OUTPUT_DATA_RATE_100HZ;
|
||||||
|
cfg.range = BMA4_ACCEL_RANGE_2G;
|
||||||
|
cfg.bandwidth = BMA4_ACCEL_NORMAL_AVG4;
|
||||||
|
cfg.perf_mode = BMA4_CONTINUOUS_MODE;
|
||||||
|
bmaSensor.setAccelConfig(cfg);
|
||||||
|
bmaSensor.enableAccel();
|
||||||
|
|
||||||
|
struct bma4_int_pin_config pin_config;
|
||||||
|
pin_config.edge_ctrl = BMA4_LEVEL_TRIGGER;
|
||||||
|
pin_config.lvl = BMA4_ACTIVE_HIGH;
|
||||||
|
pin_config.od = BMA4_PUSH_PULL;
|
||||||
|
pin_config.output_en = BMA4_OUTPUT_ENABLE;
|
||||||
|
pin_config.input_en = BMA4_INPUT_DISABLE;
|
||||||
|
// The correct trigger interrupt needs to be configured as needed
|
||||||
|
bmaSensor.setINTPinConfig(pin_config, BMA4_INTR1_MAP);
|
||||||
|
|
||||||
|
#ifdef BMA423_INT
|
||||||
|
pinMode(BMA4XX_INT, INPUT);
|
||||||
|
attachInterrupt(
|
||||||
|
BMA4XX_INT,
|
||||||
|
[] {
|
||||||
|
// Set interrupt to set irq value to true
|
||||||
|
BMA_IRQ = true;
|
||||||
|
},
|
||||||
|
RISING); // Select the interrupt mode according to the actual circuit
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct bma423_axes_remap remap_data;
|
||||||
|
remap_data.x_axis = 0;
|
||||||
|
remap_data.x_axis_sign = 1;
|
||||||
|
remap_data.y_axis = 1;
|
||||||
|
remap_data.y_axis_sign = 0;
|
||||||
|
remap_data.z_axis = 2;
|
||||||
|
remap_data.z_axis_sign = 1;
|
||||||
|
// Need to raise the wrist function, need to set the correct axis
|
||||||
|
bmaSensor.setRemapAxes(&remap_data);
|
||||||
|
// sensor.enableFeature(BMA423_STEP_CNTR, true);
|
||||||
|
bmaSensor.enableFeature(BMA423_TILT, true);
|
||||||
|
bmaSensor.enableFeature(BMA423_WAKEUP, true);
|
||||||
|
// sensor.resetStepCounter();
|
||||||
|
|
||||||
|
// Turn on feature interrupt
|
||||||
|
bmaSensor.enableStepCountInterrupt();
|
||||||
|
bmaSensor.enableTiltInterrupt();
|
||||||
|
// It corresponds to isDoubleClick interrupt
|
||||||
|
bmaSensor.enableWakeupInterrupt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int32_t runOnce() override
|
||||||
|
{
|
||||||
|
canSleep = true; // Assume we should not keep the board awake
|
||||||
|
|
||||||
|
if (acceleremoter_type == ScanI2C::DeviceType::MPU6050 && mpu.getMotionInterruptStatus()) {
|
||||||
|
wakeScreen();
|
||||||
|
} else if (acceleremoter_type == ScanI2C::DeviceType::LIS3DH && lis.getClick() > 0) {
|
||||||
|
uint8_t click = lis.getClick();
|
||||||
|
if (!config.device.double_tap_as_button_press) {
|
||||||
|
wakeScreen();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.device.double_tap_as_button_press && (click & 0x20)) {
|
||||||
|
buttonPress();
|
||||||
|
return 500;
|
||||||
|
}
|
||||||
|
} else if (acceleremoter_type == ScanI2C::DeviceType::BMA423 && bmaSensor.getINT()) {
|
||||||
|
if (bmaSensor.isTilt() || bmaSensor.isDoubleClick()) {
|
||||||
|
wakeScreen();
|
||||||
|
return 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ACCELEROMETER_CHECK_INTERVAL_MS;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
void wakeScreen()
|
||||||
|
{
|
||||||
|
if (powerFSM.getState() == &stateDARK) {
|
||||||
|
LOG_INFO("Tap or motion detected. Turning on screen\n");
|
||||||
|
powerFSM.trigger(EVENT_INPUT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void buttonPress()
|
||||||
|
{
|
||||||
|
LOG_DEBUG("Double-tap detected. Firing button press\n");
|
||||||
|
powerFSM.trigger(EVENT_PRESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
ScanI2C::DeviceType acceleremoter_type;
|
||||||
|
Adafruit_MPU6050 mpu;
|
||||||
|
Adafruit_LIS3DH lis;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace concurrency
|
||||||
75
src/AmbientLightingThread.h
Normal file
75
src/AmbientLightingThread.h
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
|
#ifdef HAS_NCP5623
|
||||||
|
#include <graphics/RAKled.h>
|
||||||
|
NCP5623 rgb;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace concurrency
|
||||||
|
{
|
||||||
|
class AmbientLightingThread : public concurrency::OSThread
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit AmbientLightingThread(ScanI2C::DeviceType type) : OSThread("AmbientLightingThread")
|
||||||
|
{
|
||||||
|
// Uncomment to test module
|
||||||
|
// moduleConfig.ambient_lighting.led_state = true;
|
||||||
|
// moduleConfig.ambient_lighting.current = 10;
|
||||||
|
// // Default to a color based on our node number
|
||||||
|
// moduleConfig.ambient_lighting.red = (myNodeInfo.my_node_num & 0xFF0000) >> 16;
|
||||||
|
// moduleConfig.ambient_lighting.green = (myNodeInfo.my_node_num & 0x00FF00) >> 8;
|
||||||
|
// moduleConfig.ambient_lighting.blue = myNodeInfo.my_node_num & 0x0000FF;
|
||||||
|
|
||||||
|
#ifdef HAS_NCP5623
|
||||||
|
_type = type;
|
||||||
|
if (_type == ScanI2C::DeviceType::NONE) {
|
||||||
|
LOG_DEBUG("AmbientLightingThread disabling due to no RGB leds found on I2C bus\n");
|
||||||
|
disable();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!moduleConfig.ambient_lighting.led_state) {
|
||||||
|
LOG_DEBUG("AmbientLightingThread disabling due to moduleConfig.ambient_lighting.led_state OFF\n");
|
||||||
|
disable();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
LOG_DEBUG("AmbientLightingThread initializing\n");
|
||||||
|
if (_type == ScanI2C::NCP5623) {
|
||||||
|
rgb.begin();
|
||||||
|
setLighting();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int32_t runOnce() override
|
||||||
|
{
|
||||||
|
#ifdef HAS_NCP5623
|
||||||
|
if (_type == ScanI2C::NCP5623 && moduleConfig.ambient_lighting.led_state) {
|
||||||
|
setLighting();
|
||||||
|
return 30000; // 30 seconds to reset from any animations that may have been running from Ext. Notification
|
||||||
|
} else {
|
||||||
|
return disable();
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
return disable();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
ScanI2C::DeviceType _type = ScanI2C::DeviceType::NONE;
|
||||||
|
|
||||||
|
void setLighting()
|
||||||
|
{
|
||||||
|
#ifdef HAS_NCP5623
|
||||||
|
rgb.setCurrent(moduleConfig.ambient_lighting.current);
|
||||||
|
rgb.setRed(moduleConfig.ambient_lighting.red);
|
||||||
|
rgb.setGreen(moduleConfig.ambient_lighting.green);
|
||||||
|
rgb.setBlue(moduleConfig.ambient_lighting.blue);
|
||||||
|
LOG_DEBUG("Initializing Ambient lighting w/ current=%d, red=%d, green=%d, blue=%d\n",
|
||||||
|
moduleConfig.ambient_lighting.current, moduleConfig.ambient_lighting.red, moduleConfig.ambient_lighting.green,
|
||||||
|
moduleConfig.ambient_lighting.blue);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace concurrency
|
||||||
77
src/AudioThread.h
Normal file
77
src/AudioThread.h
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "PowerFSM.h"
|
||||||
|
#include "concurrency/OSThread.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "sleep.h"
|
||||||
|
|
||||||
|
#ifdef HAS_I2S
|
||||||
|
#include <AudioFileSourcePROGMEM.h>
|
||||||
|
#include <AudioGeneratorRTTTL.h>
|
||||||
|
#include <AudioOutputI2S.h>
|
||||||
|
#include <ESP8266SAM.h>
|
||||||
|
|
||||||
|
#define AUDIO_THREAD_INTERVAL_MS 100
|
||||||
|
|
||||||
|
class AudioThread : public concurrency::OSThread
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
AudioThread() : OSThread("AudioThread") { initOutput(); }
|
||||||
|
|
||||||
|
void beginRttl(const void *data, uint32_t len)
|
||||||
|
{
|
||||||
|
setCPUFast(true);
|
||||||
|
rtttlFile = new AudioFileSourcePROGMEM(data, len);
|
||||||
|
i2sRtttl = new AudioGeneratorRTTTL();
|
||||||
|
i2sRtttl->begin(rtttlFile, audioOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isPlaying()
|
||||||
|
{
|
||||||
|
if (i2sRtttl != nullptr) {
|
||||||
|
return i2sRtttl->isRunning() && i2sRtttl->loop();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void stop()
|
||||||
|
{
|
||||||
|
if (i2sRtttl != nullptr) {
|
||||||
|
i2sRtttl->stop();
|
||||||
|
delete i2sRtttl;
|
||||||
|
i2sRtttl = nullptr;
|
||||||
|
}
|
||||||
|
if (rtttlFile != nullptr) {
|
||||||
|
delete rtttlFile;
|
||||||
|
rtttlFile = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
setCPUFast(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int32_t runOnce() override
|
||||||
|
{
|
||||||
|
canSleep = true; // Assume we should not keep the board awake
|
||||||
|
|
||||||
|
// if (i2sRtttl != nullptr && i2sRtttl->isRunning()) {
|
||||||
|
// i2sRtttl->loop();
|
||||||
|
// }
|
||||||
|
return AUDIO_THREAD_INTERVAL_MS;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
void initOutput()
|
||||||
|
{
|
||||||
|
audioOut = new AudioOutputI2S(1, AudioOutputI2S::EXTERNAL_I2S);
|
||||||
|
audioOut->SetPinout(DAC_I2S_BCK, DAC_I2S_WS, DAC_I2S_DOUT);
|
||||||
|
audioOut->SetGain(0.2);
|
||||||
|
};
|
||||||
|
|
||||||
|
AudioGeneratorRTTTL *i2sRtttl = nullptr;
|
||||||
|
AudioOutputI2S *audioOut;
|
||||||
|
|
||||||
|
AudioFileSourcePROGMEM *rtttlFile;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "configuration.h"
|
|
||||||
#include "BluetoothCommon.h"
|
#include "BluetoothCommon.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
// NRF52 wants these constants as byte arrays
|
// NRF52 wants these constants as byte arrays
|
||||||
// Generated here https://yupana-engineering.com/online-uuid-to-c-array-converter - but in REVERSE BYTE ORDER
|
// Generated here https://yupana-engineering.com/online-uuid-to-c-array-converter - but in REVERSE BYTE ORDER
|
||||||
|
|||||||
@@ -17,4 +17,14 @@
|
|||||||
extern const uint8_t MESH_SERVICE_UUID_16[], TORADIO_UUID_16[16u], FROMRADIO_UUID_16[], FROMNUM_UUID_16[];
|
extern const uint8_t MESH_SERVICE_UUID_16[], TORADIO_UUID_16[16u], FROMRADIO_UUID_16[], FROMNUM_UUID_16[];
|
||||||
|
|
||||||
/// Given a level between 0-100, update the BLE attribute
|
/// Given a level between 0-100, update the BLE attribute
|
||||||
void updateBatteryLevel(uint8_t level);
|
void updateBatteryLevel(uint8_t level);
|
||||||
|
|
||||||
|
class BluetoothApi
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void setup();
|
||||||
|
virtual void shutdown();
|
||||||
|
virtual void clearBonds();
|
||||||
|
virtual bool isConnected();
|
||||||
|
virtual int getRssi() = 0;
|
||||||
|
};
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
#include "concurrency/OSThread.h"
|
#include "concurrency/OSThread.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "graphics/Screen.h"
|
#include "graphics/Screen.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "modules/ExternalNotificationModule.h"
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
#include <OneButton.h>
|
#include <OneButton.h>
|
||||||
|
|
||||||
@@ -35,6 +37,9 @@ class ButtonThread : public concurrency::OSThread
|
|||||||
#endif
|
#endif
|
||||||
#ifdef BUTTON_PIN_TOUCH
|
#ifdef BUTTON_PIN_TOUCH
|
||||||
OneButton userButtonTouch;
|
OneButton userButtonTouch;
|
||||||
|
#endif
|
||||||
|
#if defined(ARCH_RASPBERRY_PI)
|
||||||
|
OneButton userButton;
|
||||||
#endif
|
#endif
|
||||||
static bool shutdown_on_long_stop;
|
static bool shutdown_on_long_stop;
|
||||||
|
|
||||||
@@ -44,19 +49,31 @@ class ButtonThread : public concurrency::OSThread
|
|||||||
// callback returns the period for the next callback invocation (or 0 if we should no longer be called)
|
// callback returns the period for the next callback invocation (or 0 if we should no longer be called)
|
||||||
ButtonThread() : OSThread("Button")
|
ButtonThread() : OSThread("Button")
|
||||||
{
|
{
|
||||||
#ifdef BUTTON_PIN
|
#if defined(ARCH_RASPBERRY_PI) || defined(BUTTON_PIN)
|
||||||
userButton = OneButton(BUTTON_PIN, true, true);
|
#if defined(ARCH_RASPBERRY_PI)
|
||||||
|
if (settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC)
|
||||||
|
userButton = OneButton(settingsMap[user], true, true);
|
||||||
|
#elif defined(BUTTON_PIN)
|
||||||
|
|
||||||
|
userButton = OneButton(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN, true, true);
|
||||||
|
#endif
|
||||||
#ifdef INPUT_PULLUP_SENSE
|
#ifdef INPUT_PULLUP_SENSE
|
||||||
// Some platforms (nrf52) have a SENSE variant which allows wake from sleep - override what OneButton did
|
// Some platforms (nrf52) have a SENSE variant which allows wake from sleep - override what OneButton did
|
||||||
pinMode(BUTTON_PIN, INPUT_PULLUP_SENSE);
|
pinMode(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN, INPUT_PULLUP_SENSE);
|
||||||
#endif
|
#endif
|
||||||
userButton.attachClick(userButtonPressed);
|
userButton.attachClick(userButtonPressed);
|
||||||
|
userButton.setClickMs(300);
|
||||||
userButton.attachDuringLongPress(userButtonPressedLong);
|
userButton.attachDuringLongPress(userButtonPressedLong);
|
||||||
userButton.attachDoubleClick(userButtonDoublePressed);
|
userButton.attachDoubleClick(userButtonDoublePressed);
|
||||||
userButton.attachMultiClick(userButtonMultiPressed);
|
userButton.attachMultiClick(userButtonMultiPressed);
|
||||||
userButton.attachLongPressStart(userButtonPressedLongStart);
|
userButton.attachLongPressStart(userButtonPressedLongStart);
|
||||||
userButton.attachLongPressStop(userButtonPressedLongStop);
|
userButton.attachLongPressStop(userButtonPressedLongStop);
|
||||||
wakeOnIrq(BUTTON_PIN, FALLING);
|
#if defined(ARCH_RASPBERRY_PI)
|
||||||
|
if (settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC)
|
||||||
|
wakeOnIrq(settingsMap[user], FALLING);
|
||||||
|
#else
|
||||||
|
wakeOnIrq(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN, FALLING);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef BUTTON_PIN_ALT
|
#ifdef BUTTON_PIN_ALT
|
||||||
userButtonAlt = OneButton(BUTTON_PIN_ALT, true, true);
|
userButtonAlt = OneButton(BUTTON_PIN_ALT, true, true);
|
||||||
@@ -85,9 +102,14 @@ class ButtonThread : public concurrency::OSThread
|
|||||||
{
|
{
|
||||||
canSleep = true; // Assume we should not keep the board awake
|
canSleep = true; // Assume we should not keep the board awake
|
||||||
|
|
||||||
#ifdef BUTTON_PIN
|
#if defined(BUTTON_PIN)
|
||||||
userButton.tick();
|
userButton.tick();
|
||||||
canSleep &= userButton.isIdle();
|
canSleep &= userButton.isIdle();
|
||||||
|
#elif defined(ARCH_RASPBERRY_PI)
|
||||||
|
if (settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC) {
|
||||||
|
userButton.tick();
|
||||||
|
canSleep &= userButton.isIdle();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef BUTTON_PIN_ALT
|
#ifdef BUTTON_PIN_ALT
|
||||||
userButtonAlt.tick();
|
userButtonAlt.tick();
|
||||||
@@ -97,24 +119,32 @@ class ButtonThread : public concurrency::OSThread
|
|||||||
userButtonTouch.tick();
|
userButtonTouch.tick();
|
||||||
canSleep &= userButtonTouch.isIdle();
|
canSleep &= userButtonTouch.isIdle();
|
||||||
#endif
|
#endif
|
||||||
// if (!canSleep) DEBUG_MSG("Supressing sleep!\n");
|
// if (!canSleep) LOG_DEBUG("Suppressing sleep!\n");
|
||||||
// else DEBUG_MSG("sleep ok\n");
|
// else LOG_DEBUG("sleep ok\n");
|
||||||
|
|
||||||
return 5;
|
return 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void touchPressed()
|
static void touchPressed()
|
||||||
{
|
{
|
||||||
screen->forceDisplay();
|
screen->forceDisplay();
|
||||||
DEBUG_MSG("touch press!\n");
|
LOG_DEBUG("touch press!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void userButtonPressed()
|
static void userButtonPressed()
|
||||||
{
|
{
|
||||||
// DEBUG_MSG("press!\n");
|
// LOG_DEBUG("press!\n");
|
||||||
#ifdef BUTTON_PIN
|
#ifdef BUTTON_PIN
|
||||||
if ((BUTTON_PIN != moduleConfig.canned_message.inputbroker_pin_press) ||
|
if (((config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN) !=
|
||||||
|
moduleConfig.canned_message.inputbroker_pin_press) ||
|
||||||
|
!moduleConfig.canned_message.enabled) {
|
||||||
|
powerFSM.trigger(EVENT_PRESS);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(ARCH_RASPBERRY_PI)
|
||||||
|
if ((settingsMap.count(user) != 0 && settingsMap[user] != RADIOLIB_NC) &&
|
||||||
|
(settingsMap[user] != moduleConfig.canned_message.inputbroker_pin_press) ||
|
||||||
!moduleConfig.canned_message.enabled) {
|
!moduleConfig.canned_message.enabled) {
|
||||||
powerFSM.trigger(EVENT_PRESS);
|
powerFSM.trigger(EVENT_PRESS);
|
||||||
}
|
}
|
||||||
@@ -122,38 +152,30 @@ class ButtonThread : public concurrency::OSThread
|
|||||||
}
|
}
|
||||||
static void userButtonPressedLong()
|
static void userButtonPressedLong()
|
||||||
{
|
{
|
||||||
// DEBUG_MSG("Long press!\n");
|
// LOG_DEBUG("Long press!\n");
|
||||||
#ifdef ARCH_ESP32
|
|
||||||
screen->adjustBrightness();
|
|
||||||
#endif
|
|
||||||
// If user button is held down for 5 seconds, shutdown the device.
|
// If user button is held down for 5 seconds, shutdown the device.
|
||||||
if ((millis() - longPressTime > 5 * 1000) && (longPressTime > 0)) {
|
if ((millis() - longPressTime > 5000) && (longPressTime > 0)) {
|
||||||
#ifdef HAS_PMU
|
#if defined(ARCH_NRF52) || defined(ARCH_ESP32)
|
||||||
if (pmu_found == true) {
|
|
||||||
setLed(false);
|
|
||||||
power->shutdown();
|
|
||||||
}
|
|
||||||
#elif defined(ARCH_NRF52)
|
|
||||||
// Do actual shutdown when button released, otherwise the button release
|
// Do actual shutdown when button released, otherwise the button release
|
||||||
// may wake the board immediatedly.
|
// may wake the board immediatedly.
|
||||||
if ((!shutdown_on_long_stop) && (millis() > 30 * 1000)) {
|
if ((!shutdown_on_long_stop) && (millis() > 30 * 1000)) {
|
||||||
screen->startShutdownScreen();
|
screen->startShutdownScreen();
|
||||||
DEBUG_MSG("Shutdown from long press");
|
LOG_INFO("Shutdown from long press");
|
||||||
playBeep();
|
playBeep();
|
||||||
#ifdef PIN_LED1
|
#ifdef PIN_LED1
|
||||||
ledOff(PIN_LED1);
|
ledOff(PIN_LED1);
|
||||||
#endif
|
#endif
|
||||||
#ifdef PIN_LED2
|
#ifdef PIN_LED2
|
||||||
ledOff(PIN_LED2);
|
ledOff(PIN_LED2);
|
||||||
#endif
|
#endif
|
||||||
#ifdef PIN_LED3
|
#ifdef PIN_LED3
|
||||||
ledOff(PIN_LED3);
|
ledOff(PIN_LED3);
|
||||||
#endif
|
#endif
|
||||||
shutdown_on_long_stop = true;
|
shutdown_on_long_stop = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
// DEBUG_MSG("Long press %u\n", (millis() - longPressTime));
|
// LOG_DEBUG("Long press %u\n", (millis() - longPressTime));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,19 +184,36 @@ class ButtonThread : public concurrency::OSThread
|
|||||||
#if defined(USE_EINK) && defined(PIN_EINK_EN)
|
#if defined(USE_EINK) && defined(PIN_EINK_EN)
|
||||||
digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW);
|
digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW);
|
||||||
#endif
|
#endif
|
||||||
|
screen->print("Sent ad-hoc ping\n");
|
||||||
|
service.refreshLocalMeshNode();
|
||||||
|
service.sendNetworkPing(NODENUM_BROADCAST, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void userButtonMultiPressed()
|
static void userButtonMultiPressed()
|
||||||
{
|
{
|
||||||
screen->print("Sent ad-hoc ping\n");
|
if (!config.device.disable_triple_click && (gps != nullptr)) {
|
||||||
service.refreshMyNodeInfo();
|
config.position.gps_enabled = !(config.position.gps_enabled);
|
||||||
service.sendNetworkPing(NODENUM_BROADCAST, true);
|
if (config.position.gps_enabled) {
|
||||||
|
LOG_DEBUG("Flag set to true to restore power\n");
|
||||||
|
gps->enable();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
LOG_DEBUG("Flag set to false for gps power\n");
|
||||||
|
gps->disable();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void userButtonPressedLongStart()
|
static void userButtonPressedLongStart()
|
||||||
{
|
{
|
||||||
|
#ifdef T_DECK
|
||||||
|
// False positive long-press triggered on T-Deck with i2s audio, so short circuit
|
||||||
|
if (moduleConfig.external_notification.enabled && (externalNotificationModule->nagCycleCutoff != UINT32_MAX)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (millis() > 30 * 1000) {
|
if (millis() > 30 * 1000) {
|
||||||
DEBUG_MSG("Long press start!\n");
|
LOG_DEBUG("Long press start!\n");
|
||||||
longPressTime = millis();
|
longPressTime = millis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -182,7 +221,7 @@ class ButtonThread : public concurrency::OSThread
|
|||||||
static void userButtonPressedLongStop()
|
static void userButtonPressedLongStop()
|
||||||
{
|
{
|
||||||
if (millis() > 30 * 1000) {
|
if (millis() > 30 * 1000) {
|
||||||
DEBUG_MSG("Long press stop!\n");
|
LOG_DEBUG("Long press stop!\n");
|
||||||
longPressTime = 0;
|
longPressTime = 0;
|
||||||
if (shutdown_on_long_stop) {
|
if (shutdown_on_long_stop) {
|
||||||
playShutdownMelody();
|
playShutdownMelody();
|
||||||
|
|||||||
172
src/DebugConfiguration.cpp
Normal file
172
src/DebugConfiguration.cpp
Normal file
@@ -0,0 +1,172 @@
|
|||||||
|
/* based on https://github.com/arcao/Syslog
|
||||||
|
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2016 Martin Sloup
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.*/
|
||||||
|
|
||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
|
#include "DebugConfiguration.h"
|
||||||
|
|
||||||
|
#if HAS_WIFI || HAS_ETHERNET
|
||||||
|
|
||||||
|
Syslog::Syslog(UDP &client)
|
||||||
|
{
|
||||||
|
this->_client = &client;
|
||||||
|
this->_server = NULL;
|
||||||
|
this->_port = 0;
|
||||||
|
this->_deviceHostname = SYSLOG_NILVALUE;
|
||||||
|
this->_appName = SYSLOG_NILVALUE;
|
||||||
|
this->_priDefault = LOGLEVEL_KERN;
|
||||||
|
}
|
||||||
|
|
||||||
|
Syslog &Syslog::server(const char *server, uint16_t port)
|
||||||
|
{
|
||||||
|
if (this->_ip.fromString(server)) {
|
||||||
|
this->_server = NULL;
|
||||||
|
} else {
|
||||||
|
this->_server = server;
|
||||||
|
}
|
||||||
|
this->_port = port;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Syslog &Syslog::server(IPAddress ip, uint16_t port)
|
||||||
|
{
|
||||||
|
this->_ip = ip;
|
||||||
|
this->_server = NULL;
|
||||||
|
this->_port = port;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Syslog &Syslog::deviceHostname(const char *deviceHostname)
|
||||||
|
{
|
||||||
|
this->_deviceHostname = (deviceHostname == NULL) ? SYSLOG_NILVALUE : deviceHostname;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Syslog &Syslog::appName(const char *appName)
|
||||||
|
{
|
||||||
|
this->_appName = (appName == NULL) ? SYSLOG_NILVALUE : appName;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Syslog &Syslog::defaultPriority(uint16_t pri)
|
||||||
|
{
|
||||||
|
this->_priDefault = pri;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Syslog &Syslog::logMask(uint8_t priMask)
|
||||||
|
{
|
||||||
|
this->_priMask = priMask;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Syslog::enable()
|
||||||
|
{
|
||||||
|
this->_enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Syslog::disable()
|
||||||
|
{
|
||||||
|
this->_enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Syslog::isEnabled()
|
||||||
|
{
|
||||||
|
return this->_enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Syslog::vlogf(uint16_t pri, const char *fmt, va_list args)
|
||||||
|
{
|
||||||
|
return this->vlogf(pri, this->_appName, fmt, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Syslog::vlogf(uint16_t pri, const char *appName, const char *fmt, va_list args)
|
||||||
|
{
|
||||||
|
char *message;
|
||||||
|
size_t initialLen;
|
||||||
|
size_t len;
|
||||||
|
bool result;
|
||||||
|
|
||||||
|
initialLen = strlen(fmt);
|
||||||
|
|
||||||
|
message = new char[initialLen + 1];
|
||||||
|
|
||||||
|
len = vsnprintf(message, initialLen + 1, fmt, args);
|
||||||
|
if (len > initialLen) {
|
||||||
|
delete[] message;
|
||||||
|
message = new char[len + 1];
|
||||||
|
|
||||||
|
vsnprintf(message, len + 1, fmt, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
result = this->_sendLog(pri, appName, message);
|
||||||
|
|
||||||
|
delete[] message;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool Syslog::_sendLog(uint16_t pri, const char *appName, const char *message)
|
||||||
|
{
|
||||||
|
int result;
|
||||||
|
|
||||||
|
if (!this->_enabled)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if ((this->_server == NULL && this->_ip == INADDR_NONE) || this->_port == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Check priority against priMask values.
|
||||||
|
if ((LOG_MASK(LOG_PRI(pri)) & this->_priMask) == 0)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Set default facility if none specified.
|
||||||
|
if ((pri & LOG_FACMASK) == 0)
|
||||||
|
pri = LOG_MAKEPRI(LOG_FAC(this->_priDefault), pri);
|
||||||
|
|
||||||
|
if (this->_server != NULL) {
|
||||||
|
result = this->_client->beginPacket(this->_server, this->_port);
|
||||||
|
} else {
|
||||||
|
result = this->_client->beginPacket(this->_ip, this->_port);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result != 1)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
this->_client->print('<');
|
||||||
|
this->_client->print(pri);
|
||||||
|
this->_client->print(F(">1 - "));
|
||||||
|
this->_client->print(this->_deviceHostname);
|
||||||
|
this->_client->print(' ');
|
||||||
|
this->_client->print(appName);
|
||||||
|
this->_client->print(F(" - - - \xEF\xBB\xBF"));
|
||||||
|
this->_client->print(F("["));
|
||||||
|
this->_client->print(int(millis() / 1000));
|
||||||
|
this->_client->print(F("]: "));
|
||||||
|
this->_client->print(message);
|
||||||
|
this->_client->endPacket();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
#ifndef SYSLOG_H
|
||||||
|
#define SYSLOG_H
|
||||||
|
|
||||||
// DEBUG LED
|
// DEBUG LED
|
||||||
#ifndef LED_INVERTED
|
#ifndef LED_INVERTED
|
||||||
#define LED_INVERTED 0 // define as 1 if LED is active low (on)
|
#define LED_INVERTED 0 // define as 1 if LED is active low (on)
|
||||||
@@ -13,20 +16,89 @@
|
|||||||
#define SERIAL_BAUD 115200 // Serial debug baud rate
|
#define SERIAL_BAUD 115200 // Serial debug baud rate
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define MESHTASTIC_LOG_LEVEL_DEBUG "DEBUG"
|
||||||
|
#define MESHTASTIC_LOG_LEVEL_INFO "INFO "
|
||||||
|
#define MESHTASTIC_LOG_LEVEL_WARN "WARN "
|
||||||
|
#define MESHTASTIC_LOG_LEVEL_ERROR "ERROR"
|
||||||
|
#define MESHTASTIC_LOG_LEVEL_CRIT "CRIT "
|
||||||
|
#define MESHTASTIC_LOG_LEVEL_TRACE "TRACE"
|
||||||
|
|
||||||
#include "SerialConsole.h"
|
#include "SerialConsole.h"
|
||||||
|
|
||||||
#define DEBUG_PORT (*console) // Serial debug port
|
#define DEBUG_PORT (*console) // Serial debug port
|
||||||
|
|
||||||
#ifdef USE_SEGGER
|
#ifdef USE_SEGGER
|
||||||
#define DEBUG_MSG(...) SEGGER_RTT_printf(0, __VA_ARGS__)
|
#define DEBUG_PORT
|
||||||
|
#define LOG_DEBUG(...) SEGGER_RTT_printf(0, __VA_ARGS__)
|
||||||
|
#define LOG_INFO(...) SEGGER_RTT_printf(0, __VA_ARGS__)
|
||||||
|
#define LOG_WARN(...) SEGGER_RTT_printf(0, __VA_ARGS__)
|
||||||
|
#define LOG_ERROR(...) SEGGER_RTT_printf(0, __VA_ARGS__)
|
||||||
|
#define LOG_CRIT(...) SEGGER_RTT_printf(0, __VA_ARGS__)
|
||||||
|
#define LOG_TRACE(...) SEGGER_RTT_printf(0, __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#ifdef DEBUG_PORT
|
#ifdef DEBUG_PORT
|
||||||
#define DEBUG_MSG(...) DEBUG_PORT.logDebug(__VA_ARGS__)
|
#define LOG_DEBUG(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_DEBUG, __VA_ARGS__)
|
||||||
|
#define LOG_INFO(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_INFO, __VA_ARGS__)
|
||||||
|
#define LOG_WARN(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_WARN, __VA_ARGS__)
|
||||||
|
#define LOG_ERROR(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_ERROR, __VA_ARGS__)
|
||||||
|
#define LOG_CRIT(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_CRIT, __VA_ARGS__)
|
||||||
|
#define LOG_TRACE(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_TRACE, __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define DEBUG_MSG(...)
|
#define LOG_DEBUG(...)
|
||||||
|
#define LOG_INFO(...)
|
||||||
|
#define LOG_WARN(...)
|
||||||
|
#define LOG_ERROR(...)
|
||||||
|
#define LOG_CRIT(...)
|
||||||
|
#define LOG_TRACE(...)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define SYSLOG_NILVALUE "-"
|
||||||
|
|
||||||
|
#define SYSLOG_CRIT 2 /* critical conditions */
|
||||||
|
#define SYSLOG_ERR 3 /* error conditions */
|
||||||
|
#define SYSLOG_WARN 4 /* warning conditions */
|
||||||
|
#define SYSLOG_INFO 6 /* informational */
|
||||||
|
#define SYSLOG_DEBUG 7 /* debug-level messages */
|
||||||
|
// trace does not go out to syslog (yet?)
|
||||||
|
|
||||||
|
#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
|
||||||
|
/* extract priority */
|
||||||
|
#define LOG_PRI(p) ((p)&LOG_PRIMASK)
|
||||||
|
#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
|
||||||
|
|
||||||
|
/* facility codes */
|
||||||
|
#define LOGLEVEL_KERN (0 << 3) /* kernel messages */
|
||||||
|
#define LOGLEVEL_USER (1 << 3) /* random user-level messages */
|
||||||
|
#define LOGLEVEL_MAIL (2 << 3) /* mail system */
|
||||||
|
#define LOGLEVEL_DAEMON (3 << 3) /* system daemons */
|
||||||
|
#define LOGLEVEL_AUTH (4 << 3) /* security/authorization messages */
|
||||||
|
#define LOGLEVEL_SYSLOG (5 << 3) /* messages generated internally by syslogd */
|
||||||
|
#define LOGLEVEL_LPR (6 << 3) /* line printer subsystem */
|
||||||
|
#define LOGLEVEL_NEWS (7 << 3) /* network news subsystem */
|
||||||
|
#define LOGLEVEL_UUCP (8 << 3) /* UUCP subsystem */
|
||||||
|
#define LOGLEVEL_CRON (9 << 3) /* clock daemon */
|
||||||
|
#define LOGLEVEL_AUTHPRIV (10 << 3) /* security/authorization messages (private) */
|
||||||
|
#define LOGLEVEL_FTP (11 << 3) /* ftp daemon */
|
||||||
|
|
||||||
|
/* other codes through 15 reserved for system use */
|
||||||
|
#define LOGLEVEL_LOCAL0 (16 << 3) /* reserved for local use */
|
||||||
|
#define LOGLEVEL_LOCAL1 (17 << 3) /* reserved for local use */
|
||||||
|
#define LOGLEVEL_LOCAL2 (18 << 3) /* reserved for local use */
|
||||||
|
#define LOGLEVEL_LOCAL3 (19 << 3) /* reserved for local use */
|
||||||
|
#define LOGLEVEL_LOCAL4 (20 << 3) /* reserved for local use */
|
||||||
|
#define LOGLEVEL_LOCAL5 (21 << 3) /* reserved for local use */
|
||||||
|
#define LOGLEVEL_LOCAL6 (22 << 3) /* reserved for local use */
|
||||||
|
#define LOGLEVEL_LOCAL7 (23 << 3) /* reserved for local use */
|
||||||
|
|
||||||
|
#define LOG_NFACILITIES 24 /* current number of facilities */
|
||||||
|
#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
|
||||||
|
/* facility of pri */
|
||||||
|
#define LOG_FAC(p) (((p)&LOG_FACMASK) >> 3)
|
||||||
|
|
||||||
|
#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
|
||||||
|
#define LOG_UPTO(pri) ((1 << ((pri) + 1)) - 1) /* all priorities through pri */
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// AXP192 (Rev1-specific options)
|
// AXP192 (Rev1-specific options)
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -36,3 +108,50 @@
|
|||||||
|
|
||||||
// Default Bluetooth PIN
|
// Default Bluetooth PIN
|
||||||
#define defaultBLEPin 123456
|
#define defaultBLEPin 123456
|
||||||
|
|
||||||
|
#if HAS_ETHERNET
|
||||||
|
#include <RAK13800_W5100S.h>
|
||||||
|
#endif // HAS_ETHERNET
|
||||||
|
|
||||||
|
#if HAS_WIFI
|
||||||
|
#include <WiFi.h>
|
||||||
|
#endif // HAS_WIFI
|
||||||
|
|
||||||
|
#if HAS_WIFI || HAS_ETHERNET
|
||||||
|
|
||||||
|
class Syslog
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
UDP *_client;
|
||||||
|
IPAddress _ip;
|
||||||
|
const char *_server;
|
||||||
|
uint16_t _port;
|
||||||
|
const char *_deviceHostname;
|
||||||
|
const char *_appName;
|
||||||
|
uint16_t _priDefault;
|
||||||
|
uint8_t _priMask = 0xff;
|
||||||
|
bool _enabled = false;
|
||||||
|
|
||||||
|
bool _sendLog(uint16_t pri, const char *appName, const char *message);
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit Syslog(UDP &client);
|
||||||
|
|
||||||
|
Syslog &server(const char *server, uint16_t port);
|
||||||
|
Syslog &server(IPAddress ip, uint16_t port);
|
||||||
|
Syslog &deviceHostname(const char *deviceHostname);
|
||||||
|
Syslog &appName(const char *appName);
|
||||||
|
Syslog &defaultPriority(uint16_t pri = LOGLEVEL_KERN);
|
||||||
|
Syslog &logMask(uint8_t priMask);
|
||||||
|
|
||||||
|
void enable();
|
||||||
|
void disable();
|
||||||
|
bool isEnabled();
|
||||||
|
|
||||||
|
bool vlogf(uint16_t pri, const char *fmt, va_list args) __attribute__((format(printf, 3, 0)));
|
||||||
|
bool vlogf(uint16_t pri, const char *appName, const char *fmt, va_list args) __attribute__((format(printf, 3, 0)));
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // HAS_ETHERNET || HAS_WIFI
|
||||||
|
|
||||||
|
#endif // SYSLOG_H
|
||||||
34
src/DisplayFormatters.cpp
Normal file
34
src/DisplayFormatters.cpp
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
#include "DisplayFormatters.h"
|
||||||
|
|
||||||
|
const char *DisplayFormatters::getModemPresetDisplayName(meshtastic_Config_LoRaConfig_ModemPreset preset, bool useShortName)
|
||||||
|
{
|
||||||
|
switch (preset) {
|
||||||
|
case meshtastic_Config_LoRaConfig_ModemPreset_SHORT_SLOW:
|
||||||
|
return useShortName ? "ShortS" : "ShortSlow";
|
||||||
|
break;
|
||||||
|
case meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST:
|
||||||
|
return useShortName ? "ShortF" : "ShortFast";
|
||||||
|
break;
|
||||||
|
case meshtastic_Config_LoRaConfig_ModemPreset_MEDIUM_SLOW:
|
||||||
|
return useShortName ? "MedS" : "MediumSlow";
|
||||||
|
break;
|
||||||
|
case meshtastic_Config_LoRaConfig_ModemPreset_MEDIUM_FAST:
|
||||||
|
return useShortName ? "MedF" : "MediumFast";
|
||||||
|
break;
|
||||||
|
case meshtastic_Config_LoRaConfig_ModemPreset_LONG_SLOW:
|
||||||
|
return useShortName ? "LongS" : "LongSlow";
|
||||||
|
break;
|
||||||
|
case meshtastic_Config_LoRaConfig_ModemPreset_LONG_FAST:
|
||||||
|
return useShortName ? "LongF" : "LongFast";
|
||||||
|
break;
|
||||||
|
case meshtastic_Config_LoRaConfig_ModemPreset_LONG_MODERATE:
|
||||||
|
return useShortName ? "LongM" : "LongMod";
|
||||||
|
break;
|
||||||
|
case meshtastic_Config_LoRaConfig_ModemPreset_VERY_LONG_SLOW:
|
||||||
|
return useShortName ? "VeryL" : "VLongSlow";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return useShortName ? "Custom" : "Invalid";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
8
src/DisplayFormatters.h
Normal file
8
src/DisplayFormatters.h
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "NodeDB.h"
|
||||||
|
|
||||||
|
class DisplayFormatters
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static const char *getModemPresetDisplayName(meshtastic_Config_LoRaConfig_ModemPreset preset, bool useShortName);
|
||||||
|
};
|
||||||
184
src/FSCommon.cpp
184
src/FSCommon.cpp
@@ -1,147 +1,180 @@
|
|||||||
#include "configuration.h"
|
/**
|
||||||
|
* @file FSCommon.cpp
|
||||||
|
* @brief This file contains functions for common filesystem operations such as copying, renaming, listing and deleting files and
|
||||||
|
* directories.
|
||||||
|
*
|
||||||
|
* The functions in this file are used to perform common filesystem operations such as copying, renaming, listing and deleting
|
||||||
|
* files and directories. These functions are used in the Meshtastic-device project to manage files and directories on the
|
||||||
|
* device's filesystem.
|
||||||
|
*
|
||||||
|
*/
|
||||||
#include "FSCommon.h"
|
#include "FSCommon.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
#ifdef HAS_SDCARD
|
#ifdef HAS_SDCARD
|
||||||
#include <SPI.h>
|
|
||||||
#include <SD.h>
|
#include <SD.h>
|
||||||
|
#include <SPI.h>
|
||||||
|
|
||||||
|
#ifdef SDCARD_USE_SPI1
|
||||||
#ifdef SDCARD_USE_SPI1
|
|
||||||
SPIClass SPI1(HSPI);
|
SPIClass SPI1(HSPI);
|
||||||
#define SDHandler SPI1
|
#define SDHandler SPI1
|
||||||
|
#else
|
||||||
|
#define SDHandler SPI
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif // HAS_SDCARD
|
||||||
|
|
||||||
#endif //HAS_SDCARD
|
/**
|
||||||
|
* @brief Copies a file from one location to another.
|
||||||
bool copyFile(const char* from, const char* to)
|
*
|
||||||
|
* @param from The path of the source file.
|
||||||
|
* @param to The path of the destination file.
|
||||||
|
* @return true if the file was successfully copied, false otherwise.
|
||||||
|
*/
|
||||||
|
bool copyFile(const char *from, const char *to)
|
||||||
{
|
{
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
unsigned char cbuffer[16];
|
unsigned char cbuffer[16];
|
||||||
|
|
||||||
File f1 = FSCom.open(from, FILE_O_READ);
|
File f1 = FSCom.open(from, FILE_O_READ);
|
||||||
if (!f1){
|
if (!f1) {
|
||||||
DEBUG_MSG("Failed to open source file %s\n", from);
|
LOG_ERROR("Failed to open source file %s\n", from);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
File f2 = FSCom.open(to, FILE_O_WRITE);
|
File f2 = FSCom.open(to, FILE_O_WRITE);
|
||||||
if (!f2) {
|
if (!f2) {
|
||||||
DEBUG_MSG("Failed to open destination file %s\n", to);
|
LOG_ERROR("Failed to open destination file %s\n", to);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (f1.available() > 0) {
|
while (f1.available() > 0) {
|
||||||
byte i = f1.read(cbuffer, 16);
|
byte i = f1.read(cbuffer, 16);
|
||||||
f2.write(cbuffer, i);
|
f2.write(cbuffer, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
f2.flush();
|
||||||
f2.close();
|
f2.close();
|
||||||
f1.close();
|
f1.close();
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool renameFile(const char* pathFrom, const char* pathTo)
|
/**
|
||||||
|
* Renames a file from pathFrom to pathTo.
|
||||||
|
*
|
||||||
|
* @param pathFrom The original path of the file.
|
||||||
|
* @param pathTo The new path of the file.
|
||||||
|
*
|
||||||
|
* @return True if the file was successfully renamed, false otherwise.
|
||||||
|
*/
|
||||||
|
bool renameFile(const char *pathFrom, const char *pathTo)
|
||||||
{
|
{
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
// rename was fixed for ESP32 IDF LittleFS in April
|
// rename was fixed for ESP32 IDF LittleFS in April
|
||||||
return FSCom.rename(pathFrom, pathTo);
|
return FSCom.rename(pathFrom, pathTo);
|
||||||
#else
|
#else
|
||||||
if (copyFile(pathFrom, pathTo) && FSCom.remove(pathFrom) ) {
|
if (copyFile(pathFrom, pathTo) && FSCom.remove(pathFrom)) {
|
||||||
return true;
|
return true;
|
||||||
} else{
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void listDir(const char * dirname, uint8_t levels, boolean del = false)
|
/**
|
||||||
|
* Lists the contents of a directory.
|
||||||
|
*
|
||||||
|
* @param dirname The name of the directory to list.
|
||||||
|
* @param levels The number of levels of subdirectories to list.
|
||||||
|
* @param del Whether or not to delete the contents of the directory after listing.
|
||||||
|
*/
|
||||||
|
void listDir(const char *dirname, uint8_t levels, bool del = false)
|
||||||
{
|
{
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
#if (defined(ARCH_ESP32) || defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
#if (defined(ARCH_ESP32) || defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
||||||
char buffer[255];
|
char buffer[255];
|
||||||
#endif
|
#endif
|
||||||
File root = FSCom.open(dirname, FILE_O_READ);
|
File root = FSCom.open(dirname, FILE_O_READ);
|
||||||
if(!root){
|
if (!root) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!root.isDirectory()){
|
if (!root.isDirectory()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
File file = root.openNextFile();
|
File file = root.openNextFile();
|
||||||
while(file){
|
while (file) {
|
||||||
if(file.isDirectory() && !String(file.name()).endsWith(".")) {
|
if (file.isDirectory() && !String(file.name()).endsWith(".")) {
|
||||||
if(levels){
|
if (levels) {
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
listDir(file.path(), levels -1, del);
|
listDir(file.path(), levels - 1, del);
|
||||||
if(del) {
|
if (del) {
|
||||||
DEBUG_MSG("Removing %s\n", file.path());
|
LOG_DEBUG("Removing %s\n", file.path());
|
||||||
strcpy(buffer, file.path());
|
strncpy(buffer, file.path(), sizeof(buffer));
|
||||||
file.close();
|
file.close();
|
||||||
FSCom.rmdir(buffer);
|
FSCom.rmdir(buffer);
|
||||||
} else {
|
} else {
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
||||||
listDir(file.name(), levels -1, del);
|
listDir(file.name(), levels - 1, del);
|
||||||
if(del) {
|
if (del) {
|
||||||
DEBUG_MSG("Removing %s\n", file.name());
|
LOG_DEBUG("Removing %s\n", file.name());
|
||||||
strcpy(buffer, file.name());
|
strncpy(buffer, file.name(), sizeof(buffer));
|
||||||
file.close();
|
file.close();
|
||||||
FSCom.rmdir(buffer);
|
FSCom.rmdir(buffer);
|
||||||
} else {
|
} else {
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
listDir(file.name(), levels -1, del);
|
listDir(file.name(), levels - 1, del);
|
||||||
file.close();
|
file.close();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
if(del) {
|
if (del) {
|
||||||
DEBUG_MSG("Deleting %s\n", file.path());
|
LOG_DEBUG("Deleting %s\n", file.path());
|
||||||
strcpy(buffer, file.path());
|
strncpy(buffer, file.path(), sizeof(buffer));
|
||||||
file.close();
|
file.close();
|
||||||
FSCom.remove(buffer);
|
FSCom.remove(buffer);
|
||||||
} else {
|
} else {
|
||||||
DEBUG_MSG(" %s (%i Bytes)\n", file.path(), file.size());
|
LOG_DEBUG(" %s (%i Bytes)\n", file.path(), file.size());
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
||||||
if(del) {
|
if (del) {
|
||||||
DEBUG_MSG("Deleting %s\n", file.name());
|
LOG_DEBUG("Deleting %s\n", file.name());
|
||||||
strcpy(buffer, file.name());
|
strncpy(buffer, file.name(), sizeof(buffer));
|
||||||
file.close();
|
file.close();
|
||||||
FSCom.remove(buffer);
|
FSCom.remove(buffer);
|
||||||
} else {
|
} else {
|
||||||
DEBUG_MSG(" %s (%i Bytes)\n", file.name(), file.size());
|
LOG_DEBUG(" %s (%i Bytes)\n", file.name(), file.size());
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
DEBUG_MSG(" %s (%i Bytes)\n", file.name(), file.size());
|
LOG_DEBUG(" %s (%i Bytes)\n", file.name(), file.size());
|
||||||
file.close();
|
file.close();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
file = root.openNextFile();
|
file = root.openNextFile();
|
||||||
}
|
}
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
if(del) {
|
if (del) {
|
||||||
DEBUG_MSG("Removing %s\n", root.path());
|
LOG_DEBUG("Removing %s\n", root.path());
|
||||||
strcpy(buffer, root.path());
|
strncpy(buffer, root.path(), sizeof(buffer));
|
||||||
root.close();
|
root.close();
|
||||||
FSCom.rmdir(buffer);
|
FSCom.rmdir(buffer);
|
||||||
} else {
|
} else {
|
||||||
root.close();
|
root.close();
|
||||||
}
|
}
|
||||||
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
#elif (defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
||||||
if(del) {
|
if (del) {
|
||||||
DEBUG_MSG("Removing %s\n", root.name());
|
LOG_DEBUG("Removing %s\n", root.name());
|
||||||
strcpy(buffer, root.name());
|
strncpy(buffer, root.name(), sizeof(buffer));
|
||||||
root.close();
|
root.close();
|
||||||
FSCom.rmdir(buffer);
|
FSCom.rmdir(buffer);
|
||||||
} else {
|
} else {
|
||||||
@@ -153,7 +186,14 @@ void listDir(const char * dirname, uint8_t levels, boolean del = false)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void rmDir(const char * dirname)
|
/**
|
||||||
|
* @brief Removes a directory and all its contents.
|
||||||
|
*
|
||||||
|
* This function recursively removes a directory and all its contents, including subdirectories and files.
|
||||||
|
*
|
||||||
|
* @param dirname The name of the directory to remove.
|
||||||
|
*/
|
||||||
|
void rmDir(const char *dirname)
|
||||||
{
|
{
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
#if (defined(ARCH_ESP32) || defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
#if (defined(ARCH_ESP32) || defined(ARCH_RP2040) || defined(ARCH_PORTDUINO))
|
||||||
@@ -168,52 +208,50 @@ void rmDir(const char * dirname)
|
|||||||
void fsInit()
|
void fsInit()
|
||||||
{
|
{
|
||||||
#ifdef FSCom
|
#ifdef FSCom
|
||||||
if (!FSBegin())
|
if (!FSBegin()) {
|
||||||
{
|
LOG_ERROR("Filesystem mount Failed.\n");
|
||||||
DEBUG_MSG("ERROR filesystem mount Failed. Formatting...\n");
|
// assert(0); This auto-formats the partition, so no need to fail here.
|
||||||
assert(0); // FIXME - report failure to phone
|
|
||||||
}
|
}
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
DEBUG_MSG("Filesystem files (%d/%d Bytes):\n", FSCom.usedBytes(), FSCom.totalBytes());
|
LOG_DEBUG("Filesystem files (%d/%d Bytes):\n", FSCom.usedBytes(), FSCom.totalBytes());
|
||||||
#else
|
#else
|
||||||
DEBUG_MSG("Filesystem files:\n");
|
LOG_DEBUG("Filesystem files:\n");
|
||||||
#endif
|
#endif
|
||||||
listDir("/", 10);
|
listDir("/", 10);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes the SD card and mounts the file system.
|
||||||
|
*/
|
||||||
void setupSDCard()
|
void setupSDCard()
|
||||||
{
|
{
|
||||||
#ifdef HAS_SDCARD
|
#ifdef HAS_SDCARD
|
||||||
SDHandler.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
|
SDHandler.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
|
||||||
|
|
||||||
if (!SD.begin(SDCARD_CS, SDHandler)) {
|
if (!SD.begin(SDCARD_CS, SDHandler)) {
|
||||||
DEBUG_MSG("No SD_MMC card detected\n");
|
LOG_DEBUG("No SD_MMC card detected\n");
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
uint8_t cardType = SD.cardType();
|
uint8_t cardType = SD.cardType();
|
||||||
if (cardType == CARD_NONE) {
|
if (cardType == CARD_NONE) {
|
||||||
DEBUG_MSG("No SD_MMC card attached\n");
|
LOG_DEBUG("No SD_MMC card attached\n");
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
DEBUG_MSG("SD_MMC Card Type: ");
|
LOG_DEBUG("SD_MMC Card Type: ");
|
||||||
if (cardType == CARD_MMC) {
|
if (cardType == CARD_MMC) {
|
||||||
DEBUG_MSG("MMC\n");
|
LOG_DEBUG("MMC\n");
|
||||||
} else if (cardType == CARD_SD) {
|
} else if (cardType == CARD_SD) {
|
||||||
DEBUG_MSG("SDSC\n");
|
LOG_DEBUG("SDSC\n");
|
||||||
} else if (cardType == CARD_SDHC) {
|
} else if (cardType == CARD_SDHC) {
|
||||||
DEBUG_MSG("SDHC\n");
|
LOG_DEBUG("SDHC\n");
|
||||||
} else {
|
} else {
|
||||||
DEBUG_MSG("UNKNOWN\n");
|
LOG_DEBUG("UNKNOWN\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
|
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
|
||||||
DEBUG_MSG("SD Card Size: %lluMB\n", cardSize);
|
LOG_DEBUG("SD Card Size: %lluMB\n", cardSize);
|
||||||
DEBUG_MSG("Total space: %llu MB\n", SD.totalBytes() / (1024 * 1024));
|
LOG_DEBUG("Total space: %llu MB\n", SD.totalBytes() / (1024 * 1024));
|
||||||
DEBUG_MSG("Used space: %llu MB\n", SD.usedBytes() / (1024 * 1024));
|
LOG_DEBUG("Used space: %llu MB\n", SD.usedBytes() / (1024 * 1024));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -13,11 +13,18 @@
|
|||||||
#define FILE_O_READ "r"
|
#define FILE_O_READ "r"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(ARCH_STM32WL)
|
||||||
|
#include "platform/stm32wl/InternalFileSystem.h" // STM32WL version
|
||||||
|
#define FSCom InternalFS
|
||||||
|
#define FSBegin() FSCom.begin()
|
||||||
|
using namespace LittleFS_Namespace;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(ARCH_RP2040)
|
#if defined(ARCH_RP2040)
|
||||||
// RP2040
|
// RP2040
|
||||||
#include "LittleFS.h"
|
#include "LittleFS.h"
|
||||||
#define FSCom LittleFS
|
#define FSCom LittleFS
|
||||||
#define FSBegin() FSCom.begin()
|
#define FSBegin() FSCom.begin() // set autoformat
|
||||||
#define FILE_O_WRITE "w"
|
#define FILE_O_WRITE "w"
|
||||||
#define FILE_O_READ "r"
|
#define FILE_O_READ "r"
|
||||||
#endif
|
#endif
|
||||||
@@ -26,7 +33,7 @@
|
|||||||
// ESP32 version
|
// ESP32 version
|
||||||
#include "LittleFS.h"
|
#include "LittleFS.h"
|
||||||
#define FSCom LittleFS
|
#define FSCom LittleFS
|
||||||
#define FSBegin() FSCom.begin(true)
|
#define FSBegin() FSCom.begin(true) // format on failure
|
||||||
#define FILE_O_WRITE "w"
|
#define FILE_O_WRITE "w"
|
||||||
#define FILE_O_READ "r"
|
#define FILE_O_READ "r"
|
||||||
#endif
|
#endif
|
||||||
@@ -35,13 +42,13 @@
|
|||||||
// NRF52 version
|
// NRF52 version
|
||||||
#include "InternalFileSystem.h"
|
#include "InternalFileSystem.h"
|
||||||
#define FSCom InternalFS
|
#define FSCom InternalFS
|
||||||
#define FSBegin() FSCom.begin()
|
#define FSBegin() FSCom.begin() // InternalFS formats on failure
|
||||||
using namespace Adafruit_LittleFS_Namespace;
|
using namespace Adafruit_LittleFS_Namespace;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void fsInit();
|
void fsInit();
|
||||||
bool copyFile(const char* from, const char* to);
|
bool copyFile(const char *from, const char *to);
|
||||||
bool renameFile(const char* pathFrom, const char* pathTo);
|
bool renameFile(const char *pathFrom, const char *pathTo);
|
||||||
void listDir(const char * dirname, uint8_t levels, boolean del);
|
void listDir(const char *dirname, uint8_t levels, bool del);
|
||||||
void rmDir(const char * dirname);
|
void rmDir(const char *dirname);
|
||||||
void setupSDCard();
|
void setupSDCard();
|
||||||
@@ -20,16 +20,19 @@ class GPSStatus : public Status
|
|||||||
bool hasLock = false; // default to false, until we complete our first read
|
bool hasLock = false; // default to false, until we complete our first read
|
||||||
bool isConnected = false; // Do we have a GPS we are talking to
|
bool isConnected = false; // Do we have a GPS we are talking to
|
||||||
|
|
||||||
Position p = Position_init_default;
|
bool isPowerSaving = false; // Are we in power saving state
|
||||||
|
|
||||||
|
meshtastic_Position p = meshtastic_Position_init_default;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GPSStatus() { statusType = STATUS_TYPE_GPS; }
|
GPSStatus() { statusType = STATUS_TYPE_GPS; }
|
||||||
|
|
||||||
// preferred method
|
// preferred method
|
||||||
GPSStatus(bool hasLock, bool isConnected, const Position &pos) : Status()
|
GPSStatus(bool hasLock, bool isConnected, bool isPowerSaving, const meshtastic_Position &pos) : Status()
|
||||||
{
|
{
|
||||||
this->hasLock = hasLock;
|
this->hasLock = hasLock;
|
||||||
this->isConnected = isConnected;
|
this->isConnected = isConnected;
|
||||||
|
this->isPowerSaving = isPowerSaving;
|
||||||
|
|
||||||
// all-in-one struct copy
|
// all-in-one struct copy
|
||||||
this->p = pos;
|
this->p = pos;
|
||||||
@@ -44,13 +47,15 @@ class GPSStatus : public Status
|
|||||||
|
|
||||||
bool getIsConnected() const { return isConnected; }
|
bool getIsConnected() const { return isConnected; }
|
||||||
|
|
||||||
|
bool getIsPowerSaving() const { return isPowerSaving; }
|
||||||
|
|
||||||
int32_t getLatitude() const
|
int32_t getLatitude() const
|
||||||
{
|
{
|
||||||
if (config.position.fixed_position) {
|
if (config.position.fixed_position) {
|
||||||
#ifdef GPS_EXTRAVERBOSE
|
#ifdef GPS_EXTRAVERBOSE
|
||||||
DEBUG_MSG("WARNING: Using fixed latitude\n");
|
LOG_WARN("Using fixed latitude\n");
|
||||||
#endif
|
#endif
|
||||||
NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum());
|
meshtastic_NodeInfoLite *node = nodeDB.getMeshNode(nodeDB.getNodeNum());
|
||||||
return node->position.latitude_i;
|
return node->position.latitude_i;
|
||||||
} else {
|
} else {
|
||||||
return p.latitude_i;
|
return p.latitude_i;
|
||||||
@@ -61,9 +66,9 @@ class GPSStatus : public Status
|
|||||||
{
|
{
|
||||||
if (config.position.fixed_position) {
|
if (config.position.fixed_position) {
|
||||||
#ifdef GPS_EXTRAVERBOSE
|
#ifdef GPS_EXTRAVERBOSE
|
||||||
DEBUG_MSG("WARNING: Using fixed longitude\n");
|
LOG_WARN("Using fixed longitude\n");
|
||||||
#endif
|
#endif
|
||||||
NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum());
|
meshtastic_NodeInfoLite *node = nodeDB.getMeshNode(nodeDB.getNodeNum());
|
||||||
return node->position.longitude_i;
|
return node->position.longitude_i;
|
||||||
} else {
|
} else {
|
||||||
return p.longitude_i;
|
return p.longitude_i;
|
||||||
@@ -74,31 +79,40 @@ class GPSStatus : public Status
|
|||||||
{
|
{
|
||||||
if (config.position.fixed_position) {
|
if (config.position.fixed_position) {
|
||||||
#ifdef GPS_EXTRAVERBOSE
|
#ifdef GPS_EXTRAVERBOSE
|
||||||
DEBUG_MSG("WARNING: Using fixed altitude\n");
|
LOG_WARN("Using fixed altitude\n");
|
||||||
#endif
|
#endif
|
||||||
NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum());
|
meshtastic_NodeInfoLite *node = nodeDB.getMeshNode(nodeDB.getNodeNum());
|
||||||
return node->position.altitude;
|
return node->position.altitude;
|
||||||
} else {
|
} else {
|
||||||
return p.altitude;
|
return p.altitude;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t getDOP() const { return p.PDOP; }
|
uint32_t getDOP() const
|
||||||
|
{
|
||||||
|
return p.PDOP;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t getHeading() const { return p.ground_track; }
|
uint32_t getHeading() const
|
||||||
|
{
|
||||||
|
return p.ground_track;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t getNumSatellites() const { return p.sats_in_view; }
|
uint32_t getNumSatellites() const
|
||||||
|
{
|
||||||
|
return p.sats_in_view;
|
||||||
|
}
|
||||||
|
|
||||||
bool matches(const GPSStatus *newStatus) const
|
bool matches(const GPSStatus *newStatus) const
|
||||||
{
|
{
|
||||||
#ifdef GPS_EXTRAVERBOSE
|
#ifdef GPS_EXTRAVERBOSE
|
||||||
DEBUG_MSG("GPSStatus.match() new pos@%x to old pos@%x\n", newStatus->p.pos_timestamp, p.pos_timestamp);
|
LOG_DEBUG("GPSStatus.match() new pos@%x to old pos@%x\n", newStatus->p.timestamp, p.timestamp);
|
||||||
#endif
|
#endif
|
||||||
return (newStatus->hasLock != hasLock || newStatus->isConnected != isConnected ||
|
return (newStatus->hasLock != hasLock || newStatus->isConnected != isConnected ||
|
||||||
newStatus->p.latitude_i != p.latitude_i || newStatus->p.longitude_i != p.longitude_i ||
|
newStatus->isPowerSaving != isPowerSaving || newStatus->p.latitude_i != p.latitude_i ||
|
||||||
newStatus->p.altitude != p.altitude || newStatus->p.altitude_hae != p.altitude_hae ||
|
newStatus->p.longitude_i != p.longitude_i || newStatus->p.altitude != p.altitude ||
|
||||||
newStatus->p.PDOP != p.PDOP || newStatus->p.ground_track != p.ground_track ||
|
newStatus->p.altitude_hae != p.altitude_hae || newStatus->p.PDOP != p.PDOP ||
|
||||||
newStatus->p.ground_speed != p.ground_speed ||
|
newStatus->p.ground_track != p.ground_track || newStatus->p.ground_speed != p.ground_speed ||
|
||||||
newStatus->p.sats_in_view != p.sats_in_view);
|
newStatus->p.sats_in_view != p.sats_in_view);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +123,7 @@ class GPSStatus : public Status
|
|||||||
|
|
||||||
if (isDirty && p.timestamp && (newStatus->p.timestamp == p.timestamp)) {
|
if (isDirty && p.timestamp && (newStatus->p.timestamp == p.timestamp)) {
|
||||||
// We can NEVER be in two locations at the same time! (also PR #886)
|
// We can NEVER be in two locations at the same time! (also PR #886)
|
||||||
DEBUG_MSG("BUG!! positional timestamp unchanged from prev solution\n");
|
LOG_ERROR("BUG: Positional timestamp unchanged from prev solution\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
@@ -121,11 +135,12 @@ class GPSStatus : public Status
|
|||||||
if (isDirty) {
|
if (isDirty) {
|
||||||
if (hasLock) {
|
if (hasLock) {
|
||||||
// In debug logs, identify position by @timestamp:stage (stage 3 = notify)
|
// In debug logs, identify position by @timestamp:stage (stage 3 = notify)
|
||||||
DEBUG_MSG("New GPS pos@%x:3 lat=%f, lon=%f, alt=%d, pdop=%.2f, track=%.2f, speed=%.2f, sats=%d\n", p.timestamp,
|
LOG_DEBUG("New GPS pos@%x:3 lat=%f, lon=%f, alt=%d, pdop=%.2f, track=%.2f, speed=%.2f, sats=%d\n", p.timestamp,
|
||||||
p.latitude_i * 1e-7, p.longitude_i * 1e-7, p.altitude, p.PDOP * 1e-2, p.ground_track * 1e-5,
|
p.latitude_i * 1e-7, p.longitude_i * 1e-7, p.altitude, p.PDOP * 1e-2, p.ground_track * 1e-5,
|
||||||
p.ground_speed * 1e-2, p.sats_in_view);
|
p.ground_speed * 1e-2, p.sats_in_view);
|
||||||
} else
|
} else {
|
||||||
DEBUG_MSG("No GPS lock\n");
|
LOG_DEBUG("No GPS lock\n");
|
||||||
|
}
|
||||||
onNewStatus.notifyObservers(this);
|
onNewStatus.notifyObservers(this);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -134,4 +149,4 @@ class GPSStatus : public Status
|
|||||||
|
|
||||||
} // namespace meshtastic
|
} // namespace meshtastic
|
||||||
|
|
||||||
extern meshtastic::GPSStatus *gpsStatus;
|
extern meshtastic::GPSStatus *gpsStatus;
|
||||||
117
src/NodeStatus.h
117
src/NodeStatus.h
@@ -1,83 +1,68 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <Arduino.h>
|
|
||||||
#include "Status.h"
|
#include "Status.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include <Arduino.h>
|
||||||
|
|
||||||
namespace meshtastic {
|
namespace meshtastic
|
||||||
|
{
|
||||||
|
|
||||||
/// Describes the state of the NodeDB system.
|
/// Describes the state of the NodeDB system.
|
||||||
class NodeStatus : public Status
|
class NodeStatus : public Status
|
||||||
|
{
|
||||||
|
|
||||||
|
private:
|
||||||
|
CallbackObserver<NodeStatus, const NodeStatus *> statusObserver =
|
||||||
|
CallbackObserver<NodeStatus, const NodeStatus *>(this, &NodeStatus::updateStatus);
|
||||||
|
|
||||||
|
uint8_t numOnline = 0;
|
||||||
|
uint8_t numTotal = 0;
|
||||||
|
|
||||||
|
uint8_t lastNumTotal = 0;
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool forceUpdate = false;
|
||||||
|
|
||||||
|
NodeStatus() { statusType = STATUS_TYPE_NODE; }
|
||||||
|
NodeStatus(uint8_t numOnline, uint8_t numTotal, bool forceUpdate = false) : Status()
|
||||||
{
|
{
|
||||||
|
this->forceUpdate = forceUpdate;
|
||||||
|
this->numOnline = numOnline;
|
||||||
|
this->numTotal = numTotal;
|
||||||
|
}
|
||||||
|
NodeStatus(const NodeStatus &);
|
||||||
|
NodeStatus &operator=(const NodeStatus &);
|
||||||
|
|
||||||
private:
|
void observe(Observable<const NodeStatus *> *source) { statusObserver.observe(source); }
|
||||||
CallbackObserver<NodeStatus, const NodeStatus *> statusObserver = CallbackObserver<NodeStatus, const NodeStatus *>(this, &NodeStatus::updateStatus);
|
|
||||||
|
|
||||||
uint8_t numOnline = 0;
|
uint8_t getNumOnline() const { return numOnline; }
|
||||||
uint8_t numTotal = 0;
|
|
||||||
|
|
||||||
uint8_t lastNumTotal = 0;
|
uint8_t getNumTotal() const { return numTotal; }
|
||||||
|
|
||||||
public:
|
uint8_t getLastNumTotal() const { return lastNumTotal; }
|
||||||
bool forceUpdate = false;
|
|
||||||
|
|
||||||
NodeStatus() {
|
bool matches(const NodeStatus *newStatus) const
|
||||||
statusType = STATUS_TYPE_NODE;
|
{
|
||||||
}
|
return (newStatus->getNumOnline() != numOnline || newStatus->getNumTotal() != numTotal);
|
||||||
NodeStatus( uint8_t numOnline, uint8_t numTotal, bool forceUpdate = false ) : Status()
|
}
|
||||||
|
int updateStatus(const NodeStatus *newStatus)
|
||||||
|
{
|
||||||
|
// Only update the status if values have actually changed
|
||||||
|
lastNumTotal = numTotal;
|
||||||
|
bool isDirty;
|
||||||
{
|
{
|
||||||
this->forceUpdate = forceUpdate;
|
isDirty = matches(newStatus);
|
||||||
this->numOnline = numOnline;
|
initialized = true;
|
||||||
this->numTotal = numTotal;
|
numOnline = newStatus->getNumOnline();
|
||||||
|
numTotal = newStatus->getNumTotal();
|
||||||
}
|
}
|
||||||
NodeStatus(const NodeStatus &);
|
if (isDirty || newStatus->forceUpdate) {
|
||||||
NodeStatus &operator=(const NodeStatus &);
|
LOG_DEBUG("Node status update: %d online, %d total\n", numOnline, numTotal);
|
||||||
|
onNewStatus.notifyObservers(this);
|
||||||
void observe(Observable<const NodeStatus *> *source)
|
|
||||||
{
|
|
||||||
statusObserver.observe(source);
|
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
uint8_t getNumOnline() const
|
} // namespace meshtastic
|
||||||
{
|
|
||||||
return numOnline;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t getNumTotal() const
|
|
||||||
{
|
|
||||||
return numTotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t getLastNumTotal() const
|
|
||||||
{
|
|
||||||
return lastNumTotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool matches(const NodeStatus *newStatus) const
|
|
||||||
{
|
|
||||||
return (
|
|
||||||
newStatus->getNumOnline() != numOnline ||
|
|
||||||
newStatus->getNumTotal() != numTotal
|
|
||||||
);
|
|
||||||
}
|
|
||||||
int updateStatus(const NodeStatus *newStatus) {
|
|
||||||
// Only update the status if values have actually changed
|
|
||||||
lastNumTotal = numTotal;
|
|
||||||
bool isDirty;
|
|
||||||
{
|
|
||||||
isDirty = matches(newStatus);
|
|
||||||
initialized = true;
|
|
||||||
numOnline = newStatus->getNumOnline();
|
|
||||||
numTotal = newStatus->getNumTotal();
|
|
||||||
}
|
|
||||||
if(isDirty || newStatus->forceUpdate) {
|
|
||||||
DEBUG_MSG("Node status update: %d online, %d total\n", numOnline, numTotal);
|
|
||||||
onNewStatus.notifyObservers(this);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
extern meshtastic::NodeStatus *nodeStatus;
|
extern meshtastic::NodeStatus *nodeStatus;
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
#include "configuration.h"
|
|
||||||
#include "OSTimer.h"
|
#include "OSTimer.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Schedule a callback to run. The callback must _not_ block, though it is called from regular thread level (not ISR)
|
* Schedule a callback to run. The callback must _not_ block, though it is called from regular thread level (not ISR)
|
||||||
*
|
*
|
||||||
* NOTE! xTimerPend... seems to ignore the time passed in on ESP32 and on NRF52
|
* NOTE! xTimerPend... seems to ignore the time passed in on ESP32 and on NRF52
|
||||||
* The reason this didn't work is bcause xTimerPednFunctCall really isn't a timer function at all - it just means run the callback
|
* The reason this didn't work is because xTimerPednFunctCall really isn't a timer function at all - it just means run the
|
||||||
|
callback
|
||||||
* from the timer thread the next time you have spare cycles.
|
* from the timer thread the next time you have spare cycles.
|
||||||
*
|
*
|
||||||
* @return true if successful, false if the timer fifo is too full.
|
* @return true if successful, false if the timer fifo is too full.
|
||||||
@@ -28,6 +29,16 @@ static void IRAM_ATTR onTimer()
|
|||||||
(*tCallback)(tParam1, tParam2);
|
(*tCallback)(tParam1, tParam2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Schedules a hardware callback function to be executed after a specified delay.
|
||||||
|
*
|
||||||
|
* @param callback The function to be executed.
|
||||||
|
* @param param1 The first parameter to be passed to the function.
|
||||||
|
* @param param2 The second parameter to be passed to the function.
|
||||||
|
* @param delayMsec The delay time in milliseconds before the function is executed.
|
||||||
|
*
|
||||||
|
* @return True if the function was successfully scheduled, false otherwise.
|
||||||
|
*/
|
||||||
bool scheduleHWCallback(PendableFunction callback, void *param1, uint32_t param2, uint32_t delayMsec)
|
bool scheduleHWCallback(PendableFunction callback, void *param1, uint32_t param2, uint32_t delayMsec)
|
||||||
{
|
{
|
||||||
if (!timer) {
|
if (!timer) {
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
#include "configuration.h"
|
|
||||||
#include "Observer.h"
|
#include "Observer.h"
|
||||||
|
#include "configuration.h"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <assert.h>
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
template <class T> class Observable;
|
template <class T> class Observable;
|
||||||
@@ -11,7 +10,7 @@ template <class T> class Observable;
|
|||||||
*/
|
*/
|
||||||
template <class T> class Observer
|
template <class T> class Observer
|
||||||
{
|
{
|
||||||
std::list<Observable<T> *> observed;
|
std::list<Observable<T> *> observed;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~Observer();
|
virtual ~Observer();
|
||||||
@@ -88,7 +87,7 @@ template <class T> class Observable
|
|||||||
template <class T> Observer<T>::~Observer()
|
template <class T> Observer<T>::~Observer()
|
||||||
{
|
{
|
||||||
for (typename std::list<Observable<T> *>::const_iterator iterator = observed.begin(); iterator != observed.end();
|
for (typename std::list<Observable<T> *>::const_iterator iterator = observed.begin(); iterator != observed.end();
|
||||||
++iterator) {
|
++iterator) {
|
||||||
(*iterator)->removeObserver(this);
|
(*iterator)->removeObserver(this);
|
||||||
}
|
}
|
||||||
observed.clear();
|
observed.clear();
|
||||||
|
|||||||
636
src/Power.cpp
636
src/Power.cpp
@@ -1,20 +1,74 @@
|
|||||||
|
/**
|
||||||
|
* @file Power.cpp
|
||||||
|
* @brief This file contains the implementation of the Power class, which is responsible for managing power-related functionality
|
||||||
|
* of the device. It includes battery level sensing, power management unit (PMU) control, and power state machine management. The
|
||||||
|
* Power class is used by the main device class to manage power-related functionality.
|
||||||
|
*
|
||||||
|
* The file also includes implementations of various battery level sensors, such as the AnalogBatteryLevel class, which assumes
|
||||||
|
* the battery voltage is attached via a voltage-divider to an analog input.
|
||||||
|
*
|
||||||
|
* This file is part of the Meshtastic project.
|
||||||
|
* For more information, see: https://meshtastic.org/
|
||||||
|
*/
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "PowerFSM.h"
|
#include "PowerFSM.h"
|
||||||
|
#include "buzz/buzz.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "meshUtils.h"
|
||||||
#include "sleep.h"
|
#include "sleep.h"
|
||||||
#include "utils.h"
|
|
||||||
#include "buzz/buzz.h"
|
// Working USB detection for powered/charging states on the RAK platform
|
||||||
|
#ifdef NRF_APM
|
||||||
|
#include "nrfx_power.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_HEAP_MQTT
|
||||||
|
#include "mqtt/MQTT.h"
|
||||||
|
#include "target_specific.h"
|
||||||
|
#include <WiFi.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef DELAY_FOREVER
|
||||||
|
#define DELAY_FOREVER portMAX_DELAY
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BATTERY_PIN) && defined(ARCH_ESP32)
|
||||||
|
|
||||||
|
#ifndef BAT_MEASURE_ADC_UNIT // ADC1 is default
|
||||||
|
static const adc1_channel_t adc_channel = ADC_CHANNEL;
|
||||||
|
static const adc_unit_t unit = ADC_UNIT_1;
|
||||||
|
#else // ADC2
|
||||||
|
static const adc2_channel_t adc_channel = ADC_CHANNEL;
|
||||||
|
static const adc_unit_t unit = ADC_UNIT_2;
|
||||||
|
RTC_NOINIT_ATTR uint64_t RTC_reg_b;
|
||||||
|
|
||||||
|
#endif // BAT_MEASURE_ADC_UNIT
|
||||||
|
|
||||||
|
esp_adc_cal_characteristics_t *adc_characs = (esp_adc_cal_characteristics_t *)calloc(1, sizeof(esp_adc_cal_characteristics_t));
|
||||||
|
#ifndef ADC_ATTENUATION
|
||||||
|
static const adc_atten_t atten = ADC_ATTEN_DB_11;
|
||||||
|
#else
|
||||||
|
static const adc_atten_t atten = ADC_ATTENUATION;
|
||||||
|
#endif
|
||||||
|
#endif // BATTERY_PIN && ARCH_ESP32
|
||||||
|
|
||||||
|
#if HAS_TELEMETRY && !defined(ARCH_PORTDUINO)
|
||||||
|
INA260Sensor ina260Sensor;
|
||||||
|
INA219Sensor ina219Sensor;
|
||||||
|
INA3221Sensor ina3221Sensor;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_PMU
|
#ifdef HAS_PMU
|
||||||
#include "XPowersLibInterface.hpp"
|
|
||||||
#include "XPowersAXP2101.tpp"
|
|
||||||
#include "XPowersAXP192.tpp"
|
#include "XPowersAXP192.tpp"
|
||||||
|
#include "XPowersAXP2101.tpp"
|
||||||
|
#include "XPowersLibInterface.hpp"
|
||||||
XPowersLibInterface *PMU = NULL;
|
XPowersLibInterface *PMU = NULL;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// Copy of the base class defined in axp20x.h.
|
// Copy of the base class defined in axp20x.h.
|
||||||
// I'd rather not inlude axp20x.h as it brings Wire dependency.
|
// I'd rather not include axp20x.h as it brings Wire dependency.
|
||||||
class HasBatteryLevel
|
class HasBatteryLevel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -98,38 +152,80 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
virtual uint16_t getBattVoltage() override
|
virtual uint16_t getBattVoltage() override
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if defined(HAS_TELEMETRY) && !defined(ARCH_PORTDUINO) && !defined(HAS_PMU)
|
||||||
|
if (hasINA()) {
|
||||||
|
LOG_DEBUG("Using INA on I2C addr 0x%x for device battery voltage\n", config.power.device_battery_ina_address);
|
||||||
|
return getINAVoltage();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef ADC_MULTIPLIER
|
#ifndef ADC_MULTIPLIER
|
||||||
#define ADC_MULTIPLIER 2.0
|
#define ADC_MULTIPLIER 2.0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef BATTERY_SENSE_SAMPLES
|
||||||
|
#define BATTERY_SENSE_SAMPLES 30
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef BATTERY_PIN
|
#ifdef BATTERY_PIN
|
||||||
// Override variant or default ADC_MULTIPLIER if we have the override pref
|
// Override variant or default ADC_MULTIPLIER if we have the override pref
|
||||||
float operativeAdcMultiplier = config.power.adc_multiplier_override > 0
|
float operativeAdcMultiplier =
|
||||||
? config.power.adc_multiplier_override
|
config.power.adc_multiplier_override > 0 ? config.power.adc_multiplier_override : ADC_MULTIPLIER;
|
||||||
: ADC_MULTIPLIER;
|
|
||||||
// Do not call analogRead() often.
|
// Do not call analogRead() often.
|
||||||
const uint32_t min_read_interval = 5000;
|
const uint32_t min_read_interval = 5000;
|
||||||
if (millis() - last_read_time_ms > min_read_interval) {
|
if (millis() - last_read_time_ms > min_read_interval) {
|
||||||
last_read_time_ms = millis();
|
last_read_time_ms = millis();
|
||||||
|
|
||||||
#ifdef BATTERY_SENSE_SAMPLES
|
// Set the number of samples, it has an effect of increasing sensitivity, especially in complex electromagnetic
|
||||||
//Set the number of samples, it has an effect of increasing sensitivity, especially in complex electromagnetic environment.
|
// environment.
|
||||||
uint32_t raw = 0;
|
uint32_t raw = 0;
|
||||||
for(uint32_t i=0; i<BATTERY_SENSE_SAMPLES;i++){
|
#ifdef ARCH_ESP32
|
||||||
|
#ifndef BAT_MEASURE_ADC_UNIT // ADC1
|
||||||
|
#ifdef ADC_CTRL
|
||||||
|
if (heltec_version == 5) {
|
||||||
|
pinMode(ADC_CTRL, OUTPUT);
|
||||||
|
digitalWrite(ADC_CTRL, HIGH);
|
||||||
|
delay(10);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
for (int i = 0; i < BATTERY_SENSE_SAMPLES; i++) {
|
||||||
|
raw += adc1_get_raw(adc_channel);
|
||||||
|
}
|
||||||
|
#ifdef ADC_CTRL
|
||||||
|
if (heltec_version == 5) {
|
||||||
|
digitalWrite(ADC_CTRL, LOW);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#else // ADC2
|
||||||
|
int32_t adc_buf = 0;
|
||||||
|
for (int i = 0; i < BATTERY_SENSE_SAMPLES; i++) {
|
||||||
|
// ADC2 wifi bug workaround, see
|
||||||
|
// https://github.com/espressif/arduino-esp32/issues/102
|
||||||
|
WRITE_PERI_REG(SENS_SAR_READ_CTRL2_REG, RTC_reg_b);
|
||||||
|
SET_PERI_REG_MASK(SENS_SAR_READ_CTRL2_REG, SENS_SAR2_DATA_INV);
|
||||||
|
adc2_get_raw(adc_channel, ADC_WIDTH_BIT_12, &adc_buf);
|
||||||
|
raw += adc_buf;
|
||||||
|
}
|
||||||
|
#endif // BAT_MEASURE_ADC_UNIT
|
||||||
|
#else // !ARCH_ESP32
|
||||||
|
for (uint32_t i = 0; i < BATTERY_SENSE_SAMPLES; i++) {
|
||||||
raw += analogRead(BATTERY_PIN);
|
raw += analogRead(BATTERY_PIN);
|
||||||
}
|
}
|
||||||
raw = raw/BATTERY_SENSE_SAMPLES;
|
|
||||||
#else
|
|
||||||
uint32_t raw = analogRead(BATTERY_PIN);
|
|
||||||
#endif
|
#endif
|
||||||
|
raw = raw / BATTERY_SENSE_SAMPLES;
|
||||||
float scaled;
|
float scaled;
|
||||||
|
#ifdef ARCH_ESP32
|
||||||
|
scaled = esp_adc_cal_raw_to_voltage(raw, adc_characs);
|
||||||
|
scaled *= operativeAdcMultiplier;
|
||||||
|
#else
|
||||||
#ifndef VBAT_RAW_TO_SCALED
|
#ifndef VBAT_RAW_TO_SCALED
|
||||||
scaled = 1000.0 * operativeAdcMultiplier * (AREF_VOLTAGE / 1024.0) * raw;
|
scaled = 1000.0 * operativeAdcMultiplier * (AREF_VOLTAGE / 1024.0) * raw;
|
||||||
#else
|
#else
|
||||||
scaled = VBAT_RAW_TO_SCALED(raw); // defined in variant.h
|
scaled = VBAT_RAW_TO_SCALED(raw); // defined in variant.h
|
||||||
#endif
|
#endif // VBAT RAW TO SCALED
|
||||||
// DEBUG_MSG("battery gpio %d raw val=%u scaled=%u\n", BATTERY_PIN, raw, (uint32_t)(scaled));
|
#endif // ARCH_ESP32
|
||||||
|
// LOG_DEBUG("battery gpio %d raw val=%u scaled=%u\n", BATTERY_PIN, raw, (uint32_t)(scaled));
|
||||||
|
|
||||||
last_read_value = scaled;
|
last_read_value = scaled;
|
||||||
return scaled;
|
return scaled;
|
||||||
} else {
|
} else {
|
||||||
@@ -137,7 +233,7 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif // BATTERY_PIN
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -147,7 +243,20 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
|
|
||||||
/// If we see a battery voltage higher than physics allows - assume charger is pumping
|
/// If we see a battery voltage higher than physics allows - assume charger is pumping
|
||||||
/// in power
|
/// in power
|
||||||
virtual bool isVbusIn() override { return getBattVoltage() > chargingVolt; }
|
/// On some boards we don't have the power management chip (like AXPxxxx)
|
||||||
|
/// so we use EXT_PWR_DETECT GPIO pin to detect external power source
|
||||||
|
virtual bool isVbusIn() override
|
||||||
|
{
|
||||||
|
#ifdef EXT_PWR_DETECT
|
||||||
|
// if external powered that pin will be pulled up
|
||||||
|
if (digitalRead(EXT_PWR_DETECT) == HIGH) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// if it's not HIGH - check the battery
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return getBattVoltage() > chargingVolt;
|
||||||
|
}
|
||||||
|
|
||||||
/// Assume charging if we have a battery and external power is connected.
|
/// Assume charging if we have a battery and external power is connected.
|
||||||
/// we can't be smart enough to say 'full'?
|
/// we can't be smart enough to say 'full'?
|
||||||
@@ -159,21 +268,55 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
|
|
||||||
#ifndef BAT_FULLVOLT
|
#ifndef BAT_FULLVOLT
|
||||||
#define BAT_FULLVOLT 4200
|
#define BAT_FULLVOLT 4200
|
||||||
#endif
|
#endif
|
||||||
#ifndef BAT_EMPTYVOLT
|
#ifndef BAT_EMPTYVOLT
|
||||||
#define BAT_EMPTYVOLT 3270
|
#define BAT_EMPTYVOLT 3270
|
||||||
#endif
|
#endif
|
||||||
#ifndef BAT_CHARGINGVOLT
|
#ifndef BAT_CHARGINGVOLT
|
||||||
#define BAT_CHARGINGVOLT 4210
|
#define BAT_CHARGINGVOLT 4210
|
||||||
#endif
|
#endif
|
||||||
#ifndef BAT_NOBATVOLT
|
#ifndef BAT_NOBATVOLT
|
||||||
#define BAT_NOBATVOLT 2230
|
#define BAT_NOBATVOLT 2230
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// For heltecs with no battery connected, the measured voltage is 2204, so raising to 2230 from 2100
|
/// For heltecs with no battery connected, the measured voltage is 2204, so raising to 2230 from 2100
|
||||||
const float fullVolt = BAT_FULLVOLT, emptyVolt = BAT_EMPTYVOLT, chargingVolt = BAT_CHARGINGVOLT, noBatVolt = BAT_NOBATVOLT;
|
const float fullVolt = BAT_FULLVOLT, emptyVolt = BAT_EMPTYVOLT, chargingVolt = BAT_CHARGINGVOLT, noBatVolt = BAT_NOBATVOLT;
|
||||||
float last_read_value = 0.0;
|
float last_read_value = 0.0;
|
||||||
uint32_t last_read_time_ms = 0;
|
uint32_t last_read_time_ms = 0;
|
||||||
|
|
||||||
|
#if defined(HAS_TELEMETRY) && !defined(ARCH_PORTDUINO)
|
||||||
|
uint16_t getINAVoltage()
|
||||||
|
{
|
||||||
|
if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA219].first == config.power.device_battery_ina_address) {
|
||||||
|
return ina219Sensor.getBusVoltageMv();
|
||||||
|
} else if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA260].first ==
|
||||||
|
config.power.device_battery_ina_address) {
|
||||||
|
return ina260Sensor.getBusVoltageMv();
|
||||||
|
} else if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA3221].first ==
|
||||||
|
config.power.device_battery_ina_address) {
|
||||||
|
return ina3221Sensor.getBusVoltageMv();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool hasINA()
|
||||||
|
{
|
||||||
|
if (!config.power.device_battery_ina_address) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA219].first == config.power.device_battery_ina_address) {
|
||||||
|
if (!ina219Sensor.isInitialized())
|
||||||
|
return ina219Sensor.runOnce() > 0;
|
||||||
|
return ina219Sensor.isRunning();
|
||||||
|
} else if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA260].first ==
|
||||||
|
config.power.device_battery_ina_address) {
|
||||||
|
if (!ina260Sensor.isInitialized())
|
||||||
|
return ina260Sensor.runOnce() > 0;
|
||||||
|
return ina260Sensor.isRunning();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
AnalogBatteryLevel analogLevel;
|
AnalogBatteryLevel analogLevel;
|
||||||
@@ -182,35 +325,69 @@ Power::Power() : OSThread("Power")
|
|||||||
{
|
{
|
||||||
statusHandler = {};
|
statusHandler = {};
|
||||||
low_voltage_counter = 0;
|
low_voltage_counter = 0;
|
||||||
|
#ifdef DEBUG_HEAP
|
||||||
|
lastheap = memGet.getFreeHeap();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Power::analogInit()
|
bool Power::analogInit()
|
||||||
{
|
{
|
||||||
|
#ifdef EXT_PWR_DETECT
|
||||||
|
pinMode(EXT_PWR_DETECT, INPUT);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef BATTERY_PIN
|
#ifdef BATTERY_PIN
|
||||||
DEBUG_MSG("Using analog input %d for battery level\n", BATTERY_PIN);
|
LOG_DEBUG("Using analog input %d for battery level\n", BATTERY_PIN);
|
||||||
|
|
||||||
// disable any internal pullups
|
// disable any internal pullups
|
||||||
pinMode(BATTERY_PIN, INPUT);
|
pinMode(BATTERY_PIN, INPUT);
|
||||||
|
|
||||||
#ifdef ARCH_ESP32
|
#ifndef BATTERY_SENSE_RESOLUTION_BITS
|
||||||
// ESP32 needs special analog stuff
|
#define BATTERY_SENSE_RESOLUTION_BITS 10
|
||||||
adcAttachPin(BATTERY_PIN);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ARCH_ESP32 // ESP32 needs special analog stuff
|
||||||
|
|
||||||
|
#ifndef ADC_WIDTH // max resolution by default
|
||||||
|
static const adc_bits_width_t width = ADC_WIDTH_BIT_12;
|
||||||
|
#else
|
||||||
|
static const adc_bits_width_t width = ADC_WIDTH;
|
||||||
|
#endif
|
||||||
|
#ifndef BAT_MEASURE_ADC_UNIT // ADC1
|
||||||
|
adc1_config_width(width);
|
||||||
|
adc1_config_channel_atten(adc_channel, atten);
|
||||||
|
#else // ADC2
|
||||||
|
adc2_config_channel_atten(adc_channel, atten);
|
||||||
|
// ADC2 wifi bug workaround
|
||||||
|
RTC_reg_b = READ_PERI_REG(SENS_SAR_READ_CTRL2_REG);
|
||||||
|
#endif
|
||||||
|
// calibrate ADC
|
||||||
|
esp_adc_cal_value_t val_type = esp_adc_cal_characterize(unit, atten, width, DEFAULT_VREF, adc_characs);
|
||||||
|
// show ADC characterization base
|
||||||
|
if (val_type == ESP_ADC_CAL_VAL_EFUSE_TP) {
|
||||||
|
LOG_INFO("ADCmod: ADC characterization based on Two Point values stored in eFuse\n");
|
||||||
|
} else if (val_type == ESP_ADC_CAL_VAL_EFUSE_VREF) {
|
||||||
|
LOG_INFO("ADCmod: ADC characterization based on reference voltage stored in eFuse\n");
|
||||||
|
} else {
|
||||||
|
LOG_INFO("ADCmod: ADC characterization based on default reference voltage\n");
|
||||||
|
}
|
||||||
|
#if defined(HELTEC_V3) || defined(HELTEC_WSL_V3)
|
||||||
|
pinMode(37, OUTPUT); // needed for P channel mosfet to work
|
||||||
|
digitalWrite(37, LOW);
|
||||||
|
#endif
|
||||||
|
#endif // ARCH_ESP32
|
||||||
|
|
||||||
#ifdef ARCH_NRF52
|
#ifdef ARCH_NRF52
|
||||||
#ifdef VBAT_AR_INTERNAL
|
#ifdef VBAT_AR_INTERNAL
|
||||||
analogReference(VBAT_AR_INTERNAL);
|
analogReference(VBAT_AR_INTERNAL);
|
||||||
#else
|
#else
|
||||||
analogReference(AR_INTERNAL); // 3.6V
|
analogReference(AR_INTERNAL); // 3.6V
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef BATTERY_SENSE_RESOLUTION_BITS
|
|
||||||
#define BATTERY_SENSE_RESOLUTION_BITS 10
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// adcStart(BATTERY_PIN);
|
|
||||||
analogReadResolution(BATTERY_SENSE_RESOLUTION_BITS); // Default of 12 is not very linear. Recommended to use 10 or 11
|
analogReadResolution(BATTERY_SENSE_RESOLUTION_BITS); // Default of 12 is not very linear. Recommended to use 10 or 11
|
||||||
// depending on needed resolution.
|
// depending on needed resolution.
|
||||||
|
|
||||||
|
#endif // ARCH_NRF52
|
||||||
|
|
||||||
batteryLevel = &analogLevel;
|
batteryLevel = &analogLevel;
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
@@ -218,13 +395,15 @@ bool Power::analogInit()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes the Power class.
|
||||||
|
*
|
||||||
|
* @return true if the setup was successful, false otherwise.
|
||||||
|
*/
|
||||||
bool Power::setup()
|
bool Power::setup()
|
||||||
{
|
{
|
||||||
bool found = axpChipInit();
|
bool found = axpChipInit() || analogInit();
|
||||||
|
|
||||||
if (!found) {
|
|
||||||
found = analogInit();
|
|
||||||
}
|
|
||||||
enabled = found;
|
enabled = found;
|
||||||
low_voltage_counter = 0;
|
low_voltage_counter = 0;
|
||||||
|
|
||||||
@@ -235,20 +414,27 @@ void Power::shutdown()
|
|||||||
{
|
{
|
||||||
screen->setOn(false);
|
screen->setOn(false);
|
||||||
#if defined(USE_EINK) && defined(PIN_EINK_EN)
|
#if defined(USE_EINK) && defined(PIN_EINK_EN)
|
||||||
digitalWrite(PIN_EINK_EN, LOW); //power off backlight first
|
digitalWrite(PIN_EINK_EN, LOW); // power off backlight first
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
LOG_INFO("Shutting down\n");
|
||||||
|
|
||||||
#ifdef HAS_PMU
|
#ifdef HAS_PMU
|
||||||
DEBUG_MSG("Shutting down\n");
|
if (pmu_found == true) {
|
||||||
if(PMU) {
|
|
||||||
PMU->setChargingLedMode(XPOWERS_CHG_LED_OFF);
|
PMU->setChargingLedMode(XPOWERS_CHG_LED_OFF);
|
||||||
PMU->shutdown();
|
PMU->shutdown();
|
||||||
}
|
}
|
||||||
#elif defined(ARCH_NRF52)
|
#elif defined(ARCH_NRF52) || defined(ARCH_ESP32)
|
||||||
playBeep();
|
#ifdef PIN_LED1
|
||||||
ledOff(PIN_LED1);
|
ledOff(PIN_LED1);
|
||||||
|
#endif
|
||||||
|
#ifdef PIN_LED2
|
||||||
ledOff(PIN_LED2);
|
ledOff(PIN_LED2);
|
||||||
doDeepSleep(DELAY_FOREVER);
|
#endif
|
||||||
|
#ifdef PIN_LED3
|
||||||
|
ledOff(PIN_LED3);
|
||||||
|
#endif
|
||||||
|
doDeepSleep(DELAY_FOREVER, false);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -259,7 +445,7 @@ void Power::readPowerStatus()
|
|||||||
{
|
{
|
||||||
if (batteryLevel) {
|
if (batteryLevel) {
|
||||||
bool hasBattery = batteryLevel->isBatteryConnect();
|
bool hasBattery = batteryLevel->isBatteryConnect();
|
||||||
int batteryVoltageMv = 0;
|
uint32_t batteryVoltageMv = 0;
|
||||||
int8_t batteryChargePercent = 0;
|
int8_t batteryChargePercent = 0;
|
||||||
if (hasBattery) {
|
if (hasBattery) {
|
||||||
batteryVoltageMv = batteryLevel->getBattVoltage();
|
batteryVoltageMv = batteryLevel->getBattVoltage();
|
||||||
@@ -276,31 +462,86 @@ void Power::readPowerStatus()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OptionalBool NRF_USB = OptFalse;
|
||||||
|
|
||||||
|
#ifdef NRF_APM // Section of code detects USB power on the RAK4631 and updates the power states. Takes 20 seconds or so to detect
|
||||||
|
// changes.
|
||||||
|
|
||||||
|
nrfx_power_usb_state_t nrf_usb_state = nrfx_power_usbstatus_get();
|
||||||
|
|
||||||
|
if (nrf_usb_state == NRFX_POWER_USB_STATE_DISCONNECTED) {
|
||||||
|
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
||||||
|
NRF_USB = OptFalse;
|
||||||
|
} else {
|
||||||
|
powerFSM.trigger(EVENT_POWER_CONNECTED);
|
||||||
|
NRF_USB = OptTrue;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
// Notify any status instances that are observing us
|
// Notify any status instances that are observing us
|
||||||
const PowerStatus powerStatus2 =
|
const PowerStatus powerStatus2 = PowerStatus(
|
||||||
PowerStatus(hasBattery ? OptTrue : OptFalse, batteryLevel->isVbusIn() ? OptTrue : OptFalse,
|
hasBattery ? OptTrue : OptFalse, batteryLevel->isVbusIn() || NRF_USB == OptTrue ? OptTrue : OptFalse,
|
||||||
batteryLevel->isCharging() ? OptTrue : OptFalse, batteryVoltageMv, batteryChargePercent);
|
batteryLevel->isCharging() || NRF_USB == OptTrue ? OptTrue : OptFalse, batteryVoltageMv, batteryChargePercent);
|
||||||
DEBUG_MSG("Battery: usbPower=%d, isCharging=%d, batMv=%d, batPct=%d\n", powerStatus2.getHasUSB(),
|
LOG_DEBUG("Battery: usbPower=%d, isCharging=%d, batMv=%d, batPct=%d\n", powerStatus2.getHasUSB(),
|
||||||
powerStatus2.getIsCharging(), powerStatus2.getBatteryVoltageMv(), powerStatus2.getBatteryChargePercent());
|
powerStatus2.getIsCharging(), powerStatus2.getBatteryVoltageMv(), powerStatus2.getBatteryChargePercent());
|
||||||
newStatus.notifyObservers(&powerStatus2);
|
newStatus.notifyObservers(&powerStatus2);
|
||||||
|
#ifdef DEBUG_HEAP
|
||||||
|
if (lastheap != memGet.getFreeHeap()) {
|
||||||
|
LOG_DEBUG("Threads running:");
|
||||||
|
int running = 0;
|
||||||
|
for (int i = 0; i < MAX_THREADS; i++) {
|
||||||
|
auto thread = concurrency::mainController.get(i);
|
||||||
|
if ((thread != nullptr) && (thread->enabled)) {
|
||||||
|
LOG_DEBUG(" %s", thread->ThreadName.c_str());
|
||||||
|
running++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LOG_DEBUG("\n");
|
||||||
|
LOG_DEBUG("Heap status: %d/%d bytes free (%d), running %d/%d threads\n", memGet.getFreeHeap(), memGet.getHeapSize(),
|
||||||
|
memGet.getFreeHeap() - lastheap, running, concurrency::mainController.size(false));
|
||||||
|
lastheap = memGet.getFreeHeap();
|
||||||
|
}
|
||||||
|
#ifdef DEBUG_HEAP_MQTT
|
||||||
|
if (mqtt) {
|
||||||
|
// send MQTT-Packet with Heap-Size
|
||||||
|
uint8_t dmac[6];
|
||||||
|
getMacAddr(dmac); // Get our hardware ID
|
||||||
|
char mac[18];
|
||||||
|
sprintf(mac, "!%02x%02x%02x%02x", dmac[2], dmac[3], dmac[4], dmac[5]);
|
||||||
|
|
||||||
// If we have a battery at all and it is less than 10% full, force deep sleep if we have more than 3 low readings in a row
|
auto newHeap = memGet.getFreeHeap();
|
||||||
// Supect fluctuating voltage on the RAK4631 to force it to deep sleep even if battery is at 85% after only a few days
|
std::string heapTopic =
|
||||||
#ifdef ARCH_NRF52
|
(*moduleConfig.mqtt.root ? moduleConfig.mqtt.root : "msh") + std::string("/2/heap/") + std::string(mac);
|
||||||
|
std::string heapString = std::to_string(newHeap);
|
||||||
|
mqtt->pubSub.publish(heapTopic.c_str(), heapString.c_str(), false);
|
||||||
|
auto wifiRSSI = WiFi.RSSI();
|
||||||
|
std::string wifiTopic =
|
||||||
|
(*moduleConfig.mqtt.root ? moduleConfig.mqtt.root : "msh") + std::string("/2/wifi/") + std::string(mac);
|
||||||
|
std::string wifiString = std::to_string(wifiRSSI);
|
||||||
|
mqtt->pubSub.publish(wifiTopic.c_str(), wifiString.c_str(), false);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// If we have a battery at all and it is less than 10% full, force deep sleep if we have more than 10 low readings in
|
||||||
|
// a row
|
||||||
if (powerStatus2.getHasBattery() && !powerStatus2.getHasUSB()) {
|
if (powerStatus2.getHasBattery() && !powerStatus2.getHasUSB()) {
|
||||||
if (batteryLevel->getBattVoltage() < MIN_BAT_MILLIVOLTS) {
|
if (batteryLevel->getBattVoltage() < MIN_BAT_MILLIVOLTS) {
|
||||||
low_voltage_counter++;
|
low_voltage_counter++;
|
||||||
if (low_voltage_counter > 3)
|
LOG_DEBUG("Low voltage counter: %d/10\n", low_voltage_counter);
|
||||||
|
if (low_voltage_counter > 10) {
|
||||||
|
#ifdef ARCH_NRF52
|
||||||
|
// We can't trigger deep sleep on NRF52, it's freezing the board
|
||||||
|
LOG_DEBUG("Low voltage detected, but not triggering deep sleep\n");
|
||||||
|
#else
|
||||||
|
LOG_INFO("Low voltage detected, triggering deep sleep\n");
|
||||||
powerFSM.trigger(EVENT_LOW_BATTERY);
|
powerFSM.trigger(EVENT_LOW_BATTERY);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
low_voltage_counter = 0;
|
low_voltage_counter = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
// If we have a battery at all and it is less than 10% full, force deep sleep
|
|
||||||
if (powerStatus2.getHasBattery() && !powerStatus2.getHasUSB() && batteryLevel->getBattVoltage() < MIN_BAT_MILLIVOLTS)
|
|
||||||
powerFSM.trigger(EVENT_LOW_BATTERY);
|
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
// No power sensing on this board - tell everyone else we have no idea what is happening
|
// No power sensing on this board - tell everyone else we have no idea what is happening
|
||||||
const PowerStatus powerStatus3 = PowerStatus(OptUnknown, OptUnknown, OptUnknown, -1, -1);
|
const PowerStatus powerStatus3 = PowerStatus(OptUnknown, OptUnknown, OptUnknown, -1, -1);
|
||||||
@@ -315,17 +556,17 @@ int32_t Power::runOnce()
|
|||||||
#ifdef HAS_PMU
|
#ifdef HAS_PMU
|
||||||
// WE no longer use the IRQ line to wake the CPU (due to false wakes from sleep), but we do poll
|
// WE no longer use the IRQ line to wake the CPU (due to false wakes from sleep), but we do poll
|
||||||
// the IRQ status by reading the registers over I2C
|
// the IRQ status by reading the registers over I2C
|
||||||
if(PMU) {
|
if (PMU) {
|
||||||
|
|
||||||
PMU->getIrqStatus();
|
PMU->getIrqStatus();
|
||||||
|
|
||||||
if(PMU->isVbusRemoveIrq()){
|
if (PMU->isVbusRemoveIrq()) {
|
||||||
DEBUG_MSG("USB unplugged\n");
|
LOG_INFO("USB unplugged\n");
|
||||||
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PMU->isVbusInsertIrq()) {
|
if (PMU->isVbusInsertIrq()) {
|
||||||
DEBUG_MSG("USB plugged In\n");
|
LOG_INFO("USB plugged In\n");
|
||||||
powerFSM.trigger(EVENT_POWER_CONNECTED);
|
powerFSM.trigger(EVENT_POWER_CONNECTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,22 +574,24 @@ int32_t Power::runOnce()
|
|||||||
Other things we could check if we cared...
|
Other things we could check if we cared...
|
||||||
|
|
||||||
if (PMU->isBatChagerStartIrq()) {
|
if (PMU->isBatChagerStartIrq()) {
|
||||||
DEBUG_MSG("Battery start charging\n");
|
LOG_DEBUG("Battery start charging\n");
|
||||||
}
|
}
|
||||||
if (PMU->isBatChagerDoneIrq()) {
|
if (PMU->isBatChagerDoneIrq()) {
|
||||||
DEBUG_MSG("Battery fully charged\n");
|
LOG_DEBUG("Battery fully charged\n");
|
||||||
}
|
}
|
||||||
if (PMU->isBatInsertIrq()) {
|
if (PMU->isBatInsertIrq()) {
|
||||||
DEBUG_MSG("Battery inserted\n");
|
LOG_DEBUG("Battery inserted\n");
|
||||||
}
|
}
|
||||||
if (PMU->isBatRemoveIrq()) {
|
if (PMU->isBatRemoveIrq()) {
|
||||||
DEBUG_MSG("Battery removed\n");
|
LOG_DEBUG("Battery removed\n");
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
#ifndef T_WATCH_S3 // FIXME - why is this triggering on the T-Watch S3?
|
||||||
if (PMU->isPekeyLongPressIrq()) {
|
if (PMU->isPekeyLongPressIrq()) {
|
||||||
DEBUG_MSG("PEK long button press\n");
|
LOG_DEBUG("PEK long button press\n");
|
||||||
screen->setOn(false);
|
screen->setOn(false);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
PMU->clearIrqStatus();
|
PMU->clearIrqStatus();
|
||||||
}
|
}
|
||||||
@@ -361,58 +604,58 @@ int32_t Power::runOnce()
|
|||||||
* Init the power manager chip
|
* Init the power manager chip
|
||||||
*
|
*
|
||||||
* axp192 power
|
* axp192 power
|
||||||
DCDC1 0.7-3.5V @ 1200mA max -> OLED // If you turn this off you'll lose comms to the axp192 because the OLED and the axp192
|
DCDC1 0.7-3.5V @ 1200mA max -> OLED // If you turn this off you'll lose comms to the axp192 because the OLED and the
|
||||||
share the same i2c bus, instead use ssd1306 sleep mode DCDC2 -> unused DCDC3 0.7-3.5V @ 700mA max -> ESP32 (keep this on!) LDO1
|
axp192 share the same i2c bus, instead use ssd1306 sleep mode DCDC2 -> unused DCDC3 0.7-3.5V @ 700mA max -> ESP32 (keep this
|
||||||
30mA -> charges GPS backup battery // charges the tiny J13 battery by the GPS to power the GPS ram (for a couple of days), can
|
on!) LDO1 30mA -> charges GPS backup battery // charges the tiny J13 battery by the GPS to power the GPS ram (for a couple of
|
||||||
not be turned off LDO2 200mA -> LORA LDO3 200mA -> GPS
|
days), can not be turned off LDO2 200mA -> LORA LDO3 200mA -> GPS
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool Power::axpChipInit()
|
bool Power::axpChipInit()
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef HAS_PMU
|
#ifdef HAS_PMU
|
||||||
|
|
||||||
TwoWire * w = NULL;
|
TwoWire *w = NULL;
|
||||||
|
|
||||||
// Use macro to distinguish which wire is used by PMU
|
// Use macro to distinguish which wire is used by PMU
|
||||||
#ifdef PMU_USE_WIRE1
|
#ifdef PMU_USE_WIRE1
|
||||||
w = &Wire1;
|
w = &Wire1;
|
||||||
#else
|
#else
|
||||||
w = &Wire;
|
w = &Wire;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* It is not necessary to specify the wire pin,
|
* It is not necessary to specify the wire pin,
|
||||||
* just input the wire, because the wire has been initialized in main.cpp
|
* just input the wire, because the wire has been initialized in main.cpp
|
||||||
*/
|
*/
|
||||||
if (!PMU) {
|
if (!PMU) {
|
||||||
PMU = new XPowersAXP2101(*w);
|
PMU = new XPowersAXP2101(*w);
|
||||||
if (!PMU->init()) {
|
if (!PMU->init()) {
|
||||||
DEBUG_MSG("Warning: Failed to find AXP2101 power management\n");
|
LOG_WARN("Failed to find AXP2101 power management\n");
|
||||||
delete PMU;
|
delete PMU;
|
||||||
PMU = NULL;
|
PMU = NULL;
|
||||||
} else {
|
} else {
|
||||||
DEBUG_MSG("AXP2101 PMU init succeeded, using AXP2101 PMU\n");
|
LOG_INFO("AXP2101 PMU init succeeded, using AXP2101 PMU\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!PMU) {
|
if (!PMU) {
|
||||||
PMU = new XPowersAXP192(*w);
|
PMU = new XPowersAXP192(*w);
|
||||||
if (!PMU->init()) {
|
if (!PMU->init()) {
|
||||||
DEBUG_MSG("Warning: Failed to find AXP192 power management\n");
|
LOG_WARN("Failed to find AXP192 power management\n");
|
||||||
delete PMU;
|
delete PMU;
|
||||||
PMU = NULL;
|
PMU = NULL;
|
||||||
} else {
|
} else {
|
||||||
DEBUG_MSG("AXP192 PMU init succeeded, using AXP192 PMU\n");
|
LOG_INFO("AXP192 PMU init succeeded, using AXP192 PMU\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!PMU) {
|
if (!PMU) {
|
||||||
/*
|
/*
|
||||||
* In XPowersLib, if the XPowersAXPxxx object is released, Wire.end() will be called at the same time.
|
* In XPowersLib, if the XPowersAXPxxx object is released, Wire.end() will be called at the same time.
|
||||||
* In order not to affect other devices, if the initialization of the PMU fails, Wire needs to be re-initialized once,
|
* In order not to affect other devices, if the initialization of the PMU fails, Wire needs to be re-initialized once,
|
||||||
* if there are multiple devices sharing the bus.
|
* if there are multiple devices sharing the bus.
|
||||||
* * */
|
* * */
|
||||||
#ifndef PMU_USE_WIRE1
|
#ifndef PMU_USE_WIRE1
|
||||||
w->begin(I2C_SDA, I2C_SCL);
|
w->begin(I2C_SDA, I2C_SCL);
|
||||||
#endif
|
#endif
|
||||||
@@ -422,97 +665,136 @@ bool Power::axpChipInit()
|
|||||||
batteryLevel = PMU;
|
batteryLevel = PMU;
|
||||||
|
|
||||||
if (PMU->getChipModel() == XPOWERS_AXP192) {
|
if (PMU->getChipModel() == XPOWERS_AXP192) {
|
||||||
|
|
||||||
// lora radio power channel
|
// lora radio power channel
|
||||||
PMU->setPowerChannelVoltage(XPOWERS_LDO2, 3300);
|
PMU->setPowerChannelVoltage(XPOWERS_LDO2, 3300);
|
||||||
PMU->enablePowerOutput(XPOWERS_LDO2);
|
PMU->enablePowerOutput(XPOWERS_LDO2);
|
||||||
|
|
||||||
|
|
||||||
// oled module power channel,
|
// oled module power channel,
|
||||||
// disable it will cause abnormal communication between boot and AXP power supply,
|
// disable it will cause abnormal communication between boot and AXP power supply,
|
||||||
// do not turn it off
|
// do not turn it off
|
||||||
PMU->setPowerChannelVoltage(XPOWERS_DCDC1, 3300);
|
PMU->setPowerChannelVoltage(XPOWERS_DCDC1, 3300);
|
||||||
// enable oled power
|
// enable oled power
|
||||||
PMU->enablePowerOutput(XPOWERS_DCDC1);
|
PMU->enablePowerOutput(XPOWERS_DCDC1);
|
||||||
|
|
||||||
|
|
||||||
// gnss module power channel - now turned on in setGpsPower
|
// gnss module power channel - now turned on in setGpsPower
|
||||||
PMU->setPowerChannelVoltage(XPOWERS_LDO3, 3300);
|
PMU->setPowerChannelVoltage(XPOWERS_LDO3, 3300);
|
||||||
// PMU->enablePowerOutput(XPOWERS_LDO3);
|
// PMU->enablePowerOutput(XPOWERS_LDO3);
|
||||||
|
|
||||||
|
// protected oled power source
|
||||||
//protected oled power source
|
|
||||||
PMU->setProtectedChannel(XPOWERS_DCDC1);
|
PMU->setProtectedChannel(XPOWERS_DCDC1);
|
||||||
//protected esp32 power source
|
// protected esp32 power source
|
||||||
PMU->setProtectedChannel(XPOWERS_DCDC3);
|
PMU->setProtectedChannel(XPOWERS_DCDC3);
|
||||||
|
|
||||||
//disable not use channel
|
// disable not use channel
|
||||||
PMU->disablePowerOutput(XPOWERS_DCDC2);
|
PMU->disablePowerOutput(XPOWERS_DCDC2);
|
||||||
|
|
||||||
//disable all axp chip interrupt
|
// disable all axp chip interrupt
|
||||||
PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ);
|
PMU->disableIRQ(XPOWERS_AXP192_ALL_IRQ);
|
||||||
|
|
||||||
// Set constant current charging current
|
// Set constant current charging current
|
||||||
PMU->setChargerConstantCurr(XPOWERS_AXP192_CHG_CUR_450MA);
|
PMU->setChargerConstantCurr(XPOWERS_AXP192_CHG_CUR_450MA);
|
||||||
|
|
||||||
|
// Set up the charging voltage
|
||||||
|
PMU->setChargeTargetVoltage(XPOWERS_AXP192_CHG_VOL_4V2);
|
||||||
} else if (PMU->getChipModel() == XPOWERS_AXP2101) {
|
} else if (PMU->getChipModel() == XPOWERS_AXP2101) {
|
||||||
|
|
||||||
// t-beam s3 core
|
/*The alternative version of T-Beam 1.1 differs from T-Beam V1.1 in that it uses an AXP2101 power chip*/
|
||||||
|
if (HW_VENDOR == meshtastic_HardwareModel_TBEAM) {
|
||||||
|
// Unuse power channel
|
||||||
|
PMU->disablePowerOutput(XPOWERS_DCDC2);
|
||||||
|
PMU->disablePowerOutput(XPOWERS_DCDC3);
|
||||||
|
PMU->disablePowerOutput(XPOWERS_DCDC4);
|
||||||
|
PMU->disablePowerOutput(XPOWERS_DCDC5);
|
||||||
|
PMU->disablePowerOutput(XPOWERS_ALDO1);
|
||||||
|
PMU->disablePowerOutput(XPOWERS_ALDO4);
|
||||||
|
PMU->disablePowerOutput(XPOWERS_BLDO1);
|
||||||
|
PMU->disablePowerOutput(XPOWERS_BLDO2);
|
||||||
|
PMU->disablePowerOutput(XPOWERS_DLDO1);
|
||||||
|
PMU->disablePowerOutput(XPOWERS_DLDO2);
|
||||||
|
|
||||||
/**
|
// GNSS RTC PowerVDD 3300mV
|
||||||
* gnss module power channel
|
PMU->setPowerChannelVoltage(XPOWERS_VBACKUP, 3300);
|
||||||
* The default ALDO4 is off, you need to turn on the GNSS power first, otherwise it will be invalid during initialization
|
PMU->enablePowerOutput(XPOWERS_VBACKUP);
|
||||||
*/
|
|
||||||
PMU->setPowerChannelVoltage(XPOWERS_ALDO4, 3300);
|
|
||||||
PMU->enablePowerOutput(XPOWERS_ALDO4);
|
|
||||||
|
|
||||||
// lora radio power channel
|
// ESP32 VDD 3300mV
|
||||||
PMU->setPowerChannelVoltage(XPOWERS_ALDO3, 3300);
|
// ! No need to set, automatically open , Don't close it
|
||||||
PMU->enablePowerOutput(XPOWERS_ALDO3);
|
// PMU->setPowerChannelVoltage(XPOWERS_DCDC1, 3300);
|
||||||
|
// PMU->setProtectedChannel(XPOWERS_DCDC1);
|
||||||
|
|
||||||
// m.2 interface
|
// LoRa VDD 3300mV
|
||||||
PMU->setPowerChannelVoltage(XPOWERS_DCDC3, 3300);
|
PMU->setPowerChannelVoltage(XPOWERS_ALDO2, 3300);
|
||||||
PMU->enablePowerOutput(XPOWERS_DCDC3);
|
PMU->enablePowerOutput(XPOWERS_ALDO2);
|
||||||
|
|
||||||
/**
|
// GNSS VDD 3300mV
|
||||||
* ALDO2 cannot be turned off.
|
PMU->setPowerChannelVoltage(XPOWERS_ALDO3, 3300);
|
||||||
* It is a necessary condition for sensor communication.
|
PMU->enablePowerOutput(XPOWERS_ALDO3);
|
||||||
* It must be turned on to properly access the sensor and screen
|
} else if (HW_VENDOR == meshtastic_HardwareModel_LILYGO_TBEAM_S3_CORE ||
|
||||||
* It is also responsible for the power supply of PCF8563
|
HW_VENDOR == meshtastic_HardwareModel_T_WATCH_S3) {
|
||||||
*/
|
// t-beam s3 core
|
||||||
PMU->setPowerChannelVoltage(XPOWERS_ALDO2, 3300);
|
/**
|
||||||
PMU->enablePowerOutput(XPOWERS_ALDO2);
|
* gnss module power channel
|
||||||
|
* The default ALDO4 is off, you need to turn on the GNSS power first, otherwise it will be invalid during
|
||||||
|
* initialization
|
||||||
|
*/
|
||||||
|
PMU->setPowerChannelVoltage(XPOWERS_ALDO4, 3300);
|
||||||
|
PMU->enablePowerOutput(XPOWERS_ALDO4);
|
||||||
|
|
||||||
// 6-axis , magnetometer ,bme280 , oled screen power channel
|
// lora radio power channel
|
||||||
PMU->setPowerChannelVoltage(XPOWERS_ALDO1, 3300);
|
PMU->setPowerChannelVoltage(XPOWERS_ALDO3, 3300);
|
||||||
PMU->enablePowerOutput(XPOWERS_ALDO1);
|
PMU->enablePowerOutput(XPOWERS_ALDO3);
|
||||||
|
|
||||||
// sdcard power channle
|
// m.2 interface
|
||||||
PMU->setPowerChannelVoltage(XPOWERS_BLDO1, 3300);
|
PMU->setPowerChannelVoltage(XPOWERS_DCDC3, 3300);
|
||||||
PMU->enablePowerOutput(XPOWERS_BLDO1);
|
PMU->enablePowerOutput(XPOWERS_DCDC3);
|
||||||
|
|
||||||
// PMU->setPowerChannelVoltage(XPOWERS_DCDC4, 3300);
|
|
||||||
// PMU->enablePowerOutput(XPOWERS_DCDC4);
|
|
||||||
|
|
||||||
//not use channel
|
/**
|
||||||
PMU->disablePowerOutput(XPOWERS_DCDC2); //not elicited
|
* ALDO2 cannot be turned off.
|
||||||
PMU->disablePowerOutput(XPOWERS_DCDC5); //not elicited
|
* It is a necessary condition for sensor communication.
|
||||||
PMU->disablePowerOutput(XPOWERS_DLDO1); //Invalid power channel, it does not exist
|
* It must be turned on to properly access the sensor and screen
|
||||||
PMU->disablePowerOutput(XPOWERS_DLDO2); //Invalid power channel, it does not exist
|
* It is also responsible for the power supply of PCF8563
|
||||||
PMU->disablePowerOutput(XPOWERS_VBACKUP);
|
*/
|
||||||
|
PMU->setPowerChannelVoltage(XPOWERS_ALDO2, 3300);
|
||||||
|
PMU->enablePowerOutput(XPOWERS_ALDO2);
|
||||||
|
|
||||||
//disable all axp chip interrupt
|
// 6-axis , magnetometer ,bme280 , oled screen power channel
|
||||||
|
PMU->setPowerChannelVoltage(XPOWERS_ALDO1, 3300);
|
||||||
|
PMU->enablePowerOutput(XPOWERS_ALDO1);
|
||||||
|
|
||||||
|
// sdcard power channel
|
||||||
|
PMU->setPowerChannelVoltage(XPOWERS_BLDO1, 3300);
|
||||||
|
PMU->enablePowerOutput(XPOWERS_BLDO1);
|
||||||
|
|
||||||
|
#ifdef T_WATCH_S3
|
||||||
|
// DRV2605 power channel
|
||||||
|
PMU->setPowerChannelVoltage(XPOWERS_BLDO2, 3300);
|
||||||
|
PMU->enablePowerOutput(XPOWERS_BLDO2);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// PMU->setPowerChannelVoltage(XPOWERS_DCDC4, 3300);
|
||||||
|
// PMU->enablePowerOutput(XPOWERS_DCDC4);
|
||||||
|
|
||||||
|
// not use channel
|
||||||
|
PMU->disablePowerOutput(XPOWERS_DCDC2); // not elicited
|
||||||
|
PMU->disablePowerOutput(XPOWERS_DCDC5); // not elicited
|
||||||
|
PMU->disablePowerOutput(XPOWERS_DLDO1); // Invalid power channel, it does not exist
|
||||||
|
PMU->disablePowerOutput(XPOWERS_DLDO2); // Invalid power channel, it does not exist
|
||||||
|
PMU->disablePowerOutput(XPOWERS_VBACKUP);
|
||||||
|
}
|
||||||
|
|
||||||
|
// disable all axp chip interrupt
|
||||||
PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ);
|
PMU->disableIRQ(XPOWERS_AXP2101_ALL_IRQ);
|
||||||
|
|
||||||
//Set the constant current charging current of AXP2101, temporarily use 500mA by default
|
// Set the constant current charging current of AXP2101, temporarily use 500mA by default
|
||||||
PMU->setChargerConstantCurr(XPOWERS_AXP2101_CHG_CUR_500MA);
|
PMU->setChargerConstantCurr(XPOWERS_AXP2101_CHG_CUR_500MA);
|
||||||
|
|
||||||
|
// Set up the charging voltage
|
||||||
|
PMU->setChargeTargetVoltage(XPOWERS_AXP2101_CHG_VOL_4V2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PMU->clearIrqStatus();
|
PMU->clearIrqStatus();
|
||||||
|
|
||||||
// TBeam1.1 /T-Beam S3-Core has no external TS detection,
|
// TBeam1.1 /T-Beam S3-Core has no external TS detection,
|
||||||
// it needs to be disabled, otherwise it will cause abnormal charging
|
// it needs to be disabled, otherwise it will cause abnormal charging
|
||||||
PMU->disableTSPinMeasure();
|
PMU->disableTSPinMeasure();
|
||||||
|
|
||||||
@@ -520,78 +802,90 @@ bool Power::axpChipInit()
|
|||||||
PMU->enableVbusVoltageMeasure();
|
PMU->enableVbusVoltageMeasure();
|
||||||
PMU->enableBattVoltageMeasure();
|
PMU->enableBattVoltageMeasure();
|
||||||
|
|
||||||
DEBUG_MSG("=======================================================================\n");
|
LOG_DEBUG("=======================================================================\n");
|
||||||
if (PMU->isChannelAvailable(XPOWERS_DCDC1)) {
|
if (PMU->isChannelAvailable(XPOWERS_DCDC1)) {
|
||||||
DEBUG_MSG("DC1 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC1) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_DCDC1));
|
LOG_DEBUG("DC1 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC1) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_DCDC1));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_DCDC2)) {
|
if (PMU->isChannelAvailable(XPOWERS_DCDC2)) {
|
||||||
DEBUG_MSG("DC2 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC2) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_DCDC2));
|
LOG_DEBUG("DC2 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC2) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_DCDC2));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_DCDC3)) {
|
if (PMU->isChannelAvailable(XPOWERS_DCDC3)) {
|
||||||
DEBUG_MSG("DC3 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC3) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_DCDC3));
|
LOG_DEBUG("DC3 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC3) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_DCDC3));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_DCDC4)) {
|
if (PMU->isChannelAvailable(XPOWERS_DCDC4)) {
|
||||||
DEBUG_MSG("DC4 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC4) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_DCDC4));
|
LOG_DEBUG("DC4 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_DCDC4) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_DCDC4));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_LDO2)) {
|
if (PMU->isChannelAvailable(XPOWERS_LDO2)) {
|
||||||
DEBUG_MSG("LDO2 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_LDO2) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_LDO2));
|
LOG_DEBUG("LDO2 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_LDO2) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_LDO2));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_LDO3)) {
|
if (PMU->isChannelAvailable(XPOWERS_LDO3)) {
|
||||||
DEBUG_MSG("LDO3 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_LDO3) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_LDO3));
|
LOG_DEBUG("LDO3 : %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_LDO3) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_LDO3));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_ALDO1)) {
|
if (PMU->isChannelAvailable(XPOWERS_ALDO1)) {
|
||||||
DEBUG_MSG("ALDO1: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO1) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_ALDO1));
|
LOG_DEBUG("ALDO1: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO1) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_ALDO1));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_ALDO2)) {
|
if (PMU->isChannelAvailable(XPOWERS_ALDO2)) {
|
||||||
DEBUG_MSG("ALDO2: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO2) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_ALDO2));
|
LOG_DEBUG("ALDO2: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO2) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_ALDO2));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_ALDO3)) {
|
if (PMU->isChannelAvailable(XPOWERS_ALDO3)) {
|
||||||
DEBUG_MSG("ALDO3: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO3) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_ALDO3));
|
LOG_DEBUG("ALDO3: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO3) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_ALDO3));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_ALDO4)) {
|
if (PMU->isChannelAvailable(XPOWERS_ALDO4)) {
|
||||||
DEBUG_MSG("ALDO4: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO4) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_ALDO4));
|
LOG_DEBUG("ALDO4: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_ALDO4) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_ALDO4));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_BLDO1)) {
|
if (PMU->isChannelAvailable(XPOWERS_BLDO1)) {
|
||||||
DEBUG_MSG("BLDO1: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_BLDO1) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_BLDO1));
|
LOG_DEBUG("BLDO1: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_BLDO1) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_BLDO1));
|
||||||
}
|
}
|
||||||
if (PMU->isChannelAvailable(XPOWERS_BLDO2)) {
|
if (PMU->isChannelAvailable(XPOWERS_BLDO2)) {
|
||||||
DEBUG_MSG("BLDO2: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_BLDO2) ? "+" : "-", PMU->getPowerChannelVoltage(XPOWERS_BLDO2));
|
LOG_DEBUG("BLDO2: %s Voltage:%u mV \n", PMU->isPowerChannelEnable(XPOWERS_BLDO2) ? "+" : "-",
|
||||||
|
PMU->getPowerChannelVoltage(XPOWERS_BLDO2));
|
||||||
}
|
}
|
||||||
DEBUG_MSG("=======================================================================\n");
|
LOG_DEBUG("=======================================================================\n");
|
||||||
|
|
||||||
|
|
||||||
//Set up the charging voltage, AXP2101/AXP192 4.2V gear is the same
|
|
||||||
// XPOWERS_AXP192_CHG_VOL_4V2 = XPOWERS_AXP2101_CHG_VOL_4V2
|
|
||||||
PMU->setChargeTargetVoltage(XPOWERS_AXP192_CHG_VOL_4V2);
|
|
||||||
|
|
||||||
|
// We can safely ignore this approach for most (or all) boards because MCU turned off
|
||||||
|
// earlier than battery discharged to 2.6V.
|
||||||
|
//
|
||||||
|
// Unfortanly for now we can't use this killswitch for RAK4630-based boards because they have a bug with
|
||||||
|
// battery voltage measurement. Probably it sometimes drops to low values.
|
||||||
|
#ifndef RAK4630
|
||||||
// Set PMU shutdown voltage at 2.6V to maximize battery utilization
|
// Set PMU shutdown voltage at 2.6V to maximize battery utilization
|
||||||
PMU->setSysPowerDownVoltage(2600);
|
PMU->setSysPowerDownVoltage(2600);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef PMU_IRQ
|
#ifdef PMU_IRQ
|
||||||
uint64_t pmuIrqMask = 0;
|
uint64_t pmuIrqMask = 0;
|
||||||
|
|
||||||
if (PMU->getChipModel() == XPOWERS_AXP192) {
|
if (PMU->getChipModel() == XPOWERS_AXP192) {
|
||||||
pmuIrqMask = XPOWERS_AXP192_VBUS_INSERT_IRQ | XPOWERS_AXP192_BAT_INSERT_IRQ | XPOWERS_AXP192_PKEY_SHORT_IRQ;
|
pmuIrqMask = XPOWERS_AXP192_VBUS_INSERT_IRQ | XPOWERS_AXP192_BAT_INSERT_IRQ | XPOWERS_AXP192_PKEY_SHORT_IRQ;
|
||||||
} else if (PMU->getChipModel() == XPOWERS_AXP2101) {
|
} else if (PMU->getChipModel() == XPOWERS_AXP2101) {
|
||||||
pmuIrqMask = XPOWERS_AXP2101_VBUS_INSERT_IRQ | XPOWERS_AXP2101_BAT_INSERT_IRQ | XPOWERS_AXP2101_PKEY_SHORT_IRQ;
|
pmuIrqMask = XPOWERS_AXP2101_VBUS_INSERT_IRQ | XPOWERS_AXP2101_BAT_INSERT_IRQ | XPOWERS_AXP2101_PKEY_SHORT_IRQ;
|
||||||
}
|
}
|
||||||
|
|
||||||
pinMode(PMU_IRQ, INPUT);
|
pinMode(PMU_IRQ, INPUT);
|
||||||
attachInterrupt(
|
attachInterrupt(
|
||||||
PMU_IRQ, [] { pmu_irq = true; }, FALLING);
|
PMU_IRQ, [] { pmu_irq = true; }, FALLING);
|
||||||
|
|
||||||
// we do not look for AXPXXX_CHARGING_FINISHED_IRQ & AXPXXX_CHARGING_IRQ because it occurs repeatedly while there is
|
// we do not look for AXPXXX_CHARGING_FINISHED_IRQ & AXPXXX_CHARGING_IRQ because it occurs repeatedly while there is
|
||||||
// no battery also it could cause inadvertent waking from light sleep just because the battery filled
|
// no battery also it could cause inadvertent waking from light sleep just because the battery filled
|
||||||
// we don't look for AXPXXX_BATT_REMOVED_IRQ because it occurs repeatedly while no battery installed
|
// we don't look for AXPXXX_BATT_REMOVED_IRQ because it occurs repeatedly while no battery installed
|
||||||
// we don't look at AXPXXX_VBUS_REMOVED_IRQ because we don't have anything hooked to vbus
|
// we don't look at AXPXXX_VBUS_REMOVED_IRQ because we don't have anything hooked to vbus
|
||||||
PMU->enableIRQ(pmuIrqMask);
|
PMU->enableIRQ(pmuIrqMask);
|
||||||
|
|
||||||
PMU->clearIrqStatus();
|
PMU->clearIrqStatus();
|
||||||
#endif /*PMU_IRQ*/
|
#endif /*PMU_IRQ*/
|
||||||
|
|
||||||
readPowerStatus();
|
readPowerStatus();
|
||||||
|
|
||||||
pmu_found = true;
|
pmu_found = true;
|
||||||
|
|
||||||
|
|||||||
173
src/PowerFSM.cpp
173
src/PowerFSM.cpp
@@ -1,5 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* @file PowerFSM.cpp
|
||||||
|
* @brief Implements the finite state machine for power management.
|
||||||
|
*
|
||||||
|
* This file contains the implementation of the finite state machine (FSM) for power management.
|
||||||
|
* The FSM controls the power states of the device, including SDS (shallow deep sleep), LS (light sleep),
|
||||||
|
* NB (normal mode), and POWER (powered mode). The FSM also handles transitions between states and
|
||||||
|
* actions to be taken upon entering or exiting each state.
|
||||||
|
*/
|
||||||
#include "PowerFSM.h"
|
#include "PowerFSM.h"
|
||||||
#include "GPS.h"
|
|
||||||
#include "MeshService.h"
|
#include "MeshService.h"
|
||||||
#include "NodeDB.h"
|
#include "NodeDB.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
@@ -11,12 +19,12 @@
|
|||||||
/// Should we behave as if we have AC power now?
|
/// Should we behave as if we have AC power now?
|
||||||
static bool isPowered()
|
static bool isPowered()
|
||||||
{
|
{
|
||||||
// Circumvent the battery sensing logic and assumes constant power if no battery pin or power mgmt IC
|
// Circumvent the battery sensing logic and assumes constant power if no battery pin or power mgmt IC
|
||||||
#if !defined(BATTERY_PIN) && !defined(HAS_AXP192) && !defined(HAS_AXP2101)
|
#if !defined(BATTERY_PIN) && !defined(HAS_AXP192) && !defined(HAS_AXP2101)
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool isRouter = (config.device.role == Config_DeviceConfig_Role_ROUTER ? 1 : 0);
|
bool isRouter = (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER ? 1 : 0);
|
||||||
|
|
||||||
// If we are not a router and we already have AC power go to POWER state after init, otherwise go to ON
|
// If we are not a router and we already have AC power go to POWER state after init, otherwise go to ON
|
||||||
// We assume routers might be powered all the time, but from a low current (solar) source
|
// We assume routers might be powered all the time, but from a low current (solar) source
|
||||||
@@ -26,22 +34,25 @@ static bool isPowered()
|
|||||||
1) If we're powered up and there's no battery, we must be getting power externally. (because we'd be dead otherwise)
|
1) If we're powered up and there's no battery, we must be getting power externally. (because we'd be dead otherwise)
|
||||||
|
|
||||||
2) If we detect USB power from the power management chip, we must be getting power externally.
|
2) If we detect USB power from the power management chip, we must be getting power externally.
|
||||||
|
|
||||||
|
3) On some boards we don't have the power management chip (like AXPxxxx) so we use EXT_PWR_DETECT GPIO pin to detect
|
||||||
|
external power source (see `isVbusIn()` in `Power.cpp`)
|
||||||
*/
|
*/
|
||||||
return !isPowerSavingMode && powerStatus && (!powerStatus->getHasBattery() || powerStatus->getHasUSB());
|
return !isPowerSavingMode && powerStatus && (!powerStatus->getHasBattery() || powerStatus->getHasUSB());
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sdsEnter()
|
static void sdsEnter()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Enter state: SDS\n");
|
LOG_DEBUG("Enter state: SDS\n");
|
||||||
// FIXME - make sure GPS and LORA radio are off first - because we want close to zero current draw
|
// FIXME - make sure GPS and LORA radio are off first - because we want close to zero current draw
|
||||||
doDeepSleep(config.power.sds_secs * 1000);
|
doDeepSleep(getConfiguredOrDefaultMs(config.power.sds_secs), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern Power *power;
|
extern Power *power;
|
||||||
|
|
||||||
static void shutdownEnter()
|
static void shutdownEnter()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Enter state: SHUTDOWN\n");
|
LOG_DEBUG("Enter state: SHUTDOWN\n");
|
||||||
power->shutdown();
|
power->shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,26 +62,26 @@ static uint32_t secsSlept;
|
|||||||
|
|
||||||
static void lsEnter()
|
static void lsEnter()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("lsEnter begin, ls_secs=%u\n", config.power.ls_secs);
|
LOG_INFO("lsEnter begin, ls_secs=%u\n", config.power.ls_secs);
|
||||||
screen->setOn(false);
|
screen->setOn(false);
|
||||||
secsSlept = 0; // How long have we been sleeping this time
|
secsSlept = 0; // How long have we been sleeping this time
|
||||||
|
|
||||||
// DEBUG_MSG("lsEnter end\n");
|
// LOG_INFO("lsEnter end\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lsIdle()
|
static void lsIdle()
|
||||||
{
|
{
|
||||||
// DEBUG_MSG("lsIdle begin ls_secs=%u\n", getPref_ls_secs());
|
// LOG_INFO("lsIdle begin ls_secs=%u\n", getPref_ls_secs());
|
||||||
|
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
|
|
||||||
// Do we have more sleeping to do?
|
// Do we have more sleeping to do?
|
||||||
if (secsSlept < config.power.ls_secs) {
|
if (secsSlept < config.power.ls_secs) {
|
||||||
// Briefly come out of sleep long enough to blink the led once every few seconds
|
|
||||||
uint32_t sleepTime = 30;
|
|
||||||
|
|
||||||
// If some other service would stall sleep, don't let sleep happen yet
|
// If some other service would stall sleep, don't let sleep happen yet
|
||||||
if (doPreflightSleep()) {
|
if (doPreflightSleep()) {
|
||||||
|
// Briefly come out of sleep long enough to blink the led once every few seconds
|
||||||
|
uint32_t sleepTime = 30;
|
||||||
|
|
||||||
setLed(false); // Never leave led on while in light sleep
|
setLed(false); // Never leave led on while in light sleep
|
||||||
esp_sleep_source_t wakeCause2 = doLightSleep(sleepTime * 1000LL);
|
esp_sleep_source_t wakeCause2 = doLightSleep(sleepTime * 1000LL);
|
||||||
|
|
||||||
@@ -78,11 +89,11 @@ static void lsIdle()
|
|||||||
case ESP_SLEEP_WAKEUP_TIMER:
|
case ESP_SLEEP_WAKEUP_TIMER:
|
||||||
// Normal case: timer expired, we should just go back to sleep ASAP
|
// Normal case: timer expired, we should just go back to sleep ASAP
|
||||||
|
|
||||||
setLed(true); // briefly turn on led
|
setLed(true); // briefly turn on led
|
||||||
wakeCause2 = doLightSleep(1); // leave led on for 1ms
|
wakeCause2 = doLightSleep(100); // leave led on for 1ms
|
||||||
|
|
||||||
secsSlept += sleepTime;
|
secsSlept += sleepTime;
|
||||||
// DEBUG_MSG("sleeping, flash led!\n");
|
// LOG_INFO("sleeping, flash led!\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ESP_SLEEP_WAKEUP_UART:
|
case ESP_SLEEP_WAKEUP_UART:
|
||||||
@@ -93,15 +104,14 @@ static void lsIdle()
|
|||||||
default:
|
default:
|
||||||
// We woke for some other reason (button press, device interrupt)
|
// We woke for some other reason (button press, device interrupt)
|
||||||
// uint64_t status = esp_sleep_get_ext1_wakeup_status();
|
// uint64_t status = esp_sleep_get_ext1_wakeup_status();
|
||||||
DEBUG_MSG("wakeCause2 %d\n", wakeCause2);
|
LOG_INFO("wakeCause2 %d\n", wakeCause2);
|
||||||
|
|
||||||
#ifdef BUTTON_PIN
|
#ifdef BUTTON_PIN
|
||||||
bool pressed = !digitalRead(BUTTON_PIN);
|
bool pressed = !digitalRead(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN);
|
||||||
#else
|
#else
|
||||||
bool pressed = false;
|
bool pressed = false;
|
||||||
#endif
|
#endif
|
||||||
if (pressed) // If we woke because of press, instead generate a PRESS event.
|
if (pressed) { // If we woke because of press, instead generate a PRESS event.
|
||||||
{
|
|
||||||
powerFSM.trigger(EVENT_PRESS);
|
powerFSM.trigger(EVENT_PRESS);
|
||||||
} else {
|
} else {
|
||||||
// Otherwise let the NB state handle the IRQ (and that state will handle stuff like IRQs etc)
|
// Otherwise let the NB state handle the IRQ (and that state will handle stuff like IRQs etc)
|
||||||
@@ -117,7 +127,7 @@ static void lsIdle()
|
|||||||
} else {
|
} else {
|
||||||
// Time to stop sleeping!
|
// Time to stop sleeping!
|
||||||
setLed(false);
|
setLed(false);
|
||||||
DEBUG_MSG("reached ls_secs, servicing loop()\n");
|
LOG_INFO("Reached ls_secs, servicing loop()\n");
|
||||||
powerFSM.trigger(EVENT_WAKE_TIMER);
|
powerFSM.trigger(EVENT_WAKE_TIMER);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -125,17 +135,17 @@ static void lsIdle()
|
|||||||
|
|
||||||
static void lsExit()
|
static void lsExit()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Exit state: LS\n");
|
LOG_INFO("Exit state: LS\n");
|
||||||
// setGPSPower(true); // restore GPS power
|
|
||||||
if (gps)
|
|
||||||
gps->forceWake(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nbEnter()
|
static void nbEnter()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Enter state: NB\n");
|
LOG_DEBUG("Enter state: NB\n");
|
||||||
screen->setOn(false);
|
screen->setOn(false);
|
||||||
|
#ifdef ARCH_ESP32
|
||||||
|
// Only ESP32 should turn off bluetooth
|
||||||
setBluetoothEnable(false);
|
setBluetoothEnable(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
// FIXME - check if we already have packets for phone and immediately trigger EVENT_PACKETS_FOR_PHONE
|
// FIXME - check if we already have packets for phone and immediately trigger EVENT_PACKETS_FOR_PHONE
|
||||||
}
|
}
|
||||||
@@ -148,7 +158,7 @@ static void darkEnter()
|
|||||||
|
|
||||||
static void serialEnter()
|
static void serialEnter()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Enter state: SERIAL\n");
|
LOG_DEBUG("Enter state: SERIAL\n");
|
||||||
setBluetoothEnable(false);
|
setBluetoothEnable(false);
|
||||||
screen->setOn(true);
|
screen->setOn(true);
|
||||||
screen->print("Serial connected\n");
|
screen->print("Serial connected\n");
|
||||||
@@ -156,20 +166,26 @@ static void serialEnter()
|
|||||||
|
|
||||||
static void serialExit()
|
static void serialExit()
|
||||||
{
|
{
|
||||||
|
// Turn bluetooth back on when we leave serial stream API
|
||||||
|
setBluetoothEnable(true);
|
||||||
screen->print("Serial disconnected\n");
|
screen->print("Serial disconnected\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void powerEnter()
|
static void powerEnter()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Enter state: POWER\n");
|
// LOG_DEBUG("Enter state: POWER\n");
|
||||||
if (!isPowered()) {
|
if (!isPowered()) {
|
||||||
// If we got here, we are in the wrong state - we should be in powered, let that state ahndle things
|
// If we got here, we are in the wrong state - we should be in powered, let that state ahndle things
|
||||||
DEBUG_MSG("Loss of power in Powered\n");
|
LOG_INFO("Loss of power in Powered\n");
|
||||||
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
||||||
} else {
|
} else {
|
||||||
screen->setOn(true);
|
screen->setOn(true);
|
||||||
setBluetoothEnable(true);
|
setBluetoothEnable(true);
|
||||||
screen->print("Powered...\n");
|
// within enter() the function getState() returns the state we came from
|
||||||
|
if (strcmp(powerFSM.getState()->name, "BOOT") != 0 && strcmp(powerFSM.getState()->name, "POWER") != 0 &&
|
||||||
|
strcmp(powerFSM.getState()->name, "DARK") != 0) {
|
||||||
|
screen->print("Powered...\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,7 +193,7 @@ static void powerIdle()
|
|||||||
{
|
{
|
||||||
if (!isPowered()) {
|
if (!isPowered()) {
|
||||||
// If we got here, we are in the wrong state
|
// If we got here, we are in the wrong state
|
||||||
DEBUG_MSG("Loss of power in Powered\n");
|
LOG_INFO("Loss of power in Powered\n");
|
||||||
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
powerFSM.trigger(EVENT_POWER_DISCONNECTED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -186,24 +202,15 @@ static void powerExit()
|
|||||||
{
|
{
|
||||||
screen->setOn(true);
|
screen->setOn(true);
|
||||||
setBluetoothEnable(true);
|
setBluetoothEnable(true);
|
||||||
screen->print("Unpowered...\n");
|
if (!isPowered())
|
||||||
|
screen->print("Unpowered...\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void onEnter()
|
static void onEnter()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Enter state: ON\n");
|
LOG_DEBUG("Enter state: ON\n");
|
||||||
screen->setOn(true);
|
screen->setOn(true);
|
||||||
setBluetoothEnable(true);
|
setBluetoothEnable(true);
|
||||||
|
|
||||||
static uint32_t lastPingMs;
|
|
||||||
|
|
||||||
uint32_t now = millis();
|
|
||||||
|
|
||||||
if ((now - lastPingMs) > 30 * 1000) { // if more than a minute since our last press, ask node we are looking at to update their state
|
|
||||||
if (displayedNodeNum)
|
|
||||||
service.sendNetworkPing(displayedNodeNum, true); // Refresh the currently displayed node
|
|
||||||
lastPingMs = now;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void onIdle()
|
static void onIdle()
|
||||||
@@ -221,7 +228,7 @@ static void screenPress()
|
|||||||
|
|
||||||
static void bootEnter()
|
static void bootEnter()
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Enter state: BOOT\n");
|
LOG_DEBUG("Enter state: BOOT\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
State stateSHUTDOWN(shutdownEnter, NULL, NULL, "SHUTDOWN");
|
State stateSHUTDOWN(shutdownEnter, NULL, NULL, "SHUTDOWN");
|
||||||
@@ -237,28 +244,36 @@ Fsm powerFSM(&stateBOOT);
|
|||||||
|
|
||||||
void PowerFSM_setup()
|
void PowerFSM_setup()
|
||||||
{
|
{
|
||||||
bool isRouter = (config.device.role == Config_DeviceConfig_Role_ROUTER ? 1 : 0);
|
bool isRouter = (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER ? 1 : 0);
|
||||||
|
bool isTrackerOrSensor = config.device.role == meshtastic_Config_DeviceConfig_Role_TRACKER ||
|
||||||
|
config.device.role == meshtastic_Config_DeviceConfig_Role_SENSOR;
|
||||||
bool hasPower = isPowered();
|
bool hasPower = isPowered();
|
||||||
|
|
||||||
DEBUG_MSG("PowerFSM init, USB power=%d\n", hasPower ? 1 : 0);
|
LOG_INFO("PowerFSM init, USB power=%d\n", hasPower ? 1 : 0);
|
||||||
powerFSM.add_timed_transition(&stateBOOT, hasPower ? &statePOWER : &stateON, 3 * 1000, NULL, "boot timeout");
|
powerFSM.add_timed_transition(&stateBOOT, hasPower ? &statePOWER : &stateON, 3 * 1000, NULL, "boot timeout");
|
||||||
|
|
||||||
// wake timer expired or a packet arrived
|
// wake timer expired or a packet arrived
|
||||||
// if we are a router node, we go to NB (no need for bluetooth) otherwise we go to DARK (so we can send message to phone)
|
// if we are a router node, we go to NB (no need for bluetooth) otherwise we go to DARK (so we can send message to phone)
|
||||||
|
#ifdef ARCH_ESP32
|
||||||
powerFSM.add_transition(&stateLS, isRouter ? &stateNB : &stateDARK, EVENT_WAKE_TIMER, NULL, "Wake timer");
|
powerFSM.add_transition(&stateLS, isRouter ? &stateNB : &stateDARK, EVENT_WAKE_TIMER, NULL, "Wake timer");
|
||||||
|
#else // Don't go into a no-bluetooth state on low power platforms
|
||||||
|
powerFSM.add_transition(&stateLS, &stateDARK, EVENT_WAKE_TIMER, NULL, "Wake timer");
|
||||||
|
#endif
|
||||||
|
|
||||||
// We need this transition, because we might not transition if we were waiting to enter light-sleep, because when we wake from
|
// We need this transition, because we might not transition if we were waiting to enter light-sleep, because when we wake from
|
||||||
// light sleep we _always_ transition to NB or dark and
|
// light sleep we _always_ transition to NB or dark and
|
||||||
powerFSM.add_transition(&stateLS, isRouter ? &stateNB : &stateDARK, EVENT_PACKET_FOR_PHONE, NULL, "Received packet, exiting light sleep");
|
powerFSM.add_transition(&stateLS, isRouter ? &stateNB : &stateDARK, EVENT_PACKET_FOR_PHONE, NULL,
|
||||||
|
"Received packet, exiting light sleep");
|
||||||
powerFSM.add_transition(&stateNB, &stateNB, EVENT_PACKET_FOR_PHONE, NULL, "Received packet, resetting win wake");
|
powerFSM.add_transition(&stateNB, &stateNB, EVENT_PACKET_FOR_PHONE, NULL, "Received packet, resetting win wake");
|
||||||
|
|
||||||
// Handle press events - note: we ignore button presses when in API mode
|
// Handle press events - note: we ignore button presses when in API mode
|
||||||
powerFSM.add_transition(&stateLS, &stateON, EVENT_PRESS, NULL, "Press");
|
powerFSM.add_transition(&stateLS, &stateON, EVENT_PRESS, NULL, "Press");
|
||||||
powerFSM.add_transition(&stateNB, &stateON, EVENT_PRESS, NULL, "Press");
|
powerFSM.add_transition(&stateNB, &stateON, EVENT_PRESS, NULL, "Press");
|
||||||
powerFSM.add_transition(&stateDARK, &stateON, EVENT_PRESS, NULL, "Press");
|
powerFSM.add_transition(&stateDARK, isPowered() ? &statePOWER : &stateON, EVENT_PRESS, NULL, "Press");
|
||||||
powerFSM.add_transition(&statePOWER, &statePOWER, EVENT_PRESS, screenPress, "Press");
|
powerFSM.add_transition(&statePOWER, &statePOWER, EVENT_PRESS, screenPress, "Press");
|
||||||
powerFSM.add_transition(&stateON, &stateON, EVENT_PRESS, screenPress, "Press"); // reenter On to restart our timers
|
powerFSM.add_transition(&stateON, &stateON, EVENT_PRESS, screenPress, "Press"); // reenter On to restart our timers
|
||||||
powerFSM.add_transition(&stateSERIAL, &stateSERIAL, EVENT_PRESS, screenPress, "Press"); // Allow button to work while in serial API
|
powerFSM.add_transition(&stateSERIAL, &stateSERIAL, EVENT_PRESS, screenPress,
|
||||||
|
"Press"); // Allow button to work while in serial API
|
||||||
|
|
||||||
// Handle critically low power battery by forcing deep sleep
|
// Handle critically low power battery by forcing deep sleep
|
||||||
powerFSM.add_transition(&stateBOOT, &stateSDS, EVENT_LOW_BATTERY, NULL, "LowBat");
|
powerFSM.add_transition(&stateBOOT, &stateSDS, EVENT_LOW_BATTERY, NULL, "LowBat");
|
||||||
@@ -280,7 +295,8 @@ void PowerFSM_setup()
|
|||||||
powerFSM.add_transition(&stateLS, &stateON, EVENT_INPUT, NULL, "Input Device");
|
powerFSM.add_transition(&stateLS, &stateON, EVENT_INPUT, NULL, "Input Device");
|
||||||
powerFSM.add_transition(&stateNB, &stateON, EVENT_INPUT, NULL, "Input Device");
|
powerFSM.add_transition(&stateNB, &stateON, EVENT_INPUT, NULL, "Input Device");
|
||||||
powerFSM.add_transition(&stateDARK, &stateON, EVENT_INPUT, NULL, "Input Device");
|
powerFSM.add_transition(&stateDARK, &stateON, EVENT_INPUT, NULL, "Input Device");
|
||||||
powerFSM.add_transition(&stateON, &stateON, EVENT_INPUT, NULL, "Input Device"); // restarts the sleep timer
|
powerFSM.add_transition(&stateON, &stateON, EVENT_INPUT, NULL, "Input Device"); // restarts the sleep timer
|
||||||
|
powerFSM.add_transition(&statePOWER, &statePOWER, EVENT_INPUT, NULL, "Input Device"); // restarts the sleep timer
|
||||||
|
|
||||||
powerFSM.add_transition(&stateDARK, &stateON, EVENT_BLUETOOTH_PAIR, NULL, "Bluetooth pairing");
|
powerFSM.add_transition(&stateDARK, &stateON, EVENT_BLUETOOTH_PAIR, NULL, "Bluetooth pairing");
|
||||||
powerFSM.add_transition(&stateON, &stateON, EVENT_BLUETOOTH_PAIR, NULL, "Bluetooth pairing");
|
powerFSM.add_transition(&stateON, &stateON, EVENT_BLUETOOTH_PAIR, NULL, "Bluetooth pairing");
|
||||||
@@ -296,10 +312,10 @@ void PowerFSM_setup()
|
|||||||
powerFSM.add_transition(&stateON, &stateON, EVENT_NODEDB_UPDATED, NULL, "NodeDB update");
|
powerFSM.add_transition(&stateON, &stateON, EVENT_NODEDB_UPDATED, NULL, "NodeDB update");
|
||||||
|
|
||||||
// Show the received text message
|
// Show the received text message
|
||||||
powerFSM.add_transition(&stateLS, &stateON, EVENT_RECEIVED_TEXT_MSG, NULL, "Received text");
|
powerFSM.add_transition(&stateLS, &stateON, EVENT_RECEIVED_MSG, NULL, "Received text");
|
||||||
powerFSM.add_transition(&stateNB, &stateON, EVENT_RECEIVED_TEXT_MSG, NULL, "Received text");
|
powerFSM.add_transition(&stateNB, &stateON, EVENT_RECEIVED_MSG, NULL, "Received text");
|
||||||
powerFSM.add_transition(&stateDARK, &stateON, EVENT_RECEIVED_TEXT_MSG, NULL, "Received text");
|
powerFSM.add_transition(&stateDARK, &stateON, EVENT_RECEIVED_MSG, NULL, "Received text");
|
||||||
powerFSM.add_transition(&stateON, &stateON, EVENT_RECEIVED_TEXT_MSG, NULL, "Received text"); // restarts the sleep timer
|
powerFSM.add_transition(&stateON, &stateON, EVENT_RECEIVED_MSG, NULL, "Received text"); // restarts the sleep timer
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are not in statePOWER but get a serial connection, suppress sleep (and keep the screen on) while connected
|
// If we are not in statePOWER but get a serial connection, suppress sleep (and keep the screen on) while connected
|
||||||
@@ -324,31 +340,30 @@ void PowerFSM_setup()
|
|||||||
|
|
||||||
powerFSM.add_transition(&stateDARK, &stateDARK, EVENT_CONTACT_FROM_PHONE, NULL, "Contact from phone");
|
powerFSM.add_transition(&stateDARK, &stateDARK, EVENT_CONTACT_FROM_PHONE, NULL, "Contact from phone");
|
||||||
|
|
||||||
// each time we get a new update packet make sure we are staying in the ON state so the screen stays awake (also we don't
|
powerFSM.add_timed_transition(&stateON, &stateDARK,
|
||||||
// shutdown bluetooth if is_router)
|
getConfiguredOrDefaultMs(config.display.screen_on_secs, default_screen_on_secs), NULL,
|
||||||
powerFSM.add_transition(&stateDARK, &stateON, EVENT_FIRMWARE_UPDATE, NULL, "Got firmware update");
|
"Screen-on timeout");
|
||||||
powerFSM.add_transition(&stateON, &stateON, EVENT_FIRMWARE_UPDATE, NULL, "Got firmware update");
|
powerFSM.add_timed_transition(&statePOWER, &stateDARK,
|
||||||
|
getConfiguredOrDefaultMs(config.display.screen_on_secs, default_screen_on_secs), NULL,
|
||||||
powerFSM.add_timed_transition(&stateON, &stateDARK, getConfiguredOrDefaultMs(config.display.screen_on_secs, default_screen_on_secs), NULL, "Screen-on timeout");
|
"Screen-on timeout");
|
||||||
|
powerFSM.add_timed_transition(&stateDARK, &stateDARK,
|
||||||
// On most boards we use light-sleep to be our main state, but on NRF52 we just stay in DARK
|
getConfiguredOrDefaultMs(config.display.screen_on_secs, default_screen_on_secs), NULL,
|
||||||
State *lowPowerState = &stateLS;
|
"Screen-on timeout");
|
||||||
|
|
||||||
|
// We never enter light-sleep or NB states on NRF52 (because the CPU uses so little power normally)
|
||||||
#ifdef ARCH_ESP32
|
#ifdef ARCH_ESP32
|
||||||
// We never enter light-sleep or NB states on NRF52 (because the CPU uses so little power normally)
|
|
||||||
|
|
||||||
// See: https://github.com/meshtastic/firmware/issues/1071
|
// See: https://github.com/meshtastic/firmware/issues/1071
|
||||||
if (isRouter || config.power.is_power_saving) {
|
// Don't add power saving transitions if we are a power saving tracker or sensor. Sleep will be initiatiated through the
|
||||||
powerFSM.add_timed_transition(&stateNB, &stateLS, getConfiguredOrDefaultMs(config.power.min_wake_secs, default_min_wake_secs), NULL, "Min wake timeout");
|
// modules
|
||||||
powerFSM.add_timed_transition(&stateDARK, &stateLS, getConfiguredOrDefaultMs(config.power.wait_bluetooth_secs, default_wait_bluetooth_secs), NULL, "Bluetooth timeout");
|
if ((isRouter || config.power.is_power_saving) && !isTrackerOrSensor) {
|
||||||
}
|
powerFSM.add_timed_transition(&stateNB, &stateLS,
|
||||||
|
getConfiguredOrDefaultMs(config.power.min_wake_secs, default_min_wake_secs), NULL,
|
||||||
#elif defined (ARCH_NRF52)
|
"Min wake timeout");
|
||||||
lowPowerState = &stateDARK;
|
powerFSM.add_timed_transition(&stateDARK, &stateLS,
|
||||||
|
getConfiguredOrDefaultMs(config.power.wait_bluetooth_secs, default_wait_bluetooth_secs),
|
||||||
|
NULL, "Bluetooth timeout");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (config.power.sds_secs != UINT32_MAX)
|
powerFSM.run_machine(); // run one iteration of the state machine, so we run our on enter tasks for the initial DARK state
|
||||||
powerFSM.add_timed_transition(lowPowerState, &stateSDS, config.power.sds_secs * 1000, NULL, "mesh timeout");
|
}
|
||||||
|
|
||||||
powerFSM.run_machine(); // run one interation of the state machine, so we run our on enter tasks for the initial DARK state
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user