mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 19:56:30 +00:00
Compare commits
847 Commits
v14.3.0
...
developmen
Author | SHA1 | Date | |
---|---|---|---|
![]() |
afba1c8b9c | ||
![]() |
a273684902 | ||
![]() |
010de30400 | ||
![]() |
93c46dc3f9 | ||
![]() |
4a632e9ef1 | ||
![]() |
2fededdc57 | ||
![]() |
1495338f53 | ||
![]() |
83ed4c3aec | ||
![]() |
a4b05b88a5 | ||
![]() |
86d5b3e727 | ||
![]() |
063ea6af3e | ||
![]() |
4b74c71f19 | ||
![]() |
d7eebc174e | ||
![]() |
e11c874eda | ||
![]() |
8f973e3b3a | ||
![]() |
37af8be39d | ||
![]() |
6080bdc472 | ||
![]() |
aa7d74dec0 | ||
![]() |
fee8198e64 | ||
![]() |
d2f7af6572 | ||
![]() |
0adf865163 | ||
![]() |
f106eb3324 | ||
![]() |
60d59fde09 | ||
![]() |
79e76bddfb | ||
![]() |
d82fb0e07f | ||
![]() |
1fbe52df06 | ||
![]() |
57c7033987 | ||
![]() |
dd4c8e875c | ||
![]() |
64d5045ccb | ||
![]() |
035667327d | ||
![]() |
becd0a6ffc | ||
![]() |
6e7e483a70 | ||
![]() |
3c0e71c290 | ||
![]() |
df4943bc19 | ||
![]() |
722db4157d | ||
![]() |
08f2826e97 | ||
![]() |
a38146cc95 | ||
![]() |
228588a6a3 | ||
![]() |
64c8719f70 | ||
![]() |
c0f11f0373 | ||
![]() |
a6124128a7 | ||
![]() |
488225c787 | ||
![]() |
95fb60fd07 | ||
![]() |
cddcafbda3 | ||
![]() |
0738f0f916 | ||
![]() |
231f342497 | ||
![]() |
4efc2d6ce6 | ||
![]() |
46e6f7ea02 | ||
![]() |
7e77086a2d | ||
![]() |
3b207db27c | ||
![]() |
d3e2bb6906 | ||
![]() |
6c699e9b95 | ||
![]() |
fc22688b5d | ||
![]() |
b4796836b0 | ||
![]() |
9e25fc0f30 | ||
![]() |
c909e20fb1 | ||
![]() |
a052ee00a2 | ||
![]() |
bb53b42790 | ||
![]() |
fca68c6b30 | ||
![]() |
6751bd397c | ||
![]() |
c22cdd24b2 | ||
![]() |
e0515a7d30 | ||
![]() |
dc14f1c3bd | ||
![]() |
d8b40263e2 | ||
![]() |
56eb8d98c0 | ||
![]() |
ae3dbde4b1 | ||
![]() |
3dec15322f | ||
![]() |
19c212f261 | ||
![]() |
850fd07d3a | ||
![]() |
59c80254cd | ||
![]() |
9e7be254c2 | ||
![]() |
912cb15beb | ||
![]() |
5086863322 | ||
![]() |
0a80f45636 | ||
![]() |
fffda63f3c | ||
![]() |
07dcbcc53e | ||
![]() |
39013e4f7b | ||
![]() |
99b73aaaf8 | ||
![]() |
c5aced3dd0 | ||
![]() |
ece26ccfaf | ||
![]() |
407c274229 | ||
![]() |
ac51cd7340 | ||
![]() |
638b3b5c1e | ||
![]() |
2380c33ef0 | ||
![]() |
4904a43b33 | ||
![]() |
143cfdd4f2 | ||
![]() |
550b8c5307 | ||
![]() |
cc95aa5f0f | ||
![]() |
aeb3005c3e | ||
![]() |
45dd2a331e | ||
![]() |
99297d6dfc | ||
![]() |
942e419b0c | ||
![]() |
8158db7dad | ||
![]() |
ddf96fb58f | ||
![]() |
232db5ce77 | ||
![]() |
8de22ee4cc | ||
![]() |
727756283d | ||
![]() |
decdfc6b51 | ||
![]() |
e9b62811c7 | ||
![]() |
25c85a90ac | ||
![]() |
91e5be450d | ||
![]() |
07809eede5 | ||
![]() |
fef5ee9a6f | ||
![]() |
7d7a9ea6fb | ||
![]() |
67d428cd3d | ||
![]() |
384edd22a7 | ||
![]() |
fb44d42426 | ||
![]() |
f378e68b3d | ||
![]() |
e30ad61e00 | ||
![]() |
9392ac7d55 | ||
![]() |
76d4651163 | ||
![]() |
ea4e399b18 | ||
![]() |
d4d6a2c779 | ||
![]() |
390927c190 | ||
![]() |
b5d6e95164 | ||
![]() |
79024cdd23 | ||
![]() |
f7d4b0e726 | ||
![]() |
0687520c93 | ||
![]() |
64d6231111 | ||
![]() |
ea99e4724f | ||
![]() |
004f1ec36a | ||
![]() |
742b7338fd | ||
![]() |
84059199d4 | ||
![]() |
4002344227 | ||
![]() |
bba5ba008e | ||
![]() |
7c2eabcd94 | ||
![]() |
76a39f7597 | ||
![]() |
17cc37b889 | ||
![]() |
8da8c97d4f | ||
![]() |
5522f3f6ba | ||
![]() |
f3d4b5275d | ||
![]() |
26613aacb2 | ||
![]() |
4be87d41ef | ||
![]() |
55c7dc0654 | ||
![]() |
93a22628e5 | ||
![]() |
263d84315f | ||
![]() |
81465a8506 | ||
![]() |
bafcfcd227 | ||
![]() |
e7f9f51e27 | ||
![]() |
d94d7c8972 | ||
![]() |
de0d88514a | ||
![]() |
601ddc564d | ||
![]() |
ea9a24e76d | ||
![]() |
1cd4e27123 | ||
![]() |
fcf4706914 | ||
![]() |
692cf547cb | ||
![]() |
04302414c8 | ||
![]() |
b90ef3b400 | ||
![]() |
2eb56b77a2 | ||
![]() |
2914554f5e | ||
![]() |
b822a37a7c | ||
![]() |
6aca98673d | ||
![]() |
429537ce4c | ||
![]() |
fe596c680d | ||
![]() |
559209ee14 | ||
![]() |
6a4f09c888 | ||
![]() |
d7f9142833 | ||
![]() |
553ee44b02 | ||
![]() |
6853e88116 | ||
![]() |
f6bf4351f5 | ||
![]() |
b684486570 | ||
![]() |
4f4bf7c61b | ||
![]() |
92f14dd0c0 | ||
![]() |
67d223dc78 | ||
![]() |
c10686e366 | ||
![]() |
c8d6f723c1 | ||
![]() |
36a2d253e5 | ||
![]() |
40bc108ba1 | ||
![]() |
7ce3ba376c | ||
![]() |
6a27899241 | ||
![]() |
a6ab85f3cd | ||
![]() |
08e1ff548b | ||
![]() |
e2d30dd64d | ||
![]() |
02ce050727 | ||
![]() |
78787f693e | ||
![]() |
3327f4a5ca | ||
![]() |
17210d1aca | ||
![]() |
54a9a117fc | ||
![]() |
2b460aa112 | ||
![]() |
a088c8791f | ||
![]() |
f5fe75c9b0 | ||
![]() |
65b1c9668f | ||
![]() |
1ee3d8c079 | ||
![]() |
1306f7a8c7 | ||
![]() |
e86af24056 | ||
![]() |
aff2157356 | ||
![]() |
fc492bb6b2 | ||
![]() |
c61462a8ea | ||
![]() |
f90be50d2d | ||
![]() |
0abe70816b | ||
![]() |
28f4a07fd6 | ||
![]() |
7fb8654c6c | ||
![]() |
08e8f0b64d | ||
![]() |
ca9df09d6a | ||
![]() |
9f764ac414 | ||
![]() |
f660ba7e04 | ||
![]() |
8471832b3a | ||
![]() |
eef115f2c5 | ||
![]() |
56ce7b3f93 | ||
![]() |
b29ef3dfbc | ||
![]() |
8ea150328d | ||
![]() |
3d11cc4fee | ||
![]() |
42a1aee832 | ||
![]() |
98c6b0730f | ||
![]() |
66013fcf04 | ||
![]() |
1e74d6fd4d | ||
![]() |
2d16798263 | ||
![]() |
c25b9827e8 | ||
![]() |
5475fcc8f3 | ||
![]() |
502cdfb9ea | ||
![]() |
75b109c893 | ||
![]() |
b5ae6bc035 | ||
![]() |
5d8b90d83b | ||
![]() |
9329dbc52b | ||
![]() |
c148c8e84d | ||
![]() |
38802ab5b7 | ||
![]() |
f83b5a8c80 | ||
![]() |
2ab84dd3a4 | ||
![]() |
faf12234f6 | ||
![]() |
7624016efb | ||
![]() |
9ed833ec5f | ||
![]() |
d7073b3bdf | ||
![]() |
195fd7c6a3 | ||
![]() |
ddf3e38ef8 | ||
![]() |
e2eae10db6 | ||
![]() |
a52f3450b8 | ||
![]() |
a4ce9efd2c | ||
![]() |
f72a989976 | ||
![]() |
736d4d6576 | ||
![]() |
060f47678d | ||
![]() |
2e251468f9 | ||
![]() |
ce5fae934b | ||
![]() |
70bf5daff9 | ||
![]() |
6cd19c0e59 | ||
![]() |
326fa9ca10 | ||
![]() |
d95200939a | ||
![]() |
7e7f237292 | ||
![]() |
2c2f7f1149 | ||
![]() |
402c9e8e8d | ||
![]() |
94652ad6ed | ||
![]() |
723684bb06 | ||
![]() |
115cefc557 | ||
![]() |
0ad8696dfc | ||
![]() |
6344c46d08 | ||
![]() |
ed6203e114 | ||
![]() |
015fa1da89 | ||
![]() |
a11e269ca0 | ||
![]() |
2831bbfd18 | ||
![]() |
92b3f7d37c | ||
![]() |
a2d1915692 | ||
![]() |
082170374c | ||
![]() |
c2628c95f3 | ||
![]() |
2bc5f682b0 | ||
![]() |
cea46bb660 | ||
![]() |
b67231483a | ||
![]() |
e6918d8b9c | ||
![]() |
7ea95ec6b2 | ||
![]() |
8921a42f79 | ||
![]() |
c8181e3290 | ||
![]() |
117e503aaa | ||
![]() |
3baa110f9d | ||
![]() |
a4096ab049 | ||
![]() |
83118b9e05 | ||
![]() |
3a28938b91 | ||
![]() |
68f019cf43 | ||
![]() |
4707cc068f | ||
![]() |
0604fac3bc | ||
![]() |
c12974366b | ||
![]() |
cced48d824 | ||
![]() |
1a8903578f | ||
![]() |
230ce2c539 | ||
![]() |
6b7606c958 | ||
![]() |
cfe1cee4d3 | ||
![]() |
2999eed8b9 | ||
![]() |
3f82228905 | ||
![]() |
7ddf8abf90 | ||
![]() |
215b37bf69 | ||
![]() |
342bb2cb7b | ||
![]() |
2096411be6 | ||
![]() |
929582b1af | ||
![]() |
4ed48feaa2 | ||
![]() |
c121dbcd4a | ||
![]() |
e8baea464f | ||
![]() |
2bf67b96a6 | ||
![]() |
0cb6a8ba24 | ||
![]() |
39494f1287 | ||
![]() |
90c690e67a | ||
![]() |
08f20b9404 | ||
![]() |
dfabe8cc0f | ||
![]() |
b43d360d37 | ||
![]() |
2f7793ddcf | ||
![]() |
3c70b728ac | ||
![]() |
289120ee92 | ||
![]() |
b77b622fbe | ||
![]() |
a47e6f1496 | ||
![]() |
74757ee7da | ||
![]() |
ea2baee3b8 | ||
![]() |
f4bb9d98b6 | ||
![]() |
87b95f798a | ||
![]() |
da4dc56b16 | ||
![]() |
714ad233e0 | ||
![]() |
2da631e442 | ||
![]() |
6f47f23f7a | ||
![]() |
69fca99ac1 | ||
![]() |
a3b564f4f3 | ||
![]() |
52f3306f15 | ||
![]() |
9d6640a42e | ||
![]() |
307e1d9c29 | ||
![]() |
f71ca3e0a2 | ||
![]() |
a3d86eebf0 | ||
![]() |
f331a64ac3 | ||
![]() |
caac9f1257 | ||
![]() |
b47a1bc1e2 | ||
![]() |
9e3ad52356 | ||
![]() |
38ceafe789 | ||
![]() |
ddc1439edf | ||
![]() |
3827bca3cc | ||
![]() |
8183a9ed3b | ||
![]() |
00e2d1d430 | ||
![]() |
863c6d1214 | ||
![]() |
73cace5274 | ||
![]() |
1ada6da6b8 | ||
![]() |
fbb752d8c2 | ||
![]() |
fb6640b91f | ||
![]() |
c0d15de965 | ||
![]() |
3764e88ed2 | ||
![]() |
0ea1f8e632 | ||
![]() |
234c5ea170 | ||
![]() |
ce92723c41 | ||
![]() |
e1f7ee26fa | ||
![]() |
a97d306a16 | ||
![]() |
508992258f | ||
![]() |
1b51aef911 | ||
![]() |
6486ba3b26 | ||
![]() |
9b4eb64caa | ||
![]() |
6d376a079e | ||
![]() |
69c3863b14 | ||
![]() |
ac8236abe1 | ||
![]() |
16e9d105ba | ||
![]() |
f3ae3bec4b | ||
![]() |
cae4551762 | ||
![]() |
007608914c | ||
![]() |
758ba17dde | ||
![]() |
08fae4bcd6 | ||
![]() |
f305113d6d | ||
![]() |
7b8d2fe93d | ||
![]() |
714435be1c | ||
![]() |
e3eb47078f | ||
![]() |
a0c8ac4f80 | ||
![]() |
c926b4b3a6 | ||
![]() |
3f93d2deee | ||
![]() |
06aa356bc3 | ||
![]() |
58632d67db | ||
![]() |
e26a2cdac9 | ||
![]() |
72535db185 | ||
![]() |
f2bf8b96e7 | ||
![]() |
549ca6e32f | ||
![]() |
72520e0743 | ||
![]() |
aed82dc8b2 | ||
![]() |
2e35a2ab93 | ||
![]() |
3c171c1ed8 | ||
![]() |
481f2cd8e1 | ||
![]() |
9a98db9773 | ||
![]() |
e92e411040 | ||
![]() |
aecba92da4 | ||
![]() |
4ee4b5908f | ||
![]() |
3f74bc83e5 | ||
![]() |
fd0501035d | ||
![]() |
670fab7ead | ||
![]() |
375864b23b | ||
![]() |
788ac574ac | ||
![]() |
5aa7d08c91 | ||
![]() |
b4c61325cb | ||
![]() |
d10eafc500 | ||
![]() |
90ebff552d | ||
![]() |
0c26698ba6 | ||
![]() |
1db796c40f | ||
![]() |
b8459eb685 | ||
![]() |
b1f3d6268d | ||
![]() |
7a4d8a5fb1 | ||
![]() |
0ab5548615 | ||
![]() |
1af1057e66 | ||
![]() |
039960153a | ||
![]() |
b4c1cd654f | ||
![]() |
c6b975561f | ||
![]() |
4306823ba6 | ||
![]() |
9b258cadcf | ||
![]() |
871723b6f7 | ||
![]() |
3c66ace01b | ||
![]() |
41af475cdb | ||
![]() |
3c5f22b31f | ||
![]() |
cb333a5a38 | ||
![]() |
c39a7d924a | ||
![]() |
f07af885a9 | ||
![]() |
f1be1b8ba9 | ||
![]() |
cfc11b5e83 | ||
![]() |
a939b4973e | ||
![]() |
d805cef66e | ||
![]() |
64ec55db4e | ||
![]() |
a2af12c969 | ||
![]() |
f383c877c6 | ||
![]() |
cc14f721f9 | ||
![]() |
ccf8902515 | ||
![]() |
f3dc35e9ca | ||
![]() |
0b3be314e7 | ||
![]() |
a9150dc703 | ||
![]() |
c076331fad | ||
![]() |
8621b9adf4 | ||
![]() |
bc7a1f5dbc | ||
![]() |
3ef9fe9f6e | ||
![]() |
1910aba79f | ||
![]() |
dbcfe486af | ||
![]() |
214b392839 | ||
![]() |
b9bc3580f4 | ||
![]() |
b07bd68046 | ||
![]() |
7a97a8fa98 | ||
![]() |
1b2fc5eccc | ||
![]() |
e7f5ecc2d0 | ||
![]() |
ff5b4956c8 | ||
![]() |
5a6b219971 | ||
![]() |
99cbdf687d | ||
![]() |
57e4d18d26 | ||
![]() |
d4a8952c34 | ||
![]() |
28b22de7e4 | ||
![]() |
f65646ba80 | ||
![]() |
f014299adc | ||
![]() |
af4ec3e0d0 | ||
![]() |
f1e5b576ba | ||
![]() |
c4dd9839c9 | ||
![]() |
db96993e50 | ||
![]() |
35a27d4541 | ||
![]() |
f727013373 | ||
![]() |
d54dfa6bc4 | ||
![]() |
a07973e866 | ||
![]() |
23ae0db9a8 | ||
![]() |
89b1df6a81 | ||
![]() |
117c1f68b7 | ||
![]() |
1988cd620d | ||
![]() |
470065e36b | ||
![]() |
d94e680b51 | ||
![]() |
c7d4a2a104 | ||
![]() |
8bf10f0b9a | ||
![]() |
ed52e711a9 | ||
![]() |
6ffb783321 | ||
![]() |
c4d2f010ef | ||
![]() |
1c0327e2c1 | ||
![]() |
63845ad3e8 | ||
![]() |
268a7267ac | ||
![]() |
a9c39fe098 | ||
![]() |
ea584f60c8 | ||
![]() |
2c0172d7d5 | ||
![]() |
94e2a91bbd | ||
![]() |
dcc407889a | ||
![]() |
97cf0a4baa | ||
![]() |
6421d6b1ab | ||
![]() |
b02ac268ad | ||
![]() |
2ac886a7f8 | ||
![]() |
8f641238b6 | ||
![]() |
2c8c5ae6b9 | ||
![]() |
892e29f599 | ||
![]() |
a9996ecc40 | ||
![]() |
9be9bb8af3 | ||
![]() |
518df07ba1 | ||
![]() |
c9cd6aae1d | ||
![]() |
ab9ad562cb | ||
![]() |
0b95779947 | ||
![]() |
0ba224bf9a | ||
![]() |
427db230fc | ||
![]() |
670d7bd8eb | ||
![]() |
cba8723c59 | ||
![]() |
c773a95ff7 | ||
![]() |
35e2d43191 | ||
![]() |
8a0e2d0604 | ||
![]() |
66a1f04414 | ||
![]() |
0c898b8d75 | ||
![]() |
299f983610 | ||
![]() |
aaa49f84ab | ||
![]() |
def7ede895 | ||
![]() |
e8ca96008f | ||
![]() |
943a0b1e6c | ||
![]() |
0bc319acb5 | ||
![]() |
d72ec454c0 | ||
![]() |
0288157fdb | ||
![]() |
7dd6b999ca | ||
![]() |
34b173e953 | ||
![]() |
9d963ce599 | ||
![]() |
f4bc628940 | ||
![]() |
0dcd38186f | ||
![]() |
9bb7b7913a | ||
![]() |
60570dec76 | ||
![]() |
95e93b8f33 | ||
![]() |
9613004bb4 | ||
![]() |
b167955e87 | ||
![]() |
18d99daa72 | ||
![]() |
4d9dd0aa3f | ||
![]() |
53dee5b002 | ||
![]() |
1065db5831 | ||
![]() |
0471f0f3c5 | ||
![]() |
beb967ccd4 | ||
![]() |
a91771e0cf | ||
![]() |
5cbe5fe9e4 | ||
![]() |
b253b344c2 | ||
![]() |
fa4f2123cf | ||
![]() |
9f3f234ac9 | ||
![]() |
4b69d30a5f | ||
![]() |
cd0743c6ed | ||
![]() |
ed1c6e2d9e | ||
![]() |
a7ee6054b5 | ||
![]() |
a49e924b53 | ||
![]() |
ebbef97cde | ||
![]() |
3068a48d90 | ||
![]() |
5ac1fdb8fe | ||
![]() |
866ffc8967 | ||
![]() |
3efdfae845 | ||
![]() |
6d7aab4662 | ||
![]() |
ec8cf6e2f0 | ||
![]() |
d176a1d65b | ||
![]() |
ddcdc85520 | ||
![]() |
fc8485d91b | ||
![]() |
e5e4c336b5 | ||
![]() |
6b3719bd9e | ||
![]() |
d0ef026bb9 | ||
![]() |
03e8497211 | ||
![]() |
cf739e9522 | ||
![]() |
e299035266 | ||
![]() |
83b09f4de1 | ||
![]() |
3365fd0d0b | ||
![]() |
ed21cfd487 | ||
![]() |
f42cb555c3 | ||
![]() |
e57b3e8b05 | ||
![]() |
76fb95b166 | ||
![]() |
d6ce776c98 | ||
![]() |
dce79fd0c3 | ||
![]() |
d3da193e39 | ||
![]() |
b73f50be6b | ||
![]() |
1fc6f5c707 | ||
![]() |
fe2f4d031f | ||
![]() |
b472e821cf | ||
![]() |
17ab5a5e83 | ||
![]() |
2263305bee | ||
![]() |
0d0b9de474 | ||
![]() |
77d98868bf | ||
![]() |
a5610eea09 | ||
![]() |
bd7e47139c | ||
![]() |
c084719b0e | ||
![]() |
124f55ca70 | ||
![]() |
50f0f8a651 | ||
![]() |
64a2fe8aee | ||
![]() |
ed7b58291a | ||
![]() |
aafe528682 | ||
![]() |
d5d757fd3d | ||
![]() |
b5c326d772 | ||
![]() |
884e795dff | ||
![]() |
8fa33ff4da | ||
![]() |
a2752bf500 | ||
![]() |
01154e9497 | ||
![]() |
1a482364bc | ||
![]() |
5f95b33220 | ||
![]() |
dc531de02b | ||
![]() |
a1aef6b39f | ||
![]() |
02225ea7c4 | ||
![]() |
2d2c732e2e | ||
![]() |
9fb8065fac | ||
![]() |
1ad89ccb3e | ||
![]() |
de3a7f3909 | ||
![]() |
17924392fa | ||
![]() |
f4d0606d06 | ||
![]() |
6d5a33772c | ||
![]() |
d1a7d70ca0 | ||
![]() |
7f8f61423a | ||
![]() |
b729886a16 | ||
![]() |
4d3a780eb1 | ||
![]() |
64f0acb0c5 | ||
![]() |
2143082aa4 | ||
![]() |
1d244fcd28 | ||
![]() |
02ae53cec5 | ||
![]() |
94f3744235 | ||
![]() |
8a37df10c6 | ||
![]() |
2024bf88ac | ||
![]() |
fc3ad45836 | ||
![]() |
4fd3d9465c | ||
![]() |
3412761881 | ||
![]() |
3457d66d1e | ||
![]() |
3b48a1c16a | ||
![]() |
27e85809b5 | ||
![]() |
f3fcbea6d1 | ||
![]() |
f59c1675eb | ||
![]() |
6745bc1b48 | ||
![]() |
9f3c7859d7 | ||
![]() |
52d4e84b39 | ||
![]() |
8311bff7ee | ||
![]() |
fde529fac4 | ||
![]() |
af724a6149 | ||
![]() |
0d9ce6de12 | ||
![]() |
df79533611 | ||
![]() |
e4ff66192f | ||
![]() |
9b6dc1f0f1 | ||
![]() |
2d3a049e59 | ||
![]() |
b7da75da30 | ||
![]() |
db29cb7152 | ||
![]() |
97b375fd57 | ||
![]() |
2c3785c1c6 | ||
![]() |
69d3fc1003 | ||
![]() |
90e0595b7f | ||
![]() |
fba6a806ac | ||
![]() |
ef7b2404d4 | ||
![]() |
6468b6edcd | ||
![]() |
c40b707b76 | ||
![]() |
af3bb96a2a | ||
![]() |
da7473e07c | ||
![]() |
b0c505d171 | ||
![]() |
6fbf8c58f7 | ||
![]() |
b3b9699782 | ||
![]() |
615c6763f6 | ||
![]() |
7cd0908c89 | ||
![]() |
bd6e7d220d | ||
![]() |
8d1b4094db | ||
![]() |
67ae7c2fe1 | ||
![]() |
5294b99ba7 | ||
![]() |
53e2fab34c | ||
![]() |
ab5208d216 | ||
![]() |
f135f46990 | ||
![]() |
9650d0f1ef | ||
![]() |
7834dbf6b6 | ||
![]() |
1099babb16 | ||
![]() |
3e3b568aeb | ||
![]() |
620fade73c | ||
![]() |
6268066bac | ||
![]() |
dc7cb05cab | ||
![]() |
d08aafd3fb | ||
![]() |
ee3fbdf4e0 | ||
![]() |
4008a4e5e6 | ||
![]() |
3c51793d5c | ||
![]() |
bdf880cf84 | ||
![]() |
c1834bd898 | ||
![]() |
a12c934a4b | ||
![]() |
71dfae2d9d | ||
![]() |
23e5a4dec2 | ||
![]() |
09f0b89ab0 | ||
![]() |
d6c1617fc5 | ||
![]() |
2969ee91a4 | ||
![]() |
364fa21fc4 | ||
![]() |
ed520140a1 | ||
![]() |
523f803b06 | ||
![]() |
aeb965435e | ||
![]() |
7df2c703a1 | ||
![]() |
54d28c9d35 | ||
![]() |
dd555a0641 | ||
![]() |
0a2fa4ec41 | ||
![]() |
6e6305f5e9 | ||
![]() |
57fc179709 | ||
![]() |
3a62cc6050 | ||
![]() |
789bbb8b97 | ||
![]() |
4ffc53b465 | ||
![]() |
f341f8d35a | ||
![]() |
9317e02f25 | ||
![]() |
b80cc6a3e6 | ||
![]() |
ccd76b26ed | ||
![]() |
f72769252e | ||
![]() |
6b753cff44 | ||
![]() |
570e2052d3 | ||
![]() |
62e4bf1acd | ||
![]() |
4046cd8ec0 | ||
![]() |
62d6a03335 | ||
![]() |
341cc87527 | ||
![]() |
ebff2d2d38 | ||
![]() |
baeaad7558 | ||
![]() |
e2bae09ded | ||
![]() |
0ea8889997 | ||
![]() |
e1fc36361e | ||
![]() |
bed14174bc | ||
![]() |
fbb2c84f29 | ||
![]() |
a838ec09f8 | ||
![]() |
038e62b72c | ||
![]() |
f176ede65d | ||
![]() |
3316bc5e70 | ||
![]() |
db0287e566 | ||
![]() |
8cb9345a97 | ||
![]() |
e8d5e442bf | ||
![]() |
5a32df5e81 | ||
![]() |
5dd132bb5f | ||
![]() |
2322646773 | ||
![]() |
155dea98cd | ||
![]() |
3ab87273e6 | ||
![]() |
e397c11e70 | ||
![]() |
2402f7cbd1 | ||
![]() |
3448e17317 | ||
![]() |
25f13e434f | ||
![]() |
b9414008df | ||
![]() |
3c703ac4d4 | ||
![]() |
f255233f90 | ||
![]() |
fb0666e6c8 | ||
![]() |
4925e9c9a8 | ||
![]() |
16b6d353f4 | ||
![]() |
bf872defab | ||
![]() |
1e9c5ad40e | ||
![]() |
3c5cbade63 | ||
![]() |
6d0467489a | ||
![]() |
fe658424b8 | ||
![]() |
ae7cba2f13 | ||
![]() |
3778f22d7b | ||
![]() |
320ad0e1d3 | ||
![]() |
3114c75a1d | ||
![]() |
873bd3f211 | ||
![]() |
7615b3c8f7 | ||
![]() |
f3bf8998ae | ||
![]() |
4e40bbf3b6 | ||
![]() |
099c68678a | ||
![]() |
6821293819 | ||
![]() |
14c0a42203 | ||
![]() |
5de16c1cca | ||
![]() |
de45fda781 | ||
![]() |
09c43fa729 | ||
![]() |
d3df759514 | ||
![]() |
0947860c83 | ||
![]() |
996ea17fb6 | ||
![]() |
ef7cd80ed8 | ||
![]() |
aeceace546 | ||
![]() |
1dff29f367 | ||
![]() |
0dcfa74ef3 | ||
![]() |
dd99642cf7 | ||
![]() |
b195bcd88d | ||
![]() |
551c919ae2 | ||
![]() |
50b6f74295 | ||
![]() |
88810fc92c | ||
![]() |
0fb39b9bac | ||
![]() |
77f9fb0783 | ||
![]() |
7dd1e2a028 | ||
![]() |
cf94ccf59c | ||
![]() |
b903c6a843 | ||
![]() |
5c3d450195 | ||
![]() |
331fd14268 | ||
![]() |
bdc7e0a65b | ||
![]() |
caa63f437c | ||
![]() |
a766947724 | ||
![]() |
043d80809b | ||
![]() |
6c4e314adc | ||
![]() |
a013c7e36d | ||
![]() |
08f99de2a5 | ||
![]() |
1b9d206dd8 | ||
![]() |
0744bf7f2b | ||
![]() |
0536cc87a0 | ||
![]() |
c86f74d456 | ||
![]() |
b40e2ec8e9 | ||
![]() |
343d9b9758 | ||
![]() |
448ca1c109 | ||
![]() |
5f9912665a | ||
![]() |
fd7554d96e | ||
![]() |
a97aeeedb7 | ||
![]() |
7e3f093dc9 | ||
![]() |
669c6e49ea | ||
![]() |
a5c33eba5e | ||
![]() |
3bc90175db | ||
![]() |
a836e841ad | ||
![]() |
c2091d7082 | ||
![]() |
7c82d3a7ae | ||
![]() |
df293dad82 | ||
![]() |
a35bb5a5c9 | ||
![]() |
19e15e21aa | ||
![]() |
feff388f03 | ||
![]() |
2f3808adc9 | ||
![]() |
5fac24a5f6 | ||
![]() |
245da3918a | ||
![]() |
ff0d003a24 | ||
![]() |
4f90c3764a | ||
![]() |
98cf7f33f7 | ||
![]() |
2fd1c0b7fb | ||
![]() |
a571ca1db5 | ||
![]() |
94c45689a6 | ||
![]() |
57d8bea761 | ||
![]() |
490c48eefe | ||
![]() |
56243ef720 | ||
![]() |
133cca3fd5 | ||
![]() |
5aaeecdbe8 | ||
![]() |
8e34864ead | ||
![]() |
2dc5c6e234 | ||
![]() |
66d69e09c9 | ||
![]() |
a463761090 | ||
![]() |
49d706f54c | ||
![]() |
deca4d9e06 | ||
![]() |
789c990c19 | ||
![]() |
5892fef63d | ||
![]() |
b89909991c | ||
![]() |
e30d88e013 | ||
![]() |
0ba0b8dada | ||
![]() |
3f4b2331ee | ||
![]() |
79a7c71145 | ||
![]() |
ccfbdd50e0 | ||
![]() |
2669cd35cf | ||
![]() |
2925836a9c | ||
![]() |
18bfda50ab | ||
![]() |
fc0dc5dfec | ||
![]() |
27db263493 | ||
![]() |
ef3c061ecf | ||
![]() |
104fec83fb | ||
![]() |
e14f014c96 | ||
![]() |
e731738385 | ||
![]() |
4f2c1f3499 | ||
![]() |
37f42b474f | ||
![]() |
faf6e66e32 | ||
![]() |
19fcaf8866 | ||
![]() |
bca4211500 | ||
![]() |
227e5f24b6 | ||
![]() |
98b04f5029 | ||
![]() |
b5a487a595 | ||
![]() |
0f2b3b1898 | ||
![]() |
41442a54ce | ||
![]() |
33e1da84e7 | ||
![]() |
73cd5cee25 | ||
![]() |
16a145f809 | ||
![]() |
0fd16f8725 | ||
![]() |
886221a1d6 | ||
![]() |
80686a8c52 | ||
![]() |
bbba5b9196 | ||
![]() |
e4f431dc7b | ||
![]() |
fd37801d53 | ||
![]() |
73897ef755 | ||
![]() |
7f6dbfbeac | ||
![]() |
5200aca185 | ||
![]() |
02972ad3ea | ||
![]() |
6b094ede16 | ||
![]() |
2b6acff4f4 | ||
![]() |
4dfa016855 | ||
![]() |
f6699b529c | ||
![]() |
bd88ddc56d | ||
![]() |
7ea96eb005 | ||
![]() |
923ed91c9c | ||
![]() |
9c24258530 | ||
![]() |
148f8350b6 | ||
![]() |
04c0aa13ea | ||
![]() |
91604b9f2a | ||
![]() |
f320ca2982 | ||
![]() |
813dc27360 | ||
![]() |
66213c88c1 | ||
![]() |
92a56a80b4 | ||
![]() |
73f755dda2 | ||
![]() |
ad65448e09 | ||
![]() |
58e3297b07 | ||
![]() |
7c3f83215a | ||
![]() |
fa7e0f938e | ||
![]() |
5a204aea48 | ||
![]() |
a35b7a9f82 | ||
![]() |
4948b70acd | ||
![]() |
e39f1cc83f | ||
![]() |
0f84211898 | ||
![]() |
aed98a6b64 | ||
![]() |
69f7f155dd |
1000
.doc_for_ai/BERRY_LANGUAGE_REFERENCE.md
Normal file
1000
.doc_for_ai/BERRY_LANGUAGE_REFERENCE.md
Normal file
File diff suppressed because it is too large
Load Diff
704
.doc_for_ai/BERRY_TASMOTA.md
Normal file
704
.doc_for_ai/BERRY_TASMOTA.md
Normal file
@ -0,0 +1,704 @@
|
||||
# Berry for Tasmota
|
||||
|
||||
This document covers Tasmota-specific Berry features and extensions, complementing the general Berry language reference.
|
||||
|
||||
## Introduction
|
||||
|
||||
Berry is the next generation scripting language for Tasmota, embedded by default in all ESP32 based firmwares (NOT supported on ESP8266). It is used for advanced scripting, superseding Rules, and enables building drivers, automations, and UI extensions.
|
||||
|
||||
## Tasmota-Specific Modules
|
||||
|
||||
Beyond standard Berry modules, Tasmota provides additional modules:
|
||||
|
||||
| Module | Description | Import |
|
||||
|--------|-------------|--------|
|
||||
| `tasmota` | Core integration module | Automatically imported |
|
||||
| `light` | Light control | Automatically imported |
|
||||
| `mqtt` | MQTT operations | `import mqtt` |
|
||||
| `webserver` | Web server extensions | `import webserver` |
|
||||
| `gpio` | GPIO control | `import gpio` |
|
||||
| `persist` | Data persistence | `import persist` |
|
||||
| `path` | File system operations | `import path` |
|
||||
| `energy` | Energy monitoring | Automatically imported |
|
||||
| `display` | Display driver integration | `import display` |
|
||||
| `crypto` | Cryptographic functions | `import crypto` |
|
||||
| `re` | Regular expressions | `import re` |
|
||||
| `mdns` | mDNS/Bonjour support | `import mdns` |
|
||||
| `ULP` | Ultra Low Power coprocessor | `import ULP` |
|
||||
| `uuid` | UUID generation | `import uuid` |
|
||||
| `crc` | CRC calculations | `import crc` |
|
||||
|
||||
## Additional Resources
|
||||
|
||||
For Tasmota-specific Berry features and extensions, please refer to the companion document `BERRY_TASMOTA.md`.
|
||||
|
||||
### Tasmota Constants and Enums
|
||||
|
||||
```berry
|
||||
# GPIO constants (gpio module)
|
||||
gpio.INPUT, gpio.OUTPUT, gpio.PULLUP, gpio.PULLDOWN
|
||||
gpio.HIGH, gpio.LOW
|
||||
gpio.REL1, gpio.KEY1, gpio.LED1, gpio.I2C_SCL, gpio.I2C_SDA
|
||||
# ... many more GPIO function constants
|
||||
|
||||
# Serial constants
|
||||
serial.SERIAL_8N1, serial.SERIAL_7E1, etc.
|
||||
|
||||
# Webserver constants
|
||||
webserver.HTTP_GET, webserver.HTTP_POST, webserver.HTTP_OPTIONS, webserver.HTTP_ANY
|
||||
webserver.HTTP_OFF, webserver.HTTP_USER, webserver.HTTP_ADMIN, webserver.HTTP_MANAGER
|
||||
webserver.HTTP_MANAGER_RESET_ONLY
|
||||
webserver.BUTTON_MAIN, webserver.BUTTON_CONFIGURATION, webserver.BUTTON_INFORMATION
|
||||
webserver.BUTTON_MANAGEMENT, webserver.BUTTON_MODULE
|
||||
```
|
||||
|
||||
### Console and REPL
|
||||
|
||||
Access Berry console via *Configuration* → *Berry Scripting Console*. The console supports:
|
||||
- Multi-line input (press Enter twice or click "Run")
|
||||
- Command history (arrow keys)
|
||||
- Colorful syntax highlighting
|
||||
- Berry VM restart with `BrRestart` command
|
||||
|
||||
### File System and Loading
|
||||
|
||||
Berry files can be source (`.be`) or pre-compiled bytecode (`.bec`):
|
||||
|
||||
```berry
|
||||
load("filename") # Loads .be or .bec file
|
||||
tasmota.compile("file.be") # Compiles .be to .bec
|
||||
```
|
||||
|
||||
**Autostart**: Place `autoexec.be` in filesystem to run Berry code at boot.
|
||||
|
||||
### Tasmota Integration Functions
|
||||
|
||||
#### Core Tasmota Functions
|
||||
|
||||
```berry
|
||||
# System information
|
||||
tasmota.get_free_heap() # Free heap bytes
|
||||
tasmota.memory() # Memory stats map
|
||||
tasmota.arch() # Architecture: "esp32", "esp32s2", etc.
|
||||
tasmota.millis() # Milliseconds since boot
|
||||
tasmota.yield() # Give time to low-level functions
|
||||
tasmota.delay(ms) # Block execution for ms milliseconds
|
||||
|
||||
# Commands and responses
|
||||
tasmota.cmd("command") # Execute Tasmota command
|
||||
tasmota.resp_cmnd_done() # Respond "Done"
|
||||
tasmota.resp_cmnd_error() # Respond "Error"
|
||||
tasmota.resp_cmnd_str(msg) # Custom response string
|
||||
tasmota.resp_cmnd(json) # Custom JSON response
|
||||
|
||||
# Configuration
|
||||
tasmota.get_option(index) # Get SetOption value
|
||||
tasmota.read_sensors() # Get sensor JSON string
|
||||
tasmota.wifi() # WiFi connection info
|
||||
tasmota.eth() # Ethernet connection info
|
||||
```
|
||||
|
||||
#### Rules and Events
|
||||
|
||||
```berry
|
||||
# Add rules (similar to Tasmota Rules but more powerful)
|
||||
tasmota.add_rule("trigger", function)
|
||||
tasmota.add_rule(["trigger1", "trigger2"], function) # AND logic
|
||||
tasmota.remove_rule("trigger")
|
||||
|
||||
# Rule function signature
|
||||
def rule_function(value, trigger, msg)
|
||||
# value: trigger value (%value% equivalent)
|
||||
# trigger: full trigger string
|
||||
# msg: parsed JSON map or original string
|
||||
end
|
||||
|
||||
# Examples
|
||||
tasmota.add_rule("Dimmer>50", def() print("Bright!") end)
|
||||
tasmota.add_rule("ANALOG#A1>300", def(val) print("ADC:", val) end)
|
||||
```
|
||||
|
||||
#### Timers and Scheduling
|
||||
|
||||
```berry
|
||||
# Timers (50ms resolution)
|
||||
tasmota.set_timer(delay_ms, function)
|
||||
tasmota.remove_timer(id)
|
||||
tasmota.defer(function) # Run in next millisecond
|
||||
|
||||
# Cron scheduling
|
||||
tasmota.add_cron("*/15 * * * * *", function, "id")
|
||||
tasmota.remove_cron("id")
|
||||
tasmota.next_cron("id") # Next execution timestamp
|
||||
|
||||
# Time functions
|
||||
tasmota.rtc() # Current time info
|
||||
tasmota.time_dump(timestamp) # Decompose timestamp
|
||||
tasmota.time_str(timestamp) # ISO 8601 string
|
||||
tasmota.strftime(format, timestamp)
|
||||
tasmota.strptime(time_str, format)
|
||||
```
|
||||
|
||||
#### Device Control
|
||||
|
||||
```berry
|
||||
# Relays and Power
|
||||
tasmota.get_power() # Array of relay states
|
||||
tasmota.set_power(idx, state) # Set relay state
|
||||
|
||||
# Lights (use light module)
|
||||
light.get() # Current light status
|
||||
light.set({"power": true, "bri": 128, "hue": 120})
|
||||
|
||||
# Light attributes: power, bri (0-255), hue (0-360), sat (0-255),
|
||||
# ct (153-500), rgb (hex string), channels (array)
|
||||
```
|
||||
|
||||
#### Custom Commands
|
||||
|
||||
```berry
|
||||
# Add custom Tasmota commands
|
||||
def my_command(cmd, idx, payload, payload_json)
|
||||
# cmd: command name, idx: command index
|
||||
# payload: raw string, payload_json: parsed JSON
|
||||
tasmota.resp_cmnd_done()
|
||||
end
|
||||
|
||||
tasmota.add_cmd("MyCmd", my_command)
|
||||
tasmota.remove_cmd("MyCmd")
|
||||
```
|
||||
|
||||
### Tasmota Drivers
|
||||
|
||||
Create complete Tasmota drivers by implementing event methods:
|
||||
|
||||
```berry
|
||||
class MyDriver
|
||||
def every_second() # Called every second
|
||||
end
|
||||
|
||||
def every_50ms() # Called every 50ms
|
||||
end
|
||||
|
||||
def web_sensor() # Add to web UI
|
||||
tasmota.web_send("{s}Sensor{m}Value{e}")
|
||||
end
|
||||
|
||||
def json_append() # Add to JSON teleperiod
|
||||
tasmota.response_append(',"MySensor":{"Value":123}')
|
||||
end
|
||||
|
||||
def web_add_main_button() # Add button to main page
|
||||
import webserver
|
||||
webserver.content_send("<button onclick='la(\"&myaction=1\");'>My Button</button>")
|
||||
end
|
||||
|
||||
def button_pressed() # Handle button press
|
||||
end
|
||||
|
||||
def mqtt_data(topic, idx, data, databytes) # Handle MQTT
|
||||
end
|
||||
|
||||
def save_before_restart() # Before restart
|
||||
end
|
||||
end
|
||||
|
||||
# Register driver
|
||||
driver = MyDriver()
|
||||
tasmota.add_driver(driver)
|
||||
```
|
||||
|
||||
### Fast Loop
|
||||
|
||||
For near real-time events (200Hz, 5ms intervals):
|
||||
|
||||
```berry
|
||||
def fast_function()
|
||||
# High-frequency processing
|
||||
end
|
||||
|
||||
tasmota.add_fast_loop(fast_function)
|
||||
tasmota.remove_fast_loop(fast_function)
|
||||
```
|
||||
|
||||
### GPIO Control
|
||||
|
||||
```berry
|
||||
import gpio
|
||||
|
||||
# GPIO detection and control
|
||||
gpio.pin_used(gpio.REL1) # Check if GPIO is used
|
||||
gpio.pin(gpio.REL1) # Get physical GPIO number
|
||||
gpio.digital_write(pin, gpio.HIGH) # Set GPIO state
|
||||
gpio.digital_read(pin) # Read GPIO state
|
||||
gpio.pin_mode(pin, gpio.OUTPUT) # Set GPIO mode
|
||||
|
||||
# PWM control
|
||||
gpio.set_pwm(pin, duty, phase) # Set PWM value
|
||||
gpio.set_pwm_freq(pin, freq) # Set PWM frequency
|
||||
|
||||
# DAC (ESP32 GPIO 25-26, ESP32-S2 GPIO 17-18)
|
||||
gpio.dac_voltage(pin, voltage_mv) # Set DAC voltage
|
||||
|
||||
# Counters
|
||||
gpio.counter_read(counter) # Read counter value
|
||||
gpio.counter_set(counter, value) # Set counter value
|
||||
```
|
||||
|
||||
### I²C Communication
|
||||
|
||||
```berry
|
||||
# Use wire1 or wire2 for I²C buses
|
||||
wire1.scan() # Scan for devices
|
||||
wire1.detect(addr) # Check if device present
|
||||
wire1.read(addr, reg, size) # Read from device
|
||||
wire1.write(addr, reg, val, size) # Write to device
|
||||
wire1.read_bytes(addr, reg, size) # Read as bytes
|
||||
wire1.write_bytes(addr, reg, bytes) # Write bytes
|
||||
|
||||
# Find device on any bus
|
||||
wire = tasmota.wire_scan(addr, i2c_index)
|
||||
```
|
||||
|
||||
### MQTT Integration
|
||||
|
||||
```berry
|
||||
import mqtt
|
||||
|
||||
# MQTT operations
|
||||
mqtt.publish(topic, payload, retain)
|
||||
mqtt.subscribe(topic, function) # Subscribe with callback
|
||||
mqtt.unsubscribe(topic)
|
||||
mqtt.connected() # Check connection status
|
||||
|
||||
# Callback function signature
|
||||
def mqtt_callback(topic, idx, payload_s, payload_b)
|
||||
# topic: full topic, payload_s: string, payload_b: bytes
|
||||
return true # Return true if handled
|
||||
end
|
||||
```
|
||||
|
||||
### Web Server Extensions
|
||||
|
||||
```berry
|
||||
import webserver
|
||||
|
||||
# In driver's web_add_handler() method
|
||||
webserver.on("/my_page", def()
|
||||
webserver.content_send("<html>My Page</html>")
|
||||
end)
|
||||
|
||||
# Request handling
|
||||
webserver.has_arg("param") # Check parameter exists
|
||||
webserver.arg("param") # Get parameter value
|
||||
webserver.arg_size() # Number of parameters
|
||||
|
||||
# Response functions
|
||||
webserver.content_send(html) # Send HTML content
|
||||
webserver.content_button() # Standard button
|
||||
webserver.html_escape(str) # Escape HTML
|
||||
```
|
||||
|
||||
### Persistence
|
||||
|
||||
```berry
|
||||
import persist
|
||||
|
||||
# Automatic persistence to _persist.json
|
||||
persist.my_value = 123
|
||||
persist.save() # Force save to flash
|
||||
persist.has("key") # Check if key exists
|
||||
persist.remove("key") # Remove key
|
||||
persist.find("key", default) # Get with default
|
||||
```
|
||||
|
||||
### Network Clients
|
||||
|
||||
#### HTTP/HTTPS Client
|
||||
|
||||
```berry
|
||||
cl = webclient()
|
||||
cl.begin("https://example.com/api")
|
||||
cl.set_auth("user", "pass")
|
||||
cl.add_header("Content-Type", "application/json")
|
||||
|
||||
result = cl.GET() # or POST(payload)
|
||||
if result == 200
|
||||
response = cl.get_string()
|
||||
# or cl.write_file("filename") for binary
|
||||
end
|
||||
cl.close()
|
||||
```
|
||||
|
||||
#### TCP Client
|
||||
|
||||
```berry
|
||||
tcp = tcpclient()
|
||||
tcp.connect("192.168.1.100", 80)
|
||||
tcp.write("GET / HTTP/1.0\r\n\r\n")
|
||||
response = tcp.read()
|
||||
tcp.close()
|
||||
```
|
||||
|
||||
#### UDP Communication
|
||||
|
||||
```berry
|
||||
u = udp()
|
||||
u.begin("", 2000) # Listen on port 2000
|
||||
u.send("192.168.1.10", 2000, bytes("Hello"))
|
||||
|
||||
# Receive (polling)
|
||||
packet = u.read() # Returns bytes or nil
|
||||
if packet
|
||||
print("From:", u.remote_ip, u.remote_port)
|
||||
end
|
||||
```
|
||||
|
||||
### Serial Communication
|
||||
|
||||
```berry
|
||||
ser = serial(rx_gpio, tx_gpio, baud, serial.SERIAL_8N1)
|
||||
ser.write(bytes("Hello")) # Send data
|
||||
data = ser.read() # Read available data
|
||||
ser.available() # Check bytes available
|
||||
ser.flush() # Flush buffers
|
||||
ser.close() # Close port
|
||||
```
|
||||
|
||||
### Cryptography
|
||||
|
||||
```berry
|
||||
import crypto
|
||||
|
||||
# AES encryption
|
||||
aes = crypto.AES_GCM(key_32_bytes, iv_12_bytes)
|
||||
encrypted = aes.encrypt(plaintext)
|
||||
tag = aes.tag()
|
||||
|
||||
# Hashing
|
||||
crypto.SHA256().update(data).finish() # SHA256 hash
|
||||
crypto.MD5().update(data).finish() # MD5 hash
|
||||
|
||||
# HMAC
|
||||
crypto.HMAC_SHA256(key).update(data).finish()
|
||||
```
|
||||
|
||||
### File System Operations
|
||||
|
||||
```berry
|
||||
import path
|
||||
|
||||
path.exists("filename") # Check file exists
|
||||
path.listdir("/") # List directory
|
||||
path.remove("filename") # Delete file
|
||||
path.mkdir("dirname") # Create directory
|
||||
path.last_modified("file") # File timestamp
|
||||
```
|
||||
|
||||
### Regular Expressions
|
||||
|
||||
```berry
|
||||
import re
|
||||
|
||||
# Pattern matching
|
||||
matches = re.search("a.*?b(z+)", "aaaabbbzzz") # Returns matches array
|
||||
all_matches = re.searchall('<([a-zA-Z]+)>', html) # All matches
|
||||
parts = re.split('/', "path/to/file") # Split string
|
||||
|
||||
# Compiled patterns (faster for reuse)
|
||||
pattern = re.compilebytes("\\d+")
|
||||
matches = re.search(pattern, "abc123def")
|
||||
```
|
||||
|
||||
### Energy Monitoring
|
||||
|
||||
```berry
|
||||
# Read energy values
|
||||
energy.voltage # Main phase voltage
|
||||
energy.current # Main phase current
|
||||
energy.active_power # Active power (W)
|
||||
energy.total # Total energy (kWh)
|
||||
|
||||
# Multi-phase access
|
||||
energy.voltage_phases[0] # Phase 0 voltage
|
||||
energy.current_phases[1] # Phase 1 current
|
||||
|
||||
# Berry energy driver (with OPTION_A 9 GPIO)
|
||||
if energy.driver_enabled()
|
||||
energy.voltage = 240
|
||||
energy.current = 1.5
|
||||
energy.active_power = 360 # This drives energy calculation
|
||||
end
|
||||
```
|
||||
|
||||
### Display Integration
|
||||
|
||||
```berry
|
||||
import display
|
||||
|
||||
# Initialize display driver
|
||||
display.start(display_ini_string)
|
||||
display.started() # Check if initialized
|
||||
display.dimmer(50) # Set brightness 0-100
|
||||
display.driver_name() # Get driver name
|
||||
|
||||
# Touch screen updates
|
||||
display.touch_update(touches, x, y, gesture)
|
||||
```
|
||||
|
||||
### Advanced Features
|
||||
|
||||
#### ULP (Ultra Low Power) Coprocessor
|
||||
|
||||
```berry
|
||||
import ULP
|
||||
|
||||
ULP.wake_period(0, 500000) # Configure wake timer
|
||||
ULP.load(bytecode) # Load ULP program
|
||||
ULP.run() # Execute ULP program
|
||||
ULP.set_mem(addr, value) # Set RTC memory
|
||||
ULP.get_mem(addr) # Get RTC memory
|
||||
```
|
||||
|
||||
#### mDNS Support
|
||||
|
||||
```berry
|
||||
import mdns
|
||||
|
||||
mdns.start("hostname") # Start mDNS
|
||||
mdns.add_service("_http", "_tcp", 80, {"path": "/"})
|
||||
mdns.stop() # Stop mDNS
|
||||
```
|
||||
|
||||
### Error Handling Patterns
|
||||
|
||||
Many Tasmota functions return `nil` for errors rather than raising exceptions:
|
||||
|
||||
```berry
|
||||
# Check return values
|
||||
data = json.load(json_string)
|
||||
if data == nil
|
||||
print("Invalid JSON")
|
||||
end
|
||||
|
||||
# Wire operations
|
||||
result = wire1.read(addr, reg, 1)
|
||||
if result == nil
|
||||
print("I2C read failed")
|
||||
end
|
||||
```
|
||||
|
||||
### Best Practices for Tasmota
|
||||
|
||||
1. **Memory Management**: Use `tasmota.gc()` to monitor memory usage
|
||||
2. **Non-blocking**: Use timers instead of `delay()` for long waits
|
||||
3. **Error Handling**: Always check return values for `nil`
|
||||
4. **Persistence**: Use `persist` module for settings that survive reboots
|
||||
5. **Performance**: Use fast_loop sparingly, prefer regular driver events
|
||||
6. **Debugging**: Enable `#define USE_BERRY_DEBUG` for development
|
||||
|
||||
## Common Tasmota Berry Patterns
|
||||
|
||||
### Simple Sensor Driver
|
||||
|
||||
```berry
|
||||
class MySensor
|
||||
var wire, addr
|
||||
|
||||
def init()
|
||||
self.addr = 0x48
|
||||
self.wire = tasmota.wire_scan(self.addr, 99) # I2C index 99
|
||||
if self.wire
|
||||
print("MySensor found on bus", self.wire.bus)
|
||||
end
|
||||
end
|
||||
|
||||
def every_second()
|
||||
if !self.wire return end
|
||||
var temp = self.wire.read(self.addr, 0x00, 2) # Read temperature
|
||||
self.temperature = temp / 256.0 # Convert to Celsius
|
||||
end
|
||||
|
||||
def web_sensor()
|
||||
if !self.wire return end
|
||||
import string
|
||||
var msg = string.format("{s}MySensor Temp{m}%.1f °C{e}", self.temperature)
|
||||
tasmota.web_send_decimal(msg)
|
||||
end
|
||||
|
||||
def json_append()
|
||||
if !self.wire return end
|
||||
import string
|
||||
var msg = string.format(',"MySensor":{"Temperature":%.1f}', self.temperature)
|
||||
tasmota.response_append(msg)
|
||||
end
|
||||
end
|
||||
|
||||
sensor = MySensor()
|
||||
tasmota.add_driver(sensor)
|
||||
```
|
||||
|
||||
### Custom Command with JSON Response
|
||||
|
||||
```berry
|
||||
def my_status_cmd(cmd, idx, payload, payload_json)
|
||||
import string
|
||||
var response = {
|
||||
"Uptime": tasmota.millis(),
|
||||
"FreeHeap": tasmota.get_free_heap(),
|
||||
"WiFi": tasmota.wifi("rssi")
|
||||
}
|
||||
tasmota.resp_cmnd(json.dump(response))
|
||||
end
|
||||
|
||||
tasmota.add_cmd("MyStatus", my_status_cmd)
|
||||
```
|
||||
|
||||
### MQTT Automation
|
||||
|
||||
```berry
|
||||
import mqtt
|
||||
|
||||
def handle_sensor_data(topic, idx, payload_s, payload_b)
|
||||
var data = json.load(payload_s)
|
||||
if data && data.find("temperature")
|
||||
var temp = data["temperature"]
|
||||
if temp > 25
|
||||
tasmota.cmd("Power1 ON") # Turn on fan
|
||||
elif temp < 20
|
||||
tasmota.cmd("Power1 OFF") # Turn off fan
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
mqtt.subscribe("sensors/+/temperature", handle_sensor_data)
|
||||
```
|
||||
|
||||
### Web UI Button with Action
|
||||
|
||||
```berry
|
||||
class WebButton
|
||||
def web_add_main_button()
|
||||
import webserver
|
||||
webserver.content_send("<p><button onclick='la(\"&toggle_led=1\");'>Toggle LED</button></p>")
|
||||
end
|
||||
|
||||
def web_sensor()
|
||||
import webserver
|
||||
if webserver.has_arg("toggle_led")
|
||||
# Toggle GPIO2 (built-in LED on many ESP32 boards)
|
||||
var pin = 2
|
||||
var current = gpio.digital_read(pin)
|
||||
gpio.digital_write(pin, !current)
|
||||
print("LED toggled to", !current)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
button = WebButton()
|
||||
tasmota.add_driver(button)
|
||||
```
|
||||
|
||||
### Scheduled Task with Persistence
|
||||
|
||||
```berry
|
||||
import persist
|
||||
|
||||
class ScheduledTask
|
||||
def init()
|
||||
if !persist.has("task_count")
|
||||
persist.task_count = 0
|
||||
end
|
||||
# Run every 5 minutes
|
||||
tasmota.add_cron("0 */5 * * * *", /-> self.run_task(), "my_task")
|
||||
end
|
||||
|
||||
def run_task()
|
||||
persist.task_count += 1
|
||||
print("Task executed", persist.task_count, "times")
|
||||
|
||||
# Do something useful
|
||||
var sensors = tasmota.read_sensors()
|
||||
print("Current sensors:", sensors)
|
||||
|
||||
persist.save() # Save counter to flash
|
||||
end
|
||||
end
|
||||
|
||||
task = ScheduledTask()
|
||||
```
|
||||
|
||||
### HTTP API Client
|
||||
|
||||
```berry
|
||||
class WeatherAPI
|
||||
var api_key, city
|
||||
|
||||
def init(key, city_name)
|
||||
self.api_key = key
|
||||
self.city = city_name
|
||||
tasmota.add_cron("0 0 * * * *", /-> self.fetch_weather(), "weather")
|
||||
end
|
||||
|
||||
def fetch_weather()
|
||||
var cl = webclient()
|
||||
var url = f"http://api.openweathermap.org/data/2.5/weather?q={self.city}&appid={self.api_key}"
|
||||
|
||||
cl.begin(url)
|
||||
var result = cl.GET()
|
||||
|
||||
if result == 200
|
||||
var response = cl.get_string()
|
||||
var data = json.load(response)
|
||||
if data
|
||||
var temp = data["main"]["temp"] - 273.15 # Kelvin to Celsius
|
||||
print(f"Weather in {self.city}: {temp:.1f}°C")
|
||||
|
||||
# Store in global for other scripts to use
|
||||
import global
|
||||
global.weather_temp = temp
|
||||
end
|
||||
end
|
||||
cl.close()
|
||||
end
|
||||
end
|
||||
|
||||
# weather = WeatherAPI("your_api_key", "London")
|
||||
```
|
||||
|
||||
### Rule-based Automation
|
||||
|
||||
```berry
|
||||
# Advanced rule that combines multiple conditions
|
||||
tasmota.add_rule(["ANALOG#A0>500", "Switch1#State=1"],
|
||||
def(values, triggers)
|
||||
print("Both conditions met:")
|
||||
print("ADC value:", values[0])
|
||||
print("Switch state:", values[1])
|
||||
tasmota.cmd("Power2 ON") # Activate something
|
||||
end
|
||||
)
|
||||
|
||||
# Time-based rule
|
||||
tasmota.add_rule("Time#Minute=30",
|
||||
def()
|
||||
if tasmota.rtc()["hour"] == 18 # 6:30 PM
|
||||
tasmota.cmd("Dimmer 20") # Dim lights for evening
|
||||
end
|
||||
end
|
||||
)
|
||||
```
|
||||
|
||||
## Best Practices and Tips
|
||||
|
||||
1. **Always check for nil returns** from Tasmota functions
|
||||
2. **Use timers instead of delay()** to avoid blocking Tasmota
|
||||
3. **Implement proper error handling** in I²C and network operations
|
||||
4. **Use persist module** for settings that should survive reboots
|
||||
5. **Test memory usage** with `tasmota.gc()` during development
|
||||
6. **Use fast_loop sparingly** - it runs 200 times per second
|
||||
7. **Prefer driver events** over polling when possible
|
||||
8. **Use f-strings** for readable string formatting
|
||||
9. **Import modules only when needed** to save memory
|
||||
10. **Use `tasmota.wire_scan()`** instead of manual I²C bus detection
|
175
.doc_for_ai/DOC_DEEP_ANALYSIS.md
Normal file
175
.doc_for_ai/DOC_DEEP_ANALYSIS.md
Normal file
@ -0,0 +1,175 @@
|
||||
# Deep Analysis of Tasmota Documentation Repository
|
||||
|
||||
This file is a summary of the Tasmota Documentation for the "docs" repository. It is provided here for convenience for GenAI to read it easily.
|
||||
|
||||
## Overview
|
||||
|
||||
Tasmota is a comprehensive open-source firmware for ESP8266/ESP8285 and ESP32-based IoT devices that provides local control, MQTT integration, and extensive customization capabilities. The documentation repository contains over 250 markdown files covering every aspect of the firmware, from basic installation to advanced development topics.
|
||||
|
||||
## Repository Structure
|
||||
|
||||
The documentation is organized into several key categories:
|
||||
|
||||
### Core Documentation
|
||||
- **Getting Started**: Complete setup guide from hardware preparation to initial configuration
|
||||
- **Commands**: Comprehensive reference of 200+ commands for device control
|
||||
- **MQTT**: Central communication protocol documentation
|
||||
- **Rules**: Flexible automation system documentation
|
||||
- **Templates**: Device configuration system
|
||||
- **Components**: GPIO mapping and peripheral management
|
||||
|
||||
### Hardware Support
|
||||
- **ESP Platforms**: ESP8266, ESP8285, ESP32 (all variants including S2, S3, C3)
|
||||
- **Supported Devices**: 125+ device-specific configuration files
|
||||
- **Peripherals**: 85+ sensor and peripheral drivers documented
|
||||
- **Pinouts**: Detailed GPIO mappings for common modules
|
||||
|
||||
### Advanced Features
|
||||
- **Berry Scripting**: Modern scripting language for ESP32 (163KB documentation)
|
||||
- **Scripting Language**: Legacy scripting for ESP8266 (93KB documentation)
|
||||
- **Matter Protocol**: Thread/Matter support for modern IoT ecosystems
|
||||
- **Zigbee**: Zigbee2Tasmota gateway functionality (100KB documentation)
|
||||
- **Bluetooth**: BLE sensor integration and device control
|
||||
|
||||
### Integration Ecosystem
|
||||
- **Home Assistant**: Native integration with autodiscovery
|
||||
- **OpenHAB**: Configuration examples and best practices
|
||||
- **Domoticz**: Integration guide
|
||||
- **KNX**: Building automation protocol support
|
||||
- **AWS IoT**: Cloud integration with certificates
|
||||
- **Azure IoT**: Microsoft cloud platform integration
|
||||
|
||||
## Key Technical Insights
|
||||
|
||||
### Architecture Philosophy
|
||||
Tasmota follows a modular architecture where:
|
||||
- Core firmware provides basic functionality (WiFi, MQTT, web interface)
|
||||
- Features are conditionally compiled based on `#define` directives
|
||||
- GPIO mapping is completely flexible through templates
|
||||
- All functionality is controllable via commands (MQTT, HTTP, serial, web console)
|
||||
|
||||
### Memory Management
|
||||
- ESP8266: 80KB RAM total, ~25-30KB available for applications
|
||||
- ESP32: Much more generous memory, supports advanced features
|
||||
- Code size optimization is critical for ESP8266 OTA updates
|
||||
- Flash memory partitioned for dual-boot OTA capability
|
||||
|
||||
### Communication Protocols
|
||||
1. **MQTT** (Primary): All device control and telemetry
|
||||
2. **HTTP**: Web interface and REST API
|
||||
3. **Serial**: Direct console access
|
||||
4. **WebSocket**: Real-time web interface updates
|
||||
|
||||
### Extensibility Mechanisms
|
||||
1. **Rules**: Event-driven automation (up to 1536 characters)
|
||||
2. **Berry Scripts**: Full programming language (ESP32 only)
|
||||
3. **Scripting**: Legacy scripting system (ESP8266)
|
||||
4. **Templates**: Device configuration sharing
|
||||
5. **Custom Drivers**: C++ sensor/peripheral drivers
|
||||
|
||||
## Development Ecosystem
|
||||
|
||||
### Build System
|
||||
- PlatformIO-based compilation
|
||||
- Multiple build environments for different ESP variants
|
||||
- Conditional compilation for feature selection
|
||||
- OTA update system with safety mechanisms
|
||||
|
||||
### Driver Development
|
||||
- Standardized sensor API with callback system
|
||||
- I2C/SPI/UART peripheral support
|
||||
- Memory-conscious development practices
|
||||
- Extensive debugging and profiling tools
|
||||
|
||||
### Scripting Capabilities
|
||||
- **Berry**: Modern language with object-oriented features, garbage collection
|
||||
- **Rules**: Simple trigger-action automation
|
||||
- **Legacy Scripting**: Procedural language for complex automation
|
||||
|
||||
### Integration APIs
|
||||
- **JSON Status Responses**: Standardized telemetry format
|
||||
- **Command Interface**: Unified control mechanism
|
||||
- **Sensor API**: Standardized peripheral integration
|
||||
- **Web Interface Extensions**: Custom UI components
|
||||
|
||||
## Notable Features
|
||||
|
||||
### Advanced Networking
|
||||
- IPv6 support
|
||||
- Wireguard VPN client
|
||||
- Range extender functionality (NAPT)
|
||||
- Multiple WiFi network support
|
||||
- Ethernet support (ESP32)
|
||||
|
||||
### Security Features
|
||||
- TLS/SSL support (ESP32)
|
||||
- Certificate-based authentication
|
||||
- Secure boot options
|
||||
- Network isolation capabilities
|
||||
|
||||
### Display and UI
|
||||
- Universal Display Driver supporting 50+ display types
|
||||
- LVGL graphics library integration
|
||||
- HASPmota: Advanced touch interface system
|
||||
- Web interface customization
|
||||
|
||||
### Industrial Features
|
||||
- Modbus bridge functionality
|
||||
- KNX building automation
|
||||
- Smart meter interfaces (P1, Teleinfo)
|
||||
- Industrial sensor support (4-20mA, etc.)
|
||||
|
||||
## Documentation Quality Assessment
|
||||
|
||||
### Strengths
|
||||
- **Comprehensive Coverage**: Every feature documented with examples
|
||||
- **Practical Focus**: Heavy emphasis on real-world usage scenarios
|
||||
- **Community-Driven**: Active contribution from users and developers
|
||||
- **Multi-Level**: From beginner tutorials to advanced development guides
|
||||
- **Well-Structured**: Logical organization with cross-references
|
||||
|
||||
### Areas for Improvement
|
||||
- **Fragmentation**: Some information scattered across multiple files
|
||||
- **Version Consistency**: Some docs may lag behind rapid development
|
||||
- **Advanced Topics**: Some complex features could use more examples
|
||||
|
||||
## Community and Ecosystem
|
||||
|
||||
### Support Channels
|
||||
- Discord server for real-time help
|
||||
- GitHub discussions for feature requests
|
||||
- Telegram and Matrix communities
|
||||
- Reddit community
|
||||
|
||||
### Device Database
|
||||
- Templates repository with 1000+ device configurations
|
||||
- Community-contributed device support
|
||||
- Standardized template sharing format
|
||||
|
||||
### Integration Ecosystem
|
||||
- Native Home Assistant integration
|
||||
- Multiple home automation platform support
|
||||
- Cloud service integrations (AWS, Azure)
|
||||
- Third-party tool ecosystem
|
||||
|
||||
## Development Trends
|
||||
|
||||
### Modern Features
|
||||
- Matter protocol support for interoperability
|
||||
- Berry scripting for advanced automation
|
||||
- LVGL for rich user interfaces
|
||||
- Machine learning integration (TensorFlow Lite)
|
||||
|
||||
### Hardware Evolution
|
||||
- ESP32 as primary platform for new features
|
||||
- ESP8266 maintained for compatibility
|
||||
- Support for latest ESP32 variants (S2, S3, C3)
|
||||
- Increasing focus on low-power applications
|
||||
|
||||
## Conclusion
|
||||
|
||||
The Tasmota documentation represents one of the most comprehensive firmware documentation projects in the IoT space. It successfully bridges the gap between simple device control and advanced IoT development, providing pathways for users to grow from basic usage to sophisticated automation and custom development.
|
||||
|
||||
The documentation's strength lies in its practical approach, extensive hardware support coverage, and community-driven nature. It serves as both a user manual and a development reference, making Tasmota accessible to a wide range of users while providing the depth needed for serious IoT development.
|
||||
|
||||
The modular architecture, extensive command system, and multiple scripting options make Tasmota a powerful platform for IoT development, with documentation that adequately supports this complexity while remaining approachable for newcomers.
|
977
.doc_for_ai/FOR_DEVELOPERS.md
Normal file
977
.doc_for_ai/FOR_DEVELOPERS.md
Normal file
@ -0,0 +1,977 @@
|
||||
# Tasmota Developer Guide
|
||||
|
||||
This file is a summary of the Tasmota Documentation for the "docs" repository. It is provided here for convenience for GenAI to read it easily.
|
||||
|
||||
## How Tasmota Works
|
||||
|
||||
### Core Architecture
|
||||
|
||||
Tasmota is a modular firmware that transforms ESP8266/ESP8285 and ESP32 microcontrollers into intelligent IoT devices. The architecture follows these key principles:
|
||||
|
||||
#### 1. Event-Driven System
|
||||
- Main loop processes events and callbacks
|
||||
- Non-blocking operations to maintain responsiveness
|
||||
- Callback system for sensors, drivers, and features
|
||||
- Timer-based scheduling for periodic tasks
|
||||
|
||||
#### 2. Modular Design
|
||||
- Core functionality always present (WiFi, MQTT, web interface)
|
||||
- Optional features compiled conditionally using `#define` directives
|
||||
- Plugin architecture for sensors and peripherals
|
||||
- Template system for device configuration
|
||||
|
||||
#### 3. Communication Hub
|
||||
- **MQTT**: Primary communication protocol for automation systems
|
||||
- **HTTP**: Web interface and REST API
|
||||
- **Serial**: Direct console access for debugging and configuration
|
||||
- **WebSocket**: Real-time web interface updates
|
||||
|
||||
### Firmware Structure
|
||||
|
||||
```
|
||||
tasmota/
|
||||
├── tasmota.ino # Main firmware file
|
||||
├── tasmota_xdrv_driver/ # Driver files directory (187 files)
|
||||
│ ├── xdrv_01_9_webserver.ino # Web server driver
|
||||
│ ├── xdrv_02_9_mqtt.ino # MQTT driver
|
||||
│ ├── xdrv_04_light.ino # Light driver
|
||||
│ └── xdrv_##_name.ino # Other drivers
|
||||
├── tasmota_xsns_sensor/ # Sensor files directory (143 files)
|
||||
│ ├── xsns_01_counter.ino # Counter sensor
|
||||
│ ├── xsns_02_analog.ino # Analog sensor
|
||||
│ └── xsns_##_name.ino # Other sensors
|
||||
├── tasmota_xlgt_light/ # Light driver files directory
|
||||
├── tasmota_xnrg_energy/ # Energy monitoring files directory
|
||||
├── tasmota_support/ # Support functions directory (29 files)
|
||||
│ ├── support.ino # Core support functions
|
||||
│ ├── settings.ino # Settings management
|
||||
│ └── support_*.ino # Other support modules
|
||||
├── include/ # Header files directory (18 files)
|
||||
│ ├── tasmota.h # Main header
|
||||
│ ├── tasmota_types.h # Type definitions
|
||||
│ ├── tasmota_globals.h # Global variables
|
||||
│ └── *.h # Other headers
|
||||
└── my_user_config.h # User configuration overrides
|
||||
```
|
||||
|
||||
### Command System
|
||||
|
||||
All Tasmota functionality is accessible through a unified command system:
|
||||
|
||||
- Commands can be sent via MQTT, HTTP, serial, or web console
|
||||
- Format: `Command [parameter]`
|
||||
- Response format: JSON for structured data
|
||||
- Backlog support for multiple commands: `Backlog cmd1; cmd2; cmd3`
|
||||
|
||||
### GPIO Management
|
||||
|
||||
Tasmota uses a flexible GPIO assignment system:
|
||||
|
||||
1. **Templates**: Pre-defined GPIO configurations for specific devices
|
||||
2. **Components**: Logical functions assigned to physical pins
|
||||
3. **Modules**: Base hardware configurations
|
||||
4. **Runtime Configuration**: GPIO can be reassigned without recompilation
|
||||
|
||||
## Development Environment Setup
|
||||
|
||||
### Prerequisites
|
||||
|
||||
1. **PlatformIO**: Primary build system
|
||||
2. **Git**: Version control
|
||||
3. **Python**: For build scripts and tools
|
||||
4. **Serial Programmer**: For initial flashing
|
||||
|
||||
### Build Configuration
|
||||
|
||||
Create `platformio_tasmota_cenv.ini` for custom environments:
|
||||
|
||||
```ini
|
||||
[env:tasmota32-custom]
|
||||
extends = env:tasmota32
|
||||
build_flags = ${env:tasmota32.build_flags}
|
||||
-DUSE_MY_CUSTOM_FEATURE
|
||||
```
|
||||
|
||||
### User Configuration
|
||||
|
||||
Create `tasmota/user_config_override.h`:
|
||||
|
||||
```c
|
||||
#ifndef _USER_CONFIG_OVERRIDE_H_
|
||||
#define _USER_CONFIG_OVERRIDE_H_
|
||||
|
||||
// Enable custom features
|
||||
#define USE_CUSTOM_SENSOR
|
||||
#define USE_BERRY_DEBUG
|
||||
|
||||
// Disable unused features to save space
|
||||
#undef USE_DOMOTICZ
|
||||
#undef USE_KNX
|
||||
|
||||
#endif
|
||||
```
|
||||
|
||||
## Driver Development
|
||||
|
||||
### Sensor Driver Structure
|
||||
|
||||
All sensor drivers follow a standardized pattern:
|
||||
|
||||
```c
|
||||
#ifdef USE_MY_SENSOR
|
||||
#define XSNS_XX XX // Unique sensor ID
|
||||
|
||||
bool MySensorDetected = false;
|
||||
|
||||
void MySensorInit(void) {
|
||||
// Initialize sensor
|
||||
if (sensor_detected) {
|
||||
MySensorDetected = true;
|
||||
}
|
||||
}
|
||||
|
||||
void MySensorEverySecond(void) {
|
||||
// Read sensor data
|
||||
}
|
||||
|
||||
void MySensorShow(bool json) {
|
||||
if (json) {
|
||||
ResponseAppend_P(PSTR(",\"MySensor\":{\"Temperature\":%d}"), temperature);
|
||||
}
|
||||
#ifdef USE_WEBSERVER
|
||||
else {
|
||||
WSContentSend_PD(HTTP_SNS_TEMP, "MySensor", temperature);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Xsns_XX(byte function) {
|
||||
bool result = false;
|
||||
|
||||
if (i2c_flg) { // Only for I2C sensors
|
||||
switch (function) {
|
||||
case FUNC_INIT:
|
||||
MySensorInit();
|
||||
break;
|
||||
case FUNC_EVERY_SECOND:
|
||||
MySensorEverySecond();
|
||||
break;
|
||||
case FUNC_JSON_APPEND:
|
||||
MySensorShow(1);
|
||||
break;
|
||||
#ifdef USE_WEBSERVER
|
||||
case FUNC_WEB_SENSOR:
|
||||
MySensorShow(0);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#endif // USE_MY_SENSOR
|
||||
```
|
||||
|
||||
### Complete Driver Callback Functions Reference
|
||||
|
||||
**VERIFIED FROM SOURCE CODE**: `tasmota/include/tasmota.h` lines 433-454
|
||||
|
||||
#### Core System Callbacks (Functions WITHOUT return results)
|
||||
|
||||
| Function | Purpose | When Called | Parameters |
|
||||
|----------|---------|-------------|-----------|
|
||||
| `FUNC_SETTINGS_OVERRIDE` | Override default settings | Before settings load | None |
|
||||
| `FUNC_SETUP_RING1` | Early setup phase 1 | System initialization | None |
|
||||
| `FUNC_SETUP_RING2` | Early setup phase 2 | System initialization | None |
|
||||
| `FUNC_PRE_INIT` | Pre-initialization | Before main init | None |
|
||||
| `FUNC_INIT` | Initialize driver/sensor | Once at startup | None |
|
||||
| `FUNC_ACTIVE` | Check if driver is active | Status queries | None |
|
||||
| `FUNC_ABOUT_TO_RESTART` | Prepare for restart | Before system restart | None |
|
||||
|
||||
#### Loop and Timing Callbacks
|
||||
|
||||
| Function | Purpose | Frequency | Parameters |
|
||||
|----------|---------|-----------|-----------|
|
||||
| `FUNC_LOOP` | Main loop processing | Every loop cycle (~1ms) | None |
|
||||
| `FUNC_SLEEP_LOOP` | Sleep mode processing | During sleep cycles | None |
|
||||
| `FUNC_EVERY_50_MSECOND` | Fast polling operations | Every 50ms | None |
|
||||
| `FUNC_EVERY_100_MSECOND` | Medium polling | Every 100ms | None |
|
||||
| `FUNC_EVERY_200_MSECOND` | Slower polling | Every 200ms | None |
|
||||
| `FUNC_EVERY_250_MSECOND` | Quarter second tasks | Every 250ms | None |
|
||||
| `FUNC_EVERY_SECOND` | Regular updates | Every second | None |
|
||||
|
||||
#### Settings and Configuration Callbacks
|
||||
|
||||
| Function | Purpose | When Called | Parameters |
|
||||
|----------|---------|-------------|-----------|
|
||||
| `FUNC_RESET_SETTINGS` | Reset to defaults | Settings reset | None |
|
||||
| `FUNC_RESTORE_SETTINGS` | Restore from backup | Settings restore | None |
|
||||
| `FUNC_SAVE_SETTINGS` | Save current settings | Settings save | None |
|
||||
| `FUNC_SAVE_AT_MIDNIGHT` | Midnight save operations | Daily at 00:00 | None |
|
||||
| `FUNC_SAVE_BEFORE_RESTART` | Save critical data | Before restart | None |
|
||||
|
||||
#### Interrupt and System Control
|
||||
|
||||
| Function | Purpose | When Called | Parameters |
|
||||
|----------|---------|-------------|-----------|
|
||||
| `FUNC_INTERRUPT_STOP` | Stop interrupts | Before critical section | None |
|
||||
| `FUNC_INTERRUPT_START` | Resume interrupts | After critical section | None |
|
||||
| `FUNC_FREE_MEM` | Memory cleanup | Low memory conditions | None |
|
||||
|
||||
#### Telemetry and JSON Callbacks
|
||||
|
||||
| Function | Purpose | When Called | Parameters |
|
||||
|----------|---------|-------------|-----------|
|
||||
| `FUNC_AFTER_TELEPERIOD` | Post-telemetry cleanup | After TelePeriod | None |
|
||||
| `FUNC_JSON_APPEND` | Add JSON telemetry | Every TelePeriod | None |
|
||||
| `FUNC_TELEPERIOD_RULES_PROCESS` | Rules after telemetry | Post-TelePeriod | None |
|
||||
|
||||
#### Web Interface Callbacks
|
||||
|
||||
| Function | Purpose | When Called | Parameters |
|
||||
|----------|---------|-------------|-----------|
|
||||
| `FUNC_WEB_SENSOR` | Show sensor on web | Sensor page load | None |
|
||||
| `FUNC_WEB_COL_SENSOR` | Column sensor display | Web page layout | None |
|
||||
| `FUNC_WEB_ADD_BUTTON` | Add web buttons | Main page load | None |
|
||||
| `FUNC_WEB_ADD_CONSOLE_BUTTON` | Add console button | Console page | None |
|
||||
| `FUNC_WEB_ADD_MANAGEMENT_BUTTON` | Add config button | Config page | None |
|
||||
| `FUNC_WEB_ADD_MAIN_BUTTON` | Add main menu button | Main page | None |
|
||||
| `FUNC_WEB_GET_ARG` | Process web arguments | Form submission | None |
|
||||
| `FUNC_WEB_ADD_HANDLER` | Add URL handlers | Web server init | None |
|
||||
| `FUNC_WEB_STATUS_LEFT` | Left status column | Status page | None |
|
||||
| `FUNC_WEB_STATUS_RIGHT` | Right status column | Status page | None |
|
||||
|
||||
#### MQTT and Communication Callbacks
|
||||
|
||||
| Function | Purpose | When Called | Parameters |
|
||||
|----------|---------|-------------|-----------|
|
||||
| `FUNC_MQTT_SUBSCRIBE` | Subscribe to MQTT topics | MQTT connect | None |
|
||||
| `FUNC_MQTT_INIT` | Initialize MQTT | MQTT setup | None |
|
||||
|
||||
#### Power and Hardware Control
|
||||
|
||||
| Function | Purpose | When Called | Parameters |
|
||||
|----------|---------|-------------|-----------|
|
||||
| `FUNC_SET_POWER` | Handle power changes | Power state change | None |
|
||||
| `FUNC_SHOW_SENSOR` | Display sensor data | Status request | None |
|
||||
| `FUNC_ANY_KEY` | Handle any key press | Key event | None |
|
||||
| `FUNC_LED_LINK` | Control link LED | Network state change | None |
|
||||
| `FUNC_ENERGY_EVERY_SECOND` | Energy monitoring | Every second | None |
|
||||
| `FUNC_ENERGY_RESET` | Reset energy counters | Reset command | None |
|
||||
|
||||
#### Advanced System Callbacks
|
||||
|
||||
| Function | Purpose | When Called | Parameters |
|
||||
|----------|---------|-------------|-----------|
|
||||
| `FUNC_SET_SCHEME` | Set color scheme | Theme change | None |
|
||||
| `FUNC_HOTPLUG_SCAN` | Scan for hotplug devices | Device detection | None |
|
||||
| `FUNC_TIME_SYNCED` | Time synchronization | NTP sync complete | None |
|
||||
| `FUNC_DEVICE_GROUP_ITEM` | Device group processing | Group operations | None |
|
||||
| `FUNC_NETWORK_UP` | Network connected | WiFi/Ethernet up | None |
|
||||
| `FUNC_NETWORK_DOWN` | Network disconnected | WiFi/Ethernet down | None |
|
||||
|
||||
#### Callback Functions WITH Return Results (ID >= 200)
|
||||
|
||||
These functions are expected to return boolean results:
|
||||
|
||||
| Function | Purpose | When Called | Return Value |
|
||||
|----------|---------|-------------|--------------|
|
||||
| `FUNC_PIN_STATE` | GPIO state query | Pin state check | true if handled |
|
||||
| `FUNC_MODULE_INIT` | Module initialization | Module setup | true if success |
|
||||
| `FUNC_ADD_BUTTON` | Add button handler | Button config | true if added |
|
||||
| `FUNC_ADD_SWITCH` | Add switch handler | Switch config | true if added |
|
||||
| `FUNC_BUTTON_PRESSED` | Handle button press | Button event | true if handled |
|
||||
| `FUNC_BUTTON_MULTI_PRESSED` | Multi-button press | Button combo | true if handled |
|
||||
| `FUNC_SET_DEVICE_POWER` | Device power control | Power command | true if handled |
|
||||
| `FUNC_MQTT_DATA` | Process MQTT data | MQTT message | true if handled |
|
||||
| `FUNC_SERIAL` | Serial data processing | Serial input | true if handled |
|
||||
| `FUNC_COMMAND` | Process commands | Command received | true if handled |
|
||||
| `FUNC_COMMAND_SENSOR` | Sensor commands | Sensor command | true if handled |
|
||||
| `FUNC_COMMAND_DRIVER` | Driver commands | Driver command | true if handled |
|
||||
| `FUNC_RULES_PROCESS` | Process rules | Rule evaluation | true if handled |
|
||||
| `FUNC_SET_CHANNELS` | Set PWM channels | Channel update | true if handled |
|
||||
|
||||
#### Callback Implementation Pattern
|
||||
|
||||
```c
|
||||
bool Xdrv_XX(uint8_t function) {
|
||||
bool result = false;
|
||||
|
||||
switch (function) {
|
||||
case FUNC_INIT:
|
||||
MyDriverInit();
|
||||
break;
|
||||
case FUNC_EVERY_SECOND:
|
||||
MyDriverEverySecond();
|
||||
break;
|
||||
case FUNC_COMMAND:
|
||||
result = MyDriverCommand();
|
||||
break;
|
||||
case FUNC_JSON_APPEND:
|
||||
MyDriverJsonAppend();
|
||||
break;
|
||||
case FUNC_WEB_SENSOR:
|
||||
MyDriverWebSensor();
|
||||
break;
|
||||
case FUNC_SAVE_BEFORE_RESTART:
|
||||
MyDriverSaveSettings();
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
### I2C Development
|
||||
|
||||
```c
|
||||
// I2C Helper Functions
|
||||
bool I2cValidRead8(uint8_t *data, uint8_t addr, uint8_t reg);
|
||||
bool I2cValidRead16(uint16_t *data, uint8_t addr, uint8_t reg);
|
||||
uint8_t I2cRead8(uint8_t addr, uint8_t reg);
|
||||
uint16_t I2cRead16(uint8_t addr, uint8_t reg);
|
||||
bool I2cWrite8(uint8_t addr, uint8_t reg, uint8_t val);
|
||||
|
||||
// Device Detection Pattern
|
||||
void MySensorDetect(void) {
|
||||
if (MySensorDetected) return;
|
||||
|
||||
for (uint8_t i = 0; i < SENSOR_MAX_ADDR; i++) {
|
||||
uint8_t addr = SENSOR_BASE_ADDR + i;
|
||||
if (I2cValidRead8(&sensor_id, addr, SENSOR_ID_REG)) {
|
||||
if (sensor_id == EXPECTED_ID) {
|
||||
MySensorDetected = true;
|
||||
AddLog(LOG_LEVEL_INFO, PSTR("MySensor found at 0x%02X"), addr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Scripting and Automation
|
||||
|
||||
### Rules System
|
||||
|
||||
Rules provide event-driven automation:
|
||||
|
||||
```
|
||||
Rule1 ON Switch1#State DO Power1 %value% ENDON
|
||||
ON Time#Minute=30 DO Publish stat/topic/alert {"time":"30min"} ENDON
|
||||
```
|
||||
|
||||
### Berry Scripting (ESP32)
|
||||
|
||||
Berry is a modern scripting language for advanced automation:
|
||||
|
||||
```berry
|
||||
# Simple sensor reading
|
||||
import json
|
||||
|
||||
def read_sensor()
|
||||
var temp = tasmota.read_sensors()
|
||||
if temp.contains("Temperature")
|
||||
print("Current temperature:", temp["Temperature"])
|
||||
end
|
||||
end
|
||||
|
||||
# Set up timer
|
||||
tasmota.set_timer(5000, read_sensor)
|
||||
|
||||
# Web interface extension
|
||||
def web_add_button()
|
||||
webserver.content_send("<button onclick='la(\"&m_toggle=1\");'>Toggle</button>")
|
||||
end
|
||||
|
||||
tasmota.add_driver(web_add_button)
|
||||
```
|
||||
|
||||
### Command Extensions
|
||||
|
||||
Add custom commands through Berry or C++:
|
||||
|
||||
```berry
|
||||
def my_command(cmd, idx, payload)
|
||||
if cmd == "MYCMD"
|
||||
print("Custom command received:", payload)
|
||||
tasmota.resp_cmnd_done()
|
||||
end
|
||||
end
|
||||
|
||||
tasmota.add_cmd('MYCMD', my_command)
|
||||
```
|
||||
|
||||
## Complete Settings Structure Reference
|
||||
|
||||
### Settings Memory Layout
|
||||
|
||||
Tasmota uses a structured settings system stored in flash memory. The main settings structure is defined in `settings.h`:
|
||||
|
||||
```c
|
||||
typedef struct {
|
||||
unsigned long cfg_holder; // 000 v6.0.0a
|
||||
unsigned long save_flag; // 004
|
||||
unsigned long version; // 008
|
||||
unsigned short flag; // 00C
|
||||
unsigned short save_data; // 00E
|
||||
int8_t timezone; // 010
|
||||
char ota_url[101]; // 011
|
||||
char mqtt_prefix[3][11]; // 076
|
||||
char serial_delimiter; // 09D
|
||||
uint8_t seriallog_level; // 09E
|
||||
uint8_t sta_config; // 09F
|
||||
char sta_ssid[2][33]; // 0A0
|
||||
char sta_pwd[2][65]; // 102
|
||||
char hostname[33]; // 183
|
||||
char syslog_host[33]; // 1A4
|
||||
uint16_t syslog_port; // 1C5
|
||||
uint8_t syslog_level; // 1C7
|
||||
uint8_t webserver; // 1C8
|
||||
uint8_t weblog_level; // 1C9
|
||||
char mqtt_fingerprint[2][60]; // 1CA
|
||||
char mqtt_host[33]; // 236
|
||||
uint16_t mqtt_port; // 257
|
||||
char mqtt_client[33]; // 259
|
||||
char mqtt_user[33]; // 27A
|
||||
char mqtt_pwd[33]; // 29B
|
||||
char mqtt_topic[33]; // 2BC
|
||||
char button_topic[33]; // 2DD
|
||||
char mqtt_grptopic[33]; // 2FE
|
||||
uint8_t display_model; // 31F
|
||||
uint8_t display_mode; // 320
|
||||
uint8_t display_refresh; // 321
|
||||
uint8_t display_rows; // 322
|
||||
uint8_t display_cols[2]; // 323
|
||||
uint8_t display_address[8]; // 325
|
||||
uint8_t display_dimmer; // 32D
|
||||
uint8_t display_size; // 32E
|
||||
uint16_t pwm_frequency; // 32F
|
||||
power_t power; // 331
|
||||
uint16_t pwm_value[MAX_PWMS]; // 335
|
||||
int16_t altitude; // 345
|
||||
uint16_t tele_period; // 347
|
||||
uint8_t ledstate; // 349
|
||||
uint8_t param[PARAM_MAX]; // 34A
|
||||
int16_t toffset[2]; // 35A
|
||||
uint8_t display_font; // 35E
|
||||
} Settings;
|
||||
|
||||
### ESP8266 Constraints
|
||||
|
||||
- **Flash**: 1MB total, ~500KB available for firmware
|
||||
- **RAM**: 80KB total, ~25-30KB available for application
|
||||
- **Stack**: 4KB maximum
|
||||
|
||||
### Optimization Techniques
|
||||
|
||||
1. **Use PROGMEM for constants**:
|
||||
```c
|
||||
const char MyString[] PROGMEM = "Constant string";
|
||||
```
|
||||
|
||||
2. **Minimize dynamic allocation**:
|
||||
```c
|
||||
// Avoid
|
||||
String result = String(value1) + "," + String(value2);
|
||||
|
||||
// Prefer
|
||||
char result[32];
|
||||
snprintf(result, sizeof(result), "%d,%d", value1, value2);
|
||||
```
|
||||
|
||||
3. **Use flash-efficient data types**:
|
||||
```c
|
||||
// Use uint32_t instead of uint8_t for local variables
|
||||
// Use uint8_t only in structs to save memory
|
||||
```
|
||||
|
||||
## Communication Protocols
|
||||
|
||||
### Command Context Structure
|
||||
|
||||
All command handlers receive context through the global XdrvMailbox structure:
|
||||
|
||||
```c
|
||||
struct XDRVMAILBOX {
|
||||
bool grpflg; // Group flag
|
||||
bool usridx; // User index flag
|
||||
uint16_t command_code; // Command code
|
||||
uint32_t index; // Command index
|
||||
uint32_t data_len; // Parameter length
|
||||
int32_t payload; // Numeric parameter
|
||||
char *topic; // MQTT topic
|
||||
char *data; // Command parameters
|
||||
char *command; // Command name
|
||||
} XdrvMailbox;
|
||||
```
|
||||
|
||||
**Key Fields:**
|
||||
- `command`: The command name (e.g., "Power", "Status")
|
||||
- `data`: Raw parameter string
|
||||
- `payload`: Numeric value of first parameter
|
||||
- `data_len`: Length of parameter string
|
||||
- `index`: Command index for numbered commands (Power1, Power2, etc.)
|
||||
|
||||
### MQTT Integration
|
||||
|
||||
```c
|
||||
// Publish sensor data
|
||||
void PublishSensorData(void) {
|
||||
Response_P(PSTR("{\"MySensor\":{\"Value\":%d}}"), sensor_value);
|
||||
MqttPublishTeleSensor();
|
||||
}
|
||||
|
||||
// Subscribe to commands
|
||||
bool MyCommand(void) {
|
||||
if (XdrvMailbox.data_len > 0) {
|
||||
// Process command
|
||||
ResponseCmndDone();
|
||||
return true;
|
||||
}
|
||||
ResponseCmndNumber(current_value);
|
||||
return true;
|
||||
}
|
||||
```
|
||||
|
||||
### Web Interface Extensions
|
||||
|
||||
```c
|
||||
#ifdef USE_WEBSERVER
|
||||
void MySensorWebShow(void) {
|
||||
WSContentSend_PD(PSTR(
|
||||
"{s}MySensor Temperature{m}%d°C{e}"
|
||||
"{s}MySensor Humidity{m}%d%%{e}"),
|
||||
temperature, humidity);
|
||||
}
|
||||
#endif
|
||||
```
|
||||
|
||||
## Advanced Features
|
||||
|
||||
### Template System
|
||||
|
||||
Templates define device GPIO configurations:
|
||||
|
||||
```json
|
||||
{
|
||||
"NAME":"Custom Device",
|
||||
"GPIO":[416,0,418,0,417,2720,0,0,2624,32,2656,224,0,0],
|
||||
"FLAG":0,
|
||||
"BASE":45
|
||||
}
|
||||
```
|
||||
|
||||
### Matter Protocol Support
|
||||
|
||||
For ESP32 devices, Matter provides standardized IoT communication:
|
||||
|
||||
```c
|
||||
// Matter endpoint configuration
|
||||
matter.add_endpoint(1, 0x0100); // On/Off Light
|
||||
matter.add_endpoint(2, 0x0106); // Light with dimming
|
||||
```
|
||||
|
||||
### Display Integration
|
||||
|
||||
Universal Display Driver supports 50+ display types:
|
||||
|
||||
```
|
||||
DisplayModel 1 # Select display type
|
||||
DisplayMode 1 # Text mode
|
||||
DisplayText [s1l1]Hello World
|
||||
```
|
||||
|
||||
## Testing and Debugging
|
||||
|
||||
### Debug Options
|
||||
|
||||
Enable debugging in `user_config_override.h`:
|
||||
|
||||
```c
|
||||
#define DEBUG_TASMOTA_CORE
|
||||
#define DEBUG_TASMOTA_DRIVER
|
||||
#define USE_DEBUG_DRIVER
|
||||
```
|
||||
|
||||
### Serial Debugging
|
||||
|
||||
```c
|
||||
AddLog(LOG_LEVEL_INFO, PSTR("Debug: value=%d"), value);
|
||||
AddLog(LOG_LEVEL_DEBUG, PSTR("Detailed info: %s"), info_string);
|
||||
```
|
||||
|
||||
### Memory Monitoring
|
||||
|
||||
```c
|
||||
// Check free heap
|
||||
uint32_t free_heap = ESP.getFreeHeap();
|
||||
AddLog(LOG_LEVEL_DEBUG, PSTR("Free heap: %d"), free_heap);
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Code Organization
|
||||
|
||||
1. **Use consistent naming**: `MySensor` prefix for all functions
|
||||
2. **Follow callback patterns**: Implement standard driver callbacks
|
||||
3. **Handle errors gracefully**: Check return values and sensor presence
|
||||
4. **Document thoroughly**: Include usage examples and pin assignments
|
||||
|
||||
### Performance Considerations
|
||||
|
||||
1. **Minimize blocking operations**: Use state machines for long operations
|
||||
2. **Cache sensor readings**: Don't read sensors more often than necessary
|
||||
3. **Use appropriate data types**: Consider memory usage vs. precision
|
||||
4. **Optimize for common cases**: Fast path for normal operations
|
||||
|
||||
### Security Guidelines
|
||||
|
||||
1. **Validate all inputs**: Check command parameters and sensor data
|
||||
2. **Use secure defaults**: Enable security features by default
|
||||
3. **Minimize attack surface**: Disable unused network services
|
||||
4. **Regular updates**: Keep firmware and dependencies current
|
||||
|
||||
## Integration Examples
|
||||
|
||||
### Home Assistant Discovery
|
||||
|
||||
```c
|
||||
void PublishDiscovery(void) {
|
||||
Response_P(PSTR("{"
|
||||
"\"name\":\"%s MySensor\","
|
||||
"\"stat_t\":\"%s\","
|
||||
"\"unit_of_meas\":\"°C\","
|
||||
"\"dev_cla\":\"temperature\""
|
||||
"}"), SettingsText(SET_DEVICENAME), GetStateTopic());
|
||||
|
||||
MqttPublish(GetDiscoveryTopic("sensor", "temperature"), true);
|
||||
}
|
||||
```
|
||||
|
||||
### Custom Web Interface
|
||||
|
||||
```c
|
||||
const char HTTP_MYSENSOR[] PROGMEM =
|
||||
"{s}MySensor{m}"
|
||||
"<input type='range' min='0' max='100' value='%d' "
|
||||
"onchange='la(\"&mysensor_val=\"+this.value);'>"
|
||||
"{e}";
|
||||
|
||||
void MySensorWebShow(void) {
|
||||
WSContentSend_PD(HTTP_MYSENSOR, current_value);
|
||||
}
|
||||
```
|
||||
|
||||
This guide provides the foundation for understanding and extending Tasmota. The modular architecture, standardized APIs, and extensive documentation make it an excellent platform for IoT development, whether you're adding simple sensor support or implementing complex automation systems.
|
||||
|
||||
## Complete Command Reference
|
||||
|
||||
### Core System Commands
|
||||
|
||||
| Command | Parameters | Description | Example |
|
||||
|---------|------------|-------------|---------|
|
||||
| `Status` | 0-11 | System status information | `Status 0` |
|
||||
| `Reset` | 1-6 | Reset device with options | `Reset 1` |
|
||||
| `Restart` | 1 | Restart device | `Restart 1` |
|
||||
| `Upgrade` | 1 | Start OTA upgrade | `Upgrade 1` |
|
||||
| `Upload` | 1 | Start file upload | `Upload 1` |
|
||||
| `Otaurl` | url | Set OTA URL | `Otaurl http://ota.server/firmware.bin` |
|
||||
| `Seriallog` | 0-4 | Set serial log level | `Seriallog 2` |
|
||||
| `Syslog` | 0-4 | Set syslog level | `Syslog 2` |
|
||||
| `Loghost` | hostname | Set syslog host | `Loghost 192.168.1.100` |
|
||||
| `Logport` | port | Set syslog port | `Logport 514` |
|
||||
| `Ipaddress` | x.x.x.x | Set IP address | `Ipaddress 192.168.1.100` |
|
||||
| `Gateway` | x.x.x.x | Set gateway | `Gateway 192.168.1.1` |
|
||||
| `Subnetmask` | x.x.x.x | Set subnet mask | `Subnetmask 255.255.255.0` |
|
||||
| `Dnsserver` | x.x.x.x | Set DNS server | `Dnsserver 8.8.8.8` |
|
||||
| `Mac` | - | Show MAC address | `Mac` |
|
||||
| `Hostname` | name | Set hostname | `Hostname tasmota-device` |
|
||||
|
||||
### WiFi Commands
|
||||
|
||||
| Command | Parameters | Description | Example |
|
||||
|---------|------------|-------------|---------|
|
||||
| `Ssid1` | ssid | Set WiFi SSID 1 | `Ssid1 MyNetwork` |
|
||||
| `Ssid2` | ssid | Set WiFi SSID 2 | `Ssid2 BackupNetwork` |
|
||||
| `Password1` | password | Set WiFi password 1 | `Password1 MyPassword` |
|
||||
| `Password2` | password | Set WiFi password 2 | `Password2 BackupPassword` |
|
||||
| `Ap` | 0-2 | Set AP mode | `Ap 1` |
|
||||
| `WebServer` | 0-2 | Enable web server | `WebServer 1` |
|
||||
| `WebPassword` | password | Set web password | `WebPassword admin` |
|
||||
| `WifiConfig` | 0-7 | WiFi configuration mode | `WifiConfig 4` |
|
||||
|
||||
### MQTT Commands
|
||||
|
||||
| Command | Parameters | Description | Example |
|
||||
|---------|------------|-------------|---------|
|
||||
| `MqttHost` | hostname | Set MQTT broker | `MqttHost 192.168.1.100` |
|
||||
| `MqttPort` | port | Set MQTT port | `MqttPort 1883` |
|
||||
| `MqttUser` | username | Set MQTT username | `MqttUser myuser` |
|
||||
| `MqttPassword` | password | Set MQTT password | `MqttPassword mypass` |
|
||||
| `MqttClient` | clientid | Set MQTT client ID | `MqttClient tasmota-device` |
|
||||
| `Topic` | topic | Set MQTT topic | `Topic tasmota` |
|
||||
| `GroupTopic` | topic | Set group topic | `GroupTopic tasmotas` |
|
||||
| `FullTopic` | template | Set full topic template | `FullTopic %prefix%/%topic%/` |
|
||||
| `Prefix1` | prefix | Set command prefix | `Prefix1 cmnd` |
|
||||
| `Prefix2` | prefix | Set status prefix | `Prefix2 stat` |
|
||||
| `Prefix3` | prefix | Set telemetry prefix | `Prefix3 tele` |
|
||||
| `Publish` | topic payload | Publish MQTT message | `Publish stat/topic/test Hello` |
|
||||
| `MqttRetry` | seconds | Set MQTT retry time | `MqttRetry 10` |
|
||||
| `StateText1` | text | Set OFF state text | `StateText1 OFF` |
|
||||
| `StateText2` | text | Set ON state text | `StateText2 ON` |
|
||||
| `StateText3` | text | Set TOGGLE state text | `StateText3 TOGGLE` |
|
||||
| `StateText4` | text | Set HOLD state text | `StateText4 HOLD` |
|
||||
|
||||
### Power and Relay Commands
|
||||
|
||||
| Command | Parameters | Description | Example |
|
||||
|---------|------------|-------------|---------|
|
||||
| `Power` | 0/1/2 | Control main power | `Power 1` |
|
||||
| `Power1` | 0/1/2 | Control power 1 | `Power1 ON` |
|
||||
| `Power2` | 0/1/2 | Control power 2 | `Power2 OFF` |
|
||||
| `Power3` | 0/1/2 | Control power 3 | `Power3 TOGGLE` |
|
||||
| `Power4` | 0/1/2 | Control power 4 | `Power4 1` |
|
||||
| `PowerOnState` | 0-4 | Set power on state | `PowerOnState 1` |
|
||||
| `PulseTime` | 1-111 | Set pulse time | `PulseTime1 10` |
|
||||
| `BlinkTime` | 2-3600 | Set blink time | `BlinkTime 10` |
|
||||
| `BlinkCount` | 0-32000 | Set blink count | `BlinkCount 5` |
|
||||
| `Interlock` | 0/1 | Enable interlock | `Interlock 1` |
|
||||
| `Ledstate` | 0-8 | Set LED state | `Ledstate 1` |
|
||||
| `LedPower` | 0-2 | Control LED power | `LedPower 1` |
|
||||
| `LedMask` | hex | Set LED mask | `LedMask 0xFF00` |
|
||||
|
||||
### Sensor Commands
|
||||
|
||||
| Command | Parameters | Description | Example |
|
||||
|---------|------------|-------------|---------|
|
||||
| `TelePeriod` | 10-3600 | Set telemetry period | `TelePeriod 300` |
|
||||
| `Resolution` | 0-3 | Set sensor resolution | `Resolution 2` |
|
||||
| `HumRes` | 0-3 | Set humidity resolution | `HumRes 1` |
|
||||
| `TempRes` | 0-3 | Set temperature resolution | `TempRes 2` |
|
||||
| `PressRes` | 0-3 | Set pressure resolution | `PressRes 1` |
|
||||
| `EnergyRes` | 0-5 | Set energy resolution | `EnergyRes 3` |
|
||||
| `SpeedUnit` | 1-4 | Set speed unit | `SpeedUnit 1` |
|
||||
| `WeightRes` | 0-3 | Set weight resolution | `WeightRes 2` |
|
||||
| `FreqRes` | 0-3 | Set frequency resolution | `FreqRes 2` |
|
||||
|
||||
### Timer Commands
|
||||
|
||||
| Command | Parameters | Description | Example |
|
||||
|---------|------------|-------------|---------|
|
||||
| `Timer1` | parameters | Configure timer 1 | `Timer1 {"Enable":1,"Time":"06:00","Days":"1111100","Repeat":1,"Action":1}` |
|
||||
| `Timer2` | parameters | Configure timer 2 | `Timer2 {"Enable":1,"Time":"22:00","Action":0}` |
|
||||
| `Timers` | 0/1 | Enable/disable timers | `Timers 1` |
|
||||
| `Latitude` | degrees | Set latitude | `Latitude 52.520008` |
|
||||
| `Longitude` | degrees | Set longitude | `Longitude 13.404954` |
|
||||
| `Sunrise` | - | Show sunrise time | `Sunrise` |
|
||||
| `Sunset` | - | Show sunset time | `Sunset` |
|
||||
|
||||
### GPIO and Template Commands
|
||||
|
||||
| Command | Parameters | Description | Example |
|
||||
|---------|------------|-------------|---------|
|
||||
| `Gpio` | pin,function | Set GPIO function | `Gpio 14,21` |
|
||||
| `Gpios` | - | Show GPIO configuration | `Gpios` |
|
||||
| `Template` | json | Set device template | `Template {"NAME":"Generic","GPIO":[255,255,255,255,255,255,255,255,255,255,255,255,255],"FLAG":1,"BASE":18}` |
|
||||
| `Module` | 0-255 | Set device module | `Module 1` |
|
||||
| `Modules` | - | Show available modules | `Modules` |
|
||||
| `I2CScan` | - | Scan I2C bus | `I2CScan` |
|
||||
| `I2CDriver` | driver | Enable I2C driver | `I2CDriver10 1` |
|
||||
|
||||
### Display Commands
|
||||
|
||||
| Command | Parameters | Description | Example |
|
||||
|---------|------------|-------------|---------|
|
||||
| `Display` | - | Show display info | `Display` |
|
||||
| `DisplayModel` | 1-16 | Set display model | `DisplayModel 2` |
|
||||
| `DisplayMode` | 0-5 | Set display mode | `DisplayMode 1` |
|
||||
| `DisplayDimmer` | 0-100 | Set display brightness | `DisplayDimmer 50` |
|
||||
| `DisplaySize` | 1-4 | Set display size | `DisplaySize 2` |
|
||||
| `DisplayRotate` | 0-3 | Set display rotation | `DisplayRotate 2` |
|
||||
| `DisplayText` | text | Display text | `DisplayText [s1l1]Hello World` |
|
||||
| `DisplayClear` | - | Clear display | `DisplayClear` |
|
||||
|
||||
### Rule Commands
|
||||
|
||||
| Command | Parameters | Description | Example |
|
||||
|---------|------------|-------------|---------|
|
||||
| `Rule1` | rule | Set rule 1 | `Rule1 ON Switch1#State DO Power1 %value% ENDON` |
|
||||
| `Rule2` | rule | Set rule 2 | `Rule2 ON Time#Minute=30 DO Publish stat/alert 30min ENDON` |
|
||||
| `Rule3` | rule | Set rule 3 | `Rule3 ON Button1#State DO Backlog Power1 TOGGLE; Delay 10; Power2 TOGGLE ENDON` |
|
||||
| `RuleTimer1` | 0-3600 | Set rule timer 1 | `RuleTimer1 60` |
|
||||
| `RuleTimer2` | 0-3600 | Set rule timer 2 | `RuleTimer2 120` |
|
||||
| `Mem1` | value | Set memory 1 | `Mem1 Hello` |
|
||||
| `Mem2` | value | Set memory 2 | `Mem2 World` |
|
||||
| `Var1` | value | Set variable 1 | `Var1 42` |
|
||||
| `Var2` | value | Set variable 2 | `Var2 3.14` |
|
||||
| `CalcRes` | 0-7 | Set calculation resolution | `CalcRes 2` |
|
||||
|
||||
### Berry Script Commands (ESP32)
|
||||
|
||||
| Command | Parameters | Description | Example |
|
||||
|---------|------------|-------------|---------|
|
||||
| `Br` | code | Execute Berry code | `Br print("Hello")` |
|
||||
| `BrLoad` | filename | Load Berry file | `BrLoad autoexec.be` |
|
||||
| `BrRun` | filename | Run Berry file | `BrRun script.be` |
|
||||
| `BrRestart` | - | Restart Berry VM | `BrRestart` |
|
||||
|
||||
### Energy Monitoring Commands
|
||||
|
||||
| Command | Parameters | Description | Example |
|
||||
|---------|------------|-------------|---------|
|
||||
| `PowerCal` | value | Calibrate power | `PowerCal 12530` |
|
||||
| `VoltageCal` | value | Calibrate voltage | `VoltageCal 1950` |
|
||||
| `CurrentCal` | value | Calibrate current | `CurrentCal 3500` |
|
||||
| `PowerSet` | watts | Set power reading | `PowerSet 100` |
|
||||
| `VoltageSet` | volts | Set voltage reading | `VoltageSet 230` |
|
||||
| `CurrentSet` | amps | Set current reading | `CurrentSet 0.43` |
|
||||
| `FrequencySet` | hz | Set frequency reading | `FrequencySet 50` |
|
||||
| `EnergyReset1` | kWh | Reset energy total | `EnergyReset1 0` |
|
||||
| `EnergyReset2` | kWh | Reset energy yesterday | `EnergyReset2 0` |
|
||||
| `EnergyReset3` | kWh | Reset energy today | `EnergyReset3 0` |
|
||||
| `MaxPower` | watts | Set max power | `MaxPower 3500` |
|
||||
| `MaxPowerHold` | seconds | Set max power hold | `MaxPowerHold 10` |
|
||||
| `MaxPowerWindow` | seconds | Set max power window | `MaxPowerWindow 30` |
|
||||
| `SafePower` | watts | Set safe power | `SafePower 3000` |
|
||||
| `SafePowerHold` | seconds | Set safe power hold | `SafePowerHold 10` |
|
||||
| `SafePowerWindow` | seconds | Set safe power window | `SafePowerWindow 30` |
|
||||
|
||||
## Complete Logging and Debug Reference
|
||||
|
||||
### Log Levels
|
||||
|
||||
```c
|
||||
#define LOG_LEVEL_NONE 0 // No logging
|
||||
#define LOG_LEVEL_ERROR 1 // Critical errors only
|
||||
#define LOG_LEVEL_INFO 2 // Errors and info
|
||||
#define LOG_LEVEL_DEBUG 3 // Errors, info and debug
|
||||
#define LOG_LEVEL_DEBUG_MORE 4 // All logging
|
||||
```
|
||||
|
||||
### Logging Functions
|
||||
|
||||
```c
|
||||
// Main logging function
|
||||
void AddLog(uint32_t loglevel, const char* formatP, ...);
|
||||
|
||||
// Convenience macros
|
||||
#define AddLog_P(loglevel, formatP, ...) AddLog(loglevel, PSTR(formatP), ##__VA_ARGS__)
|
||||
#define AddLog_P2(loglevel, formatP, ...) AddLog(loglevel, formatP, ##__VA_ARGS__)
|
||||
|
||||
// Debug logging (only in debug builds)
|
||||
#ifdef DEBUG_TASMOTA_CORE
|
||||
#define DEBUG_CORE_LOG(...) AddLog(__VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_CORE_LOG(...)
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_TASMOTA_DRIVER
|
||||
#define DEBUG_DRIVER_LOG(...) AddLog(__VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_DRIVER_LOG(...)
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_TASMOTA_SENSOR
|
||||
#define DEBUG_SENSOR_LOG(...) AddLog(__VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_SENSOR_LOG(...)
|
||||
#endif
|
||||
```
|
||||
|
||||
### Debug Build Options
|
||||
|
||||
```c
|
||||
// Enable in user_config_override.h for debugging
|
||||
#define DEBUG_TASMOTA_CORE // Core system debugging
|
||||
#define DEBUG_TASMOTA_DRIVER // Driver debugging
|
||||
#define DEBUG_TASMOTA_SENSOR // Sensor debugging
|
||||
#define USE_DEBUG_DRIVER // Enable debug driver
|
||||
#define DEBUG_TASMOTA_PORT Serial // Debug output port
|
||||
```
|
||||
|
||||
### Memory Debugging
|
||||
|
||||
```c
|
||||
// Memory monitoring functions
|
||||
uint32_t ESP_getFreeHeap(void);
|
||||
uint32_t ESP_getMaxAllocHeap(void);
|
||||
uint8_t ESP_getHeapFragmentation(void);
|
||||
uint32_t ESP_getFreeContStack(void);
|
||||
|
||||
// Memory debugging macros
|
||||
#define SHOW_FREE_MEM(x) AddLog(LOG_LEVEL_DEBUG, PSTR(x " free mem: %d"), ESP_getFreeHeap())
|
||||
#define CHECK_OOM() if (ESP_getFreeHeap() < 1000) AddLog(LOG_LEVEL_ERROR, PSTR("Low memory: %d"), ESP_getFreeHeap())
|
||||
```
|
||||
|
||||
## Complete I2C Reference
|
||||
|
||||
### I2C Configuration
|
||||
|
||||
```c
|
||||
// I2C pins (can be changed via GPIO configuration)
|
||||
#define I2C_SDA_PIN 4 // Default SDA pin
|
||||
#define I2C_SCL_PIN 5 // Default SCL pin
|
||||
|
||||
// I2C speeds
|
||||
#define I2C_SPEED_SLOW 50000 // 50kHz
|
||||
#define I2C_SPEED_STANDARD 100000 // 100kHz
|
||||
#define I2C_SPEED_FAST 400000 // 400kHz
|
||||
#define I2C_SPEED_FAST_PLUS 1000000 // 1MHz
|
||||
```
|
||||
|
||||
### I2C Helper Functions
|
||||
|
||||
```c
|
||||
// Basic I2C operations
|
||||
bool I2cValidRead(uint8_t addr, uint8_t reg, uint8_t size);
|
||||
bool I2cValidRead8(uint8_t *data, uint8_t addr, uint8_t reg);
|
||||
bool I2cValidRead16(uint16_t *data, uint8_t addr, uint8_t reg);
|
||||
bool I2cValidRead16LE(uint16_t *data, uint8_t addr, uint8_t reg);
|
||||
bool I2cValidRead24(int32_t *data, uint8_t addr, uint8_t reg);
|
||||
bool I2cValidReadS32(int32_t *data, uint8_t addr, uint8_t reg);
|
||||
bool I2cValidReadS32_LE(int32_t *data, uint8_t addr, uint8_t reg);
|
||||
|
||||
uint8_t I2cRead8(uint8_t addr, uint8_t reg);
|
||||
uint16_t I2cRead16(uint8_t addr, uint8_t reg);
|
||||
uint16_t I2cRead16LE(uint8_t addr, uint8_t reg);
|
||||
int32_t I2cRead24(uint8_t addr, uint8_t reg);
|
||||
int32_t I2cReadS32(uint8_t addr, uint8_t reg);
|
||||
int32_t I2cReadS32_LE(uint8_t addr, uint8_t reg);
|
||||
|
||||
bool I2cWrite8(uint8_t addr, uint8_t reg, uint8_t val);
|
||||
bool I2cWrite16(uint8_t addr, uint8_t reg, uint16_t val);
|
||||
bool I2cWrite16LE(uint8_t addr, uint8_t reg, uint16_t val);
|
||||
|
||||
// Buffer operations
|
||||
uint8_t I2cReadBuffer(uint8_t addr, uint8_t reg, uint8_t *data, uint16_t len);
|
||||
uint8_t I2cWriteBuffer(uint8_t addr, uint8_t reg, uint8_t *data, uint16_t len);
|
||||
|
||||
// Device detection
|
||||
bool I2cActive(uint8_t addr);
|
||||
void I2cScan(char *devs, unsigned int devs_len);
|
||||
void I2cResetActive(uint8_t addr, uint8_t count = 1);
|
||||
void I2cSetActive(uint8_t addr, uint8_t count = 1);
|
||||
void I2cSetActiveFound(uint8_t addr, const char *types);
|
||||
```
|
||||
|
||||
### I2C Device Detection Pattern
|
||||
|
||||
```c
|
||||
void MySensorDetect(void) {
|
||||
if (MySensorDetected) return;
|
||||
|
||||
for (uint32_t i = 0; i < SENSOR_MAX_ADDR; i++) {
|
||||
uint8_t addr = SENSOR_BASE_ADDR + i;
|
||||
if (I2cActive(addr)) continue; // Address already in use
|
||||
|
||||
if (I2cValidRead8(&sensor_id, addr, SENSOR_ID_REG)) {
|
||||
if (sensor_id == EXPECTED_SENSOR_ID) {
|
||||
I2cSetActiveFound(addr, "MySensor");
|
||||
MySensorDetected = true;
|
||||
MySensorAddress = addr;
|
||||
AddLog(LOG_LEVEL_INFO, PSTR("MySensor found at address 0x%02X"), addr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This comprehensive developer reference provides all the essential information needed to understand, extend, and debug Tasmota firmware. The detailed callback system, complete command reference, GPIO configuration options, and debugging tools give developers everything needed to create robust IoT solutions.
|
2124
.doc_for_ai/TASMOTA_SUPPORT_DEEP_ANALYSIS.md
Normal file
2124
.doc_for_ai/TASMOTA_SUPPORT_DEEP_ANALYSIS.md
Normal file
File diff suppressed because it is too large
Load Diff
1
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
1
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
@ -32,6 +32,7 @@ _Make sure your have performed every step and checked the applicable boxes befor
|
||||
- [ ] Searched the problem in [discussions](https://github.com/arendst/Tasmota/discussions)
|
||||
- [ ] Searched the problem in the [docs](https://tasmota.github.io/docs/FAQ)
|
||||
- [ ] Searched the problem in the [chat](https://discord.gg/Ks2Kzd4)
|
||||
- [ ] Problem is not scripter related, in this case open a discussion and tag gemu2015
|
||||
- [ ] Device used (e.g., Sonoff Basic): _____
|
||||
- [ ] Tasmota binary firmware version number used: _____
|
||||
- [ ] Pre-compiled
|
||||
|
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -7,7 +7,7 @@
|
||||
- [ ] Only relevant files were touched
|
||||
- [ ] Only one feature/fix was added per PR and the code change compiles without warnings
|
||||
- [ ] The code change is tested and works with Tasmota core ESP8266 V.2.7.8
|
||||
- [ ] The code change is tested and works with Tasmota core ESP32 V.3.1.0.240926
|
||||
- [ ] The code change is tested and works with Tasmota core ESP32 V.3.1.3.250712
|
||||
- [ ] I accept the [CLA](https://github.com/arendst/Tasmota/blob/development/CONTRIBUTING.md#contributor-license-agreement-cla).
|
||||
|
||||
_NOTE: The code change must pass CI tests. **Your PR cannot be merged unless tests pass**_
|
||||
|
142
.github/workflows/Tasmota_build_devel.yml
vendored
142
.github/workflows/Tasmota_build_devel.yml
vendored
@ -24,36 +24,32 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
#- name: Install clang compiler
|
||||
#run: |
|
||||
#sudo apt-get install -f clang
|
||||
- name: Make Berry and Tasmota Berry code
|
||||
python-version: '3.13'
|
||||
|
||||
- name: Make Berry and Solidify code
|
||||
run: |
|
||||
cd lib/libesp32/berry
|
||||
make
|
||||
cd ../berry_tasmota
|
||||
../berry/berry -s -g solidify_all.be
|
||||
- name: Matter Berry Code
|
||||
run: |
|
||||
cd lib/libesp32/berry_matter
|
||||
cd ../berry_matter
|
||||
../berry/berry -s -g solidify_all.be
|
||||
- name: Berry Animate Code
|
||||
run: |
|
||||
cd lib/libesp32/berry_animate
|
||||
cd ../berry_animate
|
||||
../berry/berry -s -g solidify_all.be
|
||||
- name: LVGL Berry Code
|
||||
run: |
|
||||
cd lib/libesp32_lvgl/lv_binding_berry
|
||||
cd ../../libesp32_lvgl/lv_binding_berry
|
||||
../../libesp32/berry/berry -s -g solidify_all.be
|
||||
- name: HASPmota Berry Code
|
||||
run: |
|
||||
cd lib/libesp32_lvgl/lv_haspmota
|
||||
cd ../lv_haspmota
|
||||
../../libesp32/berry/berry -s -g solidify_all.be
|
||||
- uses: jason2866/upload-artifact@v2.0.3
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: '["berry_tasmota", "berry_matter", "berry_animate", "berry_lvgl", "berry_haspmota", "berry_header"]'
|
||||
path: '["./lib/libesp32/berry_tasmota/src/solidify", "./lib/libesp32/berry_matter/src/solidify", "./lib/libesp32/berry_animate/src/solidify", "./lib/libesp32_lvgl/lv_binding_berry/src/solidify", "./lib/libesp32_lvgl/lv_haspmota/src/solidify", "./lib/libesp32/berry/generate"]'
|
||||
name: berry
|
||||
path: |
|
||||
./lib/libesp32/berry_tasmota/src/solidify
|
||||
./lib/libesp32/berry_matter/src/solidify
|
||||
./lib/libesp32/berry_animate/src/solidify
|
||||
./lib/libesp32_lvgl/lv_binding_berry/src/solidify
|
||||
./lib/libesp32_lvgl/lv_haspmota/src/solidify
|
||||
./lib/libesp32/berry/generate
|
||||
|
||||
push_solidified:
|
||||
needs: be_solidify
|
||||
@ -65,23 +61,20 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- uses: jason2866/download-artifact@v3.0.4
|
||||
python-version: '3.13'
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: |
|
||||
berry_tasmota
|
||||
berry_matter
|
||||
berry_animate
|
||||
berry_lvgl
|
||||
berry_haspmota
|
||||
berry_header
|
||||
path: |
|
||||
./lib/libesp32/berry_tasmota/src/solidify
|
||||
./lib/libesp32/berry_matter/src/solidify
|
||||
./lib/libesp32/berry_animate/src/solidify
|
||||
./lib/libesp32_lvgl/lv_binding_berry/src/solidify
|
||||
./lib/libesp32_lvgl/lv_haspmota/src/solidify
|
||||
./lib/libesp32/berry/generate
|
||||
pattern: berry
|
||||
path: berry
|
||||
- name: Move solidified Berry files back
|
||||
run: |
|
||||
ls -R ./berry
|
||||
mv berry/berry/libesp32/berry_tasmota/src/solidify/* ./lib/libesp32/berry_tasmota/src/solidify
|
||||
mv berry/berry/libesp32/berry_matter/src/solidify/* ./lib/libesp32/berry_matter/src/solidify
|
||||
mv berry/berry/libesp32/berry_animate/src/solidify/* ./lib/libesp32/berry_animate/src/solidify
|
||||
mv berry/berry/libesp32_lvgl/lv_binding_berry/src/solidify/* ./lib/libesp32_lvgl/lv_binding_berry/src/solidify
|
||||
mv berry/berry/libesp32_lvgl/lv_haspmota/src/solidify/* ./lib/libesp32_lvgl/lv_haspmota/src/solidify
|
||||
mv berry/berry/libesp32/berry/generate/* ./lib/libesp32/berry/generate
|
||||
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: Solidified Code updated
|
||||
@ -105,6 +98,8 @@ jobs:
|
||||
- tasmota32s3ser-safeboot
|
||||
- tasmota32c6-safeboot
|
||||
- tasmota32c6ser-safeboot
|
||||
- tasmota32p4-safeboot
|
||||
- tasmota32p4ser-safeboot
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@ -112,11 +107,11 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: '3.13'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install wheel
|
||||
pip install -U platformio
|
||||
pip install uv
|
||||
uv pip install --system platformio
|
||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
||||
- name: Add SHA to footer
|
||||
run: |
|
||||
@ -124,14 +119,17 @@ jobs:
|
||||
SHA=${COMMIT_SHA_LONG::7}
|
||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
|
||||
- name: Run PlatformIO
|
||||
env:
|
||||
PYTHONIOENCODING: utf-8
|
||||
PYTHONUTF8: '1'
|
||||
run: platformio run -e ${{ matrix.variant }}
|
||||
#- name: Use esp32-solo1 safeboot for esp32 too
|
||||
#run: |
|
||||
#cp ./build_output/firmware/tasmota32solo1-safeboot.bin ./build_output/firmware/tasmota32-safeboot.bin
|
||||
- name: Upload safeboot firmware artifacts
|
||||
uses: jason2866/upload-artifact@v2.0.3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: firmware_safeboot
|
||||
name: ${{ matrix.variant }}
|
||||
path: ./build_output
|
||||
|
||||
base-images:
|
||||
@ -159,22 +157,25 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: '3.13'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install wheel
|
||||
pip install -U platformio
|
||||
pip install uv
|
||||
uv pip install --system platformio
|
||||
- name: Add SHA to footer
|
||||
run: |
|
||||
COMMIT_SHA_LONG=$(git rev-parse --short HEAD || echo "")
|
||||
SHA=${COMMIT_SHA_LONG::7}
|
||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
|
||||
- name: Run PlatformIO
|
||||
env:
|
||||
PYTHONIOENCODING: utf-8
|
||||
PYTHONUTF8: '1'
|
||||
run: platformio run -e ${{ matrix.variant }}
|
||||
- name: Upload firmware artifacts
|
||||
uses: jason2866/upload-artifact@v2.0.3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: firmware
|
||||
name: ${{ matrix.variant }}
|
||||
path: ./build_output
|
||||
|
||||
base32-images:
|
||||
@ -196,6 +197,7 @@ jobs:
|
||||
- tasmota32c2
|
||||
- tasmota32c3
|
||||
- tasmota32c6
|
||||
- tasmota32p4
|
||||
- tasmota32s2
|
||||
- tasmota32s2cdc
|
||||
- tasmota32s3
|
||||
@ -207,28 +209,35 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: '3.13'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install wheel
|
||||
pip install -U platformio
|
||||
pip install uv
|
||||
uv pip install --system platformio
|
||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
||||
- name: Download safeboot firmwares
|
||||
uses: jason2866/download-artifact@v3.0.4
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: firmware_safeboot
|
||||
path: ./firmware
|
||||
pattern: tasmota32*
|
||||
path: ./temp
|
||||
- name: Move safeboot files
|
||||
run: |
|
||||
mkdir -p ./firmware/firmware
|
||||
find ./temp -type f -exec cp -t ./firmware/firmware {} +
|
||||
- name: Add SHA to footer
|
||||
run: |
|
||||
COMMIT_SHA_LONG=$(git rev-parse --short HEAD || echo "")
|
||||
SHA=${COMMIT_SHA_LONG::7}
|
||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
|
||||
- name: Run PlatformIO
|
||||
env:
|
||||
PYTHONIOENCODING: utf-8
|
||||
PYTHONUTF8: '1'
|
||||
run: platformio run -e ${{ matrix.variant }}
|
||||
- name: Upload firmware artifacts
|
||||
uses: jason2866/upload-artifact@v2.0.3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: firmware
|
||||
name: ${{ matrix.variant }}
|
||||
path: ./build_output
|
||||
|
||||
language-images:
|
||||
@ -239,7 +248,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
variant: [ tasmota, tasmota32 ]
|
||||
language: [ AD, AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ]
|
||||
language: [ AD, AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, LT, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@ -247,28 +256,35 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: '3.13'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install wheel
|
||||
pip install -U platformio
|
||||
pip install uv
|
||||
uv pip install --system platformio
|
||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
||||
- name: Download safeboot firmwares
|
||||
uses: jason2866/download-artifact@v3.0.4
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: firmware_safeboot
|
||||
path: ./firmware
|
||||
pattern: tasmota32*
|
||||
path: ./temp
|
||||
- name: Move safeboot files
|
||||
run: |
|
||||
mkdir -p ./firmware/firmware
|
||||
find ./temp -type f -exec cp -t ./firmware/firmware {} +
|
||||
- name: Add SHA to footer
|
||||
run: |
|
||||
COMMIT_SHA_LONG=$(git rev-parse --short HEAD || echo "")
|
||||
SHA=${COMMIT_SHA_LONG::7}
|
||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT $SHA-/g" ./tasmota/include/tasmota_version.h
|
||||
- name: Run PlatformIO
|
||||
env:
|
||||
PYTHONIOENCODING: utf-8
|
||||
PYTHONUTF8: '1'
|
||||
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
|
||||
- name: Upload language firmware artifacts
|
||||
uses: jason2866/upload-artifact@v2.0.3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: firmware
|
||||
name: ${{ matrix.variant }}-${{ matrix.language }}
|
||||
path: ./build_output
|
||||
|
||||
Start_final_copy:
|
||||
|
103
.github/workflows/Tasmota_build_master.yml
vendored
103
.github/workflows/Tasmota_build_master.yml
vendored
@ -32,6 +32,8 @@ jobs:
|
||||
- tasmota32s3ser-safeboot
|
||||
- tasmota32c6-safeboot
|
||||
- tasmota32c6ser-safeboot
|
||||
- tasmota32p4-safeboot
|
||||
- tasmota32p4ser-safeboot
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@ -39,21 +41,24 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: '3.13'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install wheel
|
||||
pip install -U platformio
|
||||
pip install uv
|
||||
uv pip install --system platformio
|
||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
||||
- name: Add "release" to footer
|
||||
run: |
|
||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
|
||||
- name: Run PlatformIO
|
||||
env:
|
||||
PYTHONIOENCODING: utf-8
|
||||
PYTHONUTF8: '1'
|
||||
run: platformio run -e ${{ matrix.variant }}
|
||||
- name: Upload safeboot firmware artifacts
|
||||
uses: jason2866/upload-artifact@v2.0.3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: firmware_safeboot
|
||||
name: ${{ matrix.variant }}
|
||||
path: ./build_output
|
||||
|
||||
base-images:
|
||||
@ -80,21 +85,24 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: '3.13'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install wheel
|
||||
pip install -U platformio
|
||||
pip install uv
|
||||
uv pip install --system platformio
|
||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
||||
- name: Add "release" to footer
|
||||
run: |
|
||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
|
||||
- name: Run PlatformIO
|
||||
env:
|
||||
PYTHONIOENCODING: utf-8
|
||||
PYTHONUTF8: '1'
|
||||
run: platformio run -e ${{ matrix.variant }}
|
||||
- name: Upload firmware artifacts
|
||||
uses: jason2866/upload-artifact@v2.0.3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: firmware
|
||||
name: ${{ matrix.variant }}
|
||||
path: ./build_output
|
||||
|
||||
base32-images:
|
||||
@ -116,6 +124,7 @@ jobs:
|
||||
- tasmota32c2
|
||||
- tasmota32c3
|
||||
- tasmota32c6
|
||||
- tasmota32p4
|
||||
- tasmota32s2
|
||||
- tasmota32s2cdc
|
||||
- tasmota32s3
|
||||
@ -127,29 +136,33 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: '3.13'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install wheel
|
||||
pip install -U platformio
|
||||
pip install uv
|
||||
uv pip install --system platformio
|
||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
||||
- name: Download safeboot firmwares
|
||||
uses: jason2866/download-artifact@v3.0.4
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: firmware_safeboot
|
||||
path: ./firmware
|
||||
- name: Display downloaded files
|
||||
pattern: tasmota32*
|
||||
path: ./temp
|
||||
- name: Move safeboot files
|
||||
run: |
|
||||
ls -R ./firmware/
|
||||
mkdir -p ./firmware/firmware
|
||||
find ./temp -type f -exec cp -t ./firmware/firmware {} +
|
||||
- name: Add "release" to footer
|
||||
run: |
|
||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
|
||||
- name: Run PlatformIO
|
||||
env:
|
||||
PYTHONIOENCODING: utf-8
|
||||
PYTHONUTF8: '1'
|
||||
run: platformio run -e ${{ matrix.variant }}
|
||||
- name: Upload firmware artifacts
|
||||
uses: jason2866/upload-artifact@v2.0.3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: firmware
|
||||
name: ${{ matrix.variant }}
|
||||
path: ./build_output
|
||||
|
||||
language-images:
|
||||
@ -160,7 +173,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
variant: [ tasmota, tasmota32 ]
|
||||
language: [ AD, AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ]
|
||||
language: [ AD, AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, LT, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@ -168,29 +181,33 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: '3.13'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install wheel
|
||||
pip install -U platformio
|
||||
pip install uv
|
||||
uv pip install --system platformio
|
||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
||||
- name: Download safeboot firmwares
|
||||
uses: jason2866/download-artifact@v3.0.4
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: firmware_safeboot
|
||||
path: ./firmware
|
||||
- name: Display downloaded files
|
||||
pattern: tasmota32*
|
||||
path: ./temp
|
||||
- name: Move safeboot files
|
||||
run: |
|
||||
ls -R ./firmware/
|
||||
mkdir -p ./firmware/firmware
|
||||
find ./temp -type f -exec cp -t ./firmware/firmware {} +
|
||||
- name: Add "release" to footer
|
||||
run: |
|
||||
sed -i -e "s/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT release-/g" ./tasmota/include/tasmota_version.h
|
||||
- name: Run PlatformIO
|
||||
env:
|
||||
PYTHONIOENCODING: utf-8
|
||||
PYTHONUTF8: '1'
|
||||
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
|
||||
- name: Upload language firmware artifacts
|
||||
uses: jason2866/upload-artifact@v2.0.3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: firmware
|
||||
name: ${{ matrix.variant }}-${{ matrix.language }}
|
||||
path: ./build_output
|
||||
|
||||
Release:
|
||||
@ -199,28 +216,24 @@ jobs:
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Download Tasmota firmwares
|
||||
uses: jason2866/download-artifact@v3.0.4
|
||||
- name: Download all Tasmota artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: firmware
|
||||
path: ./mv_firmware
|
||||
- name: Download safeboot firmwares
|
||||
uses: jason2866/download-artifact@v3.0.4
|
||||
with:
|
||||
name: firmware_safeboot
|
||||
path: ./mv_firmware
|
||||
pattern: tasmota*
|
||||
path: ./temp
|
||||
- name: Move files
|
||||
run: |
|
||||
mkdir -p ./release
|
||||
find ./temp -type f -exec cp -t ./release {} +
|
||||
- name: Display structure of downloaded files
|
||||
run: ls -R ./mv_firmware/
|
||||
- name: Zip all map.gz files in one file -> map_all.zip
|
||||
run: 7z a -mx=9 -tzip -xr'!.*' map_all.zip mv_firmware/map
|
||||
run: ls -R ./release/
|
||||
- name: Release
|
||||
uses: jason2866/action-gh-release@v1.2
|
||||
#if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
tag_name: ${{ github.run_number }}
|
||||
files: |
|
||||
./mv_firmware/firmware/*
|
||||
map_all.zip
|
||||
./release/tasmota*
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
110
.github/workflows/build_all_the_things.yml
vendored
110
.github/workflows/build_all_the_things.yml
vendored
@ -19,35 +19,7 @@ on:
|
||||
|
||||
jobs:
|
||||
os-check-win:
|
||||
runs-on: windows-2019
|
||||
if: github.repository == 'arendst/Tasmota'
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
variant:
|
||||
- tasmota32solo1-safeboot
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install wheel
|
||||
#python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
#platformio upgrade --dev
|
||||
#platformio update
|
||||
- name: Run PlatformIO
|
||||
run: platformio run -e ${{ matrix.variant }}
|
||||
- uses: jason2866/upload-artifact@v2.0.3
|
||||
with:
|
||||
name: firmware
|
||||
path: ./build_output
|
||||
|
||||
os-check-mac:
|
||||
runs-on: macos-14
|
||||
runs-on: windows-latest
|
||||
if: github.repository == 'arendst/Tasmota'
|
||||
strategy:
|
||||
fail-fast: true
|
||||
@ -59,19 +31,47 @@ jobs:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
python-version: '3.13'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install wheel
|
||||
#python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
#platformio upgrade --dev
|
||||
#platformio update
|
||||
pip install uv
|
||||
uv pip install --system platformio
|
||||
- name: Run PlatformIO
|
||||
env:
|
||||
PYTHONIOENCODING: utf-8
|
||||
PYTHONUTF8: '1'
|
||||
run: platformio run -e ${{ matrix.variant }}
|
||||
- uses: jason2866/upload-artifact@v2.0.3
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: firmware
|
||||
name: ${{ matrix.variant }}
|
||||
path: ./build_output
|
||||
|
||||
os-check-mac:
|
||||
runs-on: macos-14
|
||||
if: github.repository == 'arendst/Tasmota'
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
variant:
|
||||
- tasmota32solo1-safeboot
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.13'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install uv
|
||||
uv pip install --system platformio
|
||||
- name: Run PlatformIO
|
||||
env:
|
||||
PYTHONIOENCODING: utf-8
|
||||
PYTHONUTF8: '1'
|
||||
run: platformio run -e ${{ matrix.variant }}
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.variant }}
|
||||
path: ./build_output
|
||||
|
||||
base-images:
|
||||
@ -95,6 +95,7 @@ jobs:
|
||||
- tasmota32c2
|
||||
- tasmota32c3
|
||||
- tasmota32c6
|
||||
- tasmota32p4
|
||||
- tasmota32s2
|
||||
- tasmota32s2cdc
|
||||
- tasmota32s3
|
||||
@ -112,25 +113,26 @@ jobs:
|
||||
- tasmota32c2-safeboot
|
||||
- tasmota32c3-safeboot
|
||||
- tasmota32c6-safeboot
|
||||
- tasmota32p4-safeboot
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: '3.13'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install wheel
|
||||
#python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
#platformio upgrade --dev
|
||||
#platformio update
|
||||
pip install uv
|
||||
uv pip install --system platformio
|
||||
cp ./platformio_override_sample.ini ./platformio_override.ini
|
||||
- name: Run PlatformIO
|
||||
env:
|
||||
PYTHONIOENCODING: utf-8
|
||||
PYTHONUTF8: '1'
|
||||
run: platformio run -e ${{ matrix.variant }}
|
||||
- uses: jason2866/upload-artifact@v2.0.3
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: firmware
|
||||
name: ${{ matrix.variant }}
|
||||
path: ./build_output
|
||||
|
||||
language-images:
|
||||
@ -140,23 +142,23 @@ jobs:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
variant: [ tasmota ]
|
||||
language: [ AD, AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ]
|
||||
language: [ AD, AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, LT, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: '3.13'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install wheel
|
||||
#python -m pip install --upgrade pip
|
||||
pip install -U platformio
|
||||
#platformio upgrade --dev
|
||||
#platformio update
|
||||
pip install uv
|
||||
uv pip install --system platformio
|
||||
- name: Run PlatformIO
|
||||
env:
|
||||
PYTHONIOENCODING: utf-8
|
||||
PYTHONUTF8: '1'
|
||||
run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }}
|
||||
- uses: jason2866/upload-artifact@v2.0.3
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: firmware
|
||||
name: ${{ matrix.variant }}-${{ matrix.language }}
|
||||
path: ./build_output
|
||||
|
7
.gitignore
vendored
7
.gitignore
vendored
@ -19,10 +19,14 @@ managed_components
|
||||
.cache
|
||||
.dummy
|
||||
sdkconfig.*
|
||||
sdkconfig.defaults
|
||||
CMakeLists.txt
|
||||
data
|
||||
unpacked_fs
|
||||
unpacked_boards
|
||||
tasmota/user_config_override.h
|
||||
tasmota/include/local_ca_data.h
|
||||
tasmota/include/local_ca_descriptor.h
|
||||
variants
|
||||
variants3
|
||||
build
|
||||
@ -47,6 +51,9 @@ lib/libesp32/berry/berry
|
||||
*.bak
|
||||
*.code-workspace
|
||||
|
||||
## IntelliJ ######
|
||||
.idea
|
||||
|
||||
## Python virtual environments for Platformio ##
|
||||
venv
|
||||
.venv
|
||||
|
15
BUILDS.md
15
BUILDS.md
@ -14,10 +14,13 @@ Note: the `minimal` variant is not listed as it shouldn't be used outside of the
|
||||
| USE_HOME_ASSISTANT | - | - / - | - | - | - | - |
|
||||
| USE_TASMOTA_DISCOVERY | x | x / x | x | x | x | x |
|
||||
| USE_MQTT_TLS\* | - | - / x | - | - | - | - |
|
||||
| USE_MQTT_CLIENT_CERT | - | - / - | - | - | - | - |
|
||||
| USE_MQTT_AWS_IOT | - | - / - | - | - | - | - |
|
||||
| USE_4K_RSA | - | - / - | - | - | - | - |
|
||||
| USE_TELEGRAM | - | - / - | - | - | - | - |
|
||||
| USE_KNX | - | - / x | x | - | - | - |
|
||||
| USE_TELNET | - | - / - | - | - | - | - |
|
||||
| USE_XYZMODEM | - | - / - | - | - | - | - |
|
||||
| USE_WEBSERVER | x | x / x | x | x | x | x |
|
||||
| USE_WEBSEND_RESPONSE | - | - / - | - | - | - | - |
|
||||
| USE_EMULATION_HUE | x | x / x | - | x | - | - |
|
||||
@ -105,8 +108,9 @@ Note: the `minimal` variant is not listed as it shouldn't be used outside of the
|
||||
| **Feature or Sensor** | **l** | **t** | **k** | **s** | **i** | **d** | **Remarks** |
|
||||
| USE_I2C | - | x / x | x | x | - | x |
|
||||
| USE_RTC_CHIPS | - | - / x | - | - | - | - |
|
||||
| -USE_DS3231 | - | - / - | - | - | - | - |
|
||||
| -USE_BM8563 | - | - / x | - | - | - | - |
|
||||
| -USE_DS3231 | - | - / - | - | - | - | - |
|
||||
| -USE_PCF85063 | - | - / - | - | - | - | - |
|
||||
| -USE_PCF85363 | - | - / - | - | - | - | - |
|
||||
| -USE_RX8010 | - | - / - | - | - | - | - |
|
||||
| USE_SHT | - | - / x | - | x | - | - |
|
||||
@ -227,12 +231,15 @@ Note: the `minimal` variant is not listed as it shouldn't be used outside of the
|
||||
| USE_MIEL_HVAC | - | - / - | - | - | - | - |
|
||||
| USE_PROJECTOR_CTRL | - | - / - | - | - | - | - |
|
||||
| USE_AS608 | - | - / - | - | - | - | - |
|
||||
| USE_LD2402 | - | - / - | - | - | - | - |
|
||||
| USE_LD2410 | - | - / - | - | - | - | - |
|
||||
| USE_LD2410S | - | - / - | - | - | - | - |
|
||||
| USE_GM861 | - | - / - | - | - | - | - |
|
||||
| USE_TCP_BRIDGE | - | - / - | - | - | - | - | zbbridge / zbbrdgpro |
|
||||
| USE_HC8 | - | - / - | - | - | - | - |
|
||||
| USE_PIPSOLAR | - | - / - | - | - | - | - |
|
||||
| USE_WOOLIIS | - | - / - | - | - | - | - |
|
||||
| USE_C8_CO2_5K | - | - / - | - | - | - | - |
|
||||
| | | | | | | |
|
||||
| USE_NRF24 | - | - / - | - | - | - | - |
|
||||
| USE_MIBLE | - | - / - | - | - | - | - |
|
||||
@ -244,11 +251,14 @@ Note: the `minimal` variant is not listed as it shouldn't be used outside of the
|
||||
| USE_IR_RECEIVE | - | x / - | x | x | x | x |
|
||||
| USE_IR_REMOTE_FULL | - | - / - | - | - | x | - | Enable ALL protocols |
|
||||
| | | | | | | |
|
||||
| USE_WIZMOTE | - | - / - | - | - | - | - |
|
||||
| | | | | | | |
|
||||
| USE_SR04 | - | - / - | - | x | - | - |
|
||||
| USE_ME007 | - | - / - | - | - | - | - |
|
||||
| USE_DYP | - | - / - | - | - | - | - |
|
||||
| USE_TM1638 | - | - / x | - | x | - | - |
|
||||
| USE_HX711 | - | - / x | - | x | - | - |
|
||||
| -USE_HX711_M5SCALES | - | - / - | - | - | - | - |
|
||||
| USE_TX2x_WIND_SENSOR | - | - / - | - | - | - | - |
|
||||
| USE_WINDMETER | - | - / - | - | - | - | - |
|
||||
| USE_RC_SWITCH | - | - / x | - | x | - | - |
|
||||
@ -283,7 +293,8 @@ Note: the `minimal` variant is not listed as it shouldn't be used outside of the
|
||||
| USE_SONOFF_SPM | | / x | | | | |
|
||||
| USE_DISPLAY_TM1621_SONOFF | | / x | | | | |
|
||||
| USE_SHELLY_PRO | | / x | | | | |
|
||||
| USE_DALI | | / - | | | | |
|
||||
| USE_ESP32_TWAI | | / x | | | | |
|
||||
| USE_DALI | | / x | | | | |
|
||||
| USE_DINGTIAN_RELAY | | / - | | | | |
|
||||
| USE_MATTER_DEVICE | | / x | | | | | See SetOption151 |
|
||||
|
||||
|
478
CHANGELOG.md
478
CHANGELOG.md
@ -3,7 +3,469 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
## [Unreleased] - Development
|
||||
|
||||
## [14.2.0.6]
|
||||
## [15.0.1.2]
|
||||
### Added
|
||||
- Command `I2sPause` (#23646)
|
||||
- Basic support for ESP32-P4 (#23663)
|
||||
- ESP32-P4 command `HostedOta` (#23675)
|
||||
- Support for RV3028 RTC (#23672)
|
||||
|
||||
### Breaking Changed
|
||||
|
||||
### Changed
|
||||
- ESP32 Platform from 2025.05.30 to 2025.07.30, Framework (Arduino Core) from v3.1.3.250504 to v3.1.3.250707 and IDF from v5.3.3.250501 to v5.3.3.250707 (#23642)
|
||||
- Domoticz supports persistent settings for all relays, keys and switches when filesystem `#define USE_UFILESYS` is enabled
|
||||
- ESP32 Platform from 2025.07.30 to 2025.07.31, Framework (Arduino Core) from v3.1.3.250707 to v3.1.3.250712 and IDF from v5.3.3.250707 to v5.3.3.250707 (#23685)
|
||||
- ESP8266 platform update from 2025.05.00 to 2025.07.00 (#23700)
|
||||
- OpenTherm library from v0.9.0 to v1.1.5 (#23704)
|
||||
|
||||
### Fixed
|
||||
|
||||
### Removed
|
||||
|
||||
|
||||
|
||||
## [15.0.1.1] 20250708
|
||||
### Added
|
||||
- I2S additions (#23543)
|
||||
- NeoPool add Redox tank alarm (#19811)
|
||||
- Berry f-strings now support ':' in expression (#23618)
|
||||
- Universal display driver for ZJY169S0800TG01 ST7789 280x240 (#23638)
|
||||
- Commands `LoRaWanDecoder "` and `LoRaWanName "` to clear name (#23394)
|
||||
- Internal function 'WSContentSendRaw_P' (#23641)
|
||||
|
||||
### Changed
|
||||
- BLE updates for esp-nimble-cpp v2.x (#23553)
|
||||
- Library names (#23560)
|
||||
- ESP32 LoRaWan decoding won't duplicate non-decoded message if `SO147 0`
|
||||
- VEML6070 and AHT2x device detection (#23581)
|
||||
- CSS uses named colors variables (#23597)
|
||||
|
||||
### Fixed
|
||||
- LVGL restore `lv_chart.set_range` removed in LVGL 9.3.0 in favor of `lv_chart.set_axis_range` (#23567)
|
||||
- Berry vulnerability in JSON parsing for unicode (#23603)
|
||||
- Berry security issues in `int64` and improve documentation (#23605)
|
||||
- Berry security issues in `berry_mapping` and improve documentation (#23606)
|
||||
- Berry Hue regression from #23429 (#23623)
|
||||
- AHT30 sensor start with null values after deep sleep (#23624)
|
||||
|
||||
## [Released]
|
||||
|
||||
## [15.0.1] 20250614
|
||||
- Release Sharon
|
||||
|
||||
## [15.0.0.1] 20250614
|
||||
### Fixed
|
||||
- LVGL regression missing `lv.ANIM_OFF` and `lv.ANIM_ON` (#23544)
|
||||
- Berry fix `realline` (#23546)
|
||||
- LVGL HASPmota fix regression introduced with LVGL 9.3.0 (#23547)
|
||||
|
||||
## [15.0.0] 20250613
|
||||
- Release Sharon
|
||||
|
||||
## [14.6.0.2] 20250613
|
||||
### Added
|
||||
- Allow temporary change of DisplayDimmer (#23406)
|
||||
- Support for LoRaWan Rx1 and Rx2 profiles (#23394)
|
||||
- HASPmota auto-dimming when no touch (#23425)
|
||||
- Provide serial upload port from VSC to PIO (#23436)
|
||||
- Berry support for `sortedmap` (#23441)
|
||||
- Berry `introspect.module` option to not cache module entry (#23451)
|
||||
- Berry `webserver.remove_route` to revert `webserver.on` (#23452)
|
||||
- Berry `compile` and `tasmota.compile` option to compile in local context (#23457)
|
||||
- Support for AP33772S USB PD Sink Controller as used in CentyLab RotoPD
|
||||
- Berry mqtt publish rule processing
|
||||
- Berry `tasmota.is_network_up()` (#23532)
|
||||
|
||||
### Changed
|
||||
- ESP32 Platform from 2025.04.30 to 2025.05.40, Framework (Arduino Core) from v3.1.3.250411 to v3.2.0.250504 and IDF from v5.3.2.250403 to v5.4.1.250501 (#23397)
|
||||
- ESP32 Platform from 2025.05.40 to 2025.05.30, Framework (Arduino Core) from v3.2.0.250504 to v3.1.3.250504 and IDF from v5.4.1.250501 to v5.3.3.250501 (#23404)
|
||||
- ESP8266 platform update from 2024.09.00 to 2025.05.00 (#23448)
|
||||
- Increase number of supported LoRaWan nodes from 4 to 16
|
||||
- Berry change number parser for json to reuse same parser as lexer (#23505)
|
||||
- Berry increase web hooks from 16 to 32 (#23507)
|
||||
- ESP32 LVGL library from v9.2.2 to v9.3.0 (#23518)
|
||||
- Zigbee improved message when coordinator failed to start (#23525)
|
||||
- Format syslog messages according to RFC5424 adding local log time (#23509)
|
||||
|
||||
### Fixed
|
||||
- Haspmota `haspmota.parse()` page parsing (#23403)
|
||||
- ESP32-S3 display stability regression from #23397 (#23404)
|
||||
- DNS setting with `IPAddress4/5` not persisted (#23426)
|
||||
- Berry avoid json parsing for unmatched commands (#23494)
|
||||
- Berry integer and real parser to handle overflows (#23495)
|
||||
- Berry potential pointer underflow with `string.endswith` (#23496)
|
||||
- Autoconf failing when last line has no trailing LF (#23537)
|
||||
- LVGL Tasmota logo splash screen (#23538)
|
||||
|
||||
## [14.6.0.1] 20250510
|
||||
### Added
|
||||
- Command `JsonPP 0..7` to enable (>0) JSON Pretty Print on user interfaces and set number of indents
|
||||
- Command `JsonPP <command>|backlog <command>;...` to enable JSON PP only once
|
||||
- WebUI status line for MQTT and TLS, added `FUNC_WEB_STATUS` event (#23326)
|
||||
- Wireguard VPN (#23347)
|
||||
- Optional Wifi strength indicator in WebUI status line (#23352)
|
||||
- WebUI status line left and renamed events `FUNC_WEB_STATUS_LEFT` and `FUNC_WEB_STATUS_RIGHT` (#23354)
|
||||
- WebUI heap status (#23356)
|
||||
- Support for multi channel AU915-928 LoRaWanBridge by Rob Clark (#23372)
|
||||
- HASPmota `antiburn()` (#23400)
|
||||
|
||||
### Changed
|
||||
- Allow command `WebRefresh` minimum from 1000 to 400 mSec
|
||||
- GPIOViewer from v1.6.2 to v1.6.3 (No functional change)
|
||||
|
||||
### Fixed
|
||||
- Berry `bytes().asstring()` now truncates a string if buffer contains NULL (#23311)
|
||||
- Berry string literals containing NULL are truncated (#23312)
|
||||
- Berry `display.touch_update` wrongly applies resistive calibration (#23363)
|
||||
- NimBLE log_level definition conflict (#23366)
|
||||
- Matter and mDNS can be enabled at the same time (#23373)
|
||||
- Berry `introspect.module()` failed to load modules in files (#23376)
|
||||
|
||||
## [14.6.0] 20250416
|
||||
- Release Ryan
|
||||
|
||||
## [14.5.0.3] 20250416
|
||||
### Added
|
||||
- Extend command `GPIO` with different display options and allowing updating of module GPIO's in one go
|
||||
- Berry `bytes.add()` now accepts 3-bytes values (#23200)
|
||||
- Berry expose `esp_http_server` for websockets (#23206)
|
||||
- AlpineJS 2.8.2 - optional for now (#23259)
|
||||
- Support for XMODEM over serial and telnet if enabled with `#define USE_XYZMODEM`
|
||||
- PZEM_AC device address in JSON and GUI (#23268)
|
||||
- Filesystem command ``UfsList[2]``
|
||||
- ESP32 show network interface priority in `Status 5` debug logging (#23302)
|
||||
|
||||
### Breaking Changed
|
||||
- HASPmota added `y2_min` and `y2_max` to control the second series of `chart` (#23287)
|
||||
- HASPmota default theme is now Tasmota-style (#23288)
|
||||
|
||||
### Changed
|
||||
- Output of commands `GPIO` and `GPIOs` swapped
|
||||
- Smoothen light gamma curve when using `Fade` (#23230)
|
||||
- ESP32 Platform from 2025.03.30 to 2025.04.30, Framework (Arduino Core) from v3.1.3.250302 to v3.1.3.250411 and IDF from v5.3.2.250228 to 5.3.2.250403 (#23280)
|
||||
- HLK-LD2402 updates for firmware 3.3.5+ (#23281)
|
||||
|
||||
### Fixed
|
||||
- INA226 driver fixes (#23197)
|
||||
- TLS increase timeout and fix crash (#23249)
|
||||
- Berry `readline` when a line is exactly 98 characters (#23276)
|
||||
|
||||
## [14.5.0.2] 20250325
|
||||
### Added
|
||||
- Berry load `.tapp` files in `/.extensions/` then in `/` (#23113)
|
||||
- Support Vango Technologies V924x ultralow power, single-phase, power measurement (#23127)
|
||||
- Support for HLK-LD2402 24GHz smart wave motion sensor (#23133)
|
||||
- Matter prepare for ICD cluster (#23158)
|
||||
- Berry `re.dump()` (#23162)
|
||||
- Support for Telnet server using command `Telnet <0|1|port>[,<IP filter>]` if enabled with `#define USE_TELNET`
|
||||
- HASPmota autostart when `pages.jsonl` exists (#23181)
|
||||
|
||||
### Breaking Changed
|
||||
- Berry remove `Leds.create_matrix` from the standard library waiting for reimplementation (#23114)
|
||||
|
||||
### Changed
|
||||
- ESP32 Platform from 2025.02.30 to 2025.03.30, Framework (Arduino Core) from v3.1.1.250203 to v3.1.3.250302 and IDF from v5.3.2.250120 to 5.3.2.250228 (#23088)
|
||||
- ESP32 enable webcam version 2 (#18732)
|
||||
- ESP8266 enable FTP for >= 4MB variants (#23120)
|
||||
- Berry update flasher for Sonoff ZBBridge Pro (#23136)
|
||||
- Berry `re` now accepts `bytes()` as precompiled patterns, added `re.compilebytes()` (#23149)
|
||||
- RCSwitch `RCSWITCH_SEPARATION_LIMIT` from 4100 to 3600
|
||||
|
||||
### Fixed
|
||||
- Berry prevent `import` from hiding a solidified class (#23112)
|
||||
- ESP32-C3 WiFi sleep (#23096)
|
||||
- ESP32 intermittent exception on WiFi AP cannot be reached (#23115)
|
||||
- ESP32 receive incomplete serial data over 128 bytes (#23156)
|
||||
|
||||
## [14.5.0.1] 20250302
|
||||
### Added
|
||||
- Berry experimental driver for AXP2101 for M5Core2v1.1 (#23039)
|
||||
- LVGL experimental mirroring of display on Web UI (#23041)
|
||||
- Allow acl in mqtt when client certificate is in use with `#define USE_MQTT_CLIENT_CERT` (#22998)
|
||||
- Berry `tasmota.when_network_up()` and simplified Matter using it (#23057)
|
||||
- Berry `introspect.solidified()` to know if a Berry object is solidified or in RAM (#23063)
|
||||
- Berry `global.undef()` to undefine a global variable (#23073)
|
||||
|
||||
### Changed
|
||||
- LVGL, prepare for HASPmota theme, change: no-grow when clicked, DPI set to 160 (#23040)
|
||||
- LVGL Mirroring add checkbox to enable/disable the feature (in the iterim for a better solution) (#23047)
|
||||
- Leds Panel add checkbox to enable/disable the feature (in the iterim for a better solution) (#23048)
|
||||
- GPIOViewer from v1.6.1 to v1.6.2 (No functional change)
|
||||
|
||||
### Fixed
|
||||
- Too many zeros in RCSwitch received data regression from v14.4.1.4 (#23050)
|
||||
|
||||
## [14.5.0] 20250219
|
||||
- Release Ruth
|
||||
|
||||
## [14.4.1.4] 20250219
|
||||
### Added
|
||||
- Formatter `%_U` for `ext_snprintf_P()` to print uint64_t variable as decimal equivalent to `%llu`
|
||||
- Support for RC-switch decoding of 64-bit received data
|
||||
- Berry `tasmota.defer()` (#22976)
|
||||
- Support for Lithuanian language translations by zzdovydas (#22971)
|
||||
- `MqttTLS` field in `Status 6` to indicate if the MQTT connection is encrypted (#22995)
|
||||
- Support for WiZ Smart Remote using `#define USE_WIZMOTE` and command `SetOption164 1`
|
||||
- Berry `bytes().appendb64()` (#22767)
|
||||
|
||||
### Changed
|
||||
- ESP32 Platform from 2025.01.31 to 2025.02.30, Framework (Arduino Core) from v3.1.1.250109 to v3.1.1.250203 and IDF to 5.3.2 (#22943)
|
||||
- ESP32 Webcam resolution changes since v14.4.0 (#22901)
|
||||
|
||||
### Fixed
|
||||
- Berry parser error in rare case (#22997)
|
||||
- ESP32 TasMesh broker MAC address all zeros (#23005)
|
||||
- Wrong RMT channels for ESP32S3, now depends on `soc_caps.h` (#23021)
|
||||
- HASPmota exception when clicking on a checkbox (#23022)
|
||||
|
||||
## [14.4.1.3] 20250204
|
||||
### Added
|
||||
- Command `FileLog 0..4` to enable logging to filesystem using up to 16 rotating log files of 100kB (`#define FILE_LOG_SIZE 100`)
|
||||
- Command `FileLog 10..14` to enable logging to filesystem using up to 16 log files of 100kB (`#define FILE_LOG_SIZE 100`)
|
||||
- I2S Opus stream and file support for opus/aac (#22795)
|
||||
- I2S command I2sLoop (#22807)
|
||||
- Berry `serial.read()` read only `n` bytes (#22835)
|
||||
- Display template for Waveshare ESP32-C6 LCD 1.47 (#22863)
|
||||
- Berry `tasmota.global.tele_period` and `tasmota.settings.tele_period` (#22865)
|
||||
- ESP32 command `PixelType` to change the WS2812 color order and channel number (#22876)
|
||||
- Berry driver for AXP2102 and M5CoreS3 (#22878)
|
||||
- GPS driver select baudrate using GPIO GPS_RX1 (9600bps), GPS_RX2 (19200bps) or GPS_RX3 (38400bps) (#22869)
|
||||
- LVLG/HASPmota add color names from OpenHASP (#22879)
|
||||
- HASPmota support for `buttonmatrix` events (#22898)
|
||||
- Berry driver for PN532 NFC/Mifare reader (#22899)
|
||||
- Berry `tasmota.add_rule_once` and auto-remove rules with same pattern and id (#22900)
|
||||
- Berry example for HeatFan WiFi Controller
|
||||
- LVGL `lv.set_paint_cb()` to register a callback when screen is refreshed (#22909)
|
||||
- Berry `tasmota.settings` entries for PixelType (#22912)
|
||||
- Support for C8-CO2-5K CO2 sensor (#22905)
|
||||
- `#define FIX_JSON_HEXADECIMAL` to change JSON hexadecimal value "FF5F78" into "0xFF5F78" (#22919)
|
||||
|
||||
### Changed
|
||||
- ESP32 Platform from 2024.12.30 to 2025.01.30, Framework (Arduino Core) from v3.1.0.241206 to v3.1.1.250109 and IDF to 5.3.2 (#22792)
|
||||
- Allow negative values for AdcParam/AdcGpio INPUT, TEMP and RANGE parameters (#22809)
|
||||
- GPIOViewer from v1.5.9 to v1.6.0 (No functional change)
|
||||
- ESP32 Platform from 2025.01.30 to 2025.01.31 (#22832)
|
||||
- Berry `gpio.pin_mode` frees PWM on pin
|
||||
- GPIOViewer from v1.6.0 to v1.6.1 (No functional change)
|
||||
- Berry callback now passes 5 arguments instead of 4 (in line with documentation) (#22908)
|
||||
|
||||
### Fixed
|
||||
- Sonoff SPM `PowerOnState` overrules `SSPMPowerOnState` in mixed 4Relay setup with 4Relay version 1.0.0
|
||||
- ESP32-Cx compilation fails on Windows (#22832)
|
||||
- LoraWan decoding of Dragino LDS02 and MerryIoT DW10 (#22880)
|
||||
|
||||
## [14.4.1.2] 20250110
|
||||
### Added
|
||||
- Support for ESP32 Two-Wire Automotive Interface (TWAI) or Controller Area Network (CAN) busses
|
||||
- Support for Senseair S88 CO2 sensor (#22733)
|
||||
- ESP32 TasmotaLED change dynamically the number of pixels (#22754)
|
||||
- ESP32 expand `Pixels` with reverse, height and alternate (#22755)
|
||||
- Berry add light_pixels values to `tasmota.settings` (#22762)
|
||||
- Berry add `bytes().appendhex()` (#22767)
|
||||
- I2S AAC support for web radio (#22787)
|
||||
- Berry WS2812 real-time Leds panel as app (#22788)
|
||||
|
||||
### Changed
|
||||
- GPIOViewer from v1.5.8 to v1.5.9 (No functional change)
|
||||
- `Pixels` has backwards compatible arguments fixing #22755 (#22791)
|
||||
|
||||
### Fixed
|
||||
- Shutter discovery message regression from v14.4.1 (#22730)
|
||||
|
||||
## [14.4.1.1] 20241231
|
||||
### Added
|
||||
- Command ``SetOption163 1`` to disable display of Device name in GUI header
|
||||
- Berry `animate.crenel` primitive (#22673)
|
||||
- Berry scroll to Leds_matrix (#22693)
|
||||
- HASPmota support for `tabview` (#22707)
|
||||
- Berry bit-shift operators to `int64` (#22709)
|
||||
- Berry add unicode encoding to string parsing (#22713)
|
||||
- Berry `tasmota.int(v, min, max)` function (#22723)
|
||||
- Berry driver for M5Stack 8encoder (#22724)
|
||||
- Support for PCF85063 RTC (#22727)
|
||||
|
||||
### Changed
|
||||
- ESP32 disable PSRAM check (and on restart some relay toggles) with `#define DISABLE_PSRAMCHECK true` (#21266)
|
||||
- TLS disable ECDSA for MQTT to ensure we don't break fingerprints after #22649
|
||||
- GPIOViewer from v1.5.6 to v1.5.8
|
||||
- HASPmota use 'roboto.ttf' for automatic sizing of default font (#22697)
|
||||
- HASPmota add 'tag' attribute for free-form JSON (#22698)
|
||||
- Postpone save_data during light animation when fade is Off
|
||||
|
||||
### Fixed
|
||||
- Berry Zigbee fix wrong attributes (#22684)
|
||||
- Berry walrus operator (#22685)
|
||||
- Webcam compilation with `define USE_WEBCAM` but without `define ENABLE_RTSPSERVER` (#22686)
|
||||
- LVGL updated `Antiburn.tapp` (#22699)
|
||||
- Matter Air Quality sensor (#22708)
|
||||
|
||||
## [14.4.1] 20241215
|
||||
- Release Rudolph
|
||||
|
||||
## [14.4.0.1] 20241215
|
||||
### Added
|
||||
- MCP23XXX_DRV control register IOCON in template (#22622)
|
||||
- ESP32 support for TLS ECDSA (#22649)
|
||||
|
||||
### Changed
|
||||
- Berry make Leds animate calls reentrant (#22643)
|
||||
- SSL clean up remnants of old fingerprint algorithm (#22645)
|
||||
- Display removed PWM control of backlight GPIO regression from v14.1.0
|
||||
|
||||
### Fixed
|
||||
- ESP32 rules operation priority regression from v13.3.0.4 (#22636)
|
||||
- GUI display power button regression from v14.3.0.5 (#15788)
|
||||
- MCP23xxx, PCF8574 and Shift595 power control when a display is configured regression from v14.3.0.7
|
||||
- Display DisplayMode adds a display device while not configured
|
||||
- GUI timing related divide by zero exception on screen updates
|
||||
|
||||
## [14.4.0] 20241211
|
||||
- Release Rudolph
|
||||
|
||||
## [14.3.0.7] 20241211
|
||||
### Added
|
||||
- Support for TM1640 based IoTTimer by Stefan Oskamp (#21376)
|
||||
- Command `SetOption161 1` to disable display of state text (#22515)
|
||||
- ESP32 new BLE filters by name and minimum RSSI (#22530)
|
||||
- ESP32 Hybrid compile take custom boards settings in account (#22542)
|
||||
- ESP32 ULP lp_core to Berry ULP module (#22567)
|
||||
- Shelly 1 Gen3 template {"NAME":"Shelly 1 Gen3","GPIO":[0,0,0,4736,0,224,0,0,1,1,192,0,0,0,0,0,0,0,0,576,1,1],"FLAG":0,"BASE":1,"CMND":"AdcGpio3 10000,10000,4000"}
|
||||
- Shelly 1PM Gen3 template {"NAME":"Shelly 1PM Gen3","GPIO":[0,32,0,4736,224,0,3200,8161,576,1,192,0,0,0,0,0,0,0,0,1,1,1],"FLAG":0,"BASE":1,"CMND":"AdcGpio3 10000,10000,4000"}
|
||||
- Shelly 2PM Gen3 template {"NAME":"Shelly 2PM Gen3","GPIO":[9472,3458,576,225,4736,224,640,608,1,1,193,0,0,0,0,0,0,0,192,32,1,1],"FLAG":0,"BASE":1,"CMND":"AdcGpio4 10000,10000,4000"}
|
||||
- Shelly i4 Gen3 template {"NAME":"Shelly i4 Gen3","GPIO":[0,0,0,4736,32,195,194,193,1,1,192,0,0,0,0,0,0,0,0,0,1,1],"FLAG":0,"BASE":1,"CMND":"AdcGpio3 10000,10000,4000}
|
||||
- Show Active Power Total with any multi-phase energy monitoring (#22579)
|
||||
- Command `SetOption162 1` to disable adding export energy to energy today (#22578)
|
||||
- ESP32 support for WPA2/3 Enterprise conditional in core v3.1.0.241206 (#22600)
|
||||
- Support for Sonoff POWCT Energy Export Active (#22596)
|
||||
- Improved auto-selection of LED hardware support (RMT, SPI) (#22618)
|
||||
|
||||
### Breaking Changed
|
||||
- ESP32 ArtNet switches from GRB to RGB encoding (#22556)
|
||||
|
||||
### Changed
|
||||
- ESP32 max number of supported switches/buttons/relays from 28 to 32
|
||||
- ESP32 max number of interlocks from 14 to 16
|
||||
- ESP32 Platform from 2024.11.30 to 2024.11.31, Framework (Arduino Core) from v3.1.0.241030 to v3.1.0.241117 and IDF to 5.3.1.241024 (#22504)
|
||||
- Prevent active BLE operations with unencrypted MI-format beacons (#22453)
|
||||
- ESP32 replaced NeoPixelBus with TasmotaLED (#22556)
|
||||
- ESP32 Platform from 2024.11.31 to 2024.12.30, Framework (Arduino Core) from v3.1.0.241117 to v3.1.0.241206 and IDF to 5.3.2 (#22600)
|
||||
- RG-15 sensor name from RG-15 to RG15 (#22612)
|
||||
|
||||
### Fixed
|
||||
- ESP32 upgrade by file upload response based on file size (#22500)
|
||||
- Wrong GUI Module and Template drop down list indexes regression
|
||||
- Use HTML escape on File System Edit File load (#22492)
|
||||
- Magic switch applying masking window to any power change (#22535)
|
||||
- Shift595 output offsets and restart relay toggles
|
||||
- Shutter wrong power ON state (#22548)
|
||||
- ESP32-C2 TasmotaLED from not present I2S to SPI (#22575)
|
||||
- KNX Scenes index change regression from v14.2.0.4 (#22405)
|
||||
- Add GUI submenu headers and refresh configuration button text (#22592)
|
||||
- ESP8266 Device Group exception due to lack of stack space (#22271)
|
||||
|
||||
## [14.3.0.6] 20241116
|
||||
### Added
|
||||
- Add command ``WebColor20`` to control color of Button when Off
|
||||
|
||||
### Fixed
|
||||
- Matter provisioning with matter.js controller (#22470)
|
||||
- Prevent crashing when `display.ini` is missing end `#` (#22471)
|
||||
|
||||
## [14.3.0.5] 20241111
|
||||
### Added
|
||||
- ESP32 MI32 legacy add config operations (#22458)
|
||||
|
||||
### Changed
|
||||
- Redesign GUI adding feedback to buttons, shutters and lights
|
||||
- Use command `WebButton1` to change GUI shutter 1 name
|
||||
|
||||
### Removed
|
||||
- Command ``SetOption161 1`` to disable web page slider updates by commands
|
||||
|
||||
## [14.3.0.4] 20241111
|
||||
### Added
|
||||
- DALI command `DaliGroupSliders 0..16` to show GUI group sliders with feedback disabling `DaliLight`
|
||||
- Support for I2C over Serial (#22444)
|
||||
- Support KNX for scripts (#22429)
|
||||
- Support deep sleep (standby) for VL53L0X (#22441)
|
||||
- Support for MS5837 pressure and temperature sensor (#22376)
|
||||
- Berry add I2C read16/write16 supporting Little Endian (#22448)
|
||||
- Berry drivers for PCA9535 (generic and in SenseCAP D1) (#22451)
|
||||
- Shelly DALI Dimmer Gen3 template {"NAME":"Shelly DALI Dimmer Gen3","GPIO":[34,4736,0,3840,11360,11392,128,129,0,1,576,0,0,0,0,0,0,0,0,1,1,1],"FLAG":0,"BASE":1,"CMND":"AdcGpio1 10000,10000,4000}
|
||||
|
||||
### Changed
|
||||
- AHT1X/AHT2X/AHT3X ready for virtual I2C (#22427)
|
||||
- SGP4X ready for virtual I2C (#22427)
|
||||
- SCD40 reduce logging levels (#22443)
|
||||
- SCD40 ready for virtual I2C (#22443)
|
||||
- Unit (k)VAr(h) to (k)var(h) (#22435)
|
||||
|
||||
### Fixed
|
||||
- ESP32-S3 UART output mode for Tx (#22426)
|
||||
- Mitsubishi Electric HVAC Standby Stage for MiElHVAC (#22430)
|
||||
- FUNC_COMMAND linked list command buffer corruption by shutter driver
|
||||
- ESP32, ESP32-S2 and ESP32-S3 re-enable touch buttons (#22446)
|
||||
|
||||
## [14.3.0.3] 20241031
|
||||
### Added
|
||||
- Support for I2C over Serial, preliminary stub (#22388)
|
||||
|
||||
### Changed
|
||||
- ESP32 Platform from 2024.10.30 to 2024.11.30, Framework (Arduino Core) from v3.1.0.241023 to v3.1.0.241030 and IDF to 5.3.1.241024 (#22384)
|
||||
- ESP32 LVGL library from v9.2.0 to v9.2.2 (#22385)
|
||||
- Refactored `i2c_enabled` as array (#22387)
|
||||
|
||||
### Fixed
|
||||
- ESP32 Arduino Core IPv6 zones used by Matter (#22378)
|
||||
|
||||
## [14.3.0.2] 20241030
|
||||
### Added
|
||||
- DALI command `DaliGear` to set max found gear to speed up scan response
|
||||
- DALI command `DaliGroup` to add gear to groups
|
||||
- DALI command `DaliTarget` to set light control broadcast, group number or gear number
|
||||
- Mitsubishi Electric HVAC Operation time for MiElHVAC (#22334)
|
||||
- Mitsubishi Electric HVAC Outdoor Temperature for MiElHVAC (#22345)
|
||||
- Mitsubishi Electric HVAC Compressor Frequency for MiElHVAC (#22347)
|
||||
- SolaxX1 Meter mode (#22330)
|
||||
- DALI inverted signal configuration using GPIO DALI RX_i/TX_i
|
||||
- Support for Shelly DALI Dimmer Gen3 (See tips and template in file xdrv_75_dali.ino)
|
||||
- HASPmota `haspmota.get_pages()` to get the sorted list of pages (#22358)
|
||||
- Support for US AQI and EPA AQI in PMS5003x sensors (#22294)
|
||||
- HLK-LD2410 Engineering mode (#21880)
|
||||
- Support for HLK-LD2410S 24GHz smart wave motion sensor (#22253)
|
||||
- Mitsubishi Electric HVAC Auto Clear Remote Temp for MiElHVAC (#22370)
|
||||
- Command ``SetOption161 1`` to disable web page slider updates by commands
|
||||
|
||||
### Changed
|
||||
- DALI renamed commands `DaliCommission` to `DaliScan` and `DaliWeb` to `DaliLight`
|
||||
- DALI set Tasmota light control as default
|
||||
- ESP32 Framework (Arduino Core) from v3.1.0.241015 to v3.1.0.241023 (#22351)
|
||||
- Shutter optimized behavior to publish shutter data with sensor request (#22353)
|
||||
|
||||
### Fixed
|
||||
- Ethernet on -DFRAMEWORK_ARDUINO_ITEAD framework regression from v14.3.0 (#22367)
|
||||
- Alexa Hue with multiple devices (#22383)
|
||||
|
||||
### Removed
|
||||
- DALI inverted signal configuration using compile time defines
|
||||
|
||||
## [14.3.0.1] 20241022
|
||||
### Added
|
||||
- BLE track devices with RPA (#22300)
|
||||
- DALI support for short addresses and groups
|
||||
|
||||
### Changed
|
||||
- ESP32 platform update from 2024.09.30 to 2024.10.30 and Framework (Arduino Core) from v3.1.0.240926 to v3.1.0.241015 (#22299)
|
||||
- HASPmota support for page delete and object updates (#22311)
|
||||
|
||||
### Fixed
|
||||
- EQ3 TRV firmware version 1.46 fails if the default true is used in subscribe on the notify characteristic (#22328)
|
||||
|
||||
## [14.3.0] 20241015
|
||||
- Release Robert
|
||||
|
||||
## [14.2.0.6] 20241015
|
||||
### Added
|
||||
- Support for Sonoff SPM v1.3.0 (#13447)
|
||||
- LVGL port `colorwheel` from LVGL 8 (#22244)
|
||||
@ -13,13 +475,11 @@ All notable changes to this project will be documented in this file.
|
||||
- Command ``DaliSend <address>|<address+256>,<command>`` to send command (address+256 is repeat) on DALI bus
|
||||
- Command ``DaliQuery <address>|<address+256>,<command>`` to send command (address+256 is repeat) on DALI bus and wait up to DALI_TIMEOUT ms for response
|
||||
- Berry Serial `config` to change parity on-the-fly for RS-485 (#22285)
|
||||
- Misubishi Electric HVAC Heat/Dry/Cool Auto operation mode (#22216)
|
||||
- Misubishi Electric HVAC Bridge to HomeBridge/Homekit locally (#22236)
|
||||
- Misubishi Electric HVAC Air Direction Control (#22241)
|
||||
- Misubishi Electric HVAC prohibit function (#22269)
|
||||
- Misubishi Electric HVAC compressor map and operation power and energy (#22290)
|
||||
|
||||
### Breaking Changed
|
||||
- Mitsubishi Electric HVAC Heat/Dry/Cool Auto operation mode (#22216)
|
||||
- Mitsubishi Electric HVAC Bridge to HomeBridge/Homekit locally (#22236)
|
||||
- Mitsubishi Electric HVAC Air Direction Control (#22241)
|
||||
- Mitsubishi Electric HVAC prohibit function (#22269)
|
||||
- Mitsubishi Electric HVAC compressor map and operation power and energy (#22290)
|
||||
|
||||
### Changed
|
||||
- ESP32 platform update from 2024.09.10 to 2024.09.30 and Framework (Arduino Core) from v3.0.5 to v3.1.0.240926 (#22203)
|
||||
@ -137,8 +597,6 @@ All notable changes to this project will be documented in this file.
|
||||
### Removed
|
||||
- ESP8266 Analog input support using energy driver as only one channel is available
|
||||
|
||||
## [Released]
|
||||
|
||||
## [14.2.0] 20240814
|
||||
- Release Rita
|
||||
|
||||
|
@ -85,12 +85,13 @@ In addition to @arendst the following code is mainly owned by:
|
||||
| xdrv_71_magic_switch | @barbudor
|
||||
| xdrv_72_pipsolar | @chefpro
|
||||
| xdrv_73_lora | @arendst
|
||||
| xdrv_74 |
|
||||
| xdrv_74_lorawan | @arendst
|
||||
| xdrv_75_dali | @eeak, @arendst
|
||||
| xdrv_76 |
|
||||
| xdrv_77 |
|
||||
| xdrv_78 |
|
||||
| xdrv_76_serial_i2c | @s-hadinger
|
||||
| xdrv_77_wizmote | @arendst
|
||||
| xdrv_78_telnet | @arendst
|
||||
| xdrv_79_esp32_ble | @staars, @btsimonh
|
||||
| xdrv_80_wireguard_client | @s-hadinger
|
||||
| xdrv_81_esp32_webcam | @gemu, @philrich
|
||||
| xdrv_82_esp32_ethernet | @arendst
|
||||
| xdrv_83_esp32_watch | @gemu
|
||||
@ -100,11 +101,13 @@ In addition to @arendst the following code is mainly owned by:
|
||||
| xdrv_88_esp32_shelly_pro | @arendst
|
||||
| xdrv_89_ |
|
||||
| xdrv_90_esp32_dingtian_relay | @barbudor
|
||||
| xdrv_91_ |
|
||||
| xdrv_91_esp32_twai | @arendst
|
||||
| xdrv_92_ |
|
||||
| xdrv_93_ |
|
||||
| xdrv_94_ |
|
||||
| |
|
||||
| xdrv_119_i2c_ap33772s | @arendst
|
||||
| xdrv_120_xyzmodem | @arendst
|
||||
| xdrv_121_gpioviewer | @arendst
|
||||
| xdrv_122_file_settings_demo | @arendst
|
||||
| xdrv_122_file_json_settings_demo | @arendst
|
||||
@ -230,6 +233,7 @@ In addition to @arendst the following code is mainly owned by:
|
||||
| xsns_113_hc8 | Daniel Maier
|
||||
| xsns_114_amsx915 | Bastian Urschel
|
||||
| xsns_115_wooliis | Luca Melette
|
||||
| xsns_117_c8_co2_5k | @jeroenvermeulen
|
||||
| |
|
||||
| xsns_127_esp32_sensors | @arendst
|
||||
| |
|
||||
|
@ -14,11 +14,11 @@ If you like **Tasmota**, give it a star, or fork it and contribute!
|
||||
[](https://github.com/arendst/Tasmota/network)
|
||||
[](https://paypal.me/tasmota)
|
||||
|
||||
See [CHANGELOG.md](https://github.com/arendst/Tasmota/blob/development/tasmota/CHANGELOG.md) for changes since last release.
|
||||
See [CHANGELOG.md](https://github.com/arendst/Tasmota/blob/development/CHANGELOG.md) for changes since last release.
|
||||
|
||||
## Development
|
||||
|
||||
[](https://github.com/arendst/Tasmota)
|
||||
[](https://github.com/arendst/Tasmota)
|
||||
[](http://ota.tasmota.com/tasmota/)
|
||||
[](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+CI%22)
|
||||
[](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+ESP32+CI%22)
|
||||
|
@ -128,5 +128,9 @@ Index | Define | Driver | Device | Address(es) | Bus2 | Descrip
|
||||
88 | USE_QMP6988 | xsns_28 | QMP6988 | 0x56, 0x70 | Yes | Pressure and temperature sensor
|
||||
89 | USE_HX711_M5SCALES | xsns_34 | M5SCALES | 0x26 | Yes | M5Unit (Mini)Scales(HX711 STM32) U177
|
||||
90 | USE_RX8010 | xdrv_56 | RX8010 | 0x32 | Yes | RX8010 RTC from IOTTIMER
|
||||
91 | USE_MS5837 | xsns_116 | MS5837 | 0x76 | | Pressure and temperature sensor
|
||||
92 | USE_PCF85063 | xdrv_56 | PCF85063 | 0x51 | | PCF85063 Real time clock
|
||||
93 | USE_AS33772S | xdrv_119 | AS33772S | 0x52 | Yes | AS33772S USB PD Sink Controller
|
||||
94 | USE_RV3028 | xdrv_56 | RV3028 | 0x52 | Yes | RV-3028-C7 RTC Controller
|
||||
|
||||
NOTE: Bus2 supported on ESP32 only.
|
||||
|
@ -94,4 +94,4 @@ Module | LCode | Description
|
||||
06 TTGO Watch | x | TTGO Watch
|
||||
07 M5Stack Core2 | x | M5Stack Core2
|
||||
|
||||
Over 2500 additional devices are supported using [templates](TEMPLATES.md).
|
||||
Over 2800 additional devices are supported using [templates](TEMPLATES.md).
|
||||
|
@ -31,7 +31,7 @@ Firmware binaries can be downloaded from http://ota.tasmota.com/tasmota/release/
|
||||
|
||||
## Development
|
||||
|
||||
[](https://github.com/arendst/Tasmota)
|
||||
[](https://github.com/arendst/Tasmota)
|
||||
[](http://ota.tasmota.com/tasmota/)
|
||||
[](https://github.com/arendst/Tasmota/actions/workflows/build_all_the_things.yml)
|
||||
[](https://github.com/arendst/Tasmota/actions/workflows/Tasmota_build_devel.yml)
|
||||
|
122
RELEASENOTES.md
122
RELEASENOTES.md
@ -36,9 +36,9 @@ While fallback or downgrading is common practice it was never supported due to S
|
||||
|
||||
This release will be supported from ESP8266/Arduino library Core version **2.7.8** due to reported security and stability issues on previous Core version. This will also support gzipped binaries.
|
||||
|
||||
This release will be supported from ESP32/Arduino library Core version **v3.1.0.240926**.
|
||||
This release will be supported from ESP32/Arduino library Core version **v3.1.3.250504**.
|
||||
|
||||
Support of ESP8266 Core versions before 2.7.8 and ESP32 Core versions before v3.1.0.240926 have been removed.
|
||||
Support of ESP8266 Core versions before 2.7.8 and ESP32 Core versions before v3.1.3.250504 have been removed.
|
||||
|
||||
## Support of TLS
|
||||
|
||||
@ -75,12 +75,12 @@ Latest released binaries can be downloaded from
|
||||
- http://ota.tasmota.com/tasmota/release
|
||||
|
||||
Historical binaries can be downloaded from
|
||||
- http://ota.tasmota.com/tasmota/release-14.2.0
|
||||
- http://ota.tasmota.com/tasmota/release-15.0.1
|
||||
|
||||
The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota/release/tasmota.bin.gz``
|
||||
|
||||
### ESP32, ESP32-C2, ESP32-C3, ESP32-C6, ESP32-S2 and ESP32-S3 based
|
||||
The following binary downloads have been compiled with ESP32/Arduino library core version **v3.1.0.240926**.
|
||||
The following binary downloads have been compiled with ESP32/Arduino library core version **v3.1.3.250504**.
|
||||
|
||||
- **tasmota32.bin** = The Tasmota version with most drivers including additional sensors and KNX for 4M+ flash. **RECOMMENDED RELEASE BINARY**
|
||||
- **tasmota32solo1.bin** = The Tasmota version with most drivers including additional sensors and KNX for single core ESP32 and 4M+ flash.
|
||||
@ -88,7 +88,7 @@ The following binary downloads have been compiled with ESP32/Arduino library cor
|
||||
- **tasmota32s2cdc.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-S2 with serial over embedded USB CDC only and 4M+ flash.
|
||||
- **tasmota32s3.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-S3 with USB HWCDC and fallback to serial and 4M+ flash.
|
||||
- **tasmota32c2.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C2 with serial and 4M+ flash.
|
||||
- **tasmota32c3.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C2 with USB HWCDC and fallback to serial and 4M+ flash.
|
||||
- **tasmota32c3.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C3 with USB HWCDC and fallback to serial and 4M+ flash.
|
||||
- **tasmota32c6.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C6 with USB HWCDC and fallback to serial and 4M+ flash.
|
||||
- **tasmota32-AD.bin** to **tasmota32-VN.bin** = The Tasmota version in different languages for 4M+ flash.
|
||||
- **tasmota32-bluetooth.bin** = The Bluetooth version adds BLE support for 4M+ flash.
|
||||
@ -104,7 +104,7 @@ Latest released binaries can be downloaded from
|
||||
- https://ota.tasmota.com/tasmota32/release
|
||||
|
||||
Historical binaries can be downloaded from
|
||||
- https://ota.tasmota.com/tasmota32/release-14.2.0
|
||||
- https://ota.tasmota.com/tasmota32/release-15.0.1
|
||||
|
||||
The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasmota.com/tasmota32/release/tasmota32.bin``
|
||||
|
||||
@ -114,96 +114,38 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
|
||||
|
||||
[Complete list](BUILDS.md) of available feature and sensors.
|
||||
|
||||
## Changelog v14.2.0.6
|
||||
## Changelog v15.0.1.2
|
||||
### Added
|
||||
- Command ``SetOption69 1`` to enable Serial Bridge inverted Receive [#22000](https://github.com/arendst/Tasmota/issues/22000)
|
||||
- Command ``DaliWeb 1`` to enable light control for DALI broadcast address
|
||||
- Command ``DaliSend <address>|<address+256>,<command>`` to send command (address+256 is repeat) on DALI bus
|
||||
- Command ``DaliQuery <address>|<address+256>,<command>`` to send command (address+256 is repeat) on DALI bus and wait up to DALI_TIMEOUT ms for response
|
||||
- HX711 optional calibration precision option on command ``Sensor34 2 <weight in gram> <precision>`` where `<precision>` is 1 to 20 [#13983](https://github.com/arendst/Tasmota/issues/13983)
|
||||
- ESP8266 support for one-wire M1601 temperature sensor on DS18x20 GPIO [#21376](https://github.com/arendst/Tasmota/issues/21376)
|
||||
- ESP8266 support for I2C CLK on GPIO16 [#22199](https://github.com/arendst/Tasmota/issues/22199)
|
||||
- Support for I2C M5Unit (Mini)Scales using HX711 driver
|
||||
- Support for DALI on ESP8266
|
||||
- Support for RX8010 RTC as used in IOTTIMER [#21376](https://github.com/arendst/Tasmota/issues/21376)
|
||||
- Support for BL0906 up to 6 channel energy monitor as used in Athom EM2/EM6 [#22167](https://github.com/arendst/Tasmota/issues/22167)
|
||||
- Support for Sonoff SPM v1.3.0 [#13447](https://github.com/arendst/Tasmota/issues/13447)
|
||||
- Energy command ``PowerSet 60,230`` to calibrate both Current and Power with known resistive load of 60W at 230V using calibrated Voltage
|
||||
- Energy command ``CurrentSet 60,230`` to calibrate both Power and Current with known resistive load of 60W at 230V using calibrated Voltage
|
||||
- ESP8266 experimental support for second I2C bus
|
||||
- MQTT warning if trying to connect without TLS on a port that normally uses TLS [#22175](https://github.com/arendst/Tasmota/issues/22175)
|
||||
- Energy Log level 4 message when (Calculated) Apparent Power is less than Active Power indicating wrong calibration [#20653](https://github.com/arendst/Tasmota/issues/20653)
|
||||
- Support nexus protocol and calculation of separation limit to rc-switch library [#21886](https://github.com/arendst/Tasmota/issues/21886)
|
||||
- KNX additional KnxTx functions and define KNX_USE_DPT9 [#22071](https://github.com/arendst/Tasmota/issues/22071)
|
||||
- SML multi TRX line [#22056](https://github.com/arendst/Tasmota/issues/22056)
|
||||
- Misubishi Electric HVAC Heat/Dry/Cool Auto operation mode [#22216](https://github.com/arendst/Tasmota/issues/22216)
|
||||
- Misubishi Electric HVAC Bridge to HomeBridge/Homekit locally [#22236](https://github.com/arendst/Tasmota/issues/22236)
|
||||
- Misubishi Electric HVAC Air Direction Control [#22241](https://github.com/arendst/Tasmota/issues/22241)
|
||||
- Misubishi Electric HVAC prohibit function [#22269](https://github.com/arendst/Tasmota/issues/22269)
|
||||
- Misubishi Electric HVAC compressor map and operation power and energy [#22290](https://github.com/arendst/Tasmota/issues/22290)
|
||||
- Zigbee Koenkk firmware 20240710 for Sonoff Zigbee ZBPro [#22076](https://github.com/arendst/Tasmota/issues/22076)
|
||||
- Berry Zigbee improvements to prepare Matter [#22083](https://github.com/arendst/Tasmota/issues/22083)
|
||||
- Berry virtual Energy driver [#22134](https://github.com/arendst/Tasmota/issues/22134)
|
||||
- Berry improve `int64` constructor [#22172](https://github.com/arendst/Tasmota/issues/22172)
|
||||
- Berry Serial `config` to change parity on-the-fly for RS-485 [#22285](https://github.com/arendst/Tasmota/issues/22285)
|
||||
- LVGL port `colorwheel` from LVGL 8 [#22244](https://github.com/arendst/Tasmota/issues/22244)
|
||||
- HASPmota `cpicker` and `msgbox` [#22244](https://github.com/arendst/Tasmota/issues/22244)
|
||||
- Matter support for Zigbee Temperature, Humidity and Pressure sensors [#22084](https://github.com/arendst/Tasmota/issues/22084)
|
||||
- Matter support for Zigbee Occupancy and Light 0/1/2 (OnOff / Dimmer / White Color Temperature) [#22110](https://github.com/arendst/Tasmota/issues/22110)
|
||||
- Commands `LoRaWanDecoder "` and `LoRaWanName "` to clear name [#23394](https://github.com/arendst/Tasmota/issues/23394)
|
||||
- Command `I2sPause` [#23646](https://github.com/arendst/Tasmota/issues/23646)
|
||||
- Support for RV3028 RTC [#23672](https://github.com/arendst/Tasmota/issues/23672)
|
||||
- Internal function 'WSContentSendRaw_P' [#23641](https://github.com/arendst/Tasmota/issues/23641)
|
||||
- Universal display driver for ZJY169S0800TG01 ST7789 280x240 [#23638](https://github.com/arendst/Tasmota/issues/23638)
|
||||
- NeoPool add Redox tank alarm [#19811](https://github.com/arendst/Tasmota/issues/19811)
|
||||
- I2S additions [#23543](https://github.com/arendst/Tasmota/issues/23543)
|
||||
- Basic support for ESP32-P4 [#23663](https://github.com/arendst/Tasmota/issues/23663)
|
||||
- ESP32-P4 command `HostedOta` [#23675](https://github.com/arendst/Tasmota/issues/23675)
|
||||
- Berry f-strings now support ':' in expression [#23618](https://github.com/arendst/Tasmota/issues/23618)
|
||||
|
||||
### Breaking Changed
|
||||
- Berry make `energy` modules changes from #21887 backwards compatible [#22046](https://github.com/arendst/Tasmota/issues/22046)
|
||||
|
||||
### Changed
|
||||
- ESP8266 platform update from 2024.06.00 to 2024.09.00 and Framework (Arduino Core) from v2.7.7 to v2.7.8 [#22199](https://github.com/arendst/Tasmota/issues/22199)
|
||||
- ESP32 platform update from 2024.08.10 to 2024.09.30 and Framework (Arduino Core) from v3.0.4 to v3.1.0.240926 [#22203](https://github.com/arendst/Tasmota/issues/22203)
|
||||
- ESP32 LVGL library from v9.1.0 to v9.2.0 [#22031](https://github.com/arendst/Tasmota/issues/22031)
|
||||
- GPIOViewer from v1.5.5 to v1.5.6
|
||||
- Add command entered to command error and command unknown message
|
||||
- Refactored I2C drivers HTU21, BH1750, SHT3x, iAQ and HYT
|
||||
- Energy BL09xx command ``CurrentSet`` input changed from Ampere to milliAmpere
|
||||
- Command ``DaliDimmer`` range from 0..254 to 0..100
|
||||
- Energy force Apparent Power equals Active Power when (Calculated) Apparent Power is less than Active Power [#20653](https://github.com/arendst/Tasmota/issues/20653)
|
||||
- Refactor and fix PID sensor (PID_USE_LOCAL_SENSOR) read race condition [#22162](https://github.com/arendst/Tasmota/issues/22162)
|
||||
- SCD30 Lowered I2C clock from 100k to 50k [#15438](https://github.com/arendst/Tasmota/issues/15438)
|
||||
- HASPmota `delete` instead of `delete()` [#22245](https://github.com/arendst/Tasmota/issues/22245)
|
||||
- ESP32 Platform from 2025.05.30 to 2025.07.31, Framework (Arduino Core) from v3.1.3.250504 to v3.1.3.250712 and IDF from v5.3.3.250501 to v5.3.3.250707 [#23685](https://github.com/arendst/Tasmota/issues/23685)
|
||||
- ESP8266 platform update from 2025.05.00 to 2025.07.00 [#23700](https://github.com/arendst/Tasmota/issues/23700)
|
||||
- OpenTherm library from v0.9.0 to v1.1.5 [#23704](https://github.com/arendst/Tasmota/issues/23704)
|
||||
- Library names [#23560](https://github.com/arendst/Tasmota/issues/23560)
|
||||
- CSS uses named colors variables [#23597](https://github.com/arendst/Tasmota/issues/23597)
|
||||
- VEML6070 and AHT2x device detection [#23581](https://github.com/arendst/Tasmota/issues/23581)
|
||||
- Domoticz supports persistent settings for all relays, keys and switches when filesystem `#define USE_UFILESYS` is enabled
|
||||
- ESP32 LoRaWan decoding won't duplicate non-decoded message if `SO147 0`
|
||||
- BLE updates for esp-nimble-cpp v2.x [#23553](https://github.com/arendst/Tasmota/issues/23553)
|
||||
|
||||
### Fixed
|
||||
- DALI received data decoding
|
||||
- Compilation exception when metrics not found [#22170](https://github.com/arendst/Tasmota/issues/22170)
|
||||
- Crash when calling TasmotaSerial destructor when initialized with incorrect arguments [#22036](https://github.com/arendst/Tasmota/issues/22036)
|
||||
- Energy calculation [#20653](https://github.com/arendst/Tasmota/issues/20653)
|
||||
- SML trx pin error [#22119](https://github.com/arendst/Tasmota/issues/22119)
|
||||
- Shutter timing registers overflow [#21966](https://github.com/arendst/Tasmota/issues/21966)
|
||||
- Shutter missing HOLD on shutterbutton [#22108](https://github.com/arendst/Tasmota/issues/22108)
|
||||
- Shutter remaining issues on shutterinvert [#22120](https://github.com/arendst/Tasmota/issues/22120)
|
||||
- PZEM continue energy monitoring when one phase fails [#21968](https://github.com/arendst/Tasmota/issues/21968)
|
||||
- BearSSL panic on ESP8266 in rare conditions [#22017](https://github.com/arendst/Tasmota/issues/22017)
|
||||
- ModbusBridge request and response logic [#22075](https://github.com/arendst/Tasmota/issues/22075)
|
||||
- Sonoff WTS01 temperature sensor shows incorrect negative temperature [#19373](https://github.com/arendst/Tasmota/issues/19373)
|
||||
- Autoconf prevent 'init.bat' from stopping on empty lines [#22158](https://github.com/arendst/Tasmota/issues/22158)
|
||||
- Zigbee extend timeout for MCU reboot from 5s to 10s [#22009](https://github.com/arendst/Tasmota/issues/22009)
|
||||
- Zigbee avoid disabling console serial on ESP32 and improved log messages [#22082](https://github.com/arendst/Tasmota/issues/22082)
|
||||
- Zigbee flashing CC2562P with latest firmware [#22117](https://github.com/arendst/Tasmota/issues/22117)
|
||||
- ESP32 Range Extender compile error with core 3.x [#22205](https://github.com/arendst/Tasmota/issues/22205)
|
||||
- ESP32 DALI compile error with core 3.x [#22214](https://github.com/arendst/Tasmota/issues/22214)
|
||||
- ESP32 Ethernet using EthClockMode 3 [#22248](https://github.com/arendst/Tasmota/issues/22248)
|
||||
- ESP32 disable SPI DMA for uDisplay (broken since esp-idf 5.3 (core 3.1.0)) [#22264](https://github.com/arendst/Tasmota/issues/22264)
|
||||
- Berry avoid `readbytes()` from crashing when file is too large [#22057](https://github.com/arendst/Tasmota/issues/22057)
|
||||
- Berry energy missing attributes [#22116](https://github.com/arendst/Tasmota/issues/22116)
|
||||
- Berry I2C to prepare M5Stack I2C STM32 based devices [#22143](https://github.com/arendst/Tasmota/issues/22143)
|
||||
- Berry improve `persist` dirty data handling [#22246](https://github.com/arendst/Tasmota/issues/22246)
|
||||
- ESP32-S3 uDisplay force cache writes to RGB display [#22222](https://github.com/arendst/Tasmota/issues/22222)
|
||||
- LVGL Added OpenHASP icons to font `montserrat-28` [#22048](https://github.com/arendst/Tasmota/issues/22048)
|
||||
- LVGL compilation of lv_menu [#22188](https://github.com/arendst/Tasmota/issues/22188)
|
||||
- HASPmota broken `changed` event [#22194](https://github.com/arendst/Tasmota/issues/22194)
|
||||
- HASPmota error when page '1' is not defined [#22220](https://github.com/arendst/Tasmota/issues/22220)
|
||||
- Matter fixed UI bug when no endpoints configured [#22008](https://github.com/arendst/Tasmota/issues/22008)
|
||||
- Matter fix when Rules are disabled [#22016](https://github.com/arendst/Tasmota/issues/22016)
|
||||
- Matter fail to report Shutter status if no shutter is configured in Tasmota [#22049](https://github.com/arendst/Tasmota/issues/22049)
|
||||
- Matter fix Waterleak broken after Berry solidification optimisation #21885 [#22052](https://github.com/arendst/Tasmota/issues/22052)
|
||||
- AHT30 sensor start with null values after deep sleep [#23624](https://github.com/arendst/Tasmota/issues/23624)
|
||||
- Berry vulnerability in JSON parsing for unicode [#23603](https://github.com/arendst/Tasmota/issues/23603)
|
||||
- Berry security issues in `int64` and improve documentation [#23605](https://github.com/arendst/Tasmota/issues/23605)
|
||||
- Berry security issues in `berry_mapping` and improve documentation [#23606](https://github.com/arendst/Tasmota/issues/23606)
|
||||
- Berry Hue regression from #23429 [#23623](https://github.com/arendst/Tasmota/issues/23623)
|
||||
- LVGL restore `lv_chart.set_range` removed in LVGL 9.3.0 in favor of `lv_chart.set_axis_range` [#23567](https://github.com/arendst/Tasmota/issues/23567)
|
||||
|
||||
### Removed
|
||||
- ESP8266 Analog input support using energy driver as only one channel is available
|
||||
- Berry remove reuse of methods for interface-like code reuse #21500 [#22055](https://github.com/arendst/Tasmota/issues/22055)
|
||||
- Berry Zigbee removed test code [#22263](https://github.com/arendst/Tasmota/issues/22263)
|
||||
|
40
TEMPLATES.md
40
TEMPLATES.md
@ -5,7 +5,7 @@
|
||||
|
||||
# Templates
|
||||
|
||||
Find below the available templates as of October 2024. More template information can be found in the [Tasmota Device Templates Repository](http://blakadder.github.io/templates)
|
||||
Find below the available templates as of June 2025. More template information can be found in the [Tasmota Device Templates Repository](http://blakadder.github.io/templates)
|
||||
|
||||
## Adapter Board
|
||||
```
|
||||
@ -186,7 +186,6 @@ LE lampUX 15W RGBCCT {"NAME":"LE lampUX 15W","GPIO":[0,0,0,0,416,419,0,0
|
||||
LightZone MeLiTec {"NAME":"LightZone MeLiTec D114 Light ","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54}
|
||||
Lohas ZN026CL10 RGBCCT {"NAME":"Lohas LED Lamp","GPIO":[0,0,0,0,417,416,0,0,419,418,420,0,0,0],"FLAG":0,"BASE":18}
|
||||
LOLAsmart Uranus White 70 cm {"NAME":"lola smart","GPIO":[0,0,0,1088,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18}
|
||||
LSC 20W 1400lm White Ambiance {"NAME":"LSC RGBCW LED","GPIO":[0,0,0,0,0,0,0,0,4064,0,4032,0,0,0],"FLAG":0,"BASE":18}
|
||||
Luminea 24W CCT {"NAME":"Luminea NX6205-944","GPIO":[0,0,0,0,0,0,0,0,449,0,416,0,0,0],"FLAG":0,"BASE":48}
|
||||
LVL 300mm Round {"NAME":"LVL 300m Round 24W Ceiling LED","GPIO":[0,0,0,0,0,416,0,0,0,449,0,0,0,0],"FLAG":0,"BASE":48}
|
||||
Nedis CCT 800lm {"NAME":"NEDIS WIFILAW10WT","GPIO":[0,0,0,0,0,0,0,0,417,0,416,0,0,0],"FLAG":0,"BASE":18}
|
||||
@ -266,6 +265,9 @@ EARU DIN Circuit Breaker 2P 63/80A eWeLink White {"NAME":"RDCBC-2P","GPIO":[32,
|
||||
Hoch Circuit Breaker 1P {"NAME":"HOCH ZJSB9","GPIO":[32,0,0,0,0,0,0,0,224,320,0,0,0,0],"FLAG":0,"BASE":18}
|
||||
Ketotek Single Phase Energy Monitor {"NAME":"Ketotek KTEM06","GPIO":[0,2272,0,2304,0,0,0,0,0,0,320,0,32,0],"FLAG":0,"BASE":54}
|
||||
Martin Jerry 30A Circuit Breaker {"NAME":"30A Breaker","GPIO":[0,0,0,0,7584,224,0,0,2720,32,2656,2624,320,0],"FLAG":0,"BASE":18}
|
||||
Nous DIN Smart Switch 16A {"NAME":"Nous D1T","GPIO":[32,1,9312,1,1,320,1,1,9313,8160,3200,544,1,1,1,1,0,1,1,1,0,0,1,1,0,0,0,0,1,1,4736,1,1,0,0,1],"FLAG":0,"BASE":1}
|
||||
Nous DIN Smart Switch 20A {"NAME":"Nous D1T","GPIO":[32,1,9312,1,1,320,1,1,9313,8160,3200,544,1,1,1,1,0,1,1,1,0,0,1,1,0,0,0,0,1,1,4736,1,1,0,0,1],"FLAG":0,"BASE":1}
|
||||
Nous DIN Smart Switch 25A {"NAME":"Nous D1T","GPIO":[32,1,9312,1,1,320,1,1,9313,8160,3200,544,1,1,1,1,0,1,1,1,0,0,1,1,0,0,0,0,1,1,4736,1,1,0,0,1],"FLAG":0,"BASE":1}
|
||||
OpenEnergyMonitor WiFi MQTT Thermostat {"NAME":"MQTT-RELAY","GPIO":[32,0,1,0,0,224,0,0,0,0,0,0,320,0],"FLAG":0,"BASE":18}
|
||||
RocketController ASTRA Controller {"NAME":"ASTRA R4A4","GPIO":[1,1,1,1,576,1,1,1,480,1,1,1,3232,3200,1,1,0,640,608,1,0,224,225,1152,0,0,0,0,227,226,160,161,162,0,0,163],"FLAG":0,"BASE":1}
|
||||
Shelly Pro 1 {"NAME":"Shelly Pro 1","GPIO":[0,1,0,1,768,0,0,0,672,704,736,0,0,0,5600,6214,0,0,0,5568,0,0,0,0,0,0,0,0,0,0,0,32,4736,0,160,0],"FLAG":0,"BASE":1,"CMND":"AdcParam1 2,10000,10000,3350"}
|
||||
@ -401,7 +403,6 @@ Shelly Vintage 4W 260lm 2700k {"NAME":"Shelly Vintage","GPIO":[0,0,0,0,416,0,0,
|
||||
Shelly Vintage 7W 750lm 2700k {"NAME":"Shelly Vintage","GPIO":[0,0,0,0,416,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
|
||||
Shelly Vintage 7W 750lm 2700k {"NAME":"Shelly Vintage","GPIO":[0,0,0,0,416,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
|
||||
SmartDGM 9W 806lm {"NAME":"L-WB9W1","GPIO":[0,0,0,0,0,416,0,0,160,0,0,0,0,0],"FLAG":0,"BASE":18}
|
||||
Smitch 10W 6500K {"NAME":"Smitch Ambience SB-0110","GPIO":[0,0,0,0,416,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
|
||||
Smitch 10W 6500K {"NAME":"Smitch 10W 6500K Dimmable Bulb (SB0110 - E27)","GPIO":[0,0,0,0,0,416,0,0,0,417,0,0,0,0],"FLAG":0,"BASE":1}
|
||||
TCP Smart 806lm Warm White {"NAME":"TCP Smart Clas","GPIO":[0,0,0,0,0,0,0,0,0,416,0,0,0,0],"FLAG":0,"BASE":1}
|
||||
TCP Smart 810lm Filament {"NAME":"TCP Filament","GPIO":[0,0,0,0,0,0,0,0,0,0,448,0,0,0],"FLAG":0,"BASE":18}
|
||||
@ -462,7 +463,7 @@ QS-WiFi-D01-TRIAC 150W {"NAME":"QS-WiFi-D01-TRIAC","GPIO":[0,3200,0,3232,0
|
||||
RJWF-02A {"NAME":"RJWF-02A","GPIO":[32,2272,0,2304,0,0,0,0,0,0,288,0,0,0],"FLAG":0,"BASE":54}
|
||||
Shelly Dimmer {"NAME":"Shelly Dimmer 1","GPIO":[0,3200,0,3232,5568,5600,0,0,192,0,193,288,0,4736],"FLAG":0,"BASE":18}
|
||||
Shelly Dimmer 2 {"NAME":"Shelly Dimmer 2","GPIO":[0,3200,0,3232,5568,5600,0,0,193,0,192,0,320,4736],"FLAG":0,"BASE":18}
|
||||
Shelly Plus 0-10V Dimmer {"NAME":"Shelly Plus 0-10V Dimmer","GPIO":[288,0,0,0,192,0,0,0,0,0,0,0,0,0,193,1,0,0,0,0,0,32,416,0,0,0,0,0,4736,0,0,0,0,0,0,0],"FLAG":0,"BASE":1}
|
||||
Shelly Plus 0-10V Dimmer {"NAME":"Shelly Plus 0-10V Dimmer","GPIO":[288,0,0,0,192,0,0,0,0,0,0,0,0,0,193,1,0,0,0,0,0,32,448,0,0,0,0,0,4736,0,0,0,0,0,0,0],"FLAG":0,"BASE":1}
|
||||
Sonoff D1 {"NAME":"Sonoff D1","GPIO":[1,3200,0,3232,0,0,0,0,0,320,0,0,0,0],"FLAG":0,"BASE":74}
|
||||
```
|
||||
|
||||
@ -601,6 +602,7 @@ EBERG ROT 720 Infrared {"NAME":"Tuya MCU","GPIO":[0,2272,0,2304,0,0,0,0,0,
|
||||
Klarstein Bornholm Smart 2000W {"NAME":"Klarstein Bornholm","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54}
|
||||
Kogan 1500W Panel {"NAME":"Kogan Panel Heater","GPIO":[0,0,0,0,0,0,0,0,0,2304,0,2272,0,0],"FLAG":0,"BASE":54}
|
||||
LSC Smart Connect 500W IR Panel {"NAME":"LSC Connect Smart IR Panel Heater","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54}
|
||||
Mursche 450W Infrared Heater {"NAME":"Mursche Infrared Heater","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54}
|
||||
SmartMi Electric Air {"NAME":"ZNNFJ07ZM","GPIO":[0,0,0,0,0,0,0,0,0,0,0,0,0,3200,3232,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1}
|
||||
```
|
||||
|
||||
@ -989,6 +991,8 @@ Merkury {"NAME":"Merkury Switch","GPIO":[0,0,0,0,32,0,0,0,0
|
||||
Meross MSS620 16A IP44 {"NAME":"MSS620","GPIO":[0,320,0,320,225,0,0,0,224,576,32,0,0,0],"FLAG":0,"BASE":18}
|
||||
Minoston MP22W {"NAME":"Minoston MP22W","GPIO":[0,0,0,0,320,0,0,0,224,64,0,0,0,0],"FLAG":0,"BASE":18}
|
||||
Nedis PO120 IP44 {"NAME":"WIFIPO120FWT","GPIO":[32,0,0,0,2688,2656,0,0,2624,320,224,0,0,0],"FLAG":0,"BASE":49}
|
||||
Nous A6T Smart Socket {"NAME":"NOUS A5T","GPIO":[0,3072,544,3104,0,259,0,0,225,226,224,0,35,4704],"FLAG":1,"BASE":18}
|
||||
Nous Dual Smart Socket {"NAME":"NOUS A4T","GPIO":[0,2624,0,576,2656,2720,0,0,224,225,32,0,0,0],"FLAG":0,"BASE":18}
|
||||
Obi Stecker IP44 {"NAME":"OBI-Outdoor-Socket2","GPIO":[0,0,0,0,224,32,0,0,576,288,1,1,1,1],"FLAG":0,"BASE":18}
|
||||
Oittm IP44 15A {"NAME":"Oittm Outdoor","GPIO":[576,0,320,0,2688,2656,0,0,224,2592,0,0,0,0],"FLAG":0,"BASE":57}
|
||||
Oittm Outdoor {"NAME":"Oittm Outdoor","GPIO":[32,0,0,0,0,0,0,0,0,0,320,224,1,0],"FLAG":0,"BASE":18}
|
||||
@ -1073,6 +1077,7 @@ Arlec Twin Socket with Energy Meter {"NAME":"Arlec PC287HA","GPIO":[0,32,0,320,
|
||||
Athom 16A {"NAME":"Athom Power Monitoring Plug","GPIO":[0,0,0,32,2720,2656,0,0,2624,544,224,0,0,1],"FLAG":0,"BASE":18}
|
||||
Athom 16A AU {"NAME":"Athom PG05-AU16A","GPIO":[0,0,0,32,2720,2656,0,0,2624,544,224,0,0,0],"FLAG":0,"BASE":1}
|
||||
Athom 16A AU {"NAME":"Athom Plug V2","GPIO":[0,0,0,3104,0,32,0,0,224,576,0,0,0,0],"FLAG":0,"BASE":18}
|
||||
Athom 16A AU V3 {"NAME":"Athom Plug V3","GPIO":[0,0,0,32,0,224,576,0,0,0,0,0,0,0,0,0,0,0,0,0,3104,0],"FLAG":0,"BASE":1}
|
||||
Athom 16A BR V2 {"NAME":"Athom Plug V2","GPIO":[0,0,0,3104,0,32,0,0,224,576,0,0,0,0],"FLAG":0,"BASE":18}
|
||||
Athom 16A Brazil {"NAME":"Athom PG05-BR16A","GPIO":[0,0,0,32,2720,2656,0,0,2624,544,224,0,0,0],"FLAG":0,"BASE":1}
|
||||
Athom 16A EU V2 {"NAME":"Athom Plug V2","GPIO":[0,0,0,3104,0,32,0,0,224,576,0,0,0,0],"FLAG":0,"BASE":18}
|
||||
@ -1082,8 +1087,10 @@ Athom 16A Italy {"NAME":"Athom PG05-IT16A","GPIO":[0,0,0,32,2720,26
|
||||
Athom 16A Switzerland v2 {"NAME":"Athom Plug V2","GPIO":[0,0,0,3104,0,32,0,0,224,576,0,0,0,0],"FLAG":0,"BASE":18}
|
||||
Athom 16A UK {"NAME":"Athom PG04-UK16A","GPIO":[0,0,0,32,2720,2656,0,0,2624,320,224,0,0,0],"FLAG":0,"BASE":18}
|
||||
Athom 16A UK V2 {"NAME":"Athom Plug V2","GPIO":[0,0,0,3104,0,32,0,0,224,576,0,0,0,0],"FLAG":0,"BASE":18}
|
||||
Athom 16A UK V3 {"NAME":"Athom Plug V3","GPIO":[0,0,0,32,0,224,576,0,0,0,0,0,0,0,0,0,0,0,0,0,3104,0],"FLAG":0,"BASE":1}
|
||||
Athom 16A US {"NAME":"Athom PG03-US16A","GPIO":[0,0,0,32,2720,2656,0,0,2624,288,224,0,0,0],"FLAG":0,"BASE":18}
|
||||
Athom 16A US V2 {"NAME":"Athom Plug V2","GPIO":[0,0,0,3104,0,32,0,0,224,576,0,0,0,0],"FLAG":0,"BASE":18}
|
||||
Athom 16A US V3 {"NAME":"Athom Plug V3","GPIO":[0,0,0,32,0,224,576,0,0,0,0,0,0,0,0,0,0,0,0,0,3104,0],"FLAG":0,"BASE":1}
|
||||
Atlantis {"NAME":"Atlantis Smart Plug","GPIO":[32,0,0,0,2720,2656,0,0,2624,544,224,0,0,0],"FLAG":0,"BASE":18}
|
||||
Atomi AT1217 {"NAME":"AT1217","GPIO":[0,0,0,0,320,321,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18}
|
||||
Aubess 16A {"NAME":"Aubess 16A Power Monitoring Plug","GPIO":[0,32,0,0,2720,2656,0,0,2624,320,224,0,0,0],"FLAG":0,"BASE":18}
|
||||
@ -1458,6 +1465,7 @@ Nishica SM-PW701I {"NAME":"SM-PW701I","GPIO":[1,1,1,1,1,1,1,1,224,288
|
||||
Nivian {"NAME":"Nivian Smart Socket","GPIO":[0,0,320,0,0,2688,0,0,2624,32,2656,224,0,0],"FLAG":0,"BASE":18}
|
||||
Nous A1 {"NAME":"NOUS A1","GPIO":[320,0,576,0,2656,2720,0,0,2624,32,0,224,0,0],"FLAG":0,"BASE":45}
|
||||
Nous A1T 16A {"NAME":"NOUS A1T","GPIO":[32,0,0,0,2720,2656,0,0,2624,320,224,0,0,0],"FLAG":0,"BASE":49}
|
||||
Nous A8T 10A {"NAME":"NOUS A8T","GPIO":[1,1,320,1,32,1,1,1,1,224,2624,1,1,1,1,1,0,1,1,1,0,1,2656,2720,0,0,0,0,1,1,1,1,1,0,0,1],"FLAG":0,"BASE":1}
|
||||
NX-SM112 {"NAME":"NX-SM112v3","GPIO":[0,0,0,0,2720,2656,0,0,576,32,2592,224,0,0],"FLAG":0,"BASE":45}
|
||||
NX-SM200 {"NAME":"NX-SM200","GPIO":[320,0,0,0,0,2720,0,0,224,32,2656,321,2624,0],"FLAG":0,"BASE":18}
|
||||
NX-SM210 {"NAME":"NX-SM210","GPIO":[0,32,0,0,0,0,0,0,0,320,224,0,0,0],"FLAG":0,"BASE":18}
|
||||
@ -1833,6 +1841,7 @@ ZLD64-EU-W {"NAME":"ZLD64-EU-W","GPIO":[0,320,0,32,225,224,0,0
|
||||
|
||||
## Presence Sensor
|
||||
```
|
||||
Athom Human Presence Sensor {"NAME":"Athom PS01 Sensor","GPIO":[32,0,0,0,640,608,0,0,161,3232,160,3200,576,0],"FLAG":0,"BASE":18}
|
||||
Everything Presence Lite {"NAME":"Everything Presence Lite","GPIO":[0,0,0,0,0,0,0,0,0,0,544,0,3232,3200,160,161,0,640,608,0,0,1,1,1,0,0,0,0,1,0,0,0,0,0,0,0],"FLAG":0,"BASE":1}
|
||||
Everything Presence One {"NAME":"Everything Presence One","GPIO":[0,0,0,0,0,0,0,0,0,3200,3232,160,0,1,1,1,0,0,1,1,0,608,640,0,0,0,0,0,544,161,0,0,0,0,0,0],"FLAG":0,"BASE":1,"CMND":"SO114 1 | SwitchMode1 1 | SwitchMode2 1"}
|
||||
Tuya mmWave {"NAME":"ZY-M100","GPIO":[1,1,1,1,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54,"CMND":"SO97 1 | TuyaMCU 99,1 | TuyaMCU 75,104"}
|
||||
@ -2209,7 +2218,7 @@ Rogoei EBE-QPZ04 6.5W 450lm {"NAME":"EBE-QPZ04","GPIO":[0,0,0,0,4032,0,0,0,0,0,
|
||||
Saudio 7W 700lm {"NAME":"X002BU0DOL","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18}
|
||||
Sengled {"NAME":"Sengled RGBW","GPIO":[0,0,0,0,0,0,0,0,417,416,419,418,0,0],"FLAG":0,"BASE":18}
|
||||
Shelly Duo RGBW 5W 400lm {"NAME":"Shelly Duo RGBW","GPIO":[0,0,0,0,0,419,0,0,417,416,418,0,0,0],"FLAG":0,"BASE":18}
|
||||
Shelly Duo RGBW 9W 800lm {"NAME":"Shelly Duo RGBW","GPIO":[0,0,0,0,0,419,0,0,417,416,418,0,0,0],"FLAG":0,"BASE":18}
|
||||
Shelly Duo RGBW 9W 800lm {"NAME":"Shelly Duo RGBW","GPIO":[0,0,0,0,0,419,0,0,417,416,418,0,0,4736],"FLAG":0,"BASE":18,"CMND":"AdcParam 2, 32000, 1000, 3950|SetOption37 128|SetOption106 1|SetOption107 0|WebButton1 COLOR|WebButton2 WHITE|SetOption42 85|Fade ON|Speed 2|SetOption91 1|Rule1 ON POWER2#state=1 DO POWER1 OFF ENDON ON POWER1#state=1 DO POWER2 OFF ENDON ON Dimmer1#State DO POWER2 OFF ENDON ON Dimmer2#State DO POWER1 OFF ENDON|Rule1 ON"}
|
||||
Smart 810lm {"NAME":"OOOLED 60W RGB","GPIO":[0,0,0,0,418,419,0,0,416,0,417,0,0,4704],"FLAG":0,"BASE":18}
|
||||
SmartLED 9W 400lm {"NAME":"SmartLED RGBWW","GPIO":[0,0,0,0,416,419,0,0,417,420,418,0,0,0],"FLAG":0,"BASE":18}
|
||||
Smartyfi 600lm {"NAME":"SMARTYFI 9W","GPIO":[0,0,0,0,416,419,0,0,417,0,418,0,0,0],"FLAG":0,"BASE":18}
|
||||
@ -2266,10 +2275,11 @@ Anmbest 2 Channel Inching Self-locking Switch Module {"NAME":"Generic","GPIO":[
|
||||
Aptinex IOT RelayNode 4 Channel {"NAME":"APTINEX","GPIO":[0,0,1,0,0,0,0,0,224,225,226,227,0,0],"FLAG":0,"BASE":18}
|
||||
Armtronix Quad {"NAME":"Armtronix Wifi Four Relay Board","GPIO":[1,0,0,0,224,1,0,0,225,226,227,0,1,0],"FLAG":0,"BASE":7}
|
||||
Athom 1Ch Inching/Self-locking {"NAME":"Athom R01","GPIO":[1,1,1,1,1,224,1,1,1,1,1,1,576,0],"FLAG":0,"BASE":18}
|
||||
Athom 8Ch Inching/Self-locking 10A {"NAME":"Athom R08","GPIO":[229,1,1,1,230,231,1,1,226,227,225,228,224,0],"FLAG":0,"BASE":18}
|
||||
Athom 8Ch Inching/Self-locking 10A {"NAME":"Athom 8CH Relay Board","GPIO":[0,0,228,0,229,230,1,1,226,227,225,544,1,1152,231,0,0,0,0,0,0,33,32,224,0,0,0,0,35,34,37,36,39,0,0,38],"FLAG":0,"BASE":1}
|
||||
Claudy 5V {"NAME":"CLAUDY","GPIO":[0,0,225,0,0,0,0,0,0,0,0,224,0,0],"FLAG":0,"BASE":18}
|
||||
Devantech 8x16A {"NAME":"ESP32LR88","GPIO":[0,0,231,0,32,35,0,0,229,230,228,0,33,34,36,37,0,38,39,544,0,225,226,227,0,0,0,0,0,224,3232,3200,0,0,0,0],"FLAG":0,"BASE":1}
|
||||
Dingtian 16 Channel {"NAME":"Dingtian DT-R008","GPIO":[1,9408,1,9440,1,1,1,1,1,9760,9729,9856,9792,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,9824,9952,1,1,1,0,0,1],"FLAG":0,"BASE":1}
|
||||
Dingtian 2 Channel {"NAME":"Dingtian DT-R002","GPIO":[5536,9408,225,9440,0,0,0,0,0,9952,0,0,224,0,5600,0,0,0,0,5568,0,0,0,0,0,0,0,0,576,0,0,0,160,0,0,161],"FLAG":0,"BASE":1}
|
||||
Dingtian 32 Channel {"NAME":"Dingtian DT-R008","GPIO":[1,9408,1,9440,1,1,1,1,1,9760,9731,9856,9792,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,9824,9952,1,1,1,0,0,1],"FLAG":0,"BASE":1}
|
||||
Dingtian 4 Channel {"NAME":"Dingtian DT-R004","GPIO":[0,9408,225,9440,0,0,0,0,227,9952,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,226,162,0,163,160,0,0,161],"FLAG":0,"BASE":1}
|
||||
Dingtian 8 Channel {"NAME":"Dingtian DT-R008","GPIO":[1,9408,1,9440,1,1,1,1,1,9760,9728,9856,9792,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,9824,9952,1,1,1,0,0,1],"FLAG":0,"BASE":1}
|
||||
@ -2365,6 +2375,10 @@ Connex Smart Indoor {"NAME":"Connex Siren","GPIO":[0,2272,0,2304,0,0,0,
|
||||
NEO Coolcam Temperature and Humidity 3in1 Alarm {"NAME":"Neo Siren 3in1","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54}
|
||||
```
|
||||
|
||||
## Smart Meter
|
||||
```
|
||||
```
|
||||
|
||||
## Smoke Sensor
|
||||
```
|
||||
Nedis Smoke Detector {"NAME":"Nedis WIFIDS10WT","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54}
|
||||
@ -2441,7 +2455,6 @@ Connect SmartHome 3 Gang Wall Switch () {"NAME":"CSH-SWTCH3","GPIO":[0,0,288,0,
|
||||
Csmart US-B2 {"NAME":"Csmart US-B2","GPIO":[0,544,0,33,32,0,0,0,0,225,224,0,0,0],"FLAG":0,"BASE":18}
|
||||
Delock WLAN EASY-USB {"NAME":"Delock 11828","GPIO":[0,0,0,32,0,0,0,0,0,576,224,0,0,0],"FLAG":0,"BASE":53}
|
||||
Deta 1 Gang {"NAME":"Deta 1G Switch","GPIO":[0,0,0,0,544,0,0,0,0,224,0,0,64,0],"FLAG":0,"BASE":18}
|
||||
Deta 2 Gang {"NAME":"DETA 2G Switch","GPIO":[0,0,0,0,544,0,0,0,65,224,225,0,64,0],"FLAG":0,"BASE":18}
|
||||
Deta 3 Gang {"NAME":"DETA 3G Switch","GPIO":[544,0,0,66,65,224,0,0,226,0,225,0,64,0],"FLAG":0,"BASE":18}
|
||||
Deta 4 Gang {"NAME":"Deta 4G Switch","GPIO":[576,0,0,34,33,224,0,0,226,35,225,227,32,0],"FLAG":0,"BASE":18}
|
||||
DETA Mechanism {"NAME":"Deta 6014HA","GPIO":[0,0,0,0,0,0,0,0,320,0,32,0,224,0],"FLAG":0,"BASE":18}
|
||||
@ -2636,7 +2649,7 @@ Smatrul 5A RF433MHz 4 Gang Touch {"NAME":"Smatrul RF433MHz 3 Gang Touch Switch
|
||||
Smatrul Infrared Sensor {"NAME":"WHS-2","GPIO":[0,0,0,160,288,0,0,0,0,224,0,0,0,0],"FLAG":0,"BASE":18,"CMND":"SwitchMode1 4 | SO13 1"}
|
||||
Sonoff IW101 {"NAME":"Sonoff IW101","GPIO":[32,3072,0,3104,0,0,0,0,224,544,0,0,0,0],"FLAG":0,"BASE":41}
|
||||
Sonoff SwitchMan M5-1C 1 Gang {"NAME":"Sonoff SwitchMan M5-1C-86","GPIO":[32,0,0,0,288,576,0,0,0,0,0,0,0,0,416,0,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1}
|
||||
Sonoff SwitchMan M5-2C 2 Gang {"NAME":"Sonoff SwitchMan 2C","GPIO":[0,0,0,0,32,576,0,0,0,0,0,33,0,0,416,225,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1}
|
||||
Sonoff SwitchMan M5-2C 2 Gang {"NAME":"Sonoff SwitchMan 2C","GPIO":[0,0,0,0,32,576,0,0,0,0,0,33,0,0,416,225,0,0,289,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,288],"FLAG":0,"BASE":1}
|
||||
Sonoff SwitchMan M5-3C 3 Gang {"NAME":"Sonoff M5-3C","GPIO":[33,0,0,0,32,576,0,0,0,0,0,34,0,0,416,225,0,0,226,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1}
|
||||
Sonoff T1 EU 1 Gang {"NAME":"Sonoff T1 1CH","GPIO":[32,1,1,1,0,0,0,0,224,320,0,0,0,0],"FLAG":0,"BASE":28}
|
||||
Sonoff T1 EU 2 Gang {"NAME":"Sonoff T1 2CH","GPIO":[32,1,1,1,0,225,33,0,224,320,0,0,0,0],"FLAG":0,"BASE":29}
|
||||
@ -2742,9 +2755,9 @@ ZUCZUG 3 Gang {"NAME":"2ph105626a x3","GPIO":[0,288,0,32,34,33,0,
|
||||
AGL Módulo Relé 01 Canal {"NAME":"AGL-Basic","GPIO":[0,1,0,0,224,32,0,0,0,0,320,0,0,0],"FLAG":0,"BASE":18}
|
||||
Albohes 2 Channel {"NAME":"Albohes SH-08","GPIO":[0,3200,33,3232,321,320,0,0,224,544,32,0,225,1],"FLAG":0,"BASE":18}
|
||||
Athom 10A {"NAME":"CB01-TAS-1","GPIO":[0,0,0,32,320,0,0,0,0,224,0,0,0,1],"FLAG":0,"BASE":18}
|
||||
Athom 2Ch Inching/Self-locking {"NAME":"Athom R02","GPIO":[1,1,1,1,225,224,1,1,1,1,1,1,576,0],"FLAG":0,"BASE":18}
|
||||
Athom 2Ch Inching/Self-locking {"NAME":"Athom 2CH Relay Board","GPIO":[0,0,0,0,0,0,1,1,0,0,225,544,1,1152,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0,0,0,0,32,0,0,33],"FLAG":0,"BASE":1}
|
||||
Athom 3-Way Mini Relay {"NAME":"RS01-TAS-1","GPIO":[0,0,0,32,576,0,0,0,0,224,160,0,0,0],"FLAG":0,"BASE":18}
|
||||
Athom 4Ch Inching/Self-locking 10A {"NAME":"Athom R04","GPIO":[1,1,1,1,32,576,1,1,226,227,225,1,224,0],"FLAG":0,"BASE":18}
|
||||
Athom 4Ch Inching/Self-locking 10A {"NAME":"Athom 4CH Relay Board","GPIO":[0,0,0,0,0,0,1,1,226,227,225,544,1,1152,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0,0,34,35,32,0,0,33],"FLAG":0,"BASE":1}
|
||||
Athom 4Ch Inching/Self-locking 30A {"NAME":"Athom R04-30A","GPIO":[1,1,1,1,32,576,1,1,226,227,225,1,224,0],"FLAG":0,"BASE":18}
|
||||
ATMS1601 230VAC DIN Timer/Switch {"NAME":"ATMS1601","GPIO":[1,1,1,1,544,320,1,1,224,32,1,1,1,1],"FLAG":0,"BASE":18}
|
||||
Aubess Power Monitor Switch 16A {"NAME":"Aubess with (BL0942)","GPIO":[0,3200,0,7520,0,0,0,0,160,0,224,0,0,0],"FLAG":0,"BASE":18}
|
||||
@ -2782,8 +2795,11 @@ Moes {"NAME":"Moes MS-104B","GPIO":[0,0,32,0,480,0,0,0,1
|
||||
Moes 10A {"NAME":"Moes MS-101","GPIO":[0,0,0,0,0,320,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18}
|
||||
Moes Mini 3 Gang 1/2 Way {"NAME":"Moes MS-104C","GPIO":[0,0,0,34,32,33,0,0,224,225,226,0,0,0],"FLAG":0,"BASE":18}
|
||||
Nedis 10A {"NAME":"Nedis WIFIPS10WT","GPIO":[0,0,0,0,224,0,0,0,32,321,0,288,0,0],"FLAG":0,"BASE":18}
|
||||
Nous 1 Channel {"NAME":"NOUS B1T","GPIO":[544,0,1,0,32,160,1,1,224,0,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,0,0,0,1,1,1,0,1,0,0,1],"FLAG":0,"BASE":1}
|
||||
Nous 1 Channel Touch {"NAME":"NOUS L1T","GPIO":[544,0,1,32,0,0,0,0,0,224,288,0,0,0],"FLAG":0,"BASE":1}
|
||||
Nous 1/2 Channel {"NAME":"NOUS L13T Smart Switch Module","GPIO":[1,161,1,160,225,224,1,1,544,1,32,1,1,1],"FLAG":0,"BASE":18}
|
||||
Nous 2 Channel {"NAME":"NOUS B2T","GPIO":[544,3200,1,8160,32,160,1,1,224,0,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,0,0,0,1,1,1,0,1,0,0,1],"FLAG":0,"BASE":1}
|
||||
Nous 2 Channel / Curtain {"NAME":"NOUS B3T","GPIO":[544,3200,1,8128,32,160,1,1,224,225,0,1,1,1,161,1,0,1,1,1,0,1,1,1,0,0,0,0,1,1,1,0,1,0,0,1],"FLAG":0,"BASE":1}
|
||||
Nous 2 Channel Touch {"NAME":"NOUS L2T","GPIO":[544,289,1,32,225,33,0,0,0,224,288,0,0,0],"FLAG":0,"BASE":1}
|
||||
Nova Digital Basic 1 MS101 {"NAME":"NovaDigBasic1","GPIO":[0,1,0,1,320,0,0,0,224,32,0,0,0,0],"FLAG":0,"BASE":18}
|
||||
ONiOFF Smart Switch {"NAME":"ONOFF SmartSwitch","GPIO":[1,320,1,1,1,32,0,0,224,1,1,0,0,0],"FLAG":0,"BASE":1}
|
||||
@ -2937,6 +2953,10 @@ Xenon {"NAME":"Xenon SM-PM801-K1","GPIO":[0,320,0,32,2720
|
||||
Xenon 2AC 1USB {"NAME":"Xenon SM-PW801-U1","GPIO":[0,0,0,0,288,32,0,0,224,0,225,0,226,0],"FLAG":0,"BASE":18}
|
||||
```
|
||||
|
||||
## Wall Switch
|
||||
```
|
||||
```
|
||||
|
||||
## Water Sensor
|
||||
```
|
||||
Nedis SmartLife Water Detector {"NAME":"Nedis WIFIDW10WT","GPIO":[0,2272,0,2304,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54,"CMND":"TuyaMCU 51,21"}
|
||||
|
@ -41,6 +41,11 @@
|
||||
"download": {
|
||||
"speed": 230400
|
||||
},
|
||||
"espidf": {
|
||||
"custom_sdkconfig": [
|
||||
"CONFIG_FREERTOS_UNICORE=y"
|
||||
]
|
||||
},
|
||||
"url": "https://www.espressif.com/sites/default/files/documentation/esp32-solo-1_datasheet_en.pdf",
|
||||
"vendor": "Espressif"
|
||||
}
|
@ -39,6 +39,6 @@
|
||||
"download": {
|
||||
"speed": 230400
|
||||
},
|
||||
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
|
||||
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp8684/esp8684-devkitm-1/user_guide.html",
|
||||
"vendor": "Espressif"
|
||||
}
|
||||
|
@ -39,6 +39,6 @@
|
||||
"download": {
|
||||
"speed": 230400
|
||||
},
|
||||
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
|
||||
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp8684/esp8684-devkitm-1/user_guide.html",
|
||||
"vendor": "Espressif"
|
||||
}
|
||||
|
45
boards/esp32p4.json
Normal file
45
boards/esp32p4.json
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"build": {
|
||||
"core": "esp32",
|
||||
"extra_flags": [
|
||||
"-DARDUINO_TASMOTA -DESP32P4 -DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=1 -DUSE_USB_CDC_CONSOLE"
|
||||
],
|
||||
"f_cpu": "360000000L",
|
||||
"f_flash": "80000000L",
|
||||
"flash_mode": "qio",
|
||||
"mcu": "esp32p4",
|
||||
"variant": "esp32p4",
|
||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
||||
},
|
||||
"connectivity": [
|
||||
"wifi",
|
||||
"bluetooth",
|
||||
"openthread",
|
||||
"ethernet"
|
||||
],
|
||||
"debug": {
|
||||
"openocd_target": "esp32p4.cfg"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"espidf"
|
||||
],
|
||||
"name": "Espressif Generic ESP32-P4 >= 4M Flash, Tasmota 2880k Code/OTA, >= 320k FS",
|
||||
"upload": {
|
||||
"arduino": {
|
||||
"flash_extra_images": [
|
||||
[
|
||||
"0x10000",
|
||||
"tasmota32p4-safeboot.bin"
|
||||
]
|
||||
]
|
||||
},
|
||||
"flash_size": "4MB",
|
||||
"maximum_ram_size": 768000,
|
||||
"maximum_size": 4194304,
|
||||
"require_upload_port": true,
|
||||
"speed": 1500000
|
||||
},
|
||||
"url": "https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32p4/esp32-p4-function-ev-board/index.html",
|
||||
"vendor": "Espressif"
|
||||
}
|
46
boards/esp32p4_ev.json
Normal file
46
boards/esp32p4_ev.json
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"build": {
|
||||
"core": "esp32",
|
||||
"extra_flags": [
|
||||
"-DARDUINO_TASMOTA -DESP32P4 -DBOARD_HAS_PSRAM -DARDUINO_USB_MODE=1 -DUSE_USB_CDC_CONSOLE"
|
||||
],
|
||||
"f_cpu": "360000000L",
|
||||
"f_flash": "80000000L",
|
||||
"flash_mode": "qio",
|
||||
"mcu": "esp32p4",
|
||||
"variant": "esp32p4",
|
||||
"partitions": "partitions/esp32_partition_app3904k_fs3392k.csv"
|
||||
},
|
||||
"connectivity": [
|
||||
"wifi",
|
||||
"bluetooth",
|
||||
"openthread",
|
||||
"ethernet"
|
||||
],
|
||||
"debug": {
|
||||
"openocd_target": "esp32p4.cfg"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"espidf"
|
||||
],
|
||||
"name": "Espressif ESP32-P4 Function EV Board",
|
||||
"upload": {
|
||||
"arduino": {
|
||||
"flash_extra_images": [
|
||||
[
|
||||
"0x10000",
|
||||
"tasmota32p4-safeboot.bin"
|
||||
]
|
||||
]
|
||||
},
|
||||
"flash_size": "16MB",
|
||||
"maximum_ram_size": 768000,
|
||||
"maximum_size": 16777216,
|
||||
"require_upload_port": true,
|
||||
"speed": 1500000
|
||||
},
|
||||
"url": "https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32p4/esp32-p4-function-ev-board/index.html",
|
||||
"vendor": "Espressif"
|
||||
}
|
||||
|
45
boards/esp32p4ser.json
Normal file
45
boards/esp32p4ser.json
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"build": {
|
||||
"core": "esp32",
|
||||
"extra_flags": [
|
||||
"-DARDUINO_TASMOTA -DESP32P4 -DBOARD_HAS_PSRAM"
|
||||
],
|
||||
"f_cpu": "360000000L",
|
||||
"f_flash": "80000000L",
|
||||
"flash_mode": "qio",
|
||||
"mcu": "esp32p4",
|
||||
"variant": "esp32p4",
|
||||
"partitions": "partitions/esp32_partition_app2880k_fs320k.csv"
|
||||
},
|
||||
"connectivity": [
|
||||
"wifi",
|
||||
"bluetooth",
|
||||
"openthread",
|
||||
"ethernet"
|
||||
],
|
||||
"debug": {
|
||||
"openocd_target": "esp32p4.cfg"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"espidf"
|
||||
],
|
||||
"name": "Espressif Generic ESP32-P4 >= 4M Flash, Tasmota 2880k Code/OTA, >= 320k FS",
|
||||
"upload": {
|
||||
"arduino": {
|
||||
"flash_extra_images": [
|
||||
[
|
||||
"0x10000",
|
||||
"tasmota32p4-safeboot.bin"
|
||||
]
|
||||
]
|
||||
},
|
||||
"flash_size": "4MB",
|
||||
"maximum_ram_size": 768000,
|
||||
"maximum_size": 4194304,
|
||||
"require_upload_port": true,
|
||||
"speed": 1500000
|
||||
},
|
||||
"url": "https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32p4/esp32-p4-function-ev-board/index.html",
|
||||
"vendor": "Espressif"
|
||||
}
|
@ -61,7 +61,7 @@
|
||||
// SPI_MOSI_DLEN_REG is not defined anymore in esp32s3
|
||||
#define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x)
|
||||
|
||||
#elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
|
||||
#elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32P4
|
||||
#define SPI_HOST SPI1_HOST
|
||||
#define HSPI_HOST SPI2_HOST
|
||||
#define VSPI_HOST SPI2_HOST /* No SPI3_host on C2/C6 */
|
||||
|
@ -177,6 +177,22 @@ char * ToBinary(uint32_t value, char *str, int32_t digits) {
|
||||
return str;
|
||||
}
|
||||
|
||||
char * U64toStr(uint64_t value, char *str) {
|
||||
// str must be at least 24 bytes long
|
||||
uint32_t i = 23;
|
||||
str[--i] = 0; // end of string
|
||||
do {
|
||||
uint64_t m = value;
|
||||
value /= 10;
|
||||
char c = m - 10 * value;
|
||||
str[--i] = c < 10 ? c + '0' : c + 'A' - 10;
|
||||
} while (value);
|
||||
if (i) {
|
||||
memmove(str, str +i, 23 -i);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
char * U64toHex(uint64_t value, char *str, uint32_t zeroleads) {
|
||||
// str must be at least 17 bytes long
|
||||
str[16] = 0; // end of string
|
||||
@ -310,6 +326,7 @@ int32_t ext_vsnprintf_P(char * out_buf, size_t buf_len, const char * fmt_P, va_l
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'B': // Pointer to SBuffer
|
||||
{
|
||||
if (cur_val < min_valid_ptr) { new_val_str = ext_invalid_mem; }
|
||||
@ -326,6 +343,7 @@ int32_t ext_vsnprintf_P(char * out_buf, size_t buf_len, const char * fmt_P, va_l
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
// '%_b' outputs a uint32_t to binary
|
||||
// '%8_b' outputs a uint8_t to binary
|
||||
case 'b': // Binary, decimals indicates the zero prefill
|
||||
@ -416,6 +434,7 @@ int32_t ext_vsnprintf_P(char * out_buf, size_t buf_len, const char * fmt_P, va_l
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
// '%_X' outputs a 64 bits unsigned int to uppercase HEX with 16 digits
|
||||
case 'X': // input is `uint64_t*`, printed as 16 hex digits (no prefix 0x)
|
||||
{
|
||||
@ -429,6 +448,20 @@ int32_t ext_vsnprintf_P(char * out_buf, size_t buf_len, const char * fmt_P, va_l
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
// '%_U' outputs a 64 bits unsigned int to decimal
|
||||
case 'U': // input is `uint64_t*`, printed as decimal
|
||||
{
|
||||
if (cur_val < min_valid_ptr) { new_val_str = ext_invalid_mem; }
|
||||
else {
|
||||
U64toStr(*(uint64_t*)cur_val, hex);
|
||||
new_val_str = copyStr(hex);
|
||||
if (new_val_str == nullptr) { goto free_allocs; }
|
||||
allocs[alloc_idx++] = new_val_str;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
*cur_val_ptr = new_val_str;
|
||||
*fmt = 's'; // replace `%_X` with `%0s` to display a string instead
|
||||
|
@ -66,11 +66,14 @@ void test_ext_snprintf_P(void) {
|
||||
Serial.printf("--> out=%s\n", c);
|
||||
ext_snprintf_P(c, sizeof(c), "Float default=%*_f, int(3)=%*_f, int(3)=%*_f, int(3)=%*_f, 6dec=%*_f", 1, &fpi, 4, &f3, -4, &f3, -4, &f31, -8, &fpi);
|
||||
Serial.printf("--> out=%s\n", c);
|
||||
uint64_t u641 = 0x1122334455667788LL;
|
||||
uint64_t u642 = 0x0123456789ABCDEFLL;
|
||||
uint64_t u643 = 0xFEDCBA9876543210LL;
|
||||
|
||||
uint64_t u641 = 0x1122334455667788LL; // 1234605616436508552
|
||||
uint64_t u642 = 0x0123456789ABCDEFLL; // 81985529216486895
|
||||
uint64_t u643 = 0xFEDCBA9876543210LL; // 18364758544493064720
|
||||
ext_snprintf_P(c, sizeof(c), "Int64 0x%_X 0x%_X 0x%_X", &u641, &u642, &u643);
|
||||
Serial.printf("--> out=%s\n", c);
|
||||
ext_snprintf_P(c, sizeof(c), "Int64 decimal %_U %_U %_U", &u641, &u642, &u643);
|
||||
Serial.printf("--> out=%s\n", c);
|
||||
|
||||
// ext_snprintf_P(c, sizeof(c), "Float default=%*_f, int(3)=%*_f, int(3)=%*_f, int(3)=%*_f, 6dec=%*_f", &fpi, &f3, &f3, &f31, &fpi);
|
||||
|
||||
|
@ -168,15 +168,25 @@ void TasmotaSerial::Esp32Begin(void) {
|
||||
if (m_speed <= 9600) {
|
||||
// At 9600, 10 chars are ~10ms
|
||||
uart_set_rx_full_threshold(m_uart, 10);
|
||||
} else {
|
||||
// At 19200, 120 chars are ~60ms
|
||||
// At 76800, 120 chars are ~15ms
|
||||
uart_set_rx_full_threshold(m_uart, 120);
|
||||
}
|
||||
/*
|
||||
} else if (m_speed < 115200) {
|
||||
// At 19200, 120 chars are ~60ms
|
||||
// At 76800, 120 chars are ~15ms
|
||||
uart_set_rx_full_threshold(m_uart, 120);
|
||||
} else {
|
||||
} else if (m_speed == 115200) {
|
||||
// At 115200, 256 chars are ~20ms
|
||||
// Zigbee requires to keep frames together, i.e. 256 bytes max
|
||||
uart_set_rx_full_threshold(m_uart, 256);
|
||||
} else {
|
||||
// At even higher speeds set 75% of the buffer
|
||||
uart_set_rx_full_threshold(m_uart, serial_buffer_size * 3 / 4);
|
||||
}
|
||||
*/
|
||||
// For bitrate below 115200, set the Rx time out to 6 chars instead of the default 10
|
||||
if (m_speed < 115200) {
|
||||
// At 76800 the timeout is ~1ms
|
||||
|
@ -1,8 +1,8 @@
|
||||
name=Unishox Compressor Decompressor highly customized and optimized for ESP8266 and Tasmota
|
||||
name=Unishox (De)Compressor
|
||||
version=1.0
|
||||
author=Arundale Ramanathan, Stephan Hadinger
|
||||
maintainer=Arun <arun@siara.cc>, Stephan <stephan.hadinger@gmail.com>
|
||||
sentence=Unishox compression for Tasmota Rules
|
||||
paragraph=It is based on Unishox hybrid encoding technique. This version has specific Unicode code removed for size.
|
||||
paragraph=It is based on Unishox hybrid encoding technique. This Tasmota version has specific Unicode code removed for size.
|
||||
url=https://github.com/siara-cc/Unishox
|
||||
architectures=esp8266,esp32
|
@ -59,7 +59,7 @@ typedef enum WiFiPhyMode
|
||||
class WiFiHelper {
|
||||
public:
|
||||
#ifdef ESP32
|
||||
static wl_status_t begin(const char* wpa2_ssid, wpa2_auth_method_t method, const char* wpa2_identity=NULL, const char* wpa2_username=NULL, const char *wpa2_password=NULL, const char* ca_pem=NULL, const char* client_crt=NULL, const char* client_key=NULL, int32_t channel=0, const uint8_t* bssid=0, bool connect=true);
|
||||
static wl_status_t begin(const char* wpa2_ssid, wpa2_auth_method_t method, const char* wpa2_identity=NULL, const char* wpa2_username=NULL, const char *wpa2_password=NULL, const char* ca_pem=NULL, const char* client_crt=NULL, const char* client_key=NULL, int ttls_phase2_type=-1, int32_t channel=0, const uint8_t* bssid=0, bool connect=true);
|
||||
#endif
|
||||
static wl_status_t begin(const char* ssid, const char *passphrase = NULL, int32_t channel = 0, const uint8_t* bssid = NULL, bool connect = true);
|
||||
static wl_status_t begin(char* ssid, char *passphrase = NULL, int32_t channel = 0, const uint8_t* bssid = NULL, bool connect = true);
|
||||
|
@ -27,19 +27,21 @@ enum LoggingLevels {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_D
|
||||
|
||||
|
||||
#ifdef USE_IPV6
|
||||
ip_addr_t dns_save4[DNS_MAX_SERVERS] = {}; // IPv4 DNS servers
|
||||
ip_addr_t dns_save6[DNS_MAX_SERVERS] = {}; // IPv6 DNS servers
|
||||
ip_addr_t dns_save4[2] = {}; // IPv4 DNS servers
|
||||
ip_addr_t dns_save6[2] = {}; // IPv6 DNS servers
|
||||
#endif // USE_IPV6
|
||||
|
||||
#include "tasmota_options.h"
|
||||
#include "lwip/dns.h"
|
||||
|
||||
wl_status_t WiFiHelper::begin(const char* wpa2_ssid, wpa2_auth_method_t method, const char* wpa2_identity, const char* wpa2_username, const char *wpa2_password, const char* ca_pem, const char* client_crt, const char* client_key, int32_t channel, const uint8_t* bssid, bool connect) {
|
||||
#if CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT
|
||||
wl_status_t WiFiHelper::begin(const char *wpa2_ssid, wpa2_auth_method_t method, const char *wpa2_identity, const char *wpa2_username, const char *wpa2_password, const char *ca_pem, const char *client_crt, const char *client_key, int ttls_phase2_type, int32_t channel, const uint8_t *bssid, bool connect) {
|
||||
WiFiHelper::scrubDNS();
|
||||
wl_status_t ret = WiFi.begin(wpa2_ssid, method, wpa2_identity, wpa2_username, wpa2_password, ca_pem, client_crt, client_key, channel, bssid, connect);
|
||||
wl_status_t ret = WiFi.begin(wpa2_ssid, method, wpa2_identity, wpa2_username, wpa2_password, ca_pem, client_crt, client_key, ttls_phase2_type, channel, bssid, connect);
|
||||
WiFiHelper::scrubDNS();
|
||||
return ret;
|
||||
}
|
||||
#endif // CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT
|
||||
|
||||
wl_status_t WiFiHelper::begin(const char* ssid, const char *passphrase, int32_t channel, const uint8_t* bssid, bool connect) {
|
||||
WiFiHelper::scrubDNS();
|
||||
@ -74,48 +76,72 @@ extern bool WifiHasIPv6(void);
|
||||
extern bool EthernetHasIPv6(void);
|
||||
|
||||
void WiFiHelper::scrubDNS(void) {
|
||||
// AddLog(LOG_LEVEL_DEBUG, "IP>1: dns_save4 %s %s dns_save6 %s %s",
|
||||
// IPAddress(&dns_save4[0]).toString().c_str(),IPAddress(&dns_save4[1]).toString().c_str(),
|
||||
// IPAddress(&dns_save6[0]).toString().c_str(),IPAddress(&dns_save6[1]).toString().c_str());
|
||||
// String dns_entry0 = IPAddress(dns_getserver(0)).toString();
|
||||
// String dns_entry1 = IPAddress(dns_getserver(1)).toString();
|
||||
|
||||
// scan DNS entries
|
||||
bool has_v4 = WifiHasIPv4() || EthernetHasIPv4();
|
||||
bool has_v6 = false;
|
||||
#ifdef USE_IPV6
|
||||
has_v6 = WifiHasIPv6() || EthernetHasIPv6();
|
||||
#endif
|
||||
// AddLog(LOG_LEVEL_DEBUG, "IP>1: DNS: (%s %s) has4/6:%i-%i", dns_entry0.c_str(), dns_entry1.c_str(), has_v4, has_v6);
|
||||
|
||||
// First pass, save values
|
||||
for (uint32_t i=0; i<DNS_MAX_SERVERS; i++) {
|
||||
#ifdef USE_IPV6
|
||||
// First pass, save values
|
||||
for (uint32_t i=0; i<2; i++) {
|
||||
const IPAddress ip_dns = IPAddress(dns_getserver(i));
|
||||
// Step 1. save valid values from DNS
|
||||
if (!ip_addr_isany_val((const ip_addr_t &)ip_dns)) {
|
||||
if (ip_dns.type() == IPv4 && has_v4) {
|
||||
ip_dns.to_ip_addr_t(&dns_save4[i]);
|
||||
// dns_save4[i] = (ip_addr_t) ip_dns; // dns entry is populated, save it in v4 slot
|
||||
if (ip_dns.type() == IPv4 && (has_v4 || !has_v6)) {
|
||||
ip_dns.to_ip_addr_t(&dns_save4[i]); // dns entry is populated, save it in v4 slot
|
||||
} else if (has_v6) {
|
||||
ip_dns.to_ip_addr_t(&dns_save6[i]);
|
||||
// dns_save6[i] = (ip_addr_t) ip_dns; // dns entry is populated, save it in v6 slot
|
||||
ip_dns.to_ip_addr_t(&dns_save6[i]); // dns entry is populated, save it in v6 slot
|
||||
}
|
||||
}
|
||||
|
||||
// Step 2. scrub addresses not supported
|
||||
if (!has_v4) { dns_save4[i] = *IP4_ADDR_ANY; }
|
||||
if (!has_v6) { dns_save6[i] = *IP_ADDR_ANY; }
|
||||
|
||||
// Step 3. restore saved value
|
||||
if (has_v4 && has_v6) { // if both IPv4 and IPv6 are active, prefer IPv4
|
||||
if (!ip_addr_isany_val(dns_save4[i])) { dns_setserver(i, &dns_save4[i]); }
|
||||
else { dns_setserver(i, &dns_save6[i]); }
|
||||
} else if (has_v4) {
|
||||
dns_setserver(i, &dns_save4[i]);
|
||||
} else if (has_v6) {
|
||||
dns_setserver(i, &dns_save6[i]);
|
||||
} else {
|
||||
dns_setserver(i, IP4_ADDR_ANY);
|
||||
}
|
||||
#endif // USE_IPV6
|
||||
}
|
||||
// AddLog(LOG_LEVEL_DEBUG, "IP>: DNS: from(%s %s) to (%s %s) has4/6:%i-%i", dns_entry0.c_str(), dns_entry1.c_str(), IPAddress(dns_getserver(0)).toString().c_str(), IPAddress(dns_getserver(1)).toString().c_str(), has_v4, has_v6);
|
||||
|
||||
// Step 2. scrub addresses not supported
|
||||
if (!has_v4 && has_v6) { // v6 only
|
||||
dns_save4[0] = *IP4_ADDR_ANY;
|
||||
dns_save4[1] = *IP4_ADDR_ANY;
|
||||
}
|
||||
if (!has_v6) {
|
||||
dns_save6[0] = *IP_ADDR_ANY;
|
||||
dns_save6[1] = *IP_ADDR_ANY;
|
||||
}
|
||||
|
||||
// Step 3. restore saved value
|
||||
if (has_v4 && has_v6) { // if both IPv4 and IPv6 are active, prefer IPv4 for first and IPv6 for second
|
||||
if (!ip_addr_isany_val(dns_save4[0])) {
|
||||
// First DNS IPv4
|
||||
dns_setserver(0, &dns_save4[0]);
|
||||
if (!ip_addr_isany_val(dns_save6[0])) {
|
||||
dns_setserver(1, &dns_save6[0]); // take first IPv6 as second DNS
|
||||
} else {
|
||||
dns_setserver(1, &dns_save4[1]); // or revert to second IPv4
|
||||
}
|
||||
} else {
|
||||
// If no DNS IPv4, use IPv6
|
||||
dns_setserver(0, &dns_save6[0]);
|
||||
dns_setserver(1, &dns_save6[1]);
|
||||
}
|
||||
} else if (has_v6) { // v6 and no v4
|
||||
dns_setserver(0, &dns_save6[0]);
|
||||
dns_setserver(1, &dns_save6[1]);
|
||||
} else { // no v6, we use v4 even if not connected
|
||||
dns_setserver(0, &dns_save4[0]);
|
||||
dns_setserver(1, &dns_save4[1]);
|
||||
}
|
||||
#endif // USE_IPV6
|
||||
// AddLog(LOG_LEVEL_DEBUG, "IP>2: DNS: from(%s %s) to (%s %s) has4/6:%i-%i", dns_entry0.c_str(), dns_entry1.c_str(), IPAddress(dns_getserver(0)).toString().c_str(), IPAddress(dns_getserver(1)).toString().c_str(), has_v4, has_v6);
|
||||
|
||||
// AddLog(LOG_LEVEL_DEBUG, "IP>2: dns_save4 %s %s dns_save6 %s %s",
|
||||
// IPAddress(&dns_save4[0]).toString().c_str(),IPAddress(&dns_save4[1]).toString().c_str(),
|
||||
// IPAddress(&dns_save6[0]).toString().c_str(),IPAddress(&dns_save6[1]).toString().c_str());
|
||||
}
|
||||
|
||||
|
||||
@ -140,6 +166,10 @@ int WiFiHelper::getPhyMode() {
|
||||
WIFI_PHY_MODE_HE20, // PHY mode for Bandwidth HE20 (11ax)
|
||||
} wifi_phy_mode_t;
|
||||
*/
|
||||
#ifndef SOC_WIFI_SUPPORTED
|
||||
// ESP32-P4 does not support PHY modes, return 0
|
||||
return 0;
|
||||
#else
|
||||
int phy_mode = 0; // "low rate|11b|11g|HT20|HT40|HE20"
|
||||
wifi_phy_mode_t WiFiMode;
|
||||
if (esp_wifi_sta_get_negotiated_phymode(&WiFiMode) == ESP_OK) {
|
||||
@ -149,9 +179,13 @@ int WiFiHelper::getPhyMode() {
|
||||
}
|
||||
}
|
||||
return phy_mode;
|
||||
# endif
|
||||
}
|
||||
|
||||
bool WiFiHelper::setPhyMode(WiFiPhyMode_t mode) {
|
||||
# ifndef SOC_WIFI_SUPPORTED
|
||||
return false; // ESP32-P4 does not support PHY modes
|
||||
# else
|
||||
uint8_t protocol_bitmap = WIFI_PROTOCOL_11B; // 1
|
||||
switch (mode) {
|
||||
#if ESP_IDF_VERSION_MAJOR >= 5
|
||||
@ -161,6 +195,7 @@ bool WiFiHelper::setPhyMode(WiFiPhyMode_t mode) {
|
||||
case 2: protocol_bitmap |= WIFI_PROTOCOL_11G; // 2
|
||||
}
|
||||
return (ESP_OK == esp_wifi_set_protocol(WIFI_IF_STA, protocol_bitmap));
|
||||
#endif // CONFIG_IDF_TARGET_ESP32P4
|
||||
}
|
||||
|
||||
void WiFiHelper::setOutputPower(int n) {
|
||||
@ -344,8 +379,11 @@ String WiFiHelper::macAddress(void) {
|
||||
#else
|
||||
uint8_t mac[6] = {0,0,0,0,0,0};
|
||||
char macStr[18] = { 0 };
|
||||
|
||||
#ifdef CONFIG_SOC_HAS_WIFI
|
||||
esp_read_mac(mac, ESP_MAC_WIFI_STA);
|
||||
#else
|
||||
esp_read_mac(mac, ESP_MAC_BASE);
|
||||
#endif // CONFIG_SOC_HAS_WIFI
|
||||
snprintf(macStr, sizeof(macStr), "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
|
||||
return String(macStr);
|
||||
#endif
|
||||
|
128
lib/default/base64-1.1.1/src/base64.cpp
Normal file
128
lib/default/base64-1.1.1/src/base64.cpp
Normal file
@ -0,0 +1,128 @@
|
||||
/**
|
||||
* Base64 encoding and decoding of strings. Uses '+' for 62, '/' for 63, '=' for padding
|
||||
*/
|
||||
|
||||
#include "base64.hpp"
|
||||
|
||||
unsigned char binary_to_base64(unsigned char v) {
|
||||
// Capital letters - 'A' is ascii 65 and base64 0
|
||||
if(v < 26) return v + 'A';
|
||||
|
||||
// Lowercase letters - 'a' is ascii 97 and base64 26
|
||||
if(v < 52) return v + 71;
|
||||
|
||||
// Digits - '0' is ascii 48 and base64 52
|
||||
if(v < 62) return v - 4;
|
||||
|
||||
// '+' is ascii 43 and base64 62
|
||||
if(v == 62) return '+';
|
||||
|
||||
// '/' is ascii 47 and base64 63
|
||||
if(v == 63) return '/';
|
||||
|
||||
return 64;
|
||||
}
|
||||
|
||||
unsigned char base64_to_binary(unsigned char c) {
|
||||
// Capital letters - 'A' is ascii 65 and base64 0
|
||||
if('A' <= c && c <= 'Z') return c - 'A';
|
||||
|
||||
// Lowercase letters - 'a' is ascii 97 and base64 26
|
||||
if('a' <= c && c <= 'z') return c - 71;
|
||||
|
||||
// Digits - '0' is ascii 48 and base64 52
|
||||
if('0' <= c && c <= '9') return c + 4;
|
||||
|
||||
// '+' is ascii 43 and base64 62
|
||||
if(c == '+') return 62;
|
||||
|
||||
// '/' is ascii 47 and base64 63
|
||||
if(c == '/') return 63;
|
||||
|
||||
return 255;
|
||||
}
|
||||
|
||||
unsigned int encode_base64_length(unsigned int input_length) {
|
||||
return (input_length + 2)/3*4;
|
||||
}
|
||||
|
||||
unsigned int decode_base64_length(unsigned char input[]) {
|
||||
unsigned char *start = input;
|
||||
|
||||
while(base64_to_binary(input[0]) < 64) {
|
||||
++input;
|
||||
}
|
||||
|
||||
unsigned int input_length = input - start;
|
||||
|
||||
unsigned int output_length = input_length/4*3;
|
||||
|
||||
switch(input_length % 4) {
|
||||
default: return output_length;
|
||||
case 2: return output_length + 1;
|
||||
case 3: return output_length + 2;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int encode_base64(unsigned char input[], unsigned int input_length, unsigned char output[]) {
|
||||
unsigned int full_sets = input_length/3;
|
||||
|
||||
// While there are still full sets of 24 bits...
|
||||
for(unsigned int i = 0; i < full_sets; ++i) {
|
||||
output[0] = binary_to_base64( input[0] >> 2);
|
||||
output[1] = binary_to_base64((input[0] & 0x03) << 4 | input[1] >> 4);
|
||||
output[2] = binary_to_base64((input[1] & 0x0F) << 2 | input[2] >> 6);
|
||||
output[3] = binary_to_base64( input[2] & 0x3F);
|
||||
|
||||
input += 3;
|
||||
output += 4;
|
||||
}
|
||||
|
||||
switch(input_length % 3) {
|
||||
case 0:
|
||||
output[0] = '\0';
|
||||
break;
|
||||
case 1:
|
||||
output[0] = binary_to_base64( input[0] >> 2);
|
||||
output[1] = binary_to_base64((input[0] & 0x03) << 4);
|
||||
output[2] = '=';
|
||||
output[3] = '=';
|
||||
output[4] = '\0';
|
||||
break;
|
||||
case 2:
|
||||
output[0] = binary_to_base64( input[0] >> 2);
|
||||
output[1] = binary_to_base64((input[0] & 0x03) << 4 | input[1] >> 4);
|
||||
output[2] = binary_to_base64((input[1] & 0x0F) << 2);
|
||||
output[3] = '=';
|
||||
output[4] = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
return encode_base64_length(input_length);
|
||||
}
|
||||
|
||||
unsigned int decode_base64(unsigned char input[], unsigned char output[]) {
|
||||
unsigned int output_length = decode_base64_length(input);
|
||||
|
||||
// While there are still full sets of 24 bits...
|
||||
for(unsigned int i = 2; i < output_length; i += 3) {
|
||||
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
|
||||
output[1] = base64_to_binary(input[1]) << 4 | base64_to_binary(input[2]) >> 2;
|
||||
output[2] = base64_to_binary(input[2]) << 6 | base64_to_binary(input[3]);
|
||||
|
||||
input += 4;
|
||||
output += 3;
|
||||
}
|
||||
|
||||
switch(output_length % 3) {
|
||||
case 1:
|
||||
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
|
||||
break;
|
||||
case 2:
|
||||
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
|
||||
output[1] = base64_to_binary(input[1]) << 4 | base64_to_binary(input[2]) >> 2;
|
||||
break;
|
||||
}
|
||||
|
||||
return output_length;
|
||||
}
|
@ -69,127 +69,4 @@ unsigned int encode_base64(unsigned char input[], unsigned int input_length, uns
|
||||
*/
|
||||
unsigned int decode_base64(unsigned char input[], unsigned char output[]);
|
||||
|
||||
unsigned char binary_to_base64(unsigned char v) {
|
||||
// Capital letters - 'A' is ascii 65 and base64 0
|
||||
if(v < 26) return v + 'A';
|
||||
|
||||
// Lowercase letters - 'a' is ascii 97 and base64 26
|
||||
if(v < 52) return v + 71;
|
||||
|
||||
// Digits - '0' is ascii 48 and base64 52
|
||||
if(v < 62) return v - 4;
|
||||
|
||||
// '+' is ascii 43 and base64 62
|
||||
if(v == 62) return '+';
|
||||
|
||||
// '/' is ascii 47 and base64 63
|
||||
if(v == 63) return '/';
|
||||
|
||||
return 64;
|
||||
}
|
||||
|
||||
unsigned char base64_to_binary(unsigned char c) {
|
||||
// Capital letters - 'A' is ascii 65 and base64 0
|
||||
if('A' <= c && c <= 'Z') return c - 'A';
|
||||
|
||||
// Lowercase letters - 'a' is ascii 97 and base64 26
|
||||
if('a' <= c && c <= 'z') return c - 71;
|
||||
|
||||
// Digits - '0' is ascii 48 and base64 52
|
||||
if('0' <= c && c <= '9') return c + 4;
|
||||
|
||||
// '+' is ascii 43 and base64 62
|
||||
if(c == '+') return 62;
|
||||
|
||||
// '/' is ascii 47 and base64 63
|
||||
if(c == '/') return 63;
|
||||
|
||||
return 255;
|
||||
}
|
||||
|
||||
unsigned int encode_base64_length(unsigned int input_length) {
|
||||
return (input_length + 2)/3*4;
|
||||
}
|
||||
|
||||
unsigned int decode_base64_length(unsigned char input[]) {
|
||||
unsigned char *start = input;
|
||||
|
||||
while(base64_to_binary(input[0]) < 64) {
|
||||
++input;
|
||||
}
|
||||
|
||||
unsigned int input_length = input - start;
|
||||
|
||||
unsigned int output_length = input_length/4*3;
|
||||
|
||||
switch(input_length % 4) {
|
||||
default: return output_length;
|
||||
case 2: return output_length + 1;
|
||||
case 3: return output_length + 2;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int encode_base64(unsigned char input[], unsigned int input_length, unsigned char output[]) {
|
||||
unsigned int full_sets = input_length/3;
|
||||
|
||||
// While there are still full sets of 24 bits...
|
||||
for(unsigned int i = 0; i < full_sets; ++i) {
|
||||
output[0] = binary_to_base64( input[0] >> 2);
|
||||
output[1] = binary_to_base64((input[0] & 0x03) << 4 | input[1] >> 4);
|
||||
output[2] = binary_to_base64((input[1] & 0x0F) << 2 | input[2] >> 6);
|
||||
output[3] = binary_to_base64( input[2] & 0x3F);
|
||||
|
||||
input += 3;
|
||||
output += 4;
|
||||
}
|
||||
|
||||
switch(input_length % 3) {
|
||||
case 0:
|
||||
output[0] = '\0';
|
||||
break;
|
||||
case 1:
|
||||
output[0] = binary_to_base64( input[0] >> 2);
|
||||
output[1] = binary_to_base64((input[0] & 0x03) << 4);
|
||||
output[2] = '=';
|
||||
output[3] = '=';
|
||||
output[4] = '\0';
|
||||
break;
|
||||
case 2:
|
||||
output[0] = binary_to_base64( input[0] >> 2);
|
||||
output[1] = binary_to_base64((input[0] & 0x03) << 4 | input[1] >> 4);
|
||||
output[2] = binary_to_base64((input[1] & 0x0F) << 2);
|
||||
output[3] = '=';
|
||||
output[4] = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
return encode_base64_length(input_length);
|
||||
}
|
||||
|
||||
unsigned int decode_base64(unsigned char input[], unsigned char output[]) {
|
||||
unsigned int output_length = decode_base64_length(input);
|
||||
|
||||
// While there are still full sets of 24 bits...
|
||||
for(unsigned int i = 2; i < output_length; i += 3) {
|
||||
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
|
||||
output[1] = base64_to_binary(input[1]) << 4 | base64_to_binary(input[2]) >> 2;
|
||||
output[2] = base64_to_binary(input[2]) << 6 | base64_to_binary(input[3]);
|
||||
|
||||
input += 4;
|
||||
output += 3;
|
||||
}
|
||||
|
||||
switch(output_length % 3) {
|
||||
case 1:
|
||||
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
|
||||
break;
|
||||
case 2:
|
||||
output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4;
|
||||
output[1] = base64_to_binary(input[1]) << 4 | base64_to_binary(input[2]) >> 2;
|
||||
break;
|
||||
}
|
||||
|
||||
return output_length;
|
||||
}
|
||||
|
||||
#endif // ifndef
|
||||
|
@ -25,9 +25,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <Arduino.h>
|
||||
|
||||
// #define strcmp_P(x, y) strcmp(x,y)
|
||||
// #define strcasecmp_P(x,y) strcasecmp(x,y)
|
||||
// #define pgm_read_byte(x) (*(uint8_t*)(x))
|
||||
#ifndef ARRAY_SIZE
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
#endif
|
||||
|
@ -18,7 +18,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma GCC optimize ("O3")
|
||||
#pragma GCC optimize ("Os")
|
||||
|
||||
#include "AudioGeneratorAAC.h"
|
||||
|
||||
|
@ -58,6 +58,10 @@
|
||||
|
||||
#include "AudioGeneratorMIDI.h"
|
||||
|
||||
#if defined(ESP32)
|
||||
// Do not build, Espressif's GCC8+ has a compiler bug
|
||||
#else // __GNUC__ == 8
|
||||
|
||||
#pragma GCC optimize ("O3")
|
||||
|
||||
#define TSF_NO_STDIO
|
||||
@ -637,3 +641,4 @@ void AudioGeneratorMIDI::MakeStreamFromAFS(AudioFileSource *src, tsf_stream *afs
|
||||
afs->size = &afs_size;
|
||||
}
|
||||
|
||||
#endif //__GNUC__ == 8
|
||||
|
@ -21,6 +21,10 @@
|
||||
#ifndef _AUDIOGENERATORMIDI_H
|
||||
#define _AUDIOGENERATORMIDI_H
|
||||
|
||||
#if defined(ESP32)
|
||||
// Do not build, Espressif's GCC8+ has a compiler bug
|
||||
#else // __GNUC__ == 8
|
||||
|
||||
#include "AudioGenerator.h"
|
||||
|
||||
#define TSF_NO_STDIO
|
||||
@ -90,7 +94,7 @@ class AudioGeneratorMIDI : public AudioGenerator
|
||||
unsigned long earliest_time = 0;
|
||||
|
||||
struct tonegen_status { /* current status of a tone generator */
|
||||
bool playing; /* is it playing? */
|
||||
bool playing; /* is it playing? */
|
||||
char track; /* if so, which track is the note from? */
|
||||
char note; /* what note is playing? */
|
||||
char instrument; /* what instrument? */
|
||||
@ -176,6 +180,7 @@ class AudioGeneratorMIDI : public AudioGenerator
|
||||
short samplesRendered[256];
|
||||
};
|
||||
|
||||
#endif //__GNUC__ == 8
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -54,7 +54,7 @@
|
||||
#define AAC_ENABLE_SBR 1
|
||||
#endif
|
||||
|
||||
#pragma GCC optimize ("O3")
|
||||
#pragma GCC optimize ("Os")
|
||||
|
||||
#include "aacdec.h"
|
||||
#include "statname.h"
|
||||
|
@ -482,7 +482,7 @@ static int celt_plc_pitch_search(celt_sig *decode_mem[2], int C, int arch)
|
||||
int pitch_index;
|
||||
VARDECL( opus_val16, lp_pitch_buf );
|
||||
SAVE_STACK;
|
||||
opus_val16 *lp_pitch_buf = (opus_val16*)malloc((DECODE_BUFFER_SIZE>>1) * sizeof(opus_val16)); //ALLOC( lp_pitch_buf, DECODE_BUFFER_SIZE>>1, opus_val16 );
|
||||
ALLOC( lp_pitch_buf, DECODE_BUFFER_SIZE>>1, opus_val16 );
|
||||
pitch_downsample(decode_mem, lp_pitch_buf,
|
||||
DECODE_BUFFER_SIZE, C, arch);
|
||||
pitch_search(lp_pitch_buf+(PLC_PITCH_LAG_MAX>>1), lp_pitch_buf,
|
||||
@ -490,7 +490,6 @@ static int celt_plc_pitch_search(celt_sig *decode_mem[2], int C, int arch)
|
||||
PLC_PITCH_LAG_MAX-PLC_PITCH_LAG_MIN, &pitch_index, arch);
|
||||
pitch_index = PLC_PITCH_LAG_MAX-pitch_index;
|
||||
RESTORE_STACK;
|
||||
free(lp_pitch_buf);
|
||||
return pitch_index;
|
||||
}
|
||||
|
||||
|
@ -207,4 +207,3 @@
|
||||
# define __restrict__
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@ -171,7 +171,7 @@ extern "C" {
|
||||
#define OPUS_GET_IN_DTX_REQUEST 4049
|
||||
|
||||
/** Defines for the presence of extended APIs. */
|
||||
#define OPUS_HAVE_OPUS_PROJECTION_H
|
||||
// #define OPUS_HAVE_OPUS_PROJECTION_H
|
||||
|
||||
/* Macros to trigger compilation errors when the wrong types are provided to a CTL */
|
||||
#define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x))
|
||||
|
@ -239,30 +239,21 @@ opus_int32 opus_repacketizer_out(OpusRepacketizer *rp, unsigned char *data, opus
|
||||
|
||||
int opus_packet_pad(unsigned char *data, opus_int32 len, opus_int32 new_len)
|
||||
{
|
||||
OpusRepacketizer *rp = (OpusRepacketizer*)malloc(sizeof(OpusRepacketizer));
|
||||
OpusRepacketizer rp;
|
||||
opus_int32 ret;
|
||||
if (len < 1) {
|
||||
free(rp);
|
||||
if (len < 1)
|
||||
return OPUS_BAD_ARG;
|
||||
}
|
||||
if (len==new_len) {
|
||||
free(rp);
|
||||
if (len==new_len)
|
||||
return OPUS_OK;
|
||||
}
|
||||
else if (len > new_len) {
|
||||
free(rp);
|
||||
else if (len > new_len)
|
||||
return OPUS_BAD_ARG;
|
||||
}
|
||||
opus_repacketizer_init(rp);
|
||||
opus_repacketizer_init(&rp);
|
||||
/* Moving payload to the end of the packet so we can do in-place padding */
|
||||
OPUS_MOVE(data+new_len-len, data, len);
|
||||
ret = opus_repacketizer_cat(rp, data+new_len-len, len);
|
||||
if (ret != OPUS_OK) {
|
||||
free(rp);
|
||||
ret = opus_repacketizer_cat(&rp, data+new_len-len, len);
|
||||
if (ret != OPUS_OK)
|
||||
return ret;
|
||||
}
|
||||
ret = opus_repacketizer_out_range_impl(rp, 0, rp->nb_frames, data, new_len, 0, 1);
|
||||
free(rp);
|
||||
ret = opus_repacketizer_out_range_impl(&rp, 0, rp.nb_frames, data, new_len, 0, 1);
|
||||
if (ret > 0)
|
||||
return OPUS_OK;
|
||||
else
|
||||
@ -271,20 +262,15 @@ int opus_packet_pad(unsigned char *data, opus_int32 len, opus_int32 new_len)
|
||||
|
||||
opus_int32 opus_packet_unpad(unsigned char *data, opus_int32 len)
|
||||
{
|
||||
OpusRepacketizer *rp = (OpusRepacketizer*)malloc(sizeof(OpusRepacketizer));
|
||||
OpusRepacketizer rp;
|
||||
opus_int32 ret;
|
||||
if (len < 1) {
|
||||
free(rp);
|
||||
if (len < 1)
|
||||
return OPUS_BAD_ARG;
|
||||
}
|
||||
opus_repacketizer_init(rp);
|
||||
ret = opus_repacketizer_cat(rp, data, len);
|
||||
if (ret < 0) {
|
||||
free(rp);
|
||||
opus_repacketizer_init(&rp);
|
||||
ret = opus_repacketizer_cat(&rp, data, len);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
ret = opus_repacketizer_out_range_impl(rp, 0, rp->nb_frames, data, len, 0, 0);
|
||||
free(rp);
|
||||
ret = opus_repacketizer_out_range_impl(&rp, 0, rp.nb_frames, data, len, 0, 0);
|
||||
celt_assert(ret > 0 && ret <= len);
|
||||
return ret;
|
||||
}
|
||||
@ -326,14 +312,12 @@ opus_int32 opus_multistream_packet_unpad(unsigned char *data, opus_int32 len, in
|
||||
unsigned char toc;
|
||||
opus_int16 size[48];
|
||||
opus_int32 packet_offset;
|
||||
OpusRepacketizer *rp = (OpusRepacketizer*)malloc(sizeof(OpusRepacketizer));
|
||||
OpusRepacketizer rp;
|
||||
unsigned char *dst;
|
||||
opus_int32 dst_len;
|
||||
|
||||
if (len < 1){
|
||||
free(rp);
|
||||
if (len < 1)
|
||||
return OPUS_BAD_ARG;
|
||||
}
|
||||
dst = data;
|
||||
dst_len = 0;
|
||||
/* Unpad all frames */
|
||||
@ -341,34 +325,25 @@ opus_int32 opus_multistream_packet_unpad(unsigned char *data, opus_int32 len, in
|
||||
{
|
||||
opus_int32 ret;
|
||||
int self_delimited = s!=nb_streams-1;
|
||||
if (len<=0) {
|
||||
free(rp);
|
||||
if (len<=0)
|
||||
return OPUS_INVALID_PACKET;
|
||||
}
|
||||
opus_repacketizer_init(rp);
|
||||
opus_repacketizer_init(&rp);
|
||||
ret = opus_packet_parse_impl(data, len, self_delimited, &toc, NULL,
|
||||
size, NULL, &packet_offset);
|
||||
if (ret<0) {
|
||||
free(rp);
|
||||
if (ret<0)
|
||||
return ret;
|
||||
}
|
||||
ret = opus_repacketizer_cat_impl(rp, data, packet_offset, self_delimited);
|
||||
if (ret < 0) {
|
||||
free(rp);
|
||||
ret = opus_repacketizer_cat_impl(&rp, data, packet_offset, self_delimited);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
ret = opus_repacketizer_out_range_impl(rp, 0, rp->nb_frames, dst, len, self_delimited, 0);
|
||||
if (ret < 0) {
|
||||
free(rp);
|
||||
ret = opus_repacketizer_out_range_impl(&rp, 0, rp.nb_frames, dst, len, self_delimited, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
dst_len += ret;
|
||||
dst += ret;
|
||||
data += packet_offset;
|
||||
len -= packet_offset;
|
||||
}
|
||||
free(rp);
|
||||
return dst_len;
|
||||
}
|
||||
|
||||
|
@ -80,11 +80,10 @@ void silk_NLSF2A(
|
||||
};
|
||||
const unsigned char *ordering;
|
||||
opus_int k, i, dd;
|
||||
opus_int32 *cos_LSF_QA = (opus_int32*)malloc(sizeof(opus_int32) * SILK_MAX_ORDER_LPC );
|
||||
opus_int32 *P = (opus_int32*)malloc(sizeof(opus_int32) * (SILK_MAX_ORDER_LPC / 2 + 1));
|
||||
opus_int32 *Q= (opus_int32*)malloc(sizeof(opus_int32) * (SILK_MAX_ORDER_LPC / 2 + 1));
|
||||
opus_int32 cos_LSF_QA[ SILK_MAX_ORDER_LPC ];
|
||||
opus_int32 P[ SILK_MAX_ORDER_LPC / 2 + 1 ], Q[ SILK_MAX_ORDER_LPC / 2 + 1 ];
|
||||
opus_int32 Ptmp, Qtmp, f_int, f_frac, cos_val, delta;
|
||||
opus_int32 *a32_QA1 = (opus_int32*)malloc(sizeof(opus_int32) * SILK_MAX_ORDER_LPC );
|
||||
opus_int32 a32_QA1[ SILK_MAX_ORDER_LPC ];
|
||||
|
||||
silk_assert( LSF_COS_TAB_SZ_FIX == 128 );
|
||||
celt_assert( d==10 || d==16 );
|
||||
@ -138,9 +137,5 @@ void silk_NLSF2A(
|
||||
a_Q12[ k ] = (opus_int16)silk_RSHIFT_ROUND( a32_QA1[ k ], QA + 1 - 12 ); /* QA+1 -> Q12 */
|
||||
}
|
||||
}
|
||||
free(cos_LSF_QA);
|
||||
free(P);
|
||||
free(Q);
|
||||
free(a32_QA1);
|
||||
}
|
||||
|
||||
|
@ -57,12 +57,12 @@ void silk_burg_modified_c(
|
||||
opus_int k, n, s, lz, rshifts, reached_max_gain;
|
||||
opus_int32 C0, num, nrg, rc_Q31, invGain_Q30, Atmp_QA, Atmp1, tmp1, tmp2, x1, x2;
|
||||
const opus_int16 *x_ptr;
|
||||
opus_int32 *C_first_row = (opus_int32*)malloc(sizeof(opus_int32) * SILK_MAX_ORDER_LPC);
|
||||
opus_int32 *C_last_row = (opus_int32*)malloc(sizeof(opus_int32) * SILK_MAX_ORDER_LPC);
|
||||
opus_int32 *Af_QA = (opus_int32*)malloc(sizeof(opus_int32) * SILK_MAX_ORDER_LPC);
|
||||
opus_int32 *CAf = (opus_int32*)malloc(sizeof(opus_int32) * (SILK_MAX_ORDER_LPC+1));
|
||||
opus_int32 *CAb = (opus_int32*)malloc(sizeof(opus_int32) * (SILK_MAX_ORDER_LPC+1));
|
||||
opus_int32 *xcorr = (opus_int32*)malloc(sizeof(opus_int32) * SILK_MAX_ORDER_LPC);
|
||||
opus_int32 C_first_row[ SILK_MAX_ORDER_LPC ];
|
||||
opus_int32 C_last_row[ SILK_MAX_ORDER_LPC ];
|
||||
opus_int32 Af_QA[ SILK_MAX_ORDER_LPC ];
|
||||
opus_int32 CAf[ SILK_MAX_ORDER_LPC + 1 ];
|
||||
opus_int32 CAb[ SILK_MAX_ORDER_LPC + 1 ];
|
||||
opus_int32 xcorr[ SILK_MAX_ORDER_LPC ];
|
||||
opus_int64 C0_64;
|
||||
|
||||
celt_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE );
|
||||
@ -277,10 +277,4 @@ void silk_burg_modified_c(
|
||||
*res_nrg = silk_SMLAWW( nrg, silk_SMMUL( SILK_FIX_CONST( FIND_LPC_COND_FAC, 32 ), C0 ), -tmp1 );/* Q( -rshifts ) */
|
||||
*res_nrg_Q = -rshifts;
|
||||
}
|
||||
free(C_first_row);
|
||||
free(C_last_row);
|
||||
free(Af_QA);
|
||||
free(CAf);
|
||||
free(CAb);
|
||||
free(xcorr);
|
||||
}
|
||||
|
@ -49,8 +49,8 @@ void silk_warped_autocorrelation_FIX_c(
|
||||
{
|
||||
opus_int n, i, lsh;
|
||||
opus_int32 tmp1_QS, tmp2_QS;
|
||||
opus_int32 *state_QS = (opus_int32*)calloc(MAX_SHAPE_LPC_ORDER + 1, sizeof(opus_int32));
|
||||
opus_int64 *corr_QC = (opus_int64*)calloc(MAX_SHAPE_LPC_ORDER + 1, sizeof(opus_int64));
|
||||
opus_int32 state_QS[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0 };
|
||||
opus_int64 corr_QC[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0 };
|
||||
|
||||
/* Order must be even */
|
||||
celt_assert( ( order & 1 ) == 0 );
|
||||
@ -88,7 +88,5 @@ void silk_warped_autocorrelation_FIX_c(
|
||||
}
|
||||
}
|
||||
silk_assert( corr_QC[ 0 ] >= 0 ); /* If breaking, decrease QC*/
|
||||
free(state_QS);
|
||||
free(corr_QC);
|
||||
}
|
||||
#endif /* OVERRIDE_silk_warped_autocorrelation_FIX_c */
|
||||
|
@ -48,8 +48,7 @@ void silk_resampler_down2_3(
|
||||
opus_int32 *buf_ptr;
|
||||
SAVE_STACK;
|
||||
|
||||
// ALLOC( buf, RESAMPLER_MAX_BATCH_SIZE_IN + ORDER_FIR, opus_int32 );
|
||||
opus_int32 *buf = (opus_int32*)malloc((RESAMPLER_MAX_BATCH_SIZE_IN + ORDER_FIR) * sizeof(opus_int32));
|
||||
ALLOC( buf, RESAMPLER_MAX_BATCH_SIZE_IN + ORDER_FIR, opus_int32 );
|
||||
|
||||
/* Copy buffered samples to start of buffer */
|
||||
silk_memcpy( buf, S, ORDER_FIR * sizeof( opus_int32 ) );
|
||||
@ -100,6 +99,5 @@ void silk_resampler_down2_3(
|
||||
|
||||
/* Copy last part of filtered signal to the state for the next call */
|
||||
silk_memcpy( S, &buf[ nSamplesIn ], ORDER_FIR * sizeof( opus_int32 ) );
|
||||
free(buf);
|
||||
RESTORE_STACK;
|
||||
}
|
||||
|
@ -42,6 +42,16 @@
|
||||
|
||||
*/
|
||||
|
||||
// ESP32 as of 3.x has a compiler bug in this section, with the G++ generated assembly
|
||||
// being illegal. There's nothing wrong with the code here, it just looks like an
|
||||
// Xtensa backend issue. Until that's fixed, no MIDI for you!
|
||||
///home/earle/Arduino/libraries/ESP8266Audio/src/libtinysoundfont/tsf.h: In function 'void tsf_channel_midi_control(tsf*, int, int, int)':
|
||||
// /home/earle/Arduino/libraries/ESP8266Audio/src/libtinysoundfont/tsf.h:2101:1: error: insn does not satisfy its constraints:
|
||||
// 2101 | }
|
||||
// | ^
|
||||
|
||||
#if !defined(ESP32)
|
||||
|
||||
#ifndef TSF_INCLUDE_TSF_INL
|
||||
#define TSF_INCLUDE_TSF_INL
|
||||
|
||||
@ -2149,3 +2159,5 @@ TSFDEF float tsf_channel_get_tuning(tsf* f, int channel)
|
||||
#endif
|
||||
|
||||
#endif //TSF_IMPLEMENTATION
|
||||
|
||||
#endif // ! ESP32
|
||||
|
35
lib/lib_audio/ESP8266Audio/src/libwebm/.clang-format
Normal file
35
lib/lib_audio/ESP8266Audio/src/libwebm/.clang-format
Normal file
@ -0,0 +1,35 @@
|
||||
---
|
||||
Language: Cpp
|
||||
BasedOnStyle: Google
|
||||
AlignTrailingComments: false
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
|
||||
# A separate 'Other libraries' grouping is added before libwebm's headers for
|
||||
# gtest and gmock includes. This is based on the suggested grouping in the
|
||||
# Google C++ Style Guide:
|
||||
# https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
|
||||
# The other categories come from `clang-format-14 --dump-config --style=Google`.
|
||||
# See the clang-format documentation for more information on this option:
|
||||
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html#includecategories
|
||||
IncludeCategories:
|
||||
- Regex: '^<ext/.*\.h>'
|
||||
Priority: 2
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '^<.*\.h>'
|
||||
Priority: 1
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '^<.*'
|
||||
Priority: 2
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '^((<|")(gtest|gmock)/)'
|
||||
Priority: 3
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
||||
- Regex: '.*'
|
||||
Priority: 4
|
||||
SortPriority: 0
|
||||
CaseSensitive: false
|
6
lib/lib_audio/ESP8266Audio/src/libwebm/.gitattributes
vendored
Normal file
6
lib/lib_audio/ESP8266Audio/src/libwebm/.gitattributes
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
*.sln eol=crlf
|
||||
*.vcproj eol=crlf
|
||||
*.vsprops eol=crlf
|
||||
*.vcxproj eol=crlf
|
||||
*.mkv -text -diff
|
||||
*.webm -text -diff
|
36
lib/lib_audio/ESP8266Audio/src/libwebm/.gitignore
vendored
Normal file
36
lib/lib_audio/ESP8266Audio/src/libwebm/.gitignore
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
*.MKV
|
||||
*.a
|
||||
*.cmake
|
||||
*.d
|
||||
*.exe
|
||||
*.mkv
|
||||
*.ncb
|
||||
*.o
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.so*
|
||||
*.suo
|
||||
*.swp
|
||||
*.user
|
||||
*~
|
||||
.vscode
|
||||
/*.webm
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
Debug
|
||||
Makefile
|
||||
Release
|
||||
core
|
||||
dumpvtt
|
||||
ipch
|
||||
mkvmuxer_sample
|
||||
mkvmuxer_tests
|
||||
mkvparser_sample
|
||||
mkvparser_tests
|
||||
vp9_header_parser_tests
|
||||
vp9_level_stats_tests
|
||||
vttdemux
|
||||
webm2pes
|
||||
webm2pes_tests
|
||||
webm2ts
|
||||
webm_info
|
6
lib/lib_audio/ESP8266Audio/src/libwebm/.mailmap
Normal file
6
lib/lib_audio/ESP8266Audio/src/libwebm/.mailmap
Normal file
@ -0,0 +1,6 @@
|
||||
Hui Su <huisu@google.com>
|
||||
Matthew Heaney <matthewjheaney@google.com>
|
||||
Neil Birkbeck <birkbeck@google.com>
|
||||
Patrik Carlsson <patrik2.carlsson@sonymobile.com>
|
||||
Roberto Alanis Baez <alanisbaez@google.com>
|
||||
Tom Finegan <tomfinegan@google.com> <tomfinegan@chromium.org>
|
441
lib/lib_audio/ESP8266Audio/src/libwebm/.pylintrc
Normal file
441
lib/lib_audio/ESP8266Audio/src/libwebm/.pylintrc
Normal file
@ -0,0 +1,441 @@
|
||||
# This Pylint rcfile contains a best-effort configuration to uphold the
|
||||
# best-practices and style described in the Google Python style guide:
|
||||
# https://google.github.io/styleguide/pyguide.html
|
||||
#
|
||||
# Its canonical open-source location is:
|
||||
# https://google.github.io/styleguide/pylintrc
|
||||
|
||||
[MASTER]
|
||||
|
||||
# Files or directories to be skipped. They should be base names, not paths.
|
||||
ignore=third_party
|
||||
|
||||
# Files or directories matching the regex patterns are skipped. The regex
|
||||
# matches against base names, not paths.
|
||||
ignore-patterns=
|
||||
|
||||
# Pickle collected data for later comparisons.
|
||||
persistent=no
|
||||
|
||||
# List of plugins (as comma separated values of python modules names) to load,
|
||||
# usually to register additional checkers.
|
||||
load-plugins=
|
||||
|
||||
# Use multiple processes to speed up Pylint.
|
||||
jobs=4
|
||||
|
||||
# Allow loading of arbitrary C extensions. Extensions are imported into the
|
||||
# active Python interpreter and may run arbitrary code.
|
||||
unsafe-load-any-extension=no
|
||||
|
||||
|
||||
[MESSAGES CONTROL]
|
||||
|
||||
# Only show warnings with the listed confidence levels. Leave empty to show
|
||||
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
|
||||
confidence=
|
||||
|
||||
# Enable the message, report, category or checker with the given id(s). You can
|
||||
# either give multiple identifier separated by comma (,) or put this option
|
||||
# multiple time (only on the command line, not in the configuration file where
|
||||
# it should appear only once). See also the "--disable" option for examples.
|
||||
#enable=
|
||||
|
||||
# Disable the message, report, category or checker with the given id(s). You
|
||||
# can either give multiple identifiers separated by comma (,) or put this
|
||||
# option multiple times (only on the command line, not in the configuration
|
||||
# file where it should appear only once).You can also use "--disable=all" to
|
||||
# disable everything first and then reenable specific checks. For example, if
|
||||
# you want to run only the similarities checker, you can use "--disable=all
|
||||
# --enable=similarities". If you want to run only the classes checker, but have
|
||||
# no Warning level messages displayed, use"--disable=all --enable=classes
|
||||
# --disable=W"
|
||||
disable=abstract-method,
|
||||
apply-builtin,
|
||||
arguments-differ,
|
||||
attribute-defined-outside-init,
|
||||
backtick,
|
||||
bad-option-value,
|
||||
basestring-builtin,
|
||||
buffer-builtin,
|
||||
c-extension-no-member,
|
||||
consider-using-enumerate,
|
||||
cmp-builtin,
|
||||
cmp-method,
|
||||
coerce-builtin,
|
||||
coerce-method,
|
||||
delslice-method,
|
||||
div-method,
|
||||
duplicate-code,
|
||||
eq-without-hash,
|
||||
execfile-builtin,
|
||||
file-builtin,
|
||||
filter-builtin-not-iterating,
|
||||
fixme,
|
||||
getslice-method,
|
||||
global-statement,
|
||||
hex-method,
|
||||
idiv-method,
|
||||
implicit-str-concat-in-sequence,
|
||||
import-error,
|
||||
import-self,
|
||||
import-star-module-level,
|
||||
inconsistent-return-statements,
|
||||
input-builtin,
|
||||
intern-builtin,
|
||||
invalid-str-codec,
|
||||
locally-disabled,
|
||||
long-builtin,
|
||||
long-suffix,
|
||||
map-builtin-not-iterating,
|
||||
misplaced-comparison-constant,
|
||||
missing-function-docstring,
|
||||
metaclass-assignment,
|
||||
next-method-called,
|
||||
next-method-defined,
|
||||
no-absolute-import,
|
||||
no-else-break,
|
||||
no-else-continue,
|
||||
no-else-raise,
|
||||
no-else-return,
|
||||
no-init, # added
|
||||
no-member,
|
||||
no-name-in-module,
|
||||
no-self-use,
|
||||
nonzero-method,
|
||||
oct-method,
|
||||
old-division,
|
||||
old-ne-operator,
|
||||
old-octal-literal,
|
||||
old-raise-syntax,
|
||||
parameter-unpacking,
|
||||
print-statement,
|
||||
raising-string,
|
||||
range-builtin-not-iterating,
|
||||
raw_input-builtin,
|
||||
rdiv-method,
|
||||
reduce-builtin,
|
||||
relative-import,
|
||||
reload-builtin,
|
||||
round-builtin,
|
||||
setslice-method,
|
||||
signature-differs,
|
||||
standarderror-builtin,
|
||||
suppressed-message,
|
||||
sys-max-int,
|
||||
too-few-public-methods,
|
||||
too-many-ancestors,
|
||||
too-many-arguments,
|
||||
too-many-boolean-expressions,
|
||||
too-many-branches,
|
||||
too-many-instance-attributes,
|
||||
too-many-locals,
|
||||
too-many-nested-blocks,
|
||||
too-many-public-methods,
|
||||
too-many-return-statements,
|
||||
too-many-statements,
|
||||
trailing-newlines,
|
||||
unichr-builtin,
|
||||
unicode-builtin,
|
||||
unnecessary-pass,
|
||||
unpacking-in-except,
|
||||
useless-else-on-loop,
|
||||
useless-object-inheritance,
|
||||
useless-suppression,
|
||||
using-cmp-argument,
|
||||
wrong-import-order,
|
||||
xrange-builtin,
|
||||
zip-builtin-not-iterating,
|
||||
|
||||
|
||||
[REPORTS]
|
||||
|
||||
# Set the output format. Available formats are text, parseable, colorized, msvs
|
||||
# (visual studio) and html. You can also give a reporter class, eg
|
||||
# mypackage.mymodule.MyReporterClass.
|
||||
output-format=text
|
||||
|
||||
# Put messages in a separate file for each module / package specified on the
|
||||
# command line instead of printing them on stdout. Reports (if any) will be
|
||||
# written in a file name "pylint_global.[txt|html]". This option is deprecated
|
||||
# and it will be removed in Pylint 2.0.
|
||||
files-output=no
|
||||
|
||||
# Tells whether to display a full report or only the messages
|
||||
reports=no
|
||||
|
||||
# Python expression which should return a note less than 10 (10 is the highest
|
||||
# note). You have access to the variables errors warning, statement which
|
||||
# respectively contain the number of errors / warnings messages and the total
|
||||
# number of statements analyzed. This is used by the global evaluation report
|
||||
# (RP0004).
|
||||
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
|
||||
|
||||
# Template used to display messages. This is a python new-style format string
|
||||
# used to format the message information. See doc for all details
|
||||
#msg-template=
|
||||
|
||||
|
||||
[BASIC]
|
||||
|
||||
# Good variable names which should always be accepted, separated by a comma
|
||||
good-names=main,_,PRESUBMIT
|
||||
|
||||
# Bad variable names which should always be refused, separated by a comma
|
||||
bad-names=
|
||||
|
||||
# Colon-delimited sets of names that determine each other's naming style when
|
||||
# the name regexes allow several styles.
|
||||
name-group=
|
||||
|
||||
# Include a hint for the correct naming format with invalid-name
|
||||
include-naming-hint=no
|
||||
|
||||
# List of decorators that produce properties, such as abc.abstractproperty. Add
|
||||
# to this list to register other decorators that produce valid properties.
|
||||
property-classes=abc.abstractproperty,cached_property.cached_property,cached_property.threaded_cached_property,cached_property.cached_property_with_ttl,cached_property.threaded_cached_property_with_ttl
|
||||
|
||||
# Regular expression matching correct function names
|
||||
function-rgx=^(?:(?P<exempt>setUp|tearDown|setUpModule|tearDownModule)|(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$
|
||||
|
||||
# Regular expression matching correct variable names
|
||||
variable-rgx=^[a-z][a-z0-9_]*$
|
||||
|
||||
# Regular expression matching correct constant names
|
||||
const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
|
||||
|
||||
# Regular expression matching correct attribute names
|
||||
attr-rgx=^_{0,2}[a-z][a-z0-9_]*$
|
||||
|
||||
# Regular expression matching correct argument names
|
||||
argument-rgx=^[a-z][a-z0-9_]*$
|
||||
|
||||
# Regular expression matching correct class attribute names
|
||||
class-attribute-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$
|
||||
|
||||
# Regular expression matching correct inline iteration names
|
||||
inlinevar-rgx=^[a-z][a-z0-9_]*$
|
||||
|
||||
# Regular expression matching correct class names
|
||||
class-rgx=^_?[A-Z][a-zA-Z0-9]*$
|
||||
|
||||
# Regular expression matching correct module names
|
||||
module-rgx=^(_?[a-z][a-z0-9_]*|__init__)$
|
||||
|
||||
# Regular expression matching correct method names
|
||||
method-rgx=(?x)^(?:(?P<exempt>_[a-z0-9_]+__|runTest|setUp|tearDown|setUpTestCase|tearDownTestCase|setupSelf|tearDownClass|setUpClass|(test|assert)_*[A-Z0-9][a-zA-Z0-9_]*|next)|(?P<camel_case>_{0,2}[A-Z][a-zA-Z0-9_]*)|(?P<snake_case>_{0,2}[a-z][a-z0-9_]*))$
|
||||
|
||||
# Regular expression which should only match function or class names that do
|
||||
# not require a docstring.
|
||||
no-docstring-rgx=(__.*__|main|test.*|.*test|.*Test)$
|
||||
|
||||
# Minimum line length for functions/classes that require docstrings, shorter
|
||||
# ones are exempt.
|
||||
docstring-min-length=10
|
||||
|
||||
|
||||
[TYPECHECK]
|
||||
|
||||
# List of decorators that produce context managers, such as
|
||||
# contextlib.contextmanager. Add to this list to register other decorators that
|
||||
# produce valid context managers.
|
||||
contextmanager-decorators=contextlib.contextmanager,contextlib2.contextmanager
|
||||
|
||||
# Tells whether missing members accessed in mixin class should be ignored. A
|
||||
# mixin class is detected if its name ends with "mixin" (case insensitive).
|
||||
ignore-mixin-members=yes
|
||||
|
||||
# List of module names for which member attributes should not be checked
|
||||
# (useful for modules/projects where namespaces are manipulated during runtime
|
||||
# and thus existing member attributes cannot be deduced by static analysis. It
|
||||
# supports qualified module names, as well as Unix pattern matching.
|
||||
ignored-modules=
|
||||
|
||||
# List of class names for which member attributes should not be checked (useful
|
||||
# for classes with dynamically set attributes). This supports the use of
|
||||
# qualified names.
|
||||
ignored-classes=optparse.Values,thread._local,_thread._local
|
||||
|
||||
# List of members which are set dynamically and missed by pylint inference
|
||||
# system, and so shouldn't trigger E1101 when accessed. Python regular
|
||||
# expressions are accepted.
|
||||
generated-members=
|
||||
|
||||
|
||||
[FORMAT]
|
||||
|
||||
# Maximum number of characters on a single line.
|
||||
max-line-length=80
|
||||
|
||||
# TODO(https://github.com/PyCQA/pylint/issues/3352): Direct pylint to exempt
|
||||
# lines made too long by directives to pytype.
|
||||
|
||||
# Regexp for a line that is allowed to be longer than the limit.
|
||||
ignore-long-lines=(?x)(
|
||||
^\s*(\#\ )?<?https?://\S+>?$|
|
||||
^\s*(from\s+\S+\s+)?import\s+.+$)
|
||||
|
||||
# Allow the body of an if to be on the same line as the test if there is no
|
||||
# else.
|
||||
single-line-if-stmt=yes
|
||||
|
||||
# List of optional constructs for which whitespace checking is disabled. `dict-
|
||||
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
|
||||
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
|
||||
# `empty-line` allows space-only lines.
|
||||
no-space-check=
|
||||
|
||||
# Maximum number of lines in a module
|
||||
max-module-lines=99999
|
||||
|
||||
# String used as indentation unit. The internal Google style guide mandates 2
|
||||
# spaces. Google's externaly-published style guide says 4, consistent with
|
||||
# PEP 8. Here, we use 2 spaces, for conformity with many open-sourced Google
|
||||
# projects (like TensorFlow).
|
||||
indent-string=' '
|
||||
|
||||
# Number of spaces of indent required inside a hanging or continued line.
|
||||
indent-after-paren=4
|
||||
|
||||
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
|
||||
expected-line-ending-format=
|
||||
|
||||
|
||||
[MISCELLANEOUS]
|
||||
|
||||
# List of note tags to take in consideration, separated by a comma.
|
||||
notes=TODO
|
||||
|
||||
|
||||
[STRING]
|
||||
|
||||
# This flag controls whether inconsistent-quotes generates a warning when the
|
||||
# character used as a quote delimiter is used inconsistently within a module.
|
||||
check-quote-consistency=yes
|
||||
|
||||
|
||||
[VARIABLES]
|
||||
|
||||
# Tells whether we should check for unused import in __init__ files.
|
||||
init-import=no
|
||||
|
||||
# A regular expression matching the name of dummy variables (i.e. expectedly
|
||||
# not used).
|
||||
dummy-variables-rgx=^\*{0,2}(_$|unused_|dummy_)
|
||||
|
||||
# List of additional names supposed to be defined in builtins. Remember that
|
||||
# you should avoid to define new builtins when possible.
|
||||
additional-builtins=
|
||||
|
||||
# List of strings which can identify a callback function by name. A callback
|
||||
# name must start or end with one of those strings.
|
||||
callbacks=cb_,_cb
|
||||
|
||||
# List of qualified module names which can have objects that can redefine
|
||||
# builtins.
|
||||
redefining-builtins-modules=six,six.moves,past.builtins,future.builtins,functools
|
||||
|
||||
|
||||
[LOGGING]
|
||||
|
||||
# Logging modules to check that the string format arguments are in logging
|
||||
# function parameter format
|
||||
logging-modules=logging,absl.logging,tensorflow.io.logging
|
||||
|
||||
|
||||
[SIMILARITIES]
|
||||
|
||||
# Minimum lines number of a similarity.
|
||||
min-similarity-lines=4
|
||||
|
||||
# Ignore comments when computing similarities.
|
||||
ignore-comments=yes
|
||||
|
||||
# Ignore docstrings when computing similarities.
|
||||
ignore-docstrings=yes
|
||||
|
||||
# Ignore imports when computing similarities.
|
||||
ignore-imports=no
|
||||
|
||||
|
||||
[SPELLING]
|
||||
|
||||
# Spelling dictionary name. Available dictionaries: none. To make it working
|
||||
# install python-enchant package.
|
||||
spelling-dict=
|
||||
|
||||
# List of comma separated words that should not be checked.
|
||||
spelling-ignore-words=
|
||||
|
||||
# A path to a file that contains private dictionary; one word per line.
|
||||
spelling-private-dict-file=
|
||||
|
||||
# Tells whether to store unknown words to indicated private dictionary in
|
||||
# --spelling-private-dict-file option instead of raising a message.
|
||||
spelling-store-unknown-words=no
|
||||
|
||||
|
||||
[IMPORTS]
|
||||
|
||||
# Deprecated modules which should not be used, separated by a comma
|
||||
deprecated-modules=regsub,
|
||||
TERMIOS,
|
||||
Bastion,
|
||||
rexec,
|
||||
sets
|
||||
|
||||
# Create a graph of every (i.e. internal and external) dependencies in the
|
||||
# given file (report RP0402 must not be disabled)
|
||||
import-graph=
|
||||
|
||||
# Create a graph of external dependencies in the given file (report RP0402 must
|
||||
# not be disabled)
|
||||
ext-import-graph=
|
||||
|
||||
# Create a graph of internal dependencies in the given file (report RP0402 must
|
||||
# not be disabled)
|
||||
int-import-graph=
|
||||
|
||||
# Force import order to recognize a module as part of the standard
|
||||
# compatibility libraries.
|
||||
known-standard-library=
|
||||
|
||||
# Force import order to recognize a module as part of a third party library.
|
||||
known-third-party=enchant, absl
|
||||
|
||||
# Analyse import fallback blocks. This can be used to support both Python 2 and
|
||||
# 3 compatible code, which means that the block might have code that exists
|
||||
# only in one or another interpreter, leading to false positives when analysed.
|
||||
analyse-fallback-blocks=no
|
||||
|
||||
|
||||
[CLASSES]
|
||||
|
||||
# List of method names used to declare (i.e. assign) instance attributes.
|
||||
defining-attr-methods=__init__,
|
||||
__new__,
|
||||
setUp
|
||||
|
||||
# List of member names, which should be excluded from the protected access
|
||||
# warning.
|
||||
exclude-protected=_asdict,
|
||||
_fields,
|
||||
_replace,
|
||||
_source,
|
||||
_make
|
||||
|
||||
# List of valid names for the first argument in a class method.
|
||||
valid-classmethod-first-arg=cls,
|
||||
class_
|
||||
|
||||
# List of valid names for the first argument in a metaclass class method.
|
||||
valid-metaclass-classmethod-first-arg=mcs
|
||||
|
||||
|
||||
[EXCEPTIONS]
|
||||
|
||||
# Exceptions that will emit a warning when being caught. Defaults to
|
||||
# "Exception"
|
||||
overgeneral-exceptions=StandardError,
|
||||
Exception,
|
||||
BaseException
|
5
lib/lib_audio/ESP8266Audio/src/libwebm/AUTHORS.TXT
Normal file
5
lib/lib_audio/ESP8266Audio/src/libwebm/AUTHORS.TXT
Normal file
@ -0,0 +1,5 @@
|
||||
# Names should be added to this file like so:
|
||||
# Name or Organization <email address>
|
||||
|
||||
Google Inc.
|
||||
Elijah Cirioli <eli.cirioli@gmail.com>
|
41
lib/lib_audio/ESP8266Audio/src/libwebm/CONTRIBUTING.md
Normal file
41
lib/lib_audio/ESP8266Audio/src/libwebm/CONTRIBUTING.md
Normal file
@ -0,0 +1,41 @@
|
||||
# How to Contribute
|
||||
|
||||
We'd love to accept your patches and contributions to this project. There are
|
||||
just a few small guidelines you need to follow.
|
||||
|
||||
## Contributor License Agreement
|
||||
|
||||
Contributions to this project must be accompanied by a Contributor License
|
||||
Agreement. You (or your employer) retain the copyright to your contribution;
|
||||
this simply gives us permission to use and redistribute your contributions as
|
||||
part of the project. Head over to <https://cla.developers.google.com/> to see
|
||||
your current agreements on file or to sign a new one.
|
||||
|
||||
You generally only need to submit a CLA once, so if you've already submitted one
|
||||
(even if it was for a different project), you probably don't need to do it
|
||||
again.
|
||||
|
||||
## Code reviews
|
||||
|
||||
All submissions, including submissions by project members, require review. We
|
||||
use a [Gerrit](https://www.gerritcodereview.com) instance hosted at
|
||||
https://chromium-review.googlesource.com for this purpose. See the
|
||||
[WebM Project page](https://www.webmproject.org/code/contribute/submitting-patches/)
|
||||
for additional details.
|
||||
|
||||
## Code Style
|
||||
|
||||
The C++ code style is based on the
|
||||
[Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) and
|
||||
`clang-format --style=Google`. `clang-format -i --style=file` can be used to
|
||||
format individual files, it will use the settings from `.clang-format`.
|
||||
|
||||
CMake files are formatted with
|
||||
[cmake-format](https://cmake-format.readthedocs.io/en/latest/). `cmake-format
|
||||
-i` can be used to format individual files, it will use the settings from
|
||||
`.cmake-format.py`.
|
||||
|
||||
## Community Guidelines
|
||||
|
||||
This project follows
|
||||
[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).
|
30
lib/lib_audio/ESP8266Audio/src/libwebm/LICENSE.TXT
Normal file
30
lib/lib_audio/ESP8266Audio/src/libwebm/LICENSE.TXT
Normal file
@ -0,0 +1,30 @@
|
||||
Copyright (c) 2010, Google Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
* Neither the name of Google nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
23
lib/lib_audio/ESP8266Audio/src/libwebm/PATENTS.TXT
Normal file
23
lib/lib_audio/ESP8266Audio/src/libwebm/PATENTS.TXT
Normal file
@ -0,0 +1,23 @@
|
||||
Additional IP Rights Grant (Patents)
|
||||
------------------------------------
|
||||
|
||||
"These implementations" means the copyrightable works that implement the WebM
|
||||
codecs distributed by Google as part of the WebM Project.
|
||||
|
||||
Google hereby grants to you a perpetual, worldwide, non-exclusive, no-charge,
|
||||
royalty-free, irrevocable (except as stated in this section) patent license to
|
||||
make, have made, use, offer to sell, sell, import, transfer, and otherwise
|
||||
run, modify and propagate the contents of these implementations of WebM, where
|
||||
such license applies only to those patent claims, both currently owned by
|
||||
Google and acquired in the future, licensable by Google that are necessarily
|
||||
infringed by these implementations of WebM. This grant does not include claims
|
||||
that would be infringed only as a consequence of further modification of these
|
||||
implementations. If you or your agent or exclusive licensee institute or order
|
||||
or agree to the institution of patent litigation or any other patent
|
||||
enforcement activity against any entity (including a cross-claim or
|
||||
counterclaim in a lawsuit) alleging that any of these implementations of WebM
|
||||
or any code incorporated within any of these implementations of WebM
|
||||
constitute direct or contributory patent infringement, or inducement of
|
||||
patent infringement, then any patent rights granted to you under this License
|
||||
for these implementations of WebM shall terminate as of the date such
|
||||
litigation is filed.
|
202
lib/lib_audio/ESP8266Audio/src/libwebm/PRESUBMIT.py
Normal file
202
lib/lib_audio/ESP8266Audio/src/libwebm/PRESUBMIT.py
Normal file
@ -0,0 +1,202 @@
|
||||
# Copyright (c) 2021, Google Inc. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
#
|
||||
# * Neither the name of Google nor the names of its contributors may
|
||||
# be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
"""Top-level presubmit script for libwebm.
|
||||
|
||||
See https://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
|
||||
details on the presubmit API built into depot_tools.
|
||||
"""
|
||||
import re
|
||||
import subprocess2
|
||||
|
||||
USE_PYTHON3 = True
|
||||
_BASH_INDENTATION = "2"
|
||||
_GIT_COMMIT_SUBJECT_LENGTH = 65
|
||||
_INCLUDE_BASH_FILES_ONLY = [r".*\.sh$"]
|
||||
_INCLUDE_SOURCE_FILES_ONLY = [r".*\.(c|cc|[hc]pp|h)$"]
|
||||
_LIBWEBM_MAX_LINE_LENGTH = 80
|
||||
|
||||
|
||||
def _CheckCommitSubjectLength(input_api, output_api):
|
||||
"""Ensures commit's subject length is no longer than 65 chars."""
|
||||
name = "git-commit subject"
|
||||
cmd = ["git", "log", "-1", "--pretty=%s"]
|
||||
start = input_api.time.time()
|
||||
proc = subprocess2.Popen(
|
||||
cmd,
|
||||
stderr=subprocess2.PIPE,
|
||||
stdout=subprocess2.PIPE,
|
||||
universal_newlines=True)
|
||||
|
||||
stdout, _ = proc.communicate()
|
||||
duration = input_api.time.time() - start
|
||||
|
||||
if not re.match(r"^Revert",
|
||||
stdout) and (len(stdout) - 1) > _GIT_COMMIT_SUBJECT_LENGTH:
|
||||
failure_msg = (
|
||||
"The commit subject: %s is too long (%d chars)\n"
|
||||
"Try to keep this to 50 or less (up to 65 is permitted for "
|
||||
"non-reverts).\n"
|
||||
"https://www.git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-"
|
||||
"Project#_commit_guidelines") % (stdout, len(stdout) - 1)
|
||||
return output_api.PresubmitError("%s\n (%4.2fs) failed\n%s" %
|
||||
(name, duration, failure_msg))
|
||||
|
||||
return output_api.PresubmitResult("%s\n (%4.2fs) success" % (name, duration))
|
||||
|
||||
|
||||
def _GetFilesToSkip(input_api):
|
||||
"""Skips libwebm-specific files."""
|
||||
return list(input_api.DEFAULT_FILES_TO_SKIP) + [
|
||||
r"\.pylintrc$",
|
||||
]
|
||||
|
||||
|
||||
def _CheckChangeLintsClean(input_api, output_api):
|
||||
"""Makes sure that libwebm/ code is cpplint clean."""
|
||||
sources = lambda x: input_api.FilterSourceFile(
|
||||
x, files_to_check=_INCLUDE_SOURCE_FILES_ONLY, files_to_skip=None)
|
||||
return input_api.canned_checks.CheckChangeLintsClean(input_api, output_api,
|
||||
sources)
|
||||
|
||||
|
||||
def _RunShellCheckCmd(input_api, output_api, bash_file):
|
||||
"""shellcheck command wrapper."""
|
||||
cmd = ["shellcheck", "-x", "-oall", "-sbash", bash_file]
|
||||
name = "Check %s file." % bash_file
|
||||
start = input_api.time.time()
|
||||
output, rc = subprocess2.communicate(
|
||||
cmd, stdout=None, stderr=subprocess2.PIPE, universal_newlines=True)
|
||||
duration = input_api.time.time() - start
|
||||
if rc == 0:
|
||||
return output_api.PresubmitResult("%s\n%s (%4.2fs)\n" %
|
||||
(name, " ".join(cmd), duration))
|
||||
return output_api.PresubmitError("%s\n%s (%4.2fs) failed\n%s" %
|
||||
(name, " ".join(cmd), duration, output[1]))
|
||||
|
||||
|
||||
def _RunShfmtCheckCmd(input_api, output_api, bash_file):
|
||||
"""shfmt command wrapper."""
|
||||
cmd = [
|
||||
"shfmt", "-i", _BASH_INDENTATION, "-bn", "-ci", "-sr", "-kp", "-d",
|
||||
bash_file
|
||||
]
|
||||
name = "Check %s file." % bash_file
|
||||
start = input_api.time.time()
|
||||
output, rc = subprocess2.communicate(
|
||||
cmd, stdout=None, stderr=subprocess2.PIPE, universal_newlines=True)
|
||||
duration = input_api.time.time() - start
|
||||
if rc == 0:
|
||||
return output_api.PresubmitResult("%s\n%s (%4.2fs)\n" %
|
||||
(name, " ".join(cmd), duration))
|
||||
return output_api.PresubmitError("%s\n%s (%4.2fs) failed\n%s" %
|
||||
(name, " ".join(cmd), duration, output[1]))
|
||||
|
||||
|
||||
def _RunCmdOnCheckedFiles(input_api, output_api, run_cmd, files_to_check):
|
||||
"""Ensure that libwebm/ files are clean."""
|
||||
file_filter = lambda x: input_api.FilterSourceFile(
|
||||
x, files_to_check=files_to_check, files_to_skip=None)
|
||||
|
||||
affected_files = input_api.change.AffectedFiles(file_filter=file_filter)
|
||||
results = [
|
||||
run_cmd(input_api, output_api, f.AbsoluteLocalPath())
|
||||
for f in affected_files
|
||||
]
|
||||
return results
|
||||
|
||||
|
||||
def _CommonChecks(input_api, output_api):
|
||||
results = []
|
||||
results.extend(
|
||||
input_api.canned_checks.CheckChangeHasNoCrAndHasOnlyOneEol(
|
||||
input_api, output_api))
|
||||
results.extend(
|
||||
input_api.canned_checks.CheckChangeHasNoTabs(input_api, output_api))
|
||||
results.extend(
|
||||
input_api.canned_checks.CheckChangeHasNoStrayWhitespace(
|
||||
input_api, output_api))
|
||||
results.append(_CheckCommitSubjectLength(input_api, output_api))
|
||||
|
||||
source_file_filter = lambda x: input_api.FilterSourceFile(
|
||||
x, files_to_skip=_GetFilesToSkip(input_api))
|
||||
results.extend(
|
||||
input_api.canned_checks.CheckLongLines(
|
||||
input_api,
|
||||
output_api,
|
||||
maxlen=_LIBWEBM_MAX_LINE_LENGTH,
|
||||
source_file_filter=source_file_filter))
|
||||
|
||||
results.extend(
|
||||
input_api.canned_checks.CheckPatchFormatted(
|
||||
input_api,
|
||||
output_api,
|
||||
check_clang_format=True,
|
||||
check_python=True,
|
||||
result_factory=output_api.PresubmitError))
|
||||
results.extend(_CheckChangeLintsClean(input_api, output_api))
|
||||
|
||||
# Run pylint.
|
||||
results.extend(
|
||||
input_api.canned_checks.RunPylint(
|
||||
input_api,
|
||||
output_api,
|
||||
files_to_skip=_GetFilesToSkip(input_api),
|
||||
pylintrc=".pylintrc",
|
||||
version="2.7"))
|
||||
|
||||
# Binaries shellcheck and shfmt are not installed in depot_tools.
|
||||
# Installation is needed
|
||||
try:
|
||||
subprocess2.communicate(["shellcheck", "--version"])
|
||||
results.extend(
|
||||
_RunCmdOnCheckedFiles(input_api, output_api, _RunShellCheckCmd,
|
||||
_INCLUDE_BASH_FILES_ONLY))
|
||||
print("shfmt")
|
||||
subprocess2.communicate(["shfmt", "-version"])
|
||||
results.extend(
|
||||
_RunCmdOnCheckedFiles(input_api, output_api, _RunShfmtCheckCmd,
|
||||
_INCLUDE_BASH_FILES_ONLY))
|
||||
except OSError as os_error:
|
||||
results.append(
|
||||
output_api.PresubmitPromptWarning(
|
||||
"%s\nPlease install missing binaries locally." % os_error.args[0]))
|
||||
return results
|
||||
|
||||
|
||||
def CheckChangeOnUpload(input_api, output_api):
|
||||
results = []
|
||||
results.extend(_CommonChecks(input_api, output_api))
|
||||
return results
|
||||
|
||||
|
||||
def CheckChangeOnCommit(input_api, output_api):
|
||||
results = []
|
||||
results.extend(_CommonChecks(input_api, output_api))
|
||||
return results
|
148
lib/lib_audio/ESP8266Audio/src/libwebm/README.libwebm
Normal file
148
lib/lib_audio/ESP8266Audio/src/libwebm/README.libwebm
Normal file
@ -0,0 +1,148 @@
|
||||
Building Libwebm
|
||||
|
||||
To build libwebm you must first create project files. To do this run cmake
|
||||
and pass it the path to your libwebm repo.
|
||||
|
||||
Makefile.unix can be used as a fallback on systems that cmake does not
|
||||
support.
|
||||
|
||||
|
||||
CMake Basics
|
||||
|
||||
To generate project/make files for the default toolchain on your system simply
|
||||
run cmake with the path to the libwebm repo:
|
||||
|
||||
$ cmake path/to/libwebm
|
||||
|
||||
On Windows the above command will produce Visual Studio project files for the
|
||||
newest Visual Studio detected on the system. On Mac OS X and Linux systems, the
|
||||
above command will produce a makefile.
|
||||
|
||||
To control what types of projects are generated the -G parameter is added to
|
||||
the cmake command line. This argument must be followed by the name of a
|
||||
generator. Running cmake with the --help argument will list the available
|
||||
generators for your system.
|
||||
|
||||
On Mac OS X you would run the following command to generate Xcode projects:
|
||||
|
||||
$ cmake path/to/libwebm -G Xcode
|
||||
|
||||
On a Windows box you would run the following command to generate Visual Studio
|
||||
2013 projects:
|
||||
|
||||
$ cmake path/to/libwebm -G "Visual Studio 12"
|
||||
|
||||
To generate 64-bit Windows Visual Studio 2013 projects:
|
||||
|
||||
$ cmake path/to/libwebm "Visual Studio 12 Win64"
|
||||
|
||||
|
||||
CMake Makefiles: Debugging and Optimization
|
||||
|
||||
Unlike Visual Studio and Xcode projects, the build configuration for make builds
|
||||
is controlled when you run cmake. The following examples demonstrate various
|
||||
build configurations.
|
||||
|
||||
Omitting the build type produces makefiles that use build flags containing
|
||||
neither optimization nor debug flags:
|
||||
$ cmake path/to/libwebm
|
||||
|
||||
A makefile using release (optimized) flags is produced like this:
|
||||
$ cmake path/to/libwebm -DCMAKE_BUILD_TYPE=release
|
||||
|
||||
A release build with debug info can be produced as well:
|
||||
$ cmake path/to/libwebm -DCMAKE_BUILD_TYPE=relwithdebinfo
|
||||
|
||||
And your standard debug build will be produced using:
|
||||
$ cmake path/to/libwebm -DCMAKE_BUILD_TYPE=debug
|
||||
|
||||
|
||||
Tests
|
||||
|
||||
To enable libwebm tests add -DENABLE_TESTS=ON CMake generation command line. For
|
||||
example:
|
||||
|
||||
$ cmake path/to/libwebm -G Xcode -DENABLE_TESTS=ON
|
||||
|
||||
Libwebm tests depend on googletest. By default googletest is expected to be a
|
||||
sibling directory of the Libwebm repository. To change that, update your CMake
|
||||
command to be similar to the following:
|
||||
|
||||
$ cmake path/to/libwebm -G Xcode -DENABLE_TESTS=ON \
|
||||
-DGTEST_SRC_DIR=/path/to/googletest
|
||||
|
||||
The tests rely upon the LIBWEBM_TEST_DATA_PATH environment variable to locate
|
||||
test input. The following example demonstrates running the muxer tests from the
|
||||
build directory:
|
||||
|
||||
$ LIBWEBM_TEST_DATA_PATH=path/to/libwebm/testing/testdata ./mkvmuxer_tests
|
||||
|
||||
Note: Libwebm Googletest integration was built with googletest from
|
||||
https://github.com/google/googletest.git at git revision
|
||||
ddb8012eb48bc203aa93dcc2b22c1db516302b29.
|
||||
|
||||
|
||||
CMake Include-what-you-use integration
|
||||
|
||||
Include-what-you-use is an analysis tool that helps ensure libwebm includes the
|
||||
C/C++ header files actually in use. To enable the integration support
|
||||
ENABLE_IWYU must be turned on at cmake run time:
|
||||
|
||||
$ cmake path/to/libwebm -G "Unix Makefiles" -DENABLE_IWYU=ON
|
||||
|
||||
This adds the iwyu target to the build. To run include-what-you-use:
|
||||
|
||||
$ make iwyu
|
||||
|
||||
The following requirements must be met for ENABLE_IWYU to enable the iwyu
|
||||
target:
|
||||
|
||||
1. include-what-you-use and iwyu_tool.py must be in your PATH.
|
||||
2. A python interpreter must be on the system and available to CMake.
|
||||
|
||||
The values of the following variables are used to determine if the requirements
|
||||
have been met. Values to the right of the equals sign are what a successful run
|
||||
might look like:
|
||||
iwyu_path=/path/to/iwyu_tool.py
|
||||
iwyu_tool_path=/path/to/include-what-you-use
|
||||
PYTHONINTERP_FOUND=TRUE
|
||||
|
||||
An empty PYTHONINTERP_FOUND, or iwyu_path/iwyu_tool_path suffixed with NOTFOUND
|
||||
are failures.
|
||||
|
||||
For Include-what-you-use setup instructions, see:
|
||||
https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/InstructionsForUsers.md
|
||||
|
||||
If, when building the iwyu target, compile errors reporting failures loading
|
||||
standard include files occur, one solution can be found here:
|
||||
https://github.com/include-what-you-use/include-what-you-use/issues/100
|
||||
|
||||
|
||||
CMake cross compile
|
||||
To cross compile libwebm for Windows using mingw-w64 run cmake with the
|
||||
following arguments:
|
||||
|
||||
$ cmake -DCMAKE_TOOLCHAIN_FILE=path/to/libwebm/build/mingw-w64_toolchain.cmake \
|
||||
path/to/libwebm
|
||||
|
||||
Note1: As of this writing googletest will not build via mingw-w64 without
|
||||
disabling pthreads.
|
||||
googletest hash: d225acc90bc3a8c420a9bcd1f033033c1ccd7fe0
|
||||
|
||||
To build with tests when using mingw-w64 use the following arguments when
|
||||
running CMake:
|
||||
|
||||
$ cmake -DCMAKE_TOOLCHAIN_FILE=path/to/libwebm/build/mingw-w64_toolchain.cmake \
|
||||
-DENABLE_TESTS=ON -Dgtest_disable_pthreads=ON path/to/libwebm
|
||||
|
||||
Note2: i686-w64-mingw32 is the default compiler. This can be controlled using
|
||||
the MINGW_PREFIX variable:
|
||||
|
||||
$ cmake -DCMAKE_TOOLCHAIN_FILE=path/to/libwebm/build/mingw-w64_toolchain.cmake \
|
||||
-DMINGW_PREFIX=x86_64-w64-mingw32 path/to/libwebm
|
||||
|
||||
Bug reports
|
||||
|
||||
Bug reports can be filed in the libwebm issue tracker:
|
||||
https://issues.webmproject.org/.
|
||||
For security reports, select 'Security report' from the Template dropdown.
|
@ -0,0 +1,4 @@
|
||||
# This file is used by git cl to get repository specific information.
|
||||
GERRIT_HOST: True
|
||||
CODE_REVIEW_SERVER: chromium-review.googlesource.com
|
||||
GERRIT_SQUASH_UPLOADS: False
|
193
lib/lib_audio/ESP8266Audio/src/libwebm/common/webmids.h
Normal file
193
lib/lib_audio/ESP8266Audio/src/libwebm/common/webmids.h
Normal file
@ -0,0 +1,193 @@
|
||||
// Copyright (c) 2012 The WebM project authors. All Rights Reserved.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style license
|
||||
// that can be found in the LICENSE file in the root of the source
|
||||
// tree. An additional intellectual property rights grant can be found
|
||||
// in the file PATENTS. All contributing project authors may
|
||||
// be found in the AUTHORS file in the root of the source tree.
|
||||
|
||||
#ifndef COMMON_WEBMIDS_H_
|
||||
#define COMMON_WEBMIDS_H_
|
||||
|
||||
namespace libwebm {
|
||||
|
||||
enum MkvId {
|
||||
kMkvEBML = 0x1A45DFA3,
|
||||
kMkvEBMLVersion = 0x4286,
|
||||
kMkvEBMLReadVersion = 0x42F7,
|
||||
kMkvEBMLMaxIDLength = 0x42F2,
|
||||
kMkvEBMLMaxSizeLength = 0x42F3,
|
||||
kMkvDocType = 0x4282,
|
||||
kMkvDocTypeVersion = 0x4287,
|
||||
kMkvDocTypeReadVersion = 0x4285,
|
||||
kMkvVoid = 0xEC,
|
||||
kMkvSignatureSlot = 0x1B538667,
|
||||
kMkvSignatureAlgo = 0x7E8A,
|
||||
kMkvSignatureHash = 0x7E9A,
|
||||
kMkvSignaturePublicKey = 0x7EA5,
|
||||
kMkvSignature = 0x7EB5,
|
||||
kMkvSignatureElements = 0x7E5B,
|
||||
kMkvSignatureElementList = 0x7E7B,
|
||||
kMkvSignedElement = 0x6532,
|
||||
// segment
|
||||
kMkvSegment = 0x18538067,
|
||||
// Meta Seek Information
|
||||
kMkvSeekHead = 0x114D9B74,
|
||||
kMkvSeek = 0x4DBB,
|
||||
kMkvSeekID = 0x53AB,
|
||||
kMkvSeekPosition = 0x53AC,
|
||||
// Segment Information
|
||||
kMkvInfo = 0x1549A966,
|
||||
kMkvTimecodeScale = 0x2AD7B1,
|
||||
kMkvDuration = 0x4489,
|
||||
kMkvDateUTC = 0x4461,
|
||||
kMkvTitle = 0x7BA9,
|
||||
kMkvMuxingApp = 0x4D80,
|
||||
kMkvWritingApp = 0x5741,
|
||||
// Cluster
|
||||
kMkvCluster = 0x1F43B675,
|
||||
kMkvTimecode = 0xE7,
|
||||
kMkvPrevSize = 0xAB,
|
||||
kMkvBlockGroup = 0xA0,
|
||||
kMkvBlock = 0xA1,
|
||||
kMkvBlockDuration = 0x9B,
|
||||
kMkvReferenceBlock = 0xFB,
|
||||
kMkvLaceNumber = 0xCC,
|
||||
kMkvSimpleBlock = 0xA3,
|
||||
kMkvBlockAdditions = 0x75A1,
|
||||
kMkvBlockMore = 0xA6,
|
||||
kMkvBlockAddID = 0xEE,
|
||||
kMkvBlockAdditional = 0xA5,
|
||||
kMkvDiscardPadding = 0x75A2,
|
||||
// Track
|
||||
kMkvTracks = 0x1654AE6B,
|
||||
kMkvTrackEntry = 0xAE,
|
||||
kMkvTrackNumber = 0xD7,
|
||||
kMkvTrackUID = 0x73C5,
|
||||
kMkvTrackType = 0x83,
|
||||
kMkvFlagEnabled = 0xB9,
|
||||
kMkvFlagDefault = 0x88,
|
||||
kMkvFlagForced = 0x55AA,
|
||||
kMkvFlagLacing = 0x9C,
|
||||
kMkvDefaultDuration = 0x23E383,
|
||||
kMkvMaxBlockAdditionID = 0x55EE,
|
||||
kMkvName = 0x536E,
|
||||
kMkvLanguage = 0x22B59C,
|
||||
kMkvCodecID = 0x86,
|
||||
kMkvCodecPrivate = 0x63A2,
|
||||
kMkvCodecName = 0x258688,
|
||||
kMkvCodecDelay = 0x56AA,
|
||||
kMkvSeekPreRoll = 0x56BB,
|
||||
// video
|
||||
kMkvVideo = 0xE0,
|
||||
kMkvFlagInterlaced = 0x9A,
|
||||
kMkvStereoMode = 0x53B8,
|
||||
kMkvAlphaMode = 0x53C0,
|
||||
kMkvPixelWidth = 0xB0,
|
||||
kMkvPixelHeight = 0xBA,
|
||||
kMkvPixelCropBottom = 0x54AA,
|
||||
kMkvPixelCropTop = 0x54BB,
|
||||
kMkvPixelCropLeft = 0x54CC,
|
||||
kMkvPixelCropRight = 0x54DD,
|
||||
kMkvDisplayWidth = 0x54B0,
|
||||
kMkvDisplayHeight = 0x54BA,
|
||||
kMkvDisplayUnit = 0x54B2,
|
||||
kMkvAspectRatioType = 0x54B3,
|
||||
kMkvColourSpace = 0x2EB524,
|
||||
kMkvFrameRate = 0x2383E3,
|
||||
// end video
|
||||
// colour
|
||||
kMkvColour = 0x55B0,
|
||||
kMkvMatrixCoefficients = 0x55B1,
|
||||
kMkvBitsPerChannel = 0x55B2,
|
||||
kMkvChromaSubsamplingHorz = 0x55B3,
|
||||
kMkvChromaSubsamplingVert = 0x55B4,
|
||||
kMkvCbSubsamplingHorz = 0x55B5,
|
||||
kMkvCbSubsamplingVert = 0x55B6,
|
||||
kMkvChromaSitingHorz = 0x55B7,
|
||||
kMkvChromaSitingVert = 0x55B8,
|
||||
kMkvRange = 0x55B9,
|
||||
kMkvTransferCharacteristics = 0x55BA,
|
||||
kMkvPrimaries = 0x55BB,
|
||||
kMkvMaxCLL = 0x55BC,
|
||||
kMkvMaxFALL = 0x55BD,
|
||||
// mastering metadata
|
||||
kMkvMasteringMetadata = 0x55D0,
|
||||
kMkvPrimaryRChromaticityX = 0x55D1,
|
||||
kMkvPrimaryRChromaticityY = 0x55D2,
|
||||
kMkvPrimaryGChromaticityX = 0x55D3,
|
||||
kMkvPrimaryGChromaticityY = 0x55D4,
|
||||
kMkvPrimaryBChromaticityX = 0x55D5,
|
||||
kMkvPrimaryBChromaticityY = 0x55D6,
|
||||
kMkvWhitePointChromaticityX = 0x55D7,
|
||||
kMkvWhitePointChromaticityY = 0x55D8,
|
||||
kMkvLuminanceMax = 0x55D9,
|
||||
kMkvLuminanceMin = 0x55DA,
|
||||
// end mastering metadata
|
||||
// end colour
|
||||
// projection
|
||||
kMkvProjection = 0x7670,
|
||||
kMkvProjectionType = 0x7671,
|
||||
kMkvProjectionPrivate = 0x7672,
|
||||
kMkvProjectionPoseYaw = 0x7673,
|
||||
kMkvProjectionPosePitch = 0x7674,
|
||||
kMkvProjectionPoseRoll = 0x7675,
|
||||
// end projection
|
||||
// audio
|
||||
kMkvAudio = 0xE1,
|
||||
kMkvSamplingFrequency = 0xB5,
|
||||
kMkvOutputSamplingFrequency = 0x78B5,
|
||||
kMkvChannels = 0x9F,
|
||||
kMkvBitDepth = 0x6264,
|
||||
// end audio
|
||||
// ContentEncodings
|
||||
kMkvContentEncodings = 0x6D80,
|
||||
kMkvContentEncoding = 0x6240,
|
||||
kMkvContentEncodingOrder = 0x5031,
|
||||
kMkvContentEncodingScope = 0x5032,
|
||||
kMkvContentEncodingType = 0x5033,
|
||||
kMkvContentCompression = 0x5034,
|
||||
kMkvContentCompAlgo = 0x4254,
|
||||
kMkvContentCompSettings = 0x4255,
|
||||
kMkvContentEncryption = 0x5035,
|
||||
kMkvContentEncAlgo = 0x47E1,
|
||||
kMkvContentEncKeyID = 0x47E2,
|
||||
kMkvContentSignature = 0x47E3,
|
||||
kMkvContentSigKeyID = 0x47E4,
|
||||
kMkvContentSigAlgo = 0x47E5,
|
||||
kMkvContentSigHashAlgo = 0x47E6,
|
||||
kMkvContentEncAESSettings = 0x47E7,
|
||||
kMkvAESSettingsCipherMode = 0x47E8,
|
||||
kMkvAESSettingsCipherInitData = 0x47E9,
|
||||
// end ContentEncodings
|
||||
// Cueing Data
|
||||
kMkvCues = 0x1C53BB6B,
|
||||
kMkvCuePoint = 0xBB,
|
||||
kMkvCueTime = 0xB3,
|
||||
kMkvCueTrackPositions = 0xB7,
|
||||
kMkvCueTrack = 0xF7,
|
||||
kMkvCueClusterPosition = 0xF1,
|
||||
kMkvCueBlockNumber = 0x5378,
|
||||
// Chapters
|
||||
kMkvChapters = 0x1043A770,
|
||||
kMkvEditionEntry = 0x45B9,
|
||||
kMkvChapterAtom = 0xB6,
|
||||
kMkvChapterUID = 0x73C4,
|
||||
kMkvChapterStringUID = 0x5654,
|
||||
kMkvChapterTimeStart = 0x91,
|
||||
kMkvChapterTimeEnd = 0x92,
|
||||
kMkvChapterDisplay = 0x80,
|
||||
kMkvChapString = 0x85,
|
||||
kMkvChapLanguage = 0x437C,
|
||||
kMkvChapCountry = 0x437E,
|
||||
// Tags
|
||||
kMkvTags = 0x1254C367,
|
||||
kMkvTag = 0x7373,
|
||||
kMkvSimpleTag = 0x67C8,
|
||||
kMkvTagName = 0x45A3,
|
||||
kMkvTagString = 0x4487
|
||||
};
|
||||
|
||||
} // namespace libwebm
|
||||
|
||||
#endif // COMMON_WEBMIDS_H_
|
4207
lib/lib_audio/ESP8266Audio/src/libwebm/mkvmuxer/mkvmuxer.cc
Normal file
4207
lib/lib_audio/ESP8266Audio/src/libwebm/mkvmuxer/mkvmuxer.cc
Normal file
File diff suppressed because it is too large
Load Diff
1926
lib/lib_audio/ESP8266Audio/src/libwebm/mkvmuxer/mkvmuxer.h
Normal file
1926
lib/lib_audio/ESP8266Audio/src/libwebm/mkvmuxer/mkvmuxer.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,28 @@
|
||||
// Copyright (c) 2012 The WebM project authors. All Rights Reserved.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style license
|
||||
// that can be found in the LICENSE file in the root of the source
|
||||
// tree. An additional intellectual property rights grant can be found
|
||||
// in the file PATENTS. All contributing project authors may
|
||||
// be found in the AUTHORS file in the root of the source tree.
|
||||
|
||||
#ifndef MKVMUXER_MKVMUXERTYPES_H_
|
||||
#define MKVMUXER_MKVMUXERTYPES_H_
|
||||
|
||||
namespace mkvmuxer {
|
||||
typedef unsigned char uint8;
|
||||
typedef short int16;
|
||||
typedef int int32;
|
||||
typedef unsigned int uint32;
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
} // namespace mkvmuxer
|
||||
|
||||
// Copied from Chromium basictypes.h
|
||||
// A macro to disallow the copy constructor and operator= functions
|
||||
// This should be used in the private: declarations for a class
|
||||
#define LIBWEBM_DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
||||
TypeName(const TypeName&); \
|
||||
void operator=(const TypeName&)
|
||||
|
||||
#endif // MKVMUXER_MKVMUXERTYPES_HPP_
|
739
lib/lib_audio/ESP8266Audio/src/libwebm/mkvmuxer/mkvmuxerutil.cc
Normal file
739
lib/lib_audio/ESP8266Audio/src/libwebm/mkvmuxer/mkvmuxerutil.cc
Normal file
@ -0,0 +1,739 @@
|
||||
// Copyright (c) 2012 The WebM project authors. All Rights Reserved.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style license
|
||||
// that can be found in the LICENSE file in the root of the source
|
||||
// tree. An additional intellectual property rights grant can be found
|
||||
// in the file PATENTS. All contributing project authors may
|
||||
// be found in the AUTHORS file in the root of the source tree.
|
||||
|
||||
#include "mkvmuxerutil.h"
|
||||
#ifdef ESP32
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
#include <new>
|
||||
|
||||
#include "../common/webmids.h"
|
||||
#include "mkvmuxer.h"
|
||||
#include "mkvwriter.h"
|
||||
|
||||
namespace mkvmuxer {
|
||||
|
||||
namespace {
|
||||
|
||||
// Date elements are always 8 octets in size.
|
||||
const int kDateElementSize = 8;
|
||||
|
||||
uint64 WriteBlock(IMkvWriter* writer, const Frame* const frame, int64 timecode,
|
||||
uint64 timecode_scale) {
|
||||
uint64 block_additional_elem_size = 0;
|
||||
uint64 block_addid_elem_size = 0;
|
||||
uint64 block_more_payload_size = 0;
|
||||
uint64 block_more_elem_size = 0;
|
||||
uint64 block_additions_payload_size = 0;
|
||||
uint64 block_additions_elem_size = 0;
|
||||
if (frame->additional()) {
|
||||
block_additional_elem_size =
|
||||
EbmlElementSize(libwebm::kMkvBlockAdditional, frame->additional(),
|
||||
frame->additional_length());
|
||||
block_addid_elem_size = EbmlElementSize(
|
||||
libwebm::kMkvBlockAddID, static_cast<uint64>(frame->add_id()));
|
||||
|
||||
block_more_payload_size =
|
||||
block_addid_elem_size + block_additional_elem_size;
|
||||
block_more_elem_size =
|
||||
EbmlMasterElementSize(libwebm::kMkvBlockMore, block_more_payload_size) +
|
||||
block_more_payload_size;
|
||||
block_additions_payload_size = block_more_elem_size;
|
||||
block_additions_elem_size =
|
||||
EbmlMasterElementSize(libwebm::kMkvBlockAdditions,
|
||||
block_additions_payload_size) +
|
||||
block_additions_payload_size;
|
||||
}
|
||||
|
||||
uint64 discard_padding_elem_size = 0;
|
||||
if (frame->discard_padding() != 0) {
|
||||
discard_padding_elem_size =
|
||||
EbmlElementSize(libwebm::kMkvDiscardPadding,
|
||||
static_cast<int64>(frame->discard_padding()));
|
||||
}
|
||||
|
||||
const uint64 reference_block_timestamp =
|
||||
frame->reference_block_timestamp() / timecode_scale;
|
||||
uint64 reference_block_elem_size = 0;
|
||||
if (!frame->is_key()) {
|
||||
reference_block_elem_size =
|
||||
EbmlElementSize(libwebm::kMkvReferenceBlock, reference_block_timestamp);
|
||||
}
|
||||
|
||||
const uint64 duration = frame->duration() / timecode_scale;
|
||||
uint64 block_duration_elem_size = 0;
|
||||
if (duration > 0)
|
||||
block_duration_elem_size =
|
||||
EbmlElementSize(libwebm::kMkvBlockDuration, duration);
|
||||
|
||||
const uint64 block_payload_size = 4 + frame->length();
|
||||
const uint64 block_elem_size =
|
||||
EbmlMasterElementSize(libwebm::kMkvBlock, block_payload_size) +
|
||||
block_payload_size;
|
||||
|
||||
const uint64 block_group_payload_size =
|
||||
block_elem_size + block_additions_elem_size + block_duration_elem_size +
|
||||
discard_padding_elem_size + reference_block_elem_size;
|
||||
|
||||
if (!WriteEbmlMasterElement(writer, libwebm::kMkvBlockGroup,
|
||||
block_group_payload_size)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!WriteEbmlMasterElement(writer, libwebm::kMkvBlock, block_payload_size))
|
||||
return 0;
|
||||
|
||||
if (WriteUInt(writer, frame->track_number()))
|
||||
return 0;
|
||||
|
||||
if (SerializeInt(writer, timecode, 2))
|
||||
return 0;
|
||||
|
||||
// For a Block, flags is always 0.
|
||||
if (SerializeInt(writer, 0, 1))
|
||||
return 0;
|
||||
|
||||
if (writer->Write(frame->frame(), static_cast<uint32>(frame->length())))
|
||||
return 0;
|
||||
|
||||
if (frame->additional()) {
|
||||
if (!WriteEbmlMasterElement(writer, libwebm::kMkvBlockAdditions,
|
||||
block_additions_payload_size)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!WriteEbmlMasterElement(writer, libwebm::kMkvBlockMore,
|
||||
block_more_payload_size))
|
||||
return 0;
|
||||
|
||||
if (!WriteEbmlElement(writer, libwebm::kMkvBlockAddID,
|
||||
static_cast<uint64>(frame->add_id())))
|
||||
return 0;
|
||||
|
||||
if (!WriteEbmlElement(writer, libwebm::kMkvBlockAdditional,
|
||||
frame->additional(), frame->additional_length())) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (frame->discard_padding() != 0 &&
|
||||
!WriteEbmlElement(writer, libwebm::kMkvDiscardPadding,
|
||||
static_cast<int64>(frame->discard_padding()))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!frame->is_key() && !WriteEbmlElement(writer, libwebm::kMkvReferenceBlock,
|
||||
reference_block_timestamp)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (duration > 0 &&
|
||||
!WriteEbmlElement(writer, libwebm::kMkvBlockDuration, duration)) {
|
||||
return false;
|
||||
}
|
||||
return EbmlMasterElementSize(libwebm::kMkvBlockGroup,
|
||||
block_group_payload_size) +
|
||||
block_group_payload_size;
|
||||
}
|
||||
|
||||
uint64 WriteSimpleBlock(IMkvWriter* writer, const Frame* const frame,
|
||||
int64 timecode) {
|
||||
if (WriteID(writer, libwebm::kMkvSimpleBlock))
|
||||
return 0;
|
||||
|
||||
const int32 size = static_cast<int32>(frame->length()) + 4;
|
||||
if (WriteUInt(writer, size))
|
||||
return 0;
|
||||
|
||||
if (WriteUInt(writer, static_cast<uint64>(frame->track_number())))
|
||||
return 0;
|
||||
|
||||
if (SerializeInt(writer, timecode, 2))
|
||||
return 0;
|
||||
|
||||
uint64 flags = 0;
|
||||
if (frame->is_key())
|
||||
flags |= 0x80;
|
||||
|
||||
if (SerializeInt(writer, flags, 1))
|
||||
return 0;
|
||||
|
||||
if (writer->Write(frame->frame(), static_cast<uint32>(frame->length())))
|
||||
return 0;
|
||||
|
||||
return GetUIntSize(libwebm::kMkvSimpleBlock) + GetCodedUIntSize(size) + 4 +
|
||||
frame->length();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int32 GetCodedUIntSize(uint64 value) {
|
||||
if (value < 0x000000000000007FULL)
|
||||
return 1;
|
||||
else if (value < 0x0000000000003FFFULL)
|
||||
return 2;
|
||||
else if (value < 0x00000000001FFFFFULL)
|
||||
return 3;
|
||||
else if (value < 0x000000000FFFFFFFULL)
|
||||
return 4;
|
||||
else if (value < 0x00000007FFFFFFFFULL)
|
||||
return 5;
|
||||
else if (value < 0x000003FFFFFFFFFFULL)
|
||||
return 6;
|
||||
else if (value < 0x0001FFFFFFFFFFFFULL)
|
||||
return 7;
|
||||
return 8;
|
||||
}
|
||||
|
||||
int32 GetUIntSize(uint64 value) {
|
||||
if (value < 0x0000000000000100ULL)
|
||||
return 1;
|
||||
else if (value < 0x0000000000010000ULL)
|
||||
return 2;
|
||||
else if (value < 0x0000000001000000ULL)
|
||||
return 3;
|
||||
else if (value < 0x0000000100000000ULL)
|
||||
return 4;
|
||||
else if (value < 0x0000010000000000ULL)
|
||||
return 5;
|
||||
else if (value < 0x0001000000000000ULL)
|
||||
return 6;
|
||||
else if (value < 0x0100000000000000ULL)
|
||||
return 7;
|
||||
return 8;
|
||||
}
|
||||
|
||||
int32 GetIntSize(int64 value) {
|
||||
// Doubling the requested value ensures positive values with their high bit
|
||||
// set are written with 0-padding to avoid flipping the signedness.
|
||||
const uint64 v = (value < 0) ? value ^ -1LL : value;
|
||||
return GetUIntSize(2 * v);
|
||||
}
|
||||
|
||||
uint64 EbmlMasterElementSize(uint64 type, uint64 value) {
|
||||
// Size of EBML ID
|
||||
int32 ebml_size = GetUIntSize(type);
|
||||
|
||||
// Datasize
|
||||
ebml_size += GetCodedUIntSize(value);
|
||||
|
||||
return ebml_size;
|
||||
}
|
||||
|
||||
uint64 EbmlElementSize(uint64 type, int64 value) {
|
||||
// Size of EBML ID
|
||||
int32 ebml_size = GetUIntSize(type);
|
||||
|
||||
// Datasize
|
||||
ebml_size += GetIntSize(value);
|
||||
|
||||
// Size of Datasize
|
||||
ebml_size++;
|
||||
|
||||
return ebml_size;
|
||||
}
|
||||
|
||||
uint64 EbmlElementSize(uint64 type, uint64 value) {
|
||||
return EbmlElementSize(type, value, 0);
|
||||
}
|
||||
|
||||
uint64 EbmlElementSize(uint64 type, uint64 value, uint64 fixed_size) {
|
||||
// Size of EBML ID
|
||||
uint64 ebml_size = GetUIntSize(type);
|
||||
|
||||
// Datasize
|
||||
ebml_size += (fixed_size > 0) ? fixed_size : GetUIntSize(value);
|
||||
|
||||
// Size of Datasize
|
||||
ebml_size++;
|
||||
|
||||
return ebml_size;
|
||||
}
|
||||
|
||||
uint64 EbmlElementSize(uint64 type, float /* value */) {
|
||||
// Size of EBML ID
|
||||
uint64 ebml_size = GetUIntSize(type);
|
||||
|
||||
// Datasize
|
||||
ebml_size += sizeof(float);
|
||||
|
||||
// Size of Datasize
|
||||
ebml_size++;
|
||||
|
||||
return ebml_size;
|
||||
}
|
||||
|
||||
uint64 EbmlElementSize(uint64 type, const char* value) {
|
||||
if (!value)
|
||||
return 0;
|
||||
|
||||
// Size of EBML ID
|
||||
uint64 ebml_size = GetUIntSize(type);
|
||||
|
||||
// Datasize
|
||||
ebml_size += strlen(value);
|
||||
|
||||
// Size of Datasize
|
||||
ebml_size += GetCodedUIntSize(strlen(value));
|
||||
|
||||
return ebml_size;
|
||||
}
|
||||
|
||||
uint64 EbmlElementSize(uint64 type, const uint8* value, uint64 size) {
|
||||
if (!value)
|
||||
return 0;
|
||||
|
||||
// Size of EBML ID
|
||||
uint64 ebml_size = GetUIntSize(type);
|
||||
|
||||
// Datasize
|
||||
ebml_size += size;
|
||||
|
||||
// Size of Datasize
|
||||
ebml_size += GetCodedUIntSize(size);
|
||||
|
||||
return ebml_size;
|
||||
}
|
||||
|
||||
uint64 EbmlDateElementSize(uint64 type) {
|
||||
// Size of EBML ID
|
||||
uint64 ebml_size = GetUIntSize(type);
|
||||
|
||||
// Datasize
|
||||
ebml_size += kDateElementSize;
|
||||
|
||||
// Size of Datasize
|
||||
ebml_size++;
|
||||
|
||||
return ebml_size;
|
||||
}
|
||||
|
||||
int32 SerializeInt(IMkvWriter* writer, int64 value, int32 size) {
|
||||
if (!writer || size < 1 || size > 8)
|
||||
return -1;
|
||||
|
||||
for (int32 i = 1; i <= size; ++i) {
|
||||
const int32 byte_count = size - i;
|
||||
const int32 bit_count = byte_count * 8;
|
||||
|
||||
const int64 bb = value >> bit_count;
|
||||
const uint8 b = static_cast<uint8>(bb);
|
||||
|
||||
const int32 status = writer->Write(&b, 1);
|
||||
|
||||
if (status < 0)
|
||||
return status;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32 SerializeFloat(IMkvWriter* writer, float f) {
|
||||
if (!writer)
|
||||
return -1;
|
||||
|
||||
assert(sizeof(uint32) == sizeof(float));
|
||||
// This union is merely used to avoid a reinterpret_cast from float& to
|
||||
// uint32& which will result in violation of strict aliasing.
|
||||
union U32 {
|
||||
uint32 u32;
|
||||
float f;
|
||||
} value;
|
||||
value.f = f;
|
||||
|
||||
for (int32 i = 1; i <= 4; ++i) {
|
||||
const int32 byte_count = 4 - i;
|
||||
const int32 bit_count = byte_count * 8;
|
||||
|
||||
const uint8 byte = static_cast<uint8>(value.u32 >> bit_count);
|
||||
|
||||
const int32 status = writer->Write(&byte, 1);
|
||||
|
||||
if (status < 0)
|
||||
return status;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32 WriteUInt(IMkvWriter* writer, uint64 value) {
|
||||
if (!writer)
|
||||
return -1;
|
||||
|
||||
int32 size = GetCodedUIntSize(value);
|
||||
|
||||
return WriteUIntSize(writer, value, size);
|
||||
}
|
||||
|
||||
int32 WriteUIntSize(IMkvWriter* writer, uint64 value, int32 size) {
|
||||
if (!writer || size < 0 || size > 8)
|
||||
return -1;
|
||||
|
||||
if (size > 0) {
|
||||
const uint64 bit = 1LL << (size * 7);
|
||||
|
||||
if (value > (bit - 2))
|
||||
return -1;
|
||||
|
||||
value |= bit;
|
||||
} else {
|
||||
size = 1;
|
||||
int64 bit;
|
||||
|
||||
for (;;) {
|
||||
bit = 1LL << (size * 7);
|
||||
const uint64 max = bit - 2;
|
||||
|
||||
if (value <= max)
|
||||
break;
|
||||
|
||||
++size;
|
||||
}
|
||||
|
||||
if (size > 8)
|
||||
return false;
|
||||
|
||||
value |= bit;
|
||||
}
|
||||
|
||||
return SerializeInt(writer, value, size);
|
||||
}
|
||||
|
||||
int32 WriteID(IMkvWriter* writer, uint64 type) {
|
||||
if (!writer)
|
||||
return -1;
|
||||
|
||||
writer->ElementStartNotify(type, writer->Position());
|
||||
|
||||
const int32 size = GetUIntSize(type);
|
||||
|
||||
return SerializeInt(writer, type, size);
|
||||
}
|
||||
|
||||
bool WriteEbmlMasterElement(IMkvWriter* writer, uint64 type, uint64 size) {
|
||||
if (!writer)
|
||||
return false;
|
||||
|
||||
if (WriteID(writer, type))
|
||||
return false;
|
||||
|
||||
if (WriteUInt(writer, size))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, uint64 value) {
|
||||
return WriteEbmlElement(writer, type, value, 0);
|
||||
}
|
||||
|
||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, uint64 value,
|
||||
uint64 fixed_size) {
|
||||
if (!writer)
|
||||
return false;
|
||||
|
||||
if (WriteID(writer, type))
|
||||
return false;
|
||||
|
||||
uint64 size = GetUIntSize(value);
|
||||
if (fixed_size > 0) {
|
||||
if (size > fixed_size)
|
||||
return false;
|
||||
size = fixed_size;
|
||||
}
|
||||
if (WriteUInt(writer, size))
|
||||
return false;
|
||||
|
||||
if (SerializeInt(writer, value, static_cast<int32>(size)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, int64 value) {
|
||||
if (!writer)
|
||||
return false;
|
||||
|
||||
if (WriteID(writer, type))
|
||||
return 0;
|
||||
|
||||
const uint64 size = GetIntSize(value);
|
||||
if (WriteUInt(writer, size))
|
||||
return false;
|
||||
|
||||
if (SerializeInt(writer, value, static_cast<int32>(size)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, float value) {
|
||||
if (!writer)
|
||||
return false;
|
||||
|
||||
if (WriteID(writer, type))
|
||||
return false;
|
||||
|
||||
if (WriteUInt(writer, 4))
|
||||
return false;
|
||||
|
||||
if (SerializeFloat(writer, value))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, const char* value) {
|
||||
if (!writer || !value)
|
||||
return false;
|
||||
|
||||
if (WriteID(writer, type))
|
||||
return false;
|
||||
|
||||
const uint64 length = strlen(value);
|
||||
if (WriteUInt(writer, length))
|
||||
return false;
|
||||
|
||||
if (writer->Write(value, static_cast<uint32>(length)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, const uint8* value,
|
||||
uint64 size) {
|
||||
if (!writer || !value || size < 1)
|
||||
return false;
|
||||
|
||||
if (WriteID(writer, type))
|
||||
return false;
|
||||
|
||||
if (WriteUInt(writer, size))
|
||||
return false;
|
||||
|
||||
if (writer->Write(value, static_cast<uint32>(size)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WriteEbmlDateElement(IMkvWriter* writer, uint64 type, int64 value) {
|
||||
if (!writer)
|
||||
return false;
|
||||
|
||||
if (WriteID(writer, type))
|
||||
return false;
|
||||
|
||||
if (WriteUInt(writer, kDateElementSize))
|
||||
return false;
|
||||
|
||||
if (SerializeInt(writer, value, kDateElementSize))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint64 WriteFrame(IMkvWriter* writer, const Frame* const frame,
|
||||
Cluster* cluster) {
|
||||
if (!writer || !frame || !frame->IsValid() || !cluster ||
|
||||
!cluster->timecode_scale())
|
||||
return 0;
|
||||
|
||||
// Technically the timecode for a block can be less than the
|
||||
// timecode for the cluster itself (remember that block timecode
|
||||
// is a signed, 16-bit integer). However, as a simplification we
|
||||
// only permit non-negative cluster-relative timecodes for blocks.
|
||||
const int64 relative_timecode = cluster->GetRelativeTimecode(
|
||||
frame->timestamp() / cluster->timecode_scale());
|
||||
if (relative_timecode < 0 || relative_timecode > kMaxBlockTimecode)
|
||||
return 0;
|
||||
|
||||
return frame->CanBeSimpleBlock()
|
||||
? WriteSimpleBlock(writer, frame, relative_timecode)
|
||||
: WriteBlock(writer, frame, relative_timecode,
|
||||
cluster->timecode_scale());
|
||||
}
|
||||
|
||||
uint64 WriteVoidElement(IMkvWriter* writer, uint64 size) {
|
||||
if (!writer)
|
||||
return false;
|
||||
|
||||
// Subtract one for the void ID and the coded size.
|
||||
uint64 void_entry_size = size - 1 - GetCodedUIntSize(size - 1);
|
||||
uint64 void_size = EbmlMasterElementSize(libwebm::kMkvVoid, void_entry_size) +
|
||||
void_entry_size;
|
||||
|
||||
if (void_size != size)
|
||||
return 0;
|
||||
|
||||
const int64 payload_position = writer->Position();
|
||||
if (payload_position < 0)
|
||||
return 0;
|
||||
|
||||
if (WriteID(writer, libwebm::kMkvVoid))
|
||||
return 0;
|
||||
|
||||
if (WriteUInt(writer, void_entry_size))
|
||||
return 0;
|
||||
|
||||
const uint8 value = 0;
|
||||
for (int32 i = 0; i < static_cast<int32>(void_entry_size); ++i) {
|
||||
if (writer->Write(&value, 1))
|
||||
return 0;
|
||||
}
|
||||
|
||||
const int64 stop_position = writer->Position();
|
||||
if (stop_position < 0 ||
|
||||
stop_position - payload_position != static_cast<int64>(void_size))
|
||||
return 0;
|
||||
|
||||
return void_size;
|
||||
}
|
||||
|
||||
void GetVersion(int32_t* major, int32_t* minor, int32_t* build, int32_t* revision) {
|
||||
*major = 0;
|
||||
*minor = 3;
|
||||
*build = 3;
|
||||
*revision = 0;
|
||||
}
|
||||
|
||||
uint64 MakeUID(unsigned int* seed) {
|
||||
uint64 uid = 0;
|
||||
|
||||
for (int i = 0; i < 7; ++i) { // avoid problems with 8-byte values
|
||||
uid <<= 8;
|
||||
|
||||
// TODO(fgalligan): Move random number generation to platform specific code.
|
||||
#ifdef _WIN32
|
||||
(void)seed;
|
||||
const int32 nn = rand();
|
||||
#elif defined(__ANDROID__)
|
||||
(void)seed;
|
||||
int32 temp_num = 1;
|
||||
int fd = open("/dev/urandom", O_RDONLY);
|
||||
if (fd != -1) {
|
||||
read(fd, &temp_num, sizeof(temp_num));
|
||||
close(fd);
|
||||
}
|
||||
const int32 nn = temp_num;
|
||||
#else
|
||||
const int32 nn = rand_r(seed);
|
||||
#endif
|
||||
const int32 n = 0xFF & (nn >> 4); // throw away low-order bits
|
||||
|
||||
uid |= n;
|
||||
}
|
||||
|
||||
return uid;
|
||||
}
|
||||
|
||||
bool IsMatrixCoefficientsValueValid(uint64_t value) {
|
||||
switch (value) {
|
||||
case mkvmuxer::Colour::kGbr:
|
||||
case mkvmuxer::Colour::kBt709:
|
||||
case mkvmuxer::Colour::kUnspecifiedMc:
|
||||
case mkvmuxer::Colour::kReserved:
|
||||
case mkvmuxer::Colour::kFcc:
|
||||
case mkvmuxer::Colour::kBt470bg:
|
||||
case mkvmuxer::Colour::kSmpte170MMc:
|
||||
case mkvmuxer::Colour::kSmpte240MMc:
|
||||
case mkvmuxer::Colour::kYcocg:
|
||||
case mkvmuxer::Colour::kBt2020NonConstantLuminance:
|
||||
case mkvmuxer::Colour::kBt2020ConstantLuminance:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsChromaSitingHorzValueValid(uint64_t value) {
|
||||
switch (value) {
|
||||
case mkvmuxer::Colour::kUnspecifiedCsh:
|
||||
case mkvmuxer::Colour::kLeftCollocated:
|
||||
case mkvmuxer::Colour::kHalfCsh:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsChromaSitingVertValueValid(uint64_t value) {
|
||||
switch (value) {
|
||||
case mkvmuxer::Colour::kUnspecifiedCsv:
|
||||
case mkvmuxer::Colour::kTopCollocated:
|
||||
case mkvmuxer::Colour::kHalfCsv:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsColourRangeValueValid(uint64_t value) {
|
||||
switch (value) {
|
||||
case mkvmuxer::Colour::kUnspecifiedCr:
|
||||
case mkvmuxer::Colour::kBroadcastRange:
|
||||
case mkvmuxer::Colour::kFullRange:
|
||||
case mkvmuxer::Colour::kMcTcDefined:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsTransferCharacteristicsValueValid(uint64_t value) {
|
||||
switch (value) {
|
||||
case mkvmuxer::Colour::kIturBt709Tc:
|
||||
case mkvmuxer::Colour::kUnspecifiedTc:
|
||||
case mkvmuxer::Colour::kReservedTc:
|
||||
case mkvmuxer::Colour::kGamma22Curve:
|
||||
case mkvmuxer::Colour::kGamma28Curve:
|
||||
case mkvmuxer::Colour::kSmpte170MTc:
|
||||
case mkvmuxer::Colour::kSmpte240MTc:
|
||||
case mkvmuxer::Colour::kLinear:
|
||||
case mkvmuxer::Colour::kLog:
|
||||
case mkvmuxer::Colour::kLogSqrt:
|
||||
case mkvmuxer::Colour::kIec6196624:
|
||||
case mkvmuxer::Colour::kIturBt1361ExtendedColourGamut:
|
||||
case mkvmuxer::Colour::kIec6196621:
|
||||
case mkvmuxer::Colour::kIturBt202010bit:
|
||||
case mkvmuxer::Colour::kIturBt202012bit:
|
||||
case mkvmuxer::Colour::kSmpteSt2084:
|
||||
case mkvmuxer::Colour::kSmpteSt4281Tc:
|
||||
case mkvmuxer::Colour::kAribStdB67Hlg:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsPrimariesValueValid(uint64_t value) {
|
||||
switch (value) {
|
||||
case mkvmuxer::Colour::kReservedP0:
|
||||
case mkvmuxer::Colour::kIturBt709P:
|
||||
case mkvmuxer::Colour::kUnspecifiedP:
|
||||
case mkvmuxer::Colour::kReservedP3:
|
||||
case mkvmuxer::Colour::kIturBt470M:
|
||||
case mkvmuxer::Colour::kIturBt470Bg:
|
||||
case mkvmuxer::Colour::kSmpte170MP:
|
||||
case mkvmuxer::Colour::kSmpte240MP:
|
||||
case mkvmuxer::Colour::kFilm:
|
||||
case mkvmuxer::Colour::kIturBt2020:
|
||||
case mkvmuxer::Colour::kSmpteSt4281P:
|
||||
case mkvmuxer::Colour::kJedecP22Phosphors:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace mkvmuxer
|
||||
#endif // ESP32
|
117
lib/lib_audio/ESP8266Audio/src/libwebm/mkvmuxer/mkvmuxerutil.h
Normal file
117
lib/lib_audio/ESP8266Audio/src/libwebm/mkvmuxer/mkvmuxerutil.h
Normal file
@ -0,0 +1,117 @@
|
||||
// Copyright (c) 2012 The WebM project authors. All Rights Reserved.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style license
|
||||
// that can be found in the LICENSE file in the root of the source
|
||||
// tree. An additional intellectual property rights grant can be found
|
||||
// in the file PATENTS. All contributing project authors may
|
||||
// be found in the AUTHORS file in the root of the source tree.
|
||||
#ifndef MKVMUXER_MKVMUXERUTIL_H_
|
||||
#define MKVMUXER_MKVMUXERUTIL_H_
|
||||
#ifdef ESP32
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "mkvmuxertypes.h"
|
||||
|
||||
namespace mkvmuxer {
|
||||
class Cluster;
|
||||
class Frame;
|
||||
class IMkvWriter;
|
||||
|
||||
// TODO(tomfinegan): mkvmuxer:: integer types continue to be used here because
|
||||
// changing them causes pain for downstream projects. It would be nice if a
|
||||
// solution that allows removal of the mkvmuxer:: integer types while avoiding
|
||||
// pain for downstream users of libwebm. Considering that mkvmuxerutil.{cc,h}
|
||||
// are really, for the great majority of cases, EBML size calculation and writer
|
||||
// functions, perhaps a more EBML focused utility would be the way to go as a
|
||||
// first step.
|
||||
|
||||
const uint64 kEbmlUnknownValue = 0x01FFFFFFFFFFFFFFULL;
|
||||
const int64 kMaxBlockTimecode = 0x07FFFLL;
|
||||
|
||||
// Writes out |value| in Big Endian order. Returns 0 on success.
|
||||
int32 SerializeInt(IMkvWriter* writer, int64 value, int32 size);
|
||||
|
||||
// Writes out |f| in Big Endian order. Returns 0 on success.
|
||||
int32 SerializeFloat(IMkvWriter* writer, float f);
|
||||
|
||||
// Returns the size in bytes of the element.
|
||||
int32 GetUIntSize(uint64 value);
|
||||
int32 GetIntSize(int64 value);
|
||||
int32 GetCodedUIntSize(uint64 value);
|
||||
uint64 EbmlMasterElementSize(uint64 type, uint64 value);
|
||||
uint64 EbmlElementSize(uint64 type, int64 value);
|
||||
uint64 EbmlElementSize(uint64 type, uint64 value);
|
||||
uint64 EbmlElementSize(uint64 type, float value);
|
||||
uint64 EbmlElementSize(uint64 type, const char* value);
|
||||
uint64 EbmlElementSize(uint64 type, const uint8* value, uint64 size);
|
||||
uint64 EbmlDateElementSize(uint64 type);
|
||||
|
||||
// Returns the size in bytes of the element assuming that the element was
|
||||
// written using |fixed_size| bytes. If |fixed_size| is set to zero, then it
|
||||
// computes the necessary number of bytes based on |value|.
|
||||
uint64 EbmlElementSize(uint64 type, uint64 value, uint64 fixed_size);
|
||||
|
||||
// Creates an EBML coded number from |value| and writes it out. The size of
|
||||
// the coded number is determined by the value of |value|. |value| must not
|
||||
// be in a coded form. Returns 0 on success.
|
||||
int32 WriteUInt(IMkvWriter* writer, uint64 value);
|
||||
|
||||
// Creates an EBML coded number from |value| and writes it out. The size of
|
||||
// the coded number is determined by the value of |size|. |value| must not
|
||||
// be in a coded form. Returns 0 on success.
|
||||
int32 WriteUIntSize(IMkvWriter* writer, uint64 value, int32 size);
|
||||
|
||||
// Output an Mkv master element. Returns true if the element was written.
|
||||
bool WriteEbmlMasterElement(IMkvWriter* writer, uint64 value, uint64 size);
|
||||
|
||||
// Outputs an Mkv ID, calls |IMkvWriter::ElementStartNotify|, and passes the
|
||||
// ID to |SerializeInt|. Returns 0 on success.
|
||||
int32 WriteID(IMkvWriter* writer, uint64 type);
|
||||
|
||||
// Output an Mkv non-master element. Returns true if the element was written.
|
||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, uint64 value);
|
||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, int64 value);
|
||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, float value);
|
||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, const char* value);
|
||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, const uint8* value,
|
||||
uint64 size);
|
||||
bool WriteEbmlDateElement(IMkvWriter* writer, uint64 type, int64 value);
|
||||
|
||||
// Output an Mkv non-master element using fixed size. The element will be
|
||||
// written out using exactly |fixed_size| bytes. If |fixed_size| is set to zero
|
||||
// then it computes the necessary number of bytes based on |value|. Returns true
|
||||
// if the element was written.
|
||||
bool WriteEbmlElement(IMkvWriter* writer, uint64 type, uint64 value,
|
||||
uint64 fixed_size);
|
||||
|
||||
// Output a Mkv Frame. It decides the correct element to write (Block vs
|
||||
// SimpleBlock) based on the parameters of the Frame.
|
||||
uint64 WriteFrame(IMkvWriter* writer, const Frame* const frame,
|
||||
Cluster* cluster);
|
||||
|
||||
// Output a void element. |size| must be the entire size in bytes that will be
|
||||
// void. The function will calculate the size of the void header and subtract
|
||||
// it from |size|.
|
||||
uint64 WriteVoidElement(IMkvWriter* writer, uint64 size);
|
||||
|
||||
// Returns the version number of the muxer in |major|, |minor|, |build|,
|
||||
// and |revision|.
|
||||
void GetVersion(int32_t* major, int32_t* minor, int32_t* build, int32_t* revision);
|
||||
|
||||
// Returns a random number to be used for UID, using |seed| to seed
|
||||
// the random-number generator (see POSIX rand_r() for semantics).
|
||||
uint64 MakeUID(unsigned int* seed);
|
||||
|
||||
// Colour field validation helpers. All return true when |value| is valid.
|
||||
bool IsMatrixCoefficientsValueValid(uint64_t value);
|
||||
bool IsChromaSitingHorzValueValid(uint64_t value);
|
||||
bool IsChromaSitingVertValueValid(uint64_t value);
|
||||
bool IsColourRangeValueValid(uint64_t value);
|
||||
bool IsTransferCharacteristicsValueValid(uint64_t value);
|
||||
bool IsPrimariesValueValid(uint64_t value);
|
||||
|
||||
} // namespace mkvmuxer
|
||||
|
||||
#endif // ESP32
|
||||
#endif // MKVMUXER_MKVMUXERUTIL_H_
|
101
lib/lib_audio/ESP8266Audio/src/libwebm/mkvmuxer/mkvwriter.cc
Normal file
101
lib/lib_audio/ESP8266Audio/src/libwebm/mkvmuxer/mkvwriter.cc
Normal file
@ -0,0 +1,101 @@
|
||||
// Copyright (c) 2012 The WebM project authors. All Rights Reserved.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style license
|
||||
// that can be found in the LICENSE file in the root of the source
|
||||
// tree. An additional intellectual property rights grant can be found
|
||||
// in the file PATENTS. All contributing project authors may
|
||||
// be found in the AUTHORS file in the root of the source tree.
|
||||
|
||||
#include "mkvwriter.h"
|
||||
#ifdef ESP32
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <share.h> // for _SH_DENYWR
|
||||
#endif
|
||||
|
||||
namespace mkvmuxer {
|
||||
|
||||
MkvWriter::MkvWriter() : file_(NULL), writer_owns_file_(true) {}
|
||||
|
||||
MkvWriter::MkvWriter(File* fp) : file_(fp), writer_owns_file_(false), use_write_cb_(false) {}
|
||||
|
||||
MkvWriter::MkvWriter(void* userdata, int(*cb)(void* userdata, const void* buffer, uint32 length)) : write_cb_(cb), cb_userdata_(userdata), writer_owns_file_(false), use_write_cb_(true) {}
|
||||
|
||||
MkvWriter::~MkvWriter() { Close(); }
|
||||
|
||||
int32 MkvWriter::Write(const void* buffer, uint32 length) {
|
||||
if (!file_ && !write_cb_)
|
||||
return -1;
|
||||
|
||||
if (length == 0)
|
||||
return 0;
|
||||
|
||||
if (buffer == NULL)
|
||||
return -1;
|
||||
|
||||
size_t bytes_written = 0;
|
||||
if(!use_write_cb_){
|
||||
bytes_written = file_->write((const uint8_t *)buffer, (size_t)length);
|
||||
} else {
|
||||
bytes_written = write_cb_(cb_userdata_, buffer, length);
|
||||
write_cb_written_ += bytes_written;
|
||||
}
|
||||
|
||||
return (bytes_written == length) ? 0 : -1;
|
||||
}
|
||||
|
||||
bool MkvWriter::Open(const char* filename) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void MkvWriter::Close() {
|
||||
if (file_ && writer_owns_file_) {
|
||||
file_->close();
|
||||
}
|
||||
file_ = NULL;
|
||||
}
|
||||
|
||||
int64 MkvWriter::Position() const {
|
||||
if (!file_ || use_write_cb_)
|
||||
return write_cb_written_;
|
||||
|
||||
return file_->position();
|
||||
}
|
||||
|
||||
int32 MkvWriter::Position(int64 position) {
|
||||
if (use_write_cb_ && write_cb_written_ == position)
|
||||
return 0;
|
||||
if (!file_ || use_write_cb_)
|
||||
return -1;
|
||||
|
||||
return file_->seek(position);
|
||||
|
||||
// #ifdef _MSC_VER
|
||||
// return _fseeki64(file_, position, SEEK_SET);
|
||||
// #elif defined(_WIN32)
|
||||
// return fseeko64(file_, static_cast<off_t>(position), SEEK_SET);
|
||||
// #elif !(defined(__ANDROID__) && __ANDROID_API__ < 24 && !defined(__LP64__) && \
|
||||
// defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
|
||||
// // POSIX.1 has fseeko and ftello. fseeko and ftello are not available before
|
||||
// // Android API level 24. See
|
||||
// // https://android.googlesource.com/platform/bionic/+/main/docs/32-bit-abi.md
|
||||
// // return fseeko(file_, static_cast<off_t>(position), SEEK_SET);
|
||||
// #else
|
||||
// return fseek(file_, static_cast<long>(position), SEEK_SET);
|
||||
// #endif
|
||||
// return -1;
|
||||
}
|
||||
|
||||
bool MkvWriter::Seekable() const {
|
||||
if (!file_ || use_write_cb_)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void MkvWriter::ElementStartNotify(uint64, int64) {}
|
||||
|
||||
} // namespace mkvmuxer
|
||||
#endif // ESP32
|
60
lib/lib_audio/ESP8266Audio/src/libwebm/mkvmuxer/mkvwriter.h
Normal file
60
lib/lib_audio/ESP8266Audio/src/libwebm/mkvmuxer/mkvwriter.h
Normal file
@ -0,0 +1,60 @@
|
||||
// Copyright (c) 2012 The WebM project authors. All Rights Reserved.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style license
|
||||
// that can be found in the LICENSE file in the root of the source
|
||||
// tree. An additional intellectual property rights grant can be found
|
||||
// in the file PATENTS. All contributing project authors may
|
||||
// be found in the AUTHORS file in the root of the source tree.
|
||||
|
||||
#ifndef MKVMUXER_MKVWRITER_H_
|
||||
#define MKVMUXER_MKVWRITER_H_
|
||||
|
||||
#ifdef ESP32
|
||||
#include <stdio.h>
|
||||
|
||||
#include <FS.h>
|
||||
#include "mkvmuxer.h"
|
||||
#include "mkvmuxertypes.h"
|
||||
|
||||
namespace mkvmuxer {
|
||||
|
||||
// Default implementation of the IMkvWriter interface on Windows.
|
||||
class MkvWriter : public IMkvWriter {
|
||||
public:
|
||||
MkvWriter();
|
||||
MkvWriter(File* fp);
|
||||
MkvWriter(void* userdata, int(*cb)(void* userdata, const void* buffer, uint32 length));
|
||||
virtual ~MkvWriter();
|
||||
|
||||
// IMkvWriter interface
|
||||
virtual int64 Position() const;
|
||||
virtual int32 Position(int64 position);
|
||||
virtual bool Seekable() const;
|
||||
virtual int32 Write(const void* buffer, uint32 length);
|
||||
virtual void ElementStartNotify(uint64 element_id, int64 position);
|
||||
|
||||
// Creates and opens a file for writing. |filename| is the name of the file
|
||||
// to open. This function will overwrite the contents of |filename|. Returns
|
||||
// true on success.
|
||||
bool Open(const char* filename);
|
||||
|
||||
// Closes an opened file.
|
||||
void Close();
|
||||
|
||||
private:
|
||||
// File handle to output file.
|
||||
File* file_;
|
||||
// Callback function to output stream.
|
||||
int(*write_cb_)(void* userdata, const void* buffer, uint32 length);
|
||||
void* cb_userdata_;
|
||||
bool writer_owns_file_;
|
||||
bool use_write_cb_;
|
||||
uint32_t write_cb_written_ = 0;
|
||||
|
||||
LIBWEBM_DISALLOW_COPY_AND_ASSIGN(MkvWriter);
|
||||
};
|
||||
|
||||
} // namespace mkvmuxer
|
||||
|
||||
#endif // ESP32
|
||||
#endif // MKVMUXER_MKVWRITER_H_
|
8107
lib/lib_audio/ESP8266Audio/src/libwebm/mkvparser/mkvparser.cc
Normal file
8107
lib/lib_audio/ESP8266Audio/src/libwebm/mkvparser/mkvparser.cc
Normal file
File diff suppressed because it is too large
Load Diff
1147
lib/lib_audio/ESP8266Audio/src/libwebm/mkvparser/mkvparser.h
Normal file
1147
lib/lib_audio/ESP8266Audio/src/libwebm/mkvparser/mkvparser.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -90,12 +90,12 @@ int op_test(OpusHead *_head,
|
||||
ogg_sync_init(&oy);
|
||||
data=ogg_sync_buffer(&oy,(long)_initial_bytes);
|
||||
if(data!=NULL){
|
||||
ogg_stream_state *os = (ogg_stream_state*)malloc(sizeof(ogg_stream_state));
|
||||
ogg_stream_state os;
|
||||
ogg_page og;
|
||||
int ret;
|
||||
memcpy(data,_initial_data,_initial_bytes);
|
||||
ogg_sync_wrote(&oy,(long)_initial_bytes);
|
||||
ogg_stream_init(os,-1);
|
||||
ogg_stream_init(&os,-1);
|
||||
err=OP_FALSE;
|
||||
do{
|
||||
ogg_packet op;
|
||||
@ -104,11 +104,11 @@ int op_test(OpusHead *_head,
|
||||
if(ret<0)continue;
|
||||
/*Stop if we run out of data.*/
|
||||
if(!ret)break;
|
||||
ogg_stream_reset_serialno(os,ogg_page_serialno(&og));
|
||||
ogg_stream_pagein(os,&og);
|
||||
ogg_stream_reset_serialno(&os,ogg_page_serialno(&og));
|
||||
ogg_stream_pagein(&os,&og);
|
||||
/*Only process the first packet on this page (if it's a BOS packet,
|
||||
it's required to be the only one).*/
|
||||
if(ogg_stream_packetout(os,&op)==1){
|
||||
if(ogg_stream_packetout(&os,&op)==1){
|
||||
if(op.b_o_s){
|
||||
ret=opus_head_parse(_head,op.packet,op.bytes);
|
||||
/*If this didn't look like Opus, keep going.*/
|
||||
@ -122,8 +122,7 @@ int op_test(OpusHead *_head,
|
||||
}
|
||||
}
|
||||
while(err==OP_FALSE);
|
||||
ogg_stream_clear(os);
|
||||
free(os);
|
||||
ogg_stream_clear(&os);
|
||||
}
|
||||
else err=OP_EFAULT;
|
||||
ogg_sync_clear(&oy);
|
||||
@ -836,7 +835,7 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of,
|
||||
ogg_int64_t cur_page_gp;
|
||||
ogg_uint32_t serialno;
|
||||
opus_int32 total_duration;
|
||||
int *durations = (int*)malloc(255 * sizeof(int));
|
||||
int durations[255];
|
||||
int cur_page_eos;
|
||||
int op_count;
|
||||
int pi;
|
||||
@ -853,31 +852,26 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of,
|
||||
Otherwise there are no audio data packets in the whole logical stream.*/
|
||||
if(OP_UNLIKELY(page_offset<0)){
|
||||
/*Fail if there was a read error.*/
|
||||
if(page_offset<OP_FALSE) { free(durations); return (int)page_offset; }
|
||||
if(page_offset<OP_FALSE)return (int)page_offset;
|
||||
/*Fail if the pre-skip is non-zero, since it's asking us to skip more
|
||||
samples than exist.*/
|
||||
if(_link->head.pre_skip>0) {free(durations); return OP_EBADTIMESTAMP;}
|
||||
if(_link->head.pre_skip>0)return OP_EBADTIMESTAMP;
|
||||
_link->pcm_file_offset=0;
|
||||
/*Set pcm_end and end_offset so we can skip the call to
|
||||
op_find_final_pcm_offset().*/
|
||||
_link->pcm_start=_link->pcm_end=0;
|
||||
_link->end_offset=_link->data_offset;
|
||||
free(durations);
|
||||
return 0;
|
||||
}
|
||||
/*Similarly, if we hit the next link in the chain, we've gone too far.*/
|
||||
if(OP_UNLIKELY(ogg_page_bos(_og))){
|
||||
if(_link->head.pre_skip>0) {
|
||||
free(durations);
|
||||
return OP_EBADTIMESTAMP;
|
||||
}
|
||||
if(_link->head.pre_skip>0)return OP_EBADTIMESTAMP;
|
||||
/*Set pcm_end and end_offset so we can skip the call to
|
||||
op_find_final_pcm_offset().*/
|
||||
_link->pcm_file_offset=0;
|
||||
_link->pcm_start=_link->pcm_end=0;
|
||||
_link->end_offset=_link->data_offset;
|
||||
/*Tell the caller we've got a buffered page for them.*/
|
||||
free(durations);
|
||||
return 1;
|
||||
}
|
||||
/*Ignore pages from other streams (not strictly necessary, because of the
|
||||
@ -907,10 +901,7 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of,
|
||||
cur_page_gp=_of->op[op_count-1].granulepos;
|
||||
/*But getting a packet without a valid granule position on the page is not
|
||||
okay.*/
|
||||
if(cur_page_gp==-1) {
|
||||
free(durations);
|
||||
return OP_EBADTIMESTAMP;
|
||||
}
|
||||
if(cur_page_gp==-1)return OP_EBADTIMESTAMP;
|
||||
cur_page_eos=_of->op[op_count-1].e_o_s;
|
||||
if(OP_LIKELY(!cur_page_eos)){
|
||||
/*The EOS flag wasn't set.
|
||||
@ -919,7 +910,6 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of,
|
||||
if(OP_UNLIKELY(op_granpos_add(&pcm_start,cur_page_gp,-total_duration)<0)){
|
||||
/*The starting granule position MUST not be smaller than the amount of
|
||||
audio on the first page with completed packets.*/
|
||||
free(durations);
|
||||
return OP_EBADTIMESTAMP;
|
||||
}
|
||||
}
|
||||
@ -933,7 +923,6 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of,
|
||||
/*However, the end-trimming MUST not ask us to trim more samples than
|
||||
exist after applying the pre-skip.*/
|
||||
if(OP_UNLIKELY(op_granpos_cmp(cur_page_gp,_link->head.pre_skip)<0)){
|
||||
free(durations);
|
||||
return OP_EBADTIMESTAMP;
|
||||
}
|
||||
}
|
||||
@ -968,7 +957,6 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of,
|
||||
_link->pcm_file_offset=0;
|
||||
_of->prev_packet_gp=_link->pcm_start=pcm_start;
|
||||
_of->prev_page_offset=page_offset;
|
||||
free(durations);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1403,34 +1391,32 @@ static int op_open_seekable2_impl(OggOpusFile *_of){
|
||||
/*64 seek records should be enough for anybody.
|
||||
Actually, with a bisection search in a 63-bit range down to OP_CHUNK_SIZE
|
||||
granularity, much more than enough.*/
|
||||
OpusSeekRecord *sr = (OpusSeekRecord*)malloc(64 * sizeof(OpusSeekRecord));
|
||||
OpusSeekRecord sr[64];
|
||||
opus_int64 data_offset;
|
||||
int ret;
|
||||
/*We can seek, so set out learning all about this file.*/
|
||||
(*_of->callbacks.seek)(_of->stream,0,SEEK_END);
|
||||
_of->offset=_of->end=(*_of->callbacks.tell)(_of->stream);
|
||||
if(OP_UNLIKELY(_of->end<0)){free(sr); return OP_EREAD;}
|
||||
if(OP_UNLIKELY(_of->end<0))return OP_EREAD;
|
||||
data_offset=_of->links[0].data_offset;
|
||||
if(OP_UNLIKELY(_of->end<data_offset)){ free(sr); return OP_EBADLINK;}
|
||||
if(OP_UNLIKELY(_of->end<data_offset))return OP_EBADLINK;
|
||||
/*Get the offset of the last page of the physical bitstream, or, if we're
|
||||
lucky, the last Opus page of the first link, as most Ogg Opus files will
|
||||
contain a single logical bitstream.*/
|
||||
ret=op_get_prev_page_serial(_of,sr,_of->end,
|
||||
_of->links[0].serialno,_of->serialnos,_of->nserialnos);
|
||||
if(OP_UNLIKELY(ret<0)){free(sr); return ret;}
|
||||
if(OP_UNLIKELY(ret<0))return ret;
|
||||
/*If there's any trailing junk, forget about it.*/
|
||||
_of->end=sr[0].offset+sr[0].size;
|
||||
if(OP_UNLIKELY(_of->end<data_offset)){free(sr); return OP_EBADLINK;}
|
||||
if(OP_UNLIKELY(_of->end<data_offset))return OP_EBADLINK;
|
||||
/*Now enumerate the bitstream structure.*/
|
||||
ret = op_bisect_forward_serialno(_of,data_offset,sr,sizeof(sr)/sizeof(*sr),
|
||||
return op_bisect_forward_serialno(_of,data_offset,sr,sizeof(sr)/sizeof(*sr),
|
||||
&_of->serialnos,&_of->nserialnos,&_of->cserialnos);
|
||||
free(sr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int op_open_seekable2(OggOpusFile *_of){
|
||||
ogg_sync_state oy_start;
|
||||
ogg_stream_state *os_start = (ogg_stream_state*)malloc(sizeof(ogg_stream_state));
|
||||
ogg_stream_state os_start;
|
||||
ogg_packet *op_start;
|
||||
opus_int64 prev_page_offset;
|
||||
opus_int64 start_offset;
|
||||
@ -1449,9 +1435,9 @@ static int op_open_seekable2(OggOpusFile *_of){
|
||||
start_op_count=_of->op_count;
|
||||
/*This is a bit too large to put on the stack unconditionally.*/
|
||||
op_start=(ogg_packet *)_ogg_malloc(sizeof(*op_start)*start_op_count);
|
||||
if(op_start==NULL){free(os_start); return OP_EFAULT;}
|
||||
if(op_start==NULL)return OP_EFAULT;
|
||||
*&oy_start=_of->oy;
|
||||
*os_start=_of->os;
|
||||
*&os_start=_of->os;
|
||||
prev_page_offset=_of->prev_page_offset;
|
||||
start_offset=_of->offset;
|
||||
memcpy(op_start,_of->op,sizeof(*op_start)*start_op_count);
|
||||
@ -1463,7 +1449,7 @@ static int op_open_seekable2(OggOpusFile *_of){
|
||||
ogg_stream_clear(&_of->os);
|
||||
ogg_sync_clear(&_of->oy);
|
||||
*&_of->oy=*&oy_start;
|
||||
*&_of->os=*os_start;
|
||||
*&_of->os=*&os_start;
|
||||
_of->offset=start_offset;
|
||||
_of->op_count=start_op_count;
|
||||
memcpy(_of->op,op_start,sizeof(*_of->op)*start_op_count);
|
||||
@ -1471,10 +1457,9 @@ static int op_open_seekable2(OggOpusFile *_of){
|
||||
_of->prev_packet_gp=_of->links[0].pcm_start;
|
||||
_of->prev_page_offset=prev_page_offset;
|
||||
_of->cur_discard_count=_of->links[0].head.pre_skip;
|
||||
if(OP_UNLIKELY(ret<0)){free(os_start); return ret;}
|
||||
if(OP_UNLIKELY(ret<0))return ret;
|
||||
/*And restore the position indicator.*/
|
||||
ret=(*_of->callbacks.seek)(_of->stream,op_position(_of),SEEK_SET);
|
||||
free(os_start);
|
||||
return OP_UNLIKELY(ret<0)?OP_EREAD:0;
|
||||
}
|
||||
|
||||
@ -1995,7 +1980,7 @@ static int op_fetch_and_process_page(OggOpusFile *_of,
|
||||
ogg_stream_pagein(&_of->os,&og);
|
||||
if(OP_LIKELY(_of->ready_state>=OP_INITSET)){
|
||||
opus_int32 total_duration;
|
||||
int *durations = (int*)malloc(255 * sizeof(int));
|
||||
int durations[255];
|
||||
int op_count;
|
||||
int report_hole;
|
||||
report_hole=0;
|
||||
@ -2052,7 +2037,7 @@ static int op_fetch_and_process_page(OggOpusFile *_of,
|
||||
Proceed to the next link, rather than risk playing back some
|
||||
samples that shouldn't have been played.*/
|
||||
_of->op_count=0;
|
||||
if(report_hole){ free(durations); return OP_HOLE; }
|
||||
if(report_hole)return OP_HOLE;
|
||||
continue;
|
||||
}
|
||||
/*By default discard 80 ms of data after a seek, unless we seek
|
||||
@ -2160,9 +2145,9 @@ static int op_fetch_and_process_page(OggOpusFile *_of,
|
||||
_of->prev_page_offset=_page_offset;
|
||||
_of->op_count=op_count=pi;
|
||||
}
|
||||
if(report_hole) { free(durations); return OP_HOLE; }
|
||||
if(report_hole)return OP_HOLE;
|
||||
/*If end-trimming didn't trim all the packets, we're done.*/
|
||||
if(op_count>0) { free(durations); return 0; }
|
||||
if(op_count>0)return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3016,7 +3001,7 @@ static const float OP_STEREO_DOWNMIX[OP_NCHANNELS_MAX-2][OP_NCHANNELS_MAX][2]={
|
||||
#endif
|
||||
|
||||
#if defined(OP_FIXED_POINT)
|
||||
#if 0
|
||||
|
||||
/*Matrices for downmixing from the supported channel counts to stereo.
|
||||
The matrices with 5 or more channels are normalized to a total volume of 2.0,
|
||||
since most mixes sound too quiet if normalized to 1.0 (as there is generally
|
||||
@ -3025,6 +3010,7 @@ static const float OP_STEREO_DOWNMIX[OP_NCHANNELS_MAX-2][OP_NCHANNELS_MAX][2]={
|
||||
32-bit number.*/
|
||||
static const opus_int16 OP_STEREO_DOWNMIX_Q14
|
||||
[OP_NCHANNELS_MAX-2][OP_NCHANNELS_MAX][2]={
|
||||
#if OP_NCHANNELS_MAX>2
|
||||
/*3.0*/
|
||||
{
|
||||
{9598,0},{6786,6786},{0,9598}
|
||||
@ -3051,8 +3037,9 @@ static const opus_int16 OP_STEREO_DOWNMIX_Q14
|
||||
{6368,0},{4502,4502},{0,6368},{5515,3183},{3183,5515},{5515,3183},
|
||||
{3183,5515},{4502,4502}
|
||||
}
|
||||
#endif // OP_NCHANNELS_MAX>2
|
||||
};
|
||||
#endif
|
||||
|
||||
int op_read(OggOpusFile *_of,opus_int16 *_pcm,int _buf_size,int *_li){
|
||||
return op_read_native(_of,_pcm,_buf_size,_li);
|
||||
}
|
||||
@ -3070,7 +3057,6 @@ static int op_stereo_filter(OggOpusFile *_of,void *_dst,int _dst_sz,
|
||||
for(i=0;i<_nsamples;i++)dst[2*i+0]=dst[2*i+1]=_src[i];
|
||||
}
|
||||
else{
|
||||
#if 0
|
||||
for(i=0;i<_nsamples;i++){
|
||||
opus_int32 l;
|
||||
opus_int32 r;
|
||||
@ -3086,8 +3072,6 @@ static int op_stereo_filter(OggOpusFile *_of,void *_dst,int _dst_sz,
|
||||
dst[2*i+0]=(opus_int16)OP_CLAMP(-32768,l+8192>>14,32767);
|
||||
dst[2*i+1]=(opus_int16)OP_CLAMP(-32768,r+8192>>14,32767);
|
||||
}
|
||||
#endif
|
||||
// noop, removed for RAM savings
|
||||
}
|
||||
}
|
||||
return _nsamples;
|
||||
|
@ -729,7 +729,7 @@ struct OpusServerInfo{
|
||||
/**The software used by the origin server (Server).
|
||||
This is <code>NULL</code> if there was no <code>Server</code> header.*/
|
||||
char *server;
|
||||
/**The media type of the entity sent to the recipient (Content-Type).
|
||||
/**The media type of the entity sent to the recepient (Content-Type).
|
||||
This is <code>NULL</code> if there was no <code>Content-Type</code>
|
||||
header.*/
|
||||
char *content_type;
|
||||
|
@ -402,8 +402,10 @@ void IRac::airton(IRAirtonAc *ac,
|
||||
const int16_t sleep) {
|
||||
ac->begin();
|
||||
ac->setPower(on);
|
||||
ac->setMode(ac->convertMode(mode));
|
||||
ac->setTemp(degrees);
|
||||
// Mode needs to be set after temp as Fan-only uses a special temp.
|
||||
ac->setMode(ac->convertMode(mode));
|
||||
// Fan needs to be set after mode, as setMode can change the fan speed.
|
||||
ac->setFan(ac->convertFan(fan));
|
||||
ac->setSwingV(swingv != stdAc::swingv_t::kOff);
|
||||
// No Quiet setting available.
|
||||
|
@ -9,11 +9,7 @@
|
||||
},
|
||||
"version": "2.6.7",
|
||||
"frameworks": "arduino",
|
||||
"platforms": "*",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "SPI"
|
||||
}
|
||||
]
|
||||
"libCompatMode": "strict",
|
||||
"platforms": ["espressif8266"]
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ typedef struct {
|
||||
rmt_symbol_word_t reset_code;
|
||||
} rmt_led_strip_encoder_t;
|
||||
|
||||
static size_t rmt_encode_led_strip(rmt_encoder_t *encoder, rmt_channel_handle_t channel, const void *primary_data, size_t data_size, rmt_encode_state_t *ret_state)
|
||||
static IRAM_ATTR size_t rmt_encode_led_strip(rmt_encoder_t *encoder, rmt_channel_handle_t channel, const void *primary_data, size_t data_size, rmt_encode_state_t *ret_state)
|
||||
{
|
||||
rmt_led_strip_encoder_t *led_encoder = __containerof(encoder, rmt_led_strip_encoder_t, base);
|
||||
rmt_encoder_handle_t bytes_encoder = led_encoder->bytes_encoder;
|
||||
|
18
lib/lib_basic/TasmotaLED/library.json
Normal file
18
lib/lib_basic/TasmotaLED/library.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "TasmotaLED",
|
||||
"version": "0.1",
|
||||
"keywords": [
|
||||
"ws2816", "sk6812", "leds"
|
||||
],
|
||||
"description": "Lightweight implementation for adressable leds.",
|
||||
"repository":
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/arendst/Tasmota/lib/lib_basic/TasmotaLED"
|
||||
},
|
||||
"frameworks": "arduino",
|
||||
"libCompatMode": "strict",
|
||||
"platforms": [
|
||||
"espressif32"
|
||||
]
|
||||
}
|
264
lib/lib_basic/TasmotaLED/src/TasmotaLED.cpp
Normal file
264
lib/lib_basic/TasmotaLED/src/TasmotaLED.cpp
Normal file
@ -0,0 +1,264 @@
|
||||
/*
|
||||
TasmotaLED.cpp - Lightweight implementation for adressable leds.
|
||||
|
||||
Copyright (C) 2024 Stephan Hadinger
|
||||
|
||||
This library is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
#ifdef ESP32
|
||||
|
||||
#include "TasmotaLEDPusher.h"
|
||||
#include "TasmotaLED.h"
|
||||
|
||||
// DRAM_ATTR to force in IRAM because we use this in show loop
|
||||
static const DRAM_ATTR uint8_t TASMOTALED_CHANNEL_ORDERS[8][3] = {
|
||||
{1, 0, 2}, // Def=GRB (0)
|
||||
{1, 0, 2}, // GRB (1)
|
||||
{0, 1, 2}, // RGB (2)
|
||||
{0, 2, 1}, // RBG (3)
|
||||
{2, 1, 0}, // BRG (4)
|
||||
{1, 2, 0}, // BGR (5)
|
||||
{2, 0, 1}, // GBR (6)
|
||||
{1, 0, 2} // GRB (7) // fallback if erroneous value
|
||||
};
|
||||
|
||||
static const TasmotaLED_Timing TasmotaLED_Timings[] = {
|
||||
// WS2812
|
||||
// RmtBit0 0x00228010 RmtBit1 0x00128020 RmtReset 0x800207D0
|
||||
{
|
||||
.T0H = 400,
|
||||
.T0L = 850,
|
||||
.T1H = 800,
|
||||
.T1L = 450,
|
||||
.Reset = 80000 // it is 50000 for WS2812, but for compatibility with SK6812, we raise to 80000
|
||||
},
|
||||
// SK6812
|
||||
// RmtBit0 0x0024800C RmtBit1 0x00188018 RmtReset 0x80020C80
|
||||
{
|
||||
.T0H = 300,
|
||||
.T0L = 900,
|
||||
.T1H = 600,
|
||||
.T1L = 600,
|
||||
.Reset = 80000
|
||||
},
|
||||
};
|
||||
|
||||
// enable AddLog
|
||||
extern void AddLog(uint32_t loglevel, PGM_P formatP, ...);
|
||||
enum LoggingLevels {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE};
|
||||
|
||||
|
||||
TasmotaLED::TasmotaLED(uint16_t type, uint16_t num_leds) :
|
||||
_type(type),
|
||||
_timing((type >> 8) & 0xFF),
|
||||
_started(false),
|
||||
_dirty(true),
|
||||
_raw_format(false),
|
||||
_pixel_count(num_leds),
|
||||
_buf_work(nullptr),
|
||||
_buf_show(nullptr),
|
||||
_pusher(nullptr)
|
||||
{
|
||||
_adjustSubType(); // compute values for _pixel_order, _w_before, _pixel_matrix
|
||||
if (_timing > (TasmotaLed_TimingEnd >> 8)) {
|
||||
_timing = 0;
|
||||
}
|
||||
switch (_type & 0x0F) {
|
||||
case TasmotaLed_4_WRGB:
|
||||
_pixel_size = 4;
|
||||
break;
|
||||
case TasmotaLed_1_Def:
|
||||
case TasmotaLed_3_RGB:
|
||||
default: // fallback
|
||||
_pixel_size = 3;
|
||||
break;
|
||||
}
|
||||
|
||||
_pixel_matrix = &TASMOTALED_CHANNEL_ORDERS[_pixel_order];
|
||||
|
||||
_buf_work = new uint8_t[_pixel_count * _pixel_size];
|
||||
memset(_buf_work, 0, _pixel_count * _pixel_size);
|
||||
_buf_show = new uint8_t[_pixel_count * _pixel_size];
|
||||
memset(_buf_show, 0, _pixel_count * _pixel_size);
|
||||
// AddLog(LOG_LEVEL_DEBUG, "LED: type=0x%04X pixel_order=0x%02X _timing=%i ", _type, _pixel_order, _timing);
|
||||
}
|
||||
|
||||
TasmotaLED::~TasmotaLED() {
|
||||
if (_pusher) {
|
||||
delete _pusher;
|
||||
_pusher = nullptr;
|
||||
}
|
||||
delete _buf_work;
|
||||
_buf_work = nullptr;
|
||||
delete _buf_show;
|
||||
_buf_show = nullptr;
|
||||
}
|
||||
|
||||
// Adjust all internal parameters accouring to sub-type
|
||||
void TasmotaLED::_adjustSubType(void) {
|
||||
_pixel_order = (_type >> 4) & 0x07;
|
||||
_pixel_matrix = &TASMOTALED_CHANNEL_ORDERS[_pixel_order];
|
||||
_w_before = _type & 0x08;
|
||||
}
|
||||
|
||||
void TasmotaLED::SetPixelCount(uint16_t num_leds) {
|
||||
if (num_leds != _pixel_count) {
|
||||
_pixel_count = num_leds;
|
||||
delete _buf_work;
|
||||
_buf_work = new uint8_t[_pixel_count * _pixel_size];
|
||||
memset(_buf_work, 0, _pixel_count * _pixel_size);
|
||||
delete _buf_show;
|
||||
_buf_show = new uint8_t[_pixel_count * _pixel_size];
|
||||
memset(_buf_show, 0, _pixel_count * _pixel_size);
|
||||
if (_pusher) {
|
||||
_pusher->SetPixelCount(_pixel_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TasmotaLED::SetPixelSubType(uint8_t subtype) {
|
||||
// subtype is only the 8 lower bits of _type
|
||||
_type = (_type & 0xFF00) | (subtype & 0xFF);
|
||||
_adjustSubType();
|
||||
}
|
||||
|
||||
|
||||
// Color is passed as 0xWWRRGGBB and copied as WWRRGGBB in _buf_work
|
||||
void TasmotaLED::ClearTo(uint32_t wrgb, int32_t first, int32_t last) {
|
||||
// adjust first and last to be in range of 0 to _pixel_count-1
|
||||
if (first <0) { first += _pixel_count; }
|
||||
if (last <0) { last += _pixel_count; }
|
||||
if (first < 0) { first = 0; }
|
||||
if (last >= _pixel_count) { last = _pixel_count - 1; }
|
||||
if (first > last) { return; }
|
||||
// adjust to pixel format
|
||||
uint8_t b0 = (wrgb >> 24) & 0xFF;
|
||||
uint8_t b1 = (wrgb >> 16) & 0xFF;
|
||||
uint8_t b2 = (wrgb >> 8) & 0xFF;
|
||||
uint8_t b3 = (wrgb ) & 0xFF;
|
||||
|
||||
if ((b0 | b1 | b2 | b3) == 0) {
|
||||
// special version for clearing to black
|
||||
memset(_buf_work + first * _pixel_size, 0, (last - first + 1) * _pixel_size);
|
||||
} else {
|
||||
// fill sub-buffer with RRGGBB or WWRRGGBB (or raw)
|
||||
uint8_t *buf = _buf_work + first * _pixel_size;
|
||||
for (uint32_t i = first; i <= last; i++) {
|
||||
if (_pixel_size == 4) { *buf++ = b0;}
|
||||
*buf++ = b1;
|
||||
*buf++ = b2;
|
||||
*buf++ = b3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TasmotaLED::Show(void) {
|
||||
if (_pusher) {
|
||||
_dirty = false; // we don't use the _dirty attribute and always show
|
||||
|
||||
// copy the input buffer to the work buffer in format to be understood by LED strip
|
||||
if (_raw_format) {
|
||||
memmove(_buf_show, _buf_work, _pixel_count * _pixel_size); // copy buffer in next buffer so we start with the current content
|
||||
} else {
|
||||
uint8_t *buf_from = _buf_work;
|
||||
uint8_t *buf_to = _buf_show;
|
||||
if (_pixel_size == 3) {
|
||||
// copying with swapping 512 pixels (1536 bytes) takes 124 microseconds to copy, so it's negligeable
|
||||
for (uint32_t i = 0; i < _pixel_count; i++) {
|
||||
buf_to[(*_pixel_matrix)[0]] = buf_from[0]; // R
|
||||
buf_to[(*_pixel_matrix)[1]] = buf_from[1]; // G
|
||||
buf_to[(*_pixel_matrix)[2]] = buf_from[2]; // B
|
||||
buf_to += 3;
|
||||
buf_from += 3;
|
||||
}
|
||||
} else if (_pixel_size == 4) {
|
||||
for (uint32_t i = 0; i < _pixel_count; i++) {
|
||||
if (_w_before) { *buf_to++ = buf_from[3]; }
|
||||
buf_to[(*_pixel_matrix)[0]] = buf_from[0]; // R
|
||||
buf_to[(*_pixel_matrix)[1]] = buf_from[1]; // G
|
||||
buf_to[(*_pixel_matrix)[2]] = buf_from[2]; // B
|
||||
if (!_w_before) { *buf_to++ = buf_from[3]; }
|
||||
buf_to += 3; // one increment already happened
|
||||
buf_from += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
_pusher->Push(_buf_show); // push to leds
|
||||
}
|
||||
}
|
||||
|
||||
void TasmotaLED::SetPixelColor(int32_t index, uint32_t wrgb) {
|
||||
if (index < 0) { index += _pixel_count; }
|
||||
if ((index >= 0) && (index < _pixel_count)) {
|
||||
uint8_t *buf = _buf_work + index * _pixel_size;
|
||||
uint8_t b0 = (wrgb >> 24) & 0xFF;
|
||||
uint8_t b1 = (wrgb >> 16) & 0xFF;
|
||||
uint8_t b2 = (wrgb >> 8) & 0xFF;
|
||||
uint8_t b3 = (wrgb ) & 0xFF;
|
||||
|
||||
if (_pixel_size == 4) { *buf++ = b0;}
|
||||
*buf++ = b1;
|
||||
*buf++ = b2;
|
||||
*buf++ = b3;
|
||||
_dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t TasmotaLED::GetPixelColor(int32_t index) {
|
||||
if (index < 0) { index += _pixel_count; }
|
||||
if ((index >= 0) && (index < _pixel_count)) {
|
||||
uint8_t *buf = _buf_work + index * _pixel_size;
|
||||
uint32_t wrgb = 0;
|
||||
if (_pixel_size == 4) { wrgb = (*buf++) << 24; }
|
||||
wrgb |= (*buf++) << 16;
|
||||
wrgb |= (*buf++) << 8;
|
||||
wrgb |= (*buf++);
|
||||
return wrgb;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void TasmotaLED::SetPusher(TasmotaLEDPusher *pusher) {
|
||||
if (_pusher) {
|
||||
delete _pusher;
|
||||
}
|
||||
_pusher = pusher;
|
||||
_started = false;
|
||||
}
|
||||
|
||||
bool TasmotaLED::Begin(void) {
|
||||
if (_pusher) {
|
||||
if (_started) {
|
||||
return true;
|
||||
} else {
|
||||
const TasmotaLED_Timing * timing = &TasmotaLED_Timings[_timing];
|
||||
// AddLog(LOG_LEVEL_DEBUG, "LED: T0H=%i T0L=%i T1H=%i T1L=%i Reset=%i", timing.T0H, timing.T0L, timing.T1H, timing.T1L, timing.Reset);
|
||||
return _pusher->Begin(_pixel_count, _pixel_size, timing);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool TasmotaLED::CanShow(void) const {
|
||||
if (_pusher) {
|
||||
return _pusher->CanShow();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // ESP32
|
134
lib/lib_basic/TasmotaLED/src/TasmotaLED.h
Normal file
134
lib/lib_basic/TasmotaLED/src/TasmotaLED.h
Normal file
@ -0,0 +1,134 @@
|
||||
/*
|
||||
TasmotaLED.h - Lightweight implementation for adressable leds.
|
||||
|
||||
Copyright (C) 2024 Stephan Hadinger
|
||||
|
||||
This library is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __TASMOTALED_H__
|
||||
#define __TASMOTALED_H__
|
||||
|
||||
enum TasmotaLEDTypesEncoding : uint16_t {
|
||||
// bits 0..3 encode for number of bytes per pixel
|
||||
TasmotaLed_1_Def = 0x0, // Default value - identical to TasmotaLed_3_RGB
|
||||
TasmotaLed_3_RGB = 0x1, // 3 bytes per pixel
|
||||
TasmotaLed_4_WRGB = 0x2, // 4 bytes per pixel
|
||||
// bits 4..6 encode for pixel order
|
||||
TasmotaLed_Def = 0b000 << 4, // Default value - identical to TasmotaLed_GRB
|
||||
TasmotaLed_GRB = 0b001 << 4,
|
||||
TasmotaLed_RGB = 0b010 << 4,
|
||||
TasmotaLed_RBG = 0b011 << 4,
|
||||
TasmotaLed_BRG = 0b100 << 4,
|
||||
TasmotaLed_BGR = 0b101 << 4,
|
||||
TasmotaLed_GBR = 0b110 << 4,
|
||||
// bit 7 sets the position for W channel
|
||||
TasmotaLed_xxxW = 0b0 << 7, // W channel after color
|
||||
TasmotaLed_Wxxx = 0b1 << 7, // W channel before color
|
||||
// bits 8..15 encode for timing specifics
|
||||
TasmotaLed_WS2812 = 0 << 8,
|
||||
TasmotaLed_SK6812 = 1 << 8,
|
||||
TasmotaLed_TimingEnd = 2 << 8,
|
||||
};
|
||||
|
||||
enum TasmotaLEDHardware : uint32_t {
|
||||
// low-order bits are reserved for channels numbers and hardware flags - currenlty not useds
|
||||
// bits 16..23
|
||||
TasmotaLed_HW_Default = 0x000000,
|
||||
TasmotaLed_RMT = (1 << 0) << 16,
|
||||
TasmotaLed_SPI = (1 << 1) << 16,
|
||||
TasmotaLed_I2S = (1 << 2) << 16,
|
||||
TasmotaLed_HW_None = 0xFF << 16, // indicates that the specified HW is not supported
|
||||
};
|
||||
|
||||
// Below is the encoding for full strips
|
||||
// We need to keep backwards compatibility so:
|
||||
// 0 = WS2812 (GRB)
|
||||
// 1 = SK6812 with White (GRBW)
|
||||
enum TasmotaLEDTypes : uint16_t {
|
||||
ws2812_grb = TasmotaLed_3_RGB | TasmotaLed_GRB | TasmotaLed_WS2812, // 1 for backwards compatibility
|
||||
sk6812_grbw = TasmotaLed_4_WRGB | TasmotaLed_GRB | TasmotaLed_xxxW | TasmotaLed_SK6812, // 2 for backwards compatibility
|
||||
sk6812_grb = TasmotaLed_3_RGB | TasmotaLed_GRB | TasmotaLed_SK6812,
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
/*******************************************************************************************\
|
||||
* class TasmotaLED
|
||||
*
|
||||
* This class is a lightweight replacement for NeoPixelBus library with a smaller
|
||||
* implementation focusing only on pushing a buffer to the leds.
|
||||
*
|
||||
* It supports:
|
||||
* - RMT and I2S hardware support
|
||||
* Possible enhancements could be considered with SPI and Serial
|
||||
* - Led size of 3 bytes (GRB) and 4 bytes (GRBW)
|
||||
* APIs take 0xRRGGBB or 0xRRGGBBWW as input
|
||||
* but Internal buffers use GGRRBB and GGRRBBWW
|
||||
* - Led type of WS2812 and SK6812
|
||||
* - There is no buffer swapping, the working buffer is copied to an internal
|
||||
* buffer just before display, so you can keep a reference to the buffer
|
||||
* and modify it without having to worry about the display
|
||||
* - buffer is cleared at start
|
||||
* - "Dirty" is kept for API compatibility with NeoPixelBus but is glbally ignored
|
||||
* so any call to `Show()` pushes the pixels even if they haven't changed.
|
||||
* Control for dirty pixels should be done by the caller if required.
|
||||
* - We tried to keep as close as possible to NeoPixelBus method names to ease transition
|
||||
\*******************************************************************************************/
|
||||
class TasmotaLEDPusher; // forward definition
|
||||
class TasmotaLED {
|
||||
public:
|
||||
TasmotaLED(uint16_t type, uint16_t num_leds);
|
||||
~TasmotaLED();
|
||||
|
||||
void SetPixelCount(uint16_t num_leds);
|
||||
void SetPixelSubType(uint8_t type); // change only Pixel order and pixel size
|
||||
void _adjustSubType(void);
|
||||
|
||||
bool Begin(void);
|
||||
void SetPusher(TasmotaLEDPusher *pusher); // needs to be called before `Begin()`, sets the hardware implementation
|
||||
void Show(void); // pushes the pixels to the LED strip
|
||||
inline void SetRawFormat(bool raw_format) { _raw_format = raw_format; }
|
||||
|
||||
void ClearTo(uint32_t rgbw, int32_t first = 0, int32_t last = -1);
|
||||
void SetPixelColor(int32_t index, uint32_t wrgb);
|
||||
uint32_t GetPixelColor(int32_t index);
|
||||
|
||||
uint8_t GetType(void) const { return _type; }
|
||||
uint16_t PixelCount(void) const { return _pixel_count; }
|
||||
uint8_t PixelSize(void) const { return _pixel_size; }
|
||||
inline uint8_t * Pixels(void) const { return _buf_work; }
|
||||
inline bool IsDirty(void) const { return _dirty; }
|
||||
inline void Dirty(void) { _dirty = true; }
|
||||
|
||||
bool CanShow(void) const;
|
||||
|
||||
protected:
|
||||
uint16_t _type; // the composite type
|
||||
uint8_t _pixel_order; // permutation between RGB and position of W
|
||||
bool _w_before; // true if W channel comes first (4 channels only)
|
||||
uint8_t _timing; // timing code for strip, 0=WS2812, 1=SK6812...
|
||||
bool _started; // true if the hardware implementation is configured
|
||||
bool _dirty; // for NeoPixelBus compatibility, but ignored by `Push()`
|
||||
bool _raw_format; // if true, copy raw to leds, if false, convert from RGB to GRB or LED format
|
||||
uint16_t _pixel_count; // how many pixels in the strip
|
||||
uint8_t _pixel_size; // how many bytes per pixels, only 3 and 4 are supported
|
||||
uint8_t *_buf_work; // buffer used to draw into, can be modified directly by the caller
|
||||
uint8_t *_buf_show; // copy of the buffer used to push to leds, private to this class
|
||||
const uint8_t (*_pixel_matrix)[3]; // pointer to the pixer_order_matrix
|
||||
TasmotaLEDPusher *_pusher; // pixels pusher implementation based on hardware (RMT, I2S...)
|
||||
};
|
||||
|
||||
#endif // __cplusplus
|
||||
#endif // __TASMOTALED_H__
|
98
lib/lib_basic/TasmotaLED/src/TasmotaLEDPusher.cpp
Normal file
98
lib/lib_basic/TasmotaLED/src/TasmotaLEDPusher.cpp
Normal file
@ -0,0 +1,98 @@
|
||||
/*
|
||||
TasmotaLEDPusher.cpp - Implementation to push Leds via hardware acceleration
|
||||
|
||||
Copyright (C) 2024 Stephan Hadinger
|
||||
|
||||
This library is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef ESP32
|
||||
|
||||
#include "TasmotaLEDPusher.h"
|
||||
#include "TasmotaLED.h"
|
||||
|
||||
//**************************************************************************************************************
|
||||
// enable AddLog support within a C++ library
|
||||
extern void AddLog(uint32_t loglevel, PGM_P formatP, ...);
|
||||
enum LoggingLevels {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE};
|
||||
//**************************************************************************************************************
|
||||
|
||||
|
||||
// convert to the appropriate hardware acceleration based on capacities of the SOC
|
||||
uint32_t TasmotaLEDPusher::ResolveHardware(uint32_t hw_input) {
|
||||
// Step 1. discard any unsupported hardware, and replace with TasmotaLed_HW_Default
|
||||
uint32_t hw = hw_input & 0xFF0000; // discard bits 0..15
|
||||
#if !TASMOTALED_HARDWARE_RMT
|
||||
hw &= ~TasmotaLed_RMT; // remove RMT flag if not supported by hardware
|
||||
#endif // TASMOTALED_HARDWARE_RMT
|
||||
#if !TASMOTALED_HARDWARE_SPI
|
||||
hw &= ~TasmotaLed_SPI; // remove SPI flag if not supported by hardware
|
||||
#endif // TASMOTALED_HARDWARE_SPI
|
||||
#if !TASMOTALED_HARDWARE_I2S
|
||||
hw &= ~TasmotaLed_I2S; // remove I2S flag if not supported by hardware
|
||||
#endif // TASMOTALED_HARDWARE_I2S
|
||||
|
||||
// Step 2. If TasmotaLed_HW_Default, find a suitable scheme, RMT preferred
|
||||
#if TASMOTALED_HARDWARE_RMT
|
||||
if (hw == TasmotaLed_HW_Default) {
|
||||
hw |= TasmotaLed_RMT;
|
||||
}
|
||||
#endif // TASMOTALED_HARDWARE_RMT
|
||||
#if TASMOTALED_HARDWARE_I2S
|
||||
if (hw == TasmotaLed_HW_Default) {
|
||||
hw |= TasmotaLed_I2S;
|
||||
}
|
||||
#endif // TASMOTALED_HARDWARE_I2S
|
||||
#if TASMOTALED_HARDWARE_SPI
|
||||
if (hw == TasmotaLed_HW_Default) {
|
||||
hw |= TasmotaLed_SPI;
|
||||
}
|
||||
#endif // TASMOTALED_HARDWARE_SPI
|
||||
return hw;
|
||||
}
|
||||
|
||||
|
||||
TasmotaLEDPusher * TasmotaLEDPusher::Create(uint32_t hw, int8_t gpio) {
|
||||
TasmotaLEDPusher * pusher = nullptr;
|
||||
|
||||
hw = TasmotaLEDPusher::ResolveHardware(hw);
|
||||
|
||||
#if TASMOTALED_HARDWARE_RMT
|
||||
if (pusher == nullptr && (hw & TasmotaLed_RMT)) {
|
||||
pusher = new TasmotaLEDPusherRMT(gpio);
|
||||
if (pusher->Initialized()) {
|
||||
AddLog(LOG_LEVEL_DEBUG, "LED: RMT gpio %i", gpio);
|
||||
} else {
|
||||
AddLog(LOG_LEVEL_INFO, "LED: Error create %s bus failed %i err=%i", "RMT", gpio, pusher->Error());
|
||||
delete pusher;
|
||||
pusher = nullptr;
|
||||
}
|
||||
}
|
||||
#endif // TASMOTALED_HARDWARE_RMT
|
||||
#if TASMOTALED_HARDWARE_SPI
|
||||
if (pusher == nullptr && (hw & TasmotaLed_SPI)) {
|
||||
pusher = new TasmotaLEDPusherSPI(gpio);
|
||||
if (pusher->Initialized()) {
|
||||
AddLog(LOG_LEVEL_DEBUG, "LED: SPI gpio %i", gpio);
|
||||
} else {
|
||||
AddLog(LOG_LEVEL_INFO, "LED: Error create %s bus failed %i err=%i", "SPI", gpio, pusher->Error());
|
||||
delete pusher;
|
||||
pusher = nullptr;
|
||||
}
|
||||
}
|
||||
#endif // TASMOTALED_HARDWARE_SPI
|
||||
return pusher;
|
||||
}
|
||||
|
||||
#endif // ESP32
|
169
lib/lib_basic/TasmotaLED/src/TasmotaLEDPusher.h
Normal file
169
lib/lib_basic/TasmotaLED/src/TasmotaLEDPusher.h
Normal file
@ -0,0 +1,169 @@
|
||||
/*
|
||||
TasmotaLEDPusher.h - Abstract class for Leds pusher (RMT, SPI, I2S...)
|
||||
|
||||
Copyright (C) 2024 Stephan Hadinger
|
||||
|
||||
This library is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __TASMOTALEDPUSHER_H__
|
||||
#define __TASMOTALEDPUSHER_H__
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
// Below are flags to enable of disable each hardware support: RMT, I2S, SPI
|
||||
// By default, only enable RMT support, and SPI is used as fallback if no protocol works
|
||||
//
|
||||
// Use de defines below:
|
||||
// #define TASMOTALED_HARDWARE_RMT 0/1
|
||||
// #define TASMOTALED_HARDWARE_I2S 0/1
|
||||
// #define TASMOTALED_HARDWARE_SPI 0/1
|
||||
//
|
||||
#ifndef TASMOTALED_HARDWARE_RMT
|
||||
#define TASMOTALED_HARDWARE_RMT 1
|
||||
#endif
|
||||
|
||||
#ifndef TASMOTALED_HARDWARE_I2S
|
||||
#define TASMOTALED_HARDWARE_I2S 0
|
||||
#endif
|
||||
|
||||
#ifndef TASMOTALED_HARDWARE_SPI
|
||||
#define TASMOTALED_HARDWARE_SPI 0
|
||||
#endif
|
||||
|
||||
// Disable any hardware if not supported by the SOC
|
||||
#if TASMOTALED_HARDWARE_RMT && !defined(SOC_RMT_SUPPORTED)
|
||||
#undef TASMOTALED_HARDWARE_RMT
|
||||
#define TASMOTALED_HARDWARE_RMT 0
|
||||
#endif
|
||||
|
||||
#if TASMOTALED_HARDWARE_I2S && !defined(SOC_I2S_SUPPORTED)
|
||||
#undef TASMOTALED_HARDWARE_I2S
|
||||
#define TASMOTALED_HARDWARE_I2S 0
|
||||
#endif
|
||||
|
||||
#if TASMOTALED_HARDWARE_SPI && !defined(SOC_GPSPI_SUPPORTED)
|
||||
#undef TASMOTALED_HARDWARE_SPI
|
||||
#define TASMOTALED_HARDWARE_SPI 0
|
||||
#endif
|
||||
|
||||
// if no protocol is defined, use SPI as fallback
|
||||
#if !TASMOTALED_HARDWARE_RMT && !TASMOTALED_HARDWARE_I2S && !TASMOTALED_HARDWARE_SPI
|
||||
#undef TASMOTALED_HARDWARE_SPI
|
||||
#define TASMOTALED_HARDWARE_SPI 1
|
||||
#endif
|
||||
|
||||
// Timing structure for LEDS - in nanoseconds
|
||||
// It is passed by TasmotaLed to the pushers
|
||||
typedef struct TasmotaLED_Timing {
|
||||
uint16_t T0H, T0L, T1H, T1L;
|
||||
uint32_t Reset;
|
||||
} TasmotaLED_Timing;
|
||||
|
||||
/*******************************************************************************************\
|
||||
* class TasmotaLEDPusher
|
||||
*
|
||||
* This is an virtual abstract class for Leds pusher (RMT, SPI, I2S...)
|
||||
*
|
||||
* Below are interfaces for current implementations
|
||||
\*******************************************************************************************/
|
||||
class TasmotaLEDPusher {
|
||||
public:
|
||||
TasmotaLEDPusher() : _initialized(false), _err(ESP_OK), _pixel_count(0), _pixel_size(0), _led_timing(nullptr) {};
|
||||
virtual ~TasmotaLEDPusher() {};
|
||||
|
||||
bool Initialized(void) const { return _initialized; }
|
||||
esp_err_t Error(void) const { return _err; }
|
||||
virtual bool Begin(uint16_t pixel_count, uint16_t pixel_size, const TasmotaLED_Timing * led_timing) {
|
||||
_pixel_count = pixel_count;
|
||||
_pixel_size = pixel_size;
|
||||
_led_timing = led_timing;
|
||||
return true;
|
||||
}
|
||||
virtual bool Push(uint8_t *buf) = 0;
|
||||
virtual bool CanShow(void) = 0;
|
||||
virtual bool SetPixelCount(uint16_t pixel_count) = 0;
|
||||
|
||||
static uint32_t ResolveHardware(uint32_t hw); // convert to the appropriate hardware acceleration based on capacities of the SOC
|
||||
static TasmotaLEDPusher * Create(uint32_t hw, int8_t gpio); // create instance for the provided type, or nullptr if failed
|
||||
|
||||
protected:
|
||||
bool _initialized; // did the hardware got correctly initialized
|
||||
esp_err_t _err;
|
||||
uint16_t _pixel_count;
|
||||
uint16_t _pixel_size;
|
||||
const TasmotaLED_Timing * _led_timing;
|
||||
};
|
||||
|
||||
/*******************************************************************************************\
|
||||
* class TasmotaLEDPusherRMT
|
||||
*
|
||||
* Implementation based on RMT driver
|
||||
\*******************************************************************************************/
|
||||
#if TASMOTALED_HARDWARE_RMT
|
||||
#include "driver/rmt_tx.h"
|
||||
class TasmotaLEDPusherRMT : public TasmotaLEDPusher {
|
||||
public:
|
||||
TasmotaLEDPusherRMT(int8_t pin);
|
||||
~TasmotaLEDPusherRMT();
|
||||
|
||||
bool Begin(uint16_t pixel_count, uint16_t pixel_size, const TasmotaLED_Timing * led_timing) override;
|
||||
bool SetPixelCount(uint16_t pixel_count) override;
|
||||
|
||||
bool Push(uint8_t *buf) override;
|
||||
bool CanShow(void) override;
|
||||
protected:
|
||||
int8_t _pin;
|
||||
rmt_transmit_config_t _tx_config = {};
|
||||
rmt_channel_handle_t _channel = nullptr;;
|
||||
rmt_encoder_handle_t _led_encoder = nullptr;
|
||||
};
|
||||
#endif // TASMOTALED_HARDWARE_RMT
|
||||
|
||||
/*******************************************************************************************\
|
||||
* class TasmotaLEDPusherSPI
|
||||
*
|
||||
* Implementation based on SPI driver, mandatory for C2
|
||||
\*******************************************************************************************/
|
||||
#if TASMOTALED_HARDWARE_SPI
|
||||
#include <driver/spi_master.h>
|
||||
|
||||
typedef struct led_strip_spi_obj_t {
|
||||
uint8_t * pixel_buf;
|
||||
uint16_t strip_len;
|
||||
uint8_t bytes_per_pixel;
|
||||
spi_host_device_t spi_host;
|
||||
spi_device_handle_t spi_device;
|
||||
spi_transaction_t tx_conf; // transaction in process if any
|
||||
} led_strip_spi_obj;
|
||||
|
||||
class TasmotaLEDPusherSPI : public TasmotaLEDPusher {
|
||||
public:
|
||||
TasmotaLEDPusherSPI(int8_t pin);
|
||||
~TasmotaLEDPusherSPI();
|
||||
|
||||
bool Begin(uint16_t pixel_count, uint16_t pixel_size, const TasmotaLED_Timing * led_timing) override;
|
||||
bool SetPixelCount(uint16_t pixel_count) override;
|
||||
|
||||
bool Push(uint8_t *buf) override;
|
||||
bool CanShow(void) override;
|
||||
|
||||
protected:
|
||||
int8_t _pin;
|
||||
struct led_strip_spi_obj_t _spi_strip = {};;
|
||||
const bool _with_dma = true;
|
||||
};
|
||||
#endif // TASMOTALED_HARDWARE_SPI
|
||||
|
||||
#endif // __TASMOTALEDPUSHER_H__
|
252
lib/lib_basic/TasmotaLED/src/TasmotaLEDPusherRMT.cpp
Normal file
252
lib/lib_basic/TasmotaLED/src/TasmotaLEDPusherRMT.cpp
Normal file
@ -0,0 +1,252 @@
|
||||
/*
|
||||
TasmotaLEDPusherRMT.cpp - Implementation to push Leds via RMT channel
|
||||
|
||||
Copyright (C) 2024 Stephan Hadinger
|
||||
|
||||
This library is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef ESP32
|
||||
|
||||
#include "TasmotaLEDPusher.h"
|
||||
#include "TasmotaLED.h"
|
||||
|
||||
#if TASMOTALED_HARDWARE_RMT
|
||||
#include <rom/gpio.h>
|
||||
#include <esp_check.h>
|
||||
|
||||
//**************************************************************************************************************
|
||||
// enable AddLog support within a C++ library
|
||||
extern void AddLog(uint32_t loglevel, PGM_P formatP, ...);
|
||||
enum LoggingLevels {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE};
|
||||
//**************************************************************************************************************
|
||||
|
||||
/*******************************************************************************************\
|
||||
* Implementation for TasmotaLEDPusherRMT
|
||||
*
|
||||
* Code mostly copied from Tasmota patch to NeoPixelBus applied to support esp-idf 5.x
|
||||
* itself inspired from esp-idf example for RMT encoder from
|
||||
* https://github.com/espressif/esp-idf/tree/v5.3.1/examples/peripherals/rmt/ir_nec_transceiver
|
||||
\*******************************************************************************************/
|
||||
#define RMT_LED_STRIP_RESOLUTION_HZ 40000000 // 40MHz resolution, steps of 25 nanoseconds
|
||||
|
||||
// structure used to pass arguments to `rmt_new_led_strip_encoder`
|
||||
// currently only the encoder resolution in Hz
|
||||
typedef struct {
|
||||
uint32_t resolution; /*!< Encoder resolution, in Hz */
|
||||
} led_strip_encoder_config_t;
|
||||
|
||||
// structure used to store all the necessary information for the RMT encoder
|
||||
typedef struct {
|
||||
rmt_encoder_t base;
|
||||
rmt_encoder_t *bytes_encoder;
|
||||
rmt_encoder_t *copy_encoder;
|
||||
int32_t state;
|
||||
rmt_symbol_word_t reset_code;
|
||||
} rmt_led_strip_encoder_t;
|
||||
|
||||
static IRAM_ATTR size_t rmt_encode_led_strip(rmt_encoder_t *encoder, rmt_channel_handle_t channel, const void *primary_data, size_t data_size, rmt_encode_state_t *ret_state)
|
||||
{
|
||||
rmt_led_strip_encoder_t *led_encoder = __containerof(encoder, rmt_led_strip_encoder_t, base);
|
||||
rmt_encoder_handle_t bytes_encoder = led_encoder->bytes_encoder;
|
||||
rmt_encoder_handle_t copy_encoder = led_encoder->copy_encoder;
|
||||
rmt_encode_state_t session_state = RMT_ENCODING_RESET;
|
||||
rmt_encode_state_t state = RMT_ENCODING_RESET;
|
||||
size_t encoded_symbols = 0;
|
||||
switch (led_encoder->state) {
|
||||
case 0: // send RGB data
|
||||
encoded_symbols += bytes_encoder->encode(bytes_encoder, channel, primary_data, data_size, &session_state);
|
||||
if (session_state & RMT_ENCODING_COMPLETE) {
|
||||
led_encoder->state = 1; // switch to next state when current encoding session finished
|
||||
}
|
||||
if (session_state & RMT_ENCODING_MEM_FULL) {
|
||||
state = static_cast<rmt_encode_state_t>(static_cast<uint8_t>(state) | static_cast<uint8_t>(RMT_ENCODING_MEM_FULL));
|
||||
goto out; // yield if there's no free space for encoding artifacts
|
||||
}
|
||||
// fall-through
|
||||
case 1: // send reset code
|
||||
encoded_symbols += copy_encoder->encode(copy_encoder, channel, &led_encoder->reset_code, sizeof(led_encoder->reset_code), &session_state);
|
||||
if (session_state & RMT_ENCODING_COMPLETE) {
|
||||
led_encoder->state = RMT_ENCODING_RESET; // back to the initial encoding session
|
||||
state = static_cast<rmt_encode_state_t>(static_cast<uint8_t>(state) | static_cast<uint8_t>(RMT_ENCODING_COMPLETE));
|
||||
}
|
||||
if (session_state & RMT_ENCODING_MEM_FULL) {
|
||||
state = static_cast<rmt_encode_state_t>(static_cast<uint8_t>(state) | static_cast<uint8_t>(RMT_ENCODING_MEM_FULL));
|
||||
goto out; // yield if there's no free space for encoding artifacts
|
||||
}
|
||||
}
|
||||
out:
|
||||
*ret_state = state;
|
||||
return encoded_symbols;
|
||||
}
|
||||
|
||||
static esp_err_t rmt_del_led_strip_encoder(rmt_encoder_t *encoder) {
|
||||
rmt_led_strip_encoder_t *led_encoder = __containerof(encoder, rmt_led_strip_encoder_t, base);
|
||||
rmt_del_encoder(led_encoder->bytes_encoder);
|
||||
rmt_del_encoder(led_encoder->copy_encoder);
|
||||
delete led_encoder;
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t rmt_led_strip_encoder_reset(rmt_encoder_t *encoder) {
|
||||
rmt_led_strip_encoder_t *led_encoder = __containerof(encoder, rmt_led_strip_encoder_t, base);
|
||||
rmt_encoder_reset(led_encoder->bytes_encoder);
|
||||
rmt_encoder_reset(led_encoder->copy_encoder);
|
||||
led_encoder->state = RMT_ENCODING_RESET;
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t rmt_new_led_strip_encoder(const led_strip_encoder_config_t *config, rmt_encoder_handle_t *ret_encoder, rmt_symbol_word_t bit0, rmt_symbol_word_t bit1, rmt_symbol_word_t reset_code) {
|
||||
static const char* TAG = "TASMOTA_RMT";
|
||||
esp_err_t ret = ESP_OK;
|
||||
rmt_led_strip_encoder_t *led_encoder = NULL;
|
||||
rmt_bytes_encoder_config_t bytes_encoder_config;
|
||||
rmt_copy_encoder_config_t copy_encoder_config = {};
|
||||
|
||||
ESP_GOTO_ON_FALSE(config && ret_encoder, ESP_ERR_INVALID_ARG, err, TAG, "invalid argument");
|
||||
led_encoder = new rmt_led_strip_encoder_t();
|
||||
ESP_GOTO_ON_FALSE(led_encoder, ESP_ERR_NO_MEM, err, TAG, "no mem for led strip encoder");
|
||||
led_encoder->base.encode = rmt_encode_led_strip;
|
||||
led_encoder->base.del = rmt_del_led_strip_encoder;
|
||||
led_encoder->base.reset = rmt_led_strip_encoder_reset;
|
||||
led_encoder->reset_code = reset_code;
|
||||
|
||||
bytes_encoder_config.bit0 = bit0;
|
||||
bytes_encoder_config.bit1 = bit1;
|
||||
bytes_encoder_config.flags.msb_first = 1; // WS2812 transfer bit order: G7...G0R7...R0B7...B0 - TODO: more checks
|
||||
|
||||
ESP_GOTO_ON_ERROR(rmt_new_bytes_encoder(&bytes_encoder_config, &led_encoder->bytes_encoder), err, TAG, "create bytes encoder failed");
|
||||
ESP_GOTO_ON_ERROR(rmt_new_copy_encoder(©_encoder_config, &led_encoder->copy_encoder), err, TAG, "create copy encoder failed");
|
||||
|
||||
*ret_encoder = &led_encoder->base;
|
||||
return ret;
|
||||
err:
|
||||
AddLog(LOG_LEVEL_INFO, "RMT: could not init led encoder");
|
||||
if (led_encoder) {
|
||||
if (led_encoder->bytes_encoder) { rmt_del_encoder(led_encoder->bytes_encoder); }
|
||||
if (led_encoder->copy_encoder) { rmt_del_encoder(led_encoder->copy_encoder); }
|
||||
delete led_encoder;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
TasmotaLEDPusherRMT::~TasmotaLEDPusherRMT() {
|
||||
if (_channel) {
|
||||
rmt_tx_wait_all_done(_channel, 10000 / portTICK_PERIOD_MS);
|
||||
rmt_del_channel(_channel);
|
||||
_channel = nullptr;
|
||||
}
|
||||
|
||||
if (_pin >= 0) {
|
||||
gpio_matrix_out(_pin, 0x100, false, false);
|
||||
pinMode(_pin, INPUT);
|
||||
_pin = -1;
|
||||
}
|
||||
}
|
||||
|
||||
TasmotaLEDPusherRMT::TasmotaLEDPusherRMT(int8_t pin) : _pin(pin) {
|
||||
esp_err_t ret = ESP_OK;
|
||||
rmt_tx_channel_config_t config = {};
|
||||
config.clk_src = RMT_CLK_SRC_DEFAULT;
|
||||
config.gpio_num = static_cast<gpio_num_t>(_pin);
|
||||
config.mem_block_symbols = 192; // memory block size, 64 * 4 = 256 Bytes
|
||||
config.resolution_hz = RMT_LED_STRIP_RESOLUTION_HZ; // 40 MHz tick resolution, i.e., 1 tick = 0.025 µs or 25 ns
|
||||
config.trans_queue_depth = 4; // set the number of transactions that can pend in the background
|
||||
config.flags.invert_out = false; // do not invert output signal
|
||||
config.flags.with_dma = false; // do not need DMA backend
|
||||
|
||||
_err = rmt_new_tx_channel(&config, &_channel);
|
||||
if (_err == ESP_OK) {
|
||||
_initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool TasmotaLEDPusherRMT::Begin(uint16_t pixel_count, uint16_t pixel_size, const TasmotaLED_Timing * led_timing) {
|
||||
if (!_initialized) { return false; }
|
||||
TasmotaLEDPusher::Begin(pixel_count, pixel_size, led_timing);
|
||||
led_strip_encoder_config_t encoder_config = {
|
||||
.resolution = RMT_LED_STRIP_RESOLUTION_HZ,
|
||||
};
|
||||
|
||||
_tx_config.loop_count = 0; // no loop
|
||||
|
||||
rmt_symbol_word_t RmtBit0 = {
|
||||
.duration0 = (uint16_t) (led_timing->T0H * (RMT_LED_STRIP_RESOLUTION_HZ / 1000000) / 1000),
|
||||
.level0 = 1,
|
||||
.duration1 = (uint16_t) (led_timing->T0L * (RMT_LED_STRIP_RESOLUTION_HZ / 1000000) / 1000),
|
||||
.level1 = 0,
|
||||
};
|
||||
rmt_symbol_word_t RmtBit1 = {
|
||||
.duration0 = (uint16_t) (led_timing->T1H * (RMT_LED_STRIP_RESOLUTION_HZ / 1000000) / 1000),
|
||||
.level0 = 1,
|
||||
.duration1 = (uint16_t) (led_timing->T1L * (RMT_LED_STRIP_RESOLUTION_HZ / 1000000) / 1000),
|
||||
.level1 = 0,
|
||||
};
|
||||
rmt_symbol_word_t RmtReset = {
|
||||
.duration0 = (uint16_t) (led_timing->Reset * (RMT_LED_STRIP_RESOLUTION_HZ / 1000000) / 1000),
|
||||
.level0 = 0,
|
||||
.duration1 = 50 * (RMT_LED_STRIP_RESOLUTION_HZ / 1000000) / 1000,
|
||||
.level1 = 1,
|
||||
};
|
||||
// AddLog(LOG_LEVEL_INFO, "RMT: RmtBit0 0x%08X RmtBit1 0x%08X RmtReset 0x%08X", RmtBit0.val, RmtBit1.val, RmtReset.val);
|
||||
_err = rmt_new_led_strip_encoder(&encoder_config, &_led_encoder, RmtBit0, RmtBit1, RmtReset);
|
||||
if (_err != ESP_OK) {
|
||||
// AddLog(LOG_LEVEL_INFO, "RMT: cannot initialize led strip encoder err=%i", ret);
|
||||
return false;
|
||||
}
|
||||
_err = rmt_enable(_channel);
|
||||
if (_err != ESP_OK) {
|
||||
// AddLog(LOG_LEVEL_INFO, "RMT: cannot enable channel err=%i", ret);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TasmotaLEDPusherRMT::SetPixelCount(uint16_t pixel_count) {
|
||||
if (!_initialized) { return false; }
|
||||
if (pixel_count > 0 && _pixel_count != pixel_count) {
|
||||
_pixel_count = pixel_count;
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TasmotaLEDPusherRMT::CanShow(void) {
|
||||
if (_channel && _initialized) {
|
||||
return (ESP_OK == rmt_tx_wait_all_done(_channel, 0));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool TasmotaLEDPusherRMT::Push(uint8_t *buf) {
|
||||
if (!_initialized) { return false; }
|
||||
|
||||
// wait for not actively sending data
|
||||
// this will time out at 1 second, an arbitrarily long period of time
|
||||
// and do nothing if this happens
|
||||
esp_err_t ret = rmt_tx_wait_all_done(_channel, 1000 / portTICK_PERIOD_MS);
|
||||
if (ESP_OK == ret) {
|
||||
// now start the RMT transmit with the editing buffer before we swap
|
||||
ret = rmt_transmit(_channel, _led_encoder, buf, _pixel_count * _pixel_size, &_tx_config);
|
||||
if (ESP_OK != ret) {
|
||||
AddLog(LOG_LEVEL_DEBUG, "RMT: cannot transmit err=%i", ret);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // TASMOTALED_HARDWARE_RMT
|
||||
#endif // ESP32
|
225
lib/lib_basic/TasmotaLED/src/TasmotaLEDPusherSPI.cpp
Normal file
225
lib/lib_basic/TasmotaLED/src/TasmotaLEDPusherSPI.cpp
Normal file
@ -0,0 +1,225 @@
|
||||
/*
|
||||
TasmotaLEDPusherRMT.cpp - Implementation to push Leds via SPI channel
|
||||
|
||||
Copyright (C) 2024 Stephan Hadinger
|
||||
|
||||
This library is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef ESP32
|
||||
|
||||
#include "TasmotaLEDPusher.h"
|
||||
#include "TasmotaLED.h"
|
||||
|
||||
#if TASMOTALED_HARDWARE_SPI
|
||||
#include <rom/gpio.h>
|
||||
|
||||
//**************************************************************************************************************
|
||||
// enable AddLog support within a C++ library
|
||||
extern void AddLog(uint32_t loglevel, PGM_P formatP, ...);
|
||||
enum LoggingLevels {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE};
|
||||
//**************************************************************************************************************
|
||||
|
||||
/*******************************************************************************************\
|
||||
* Implementation for TasmotaLEDPusherSPI
|
||||
*
|
||||
\*******************************************************************************************/
|
||||
|
||||
#define LED_STRIP_SPI_DEFAULT_RESOLUTION (25 * 100 * 1000) // 2.5MHz resolution
|
||||
#define LED_STRIP_SPI_DEFAULT_TRANS_QUEUE_SIZE 4
|
||||
|
||||
#define SPI_BYTES_PER_COLOR_BYTE 3
|
||||
#define SPI_BITS_PER_COLOR_BYTE (SPI_BYTES_PER_COLOR_BYTE * 8)
|
||||
|
||||
static void __led_strip_spi_bit(uint8_t data, uint8_t *buf)
|
||||
{
|
||||
// Each color of 1 bit is represented by 3 bits of SPI, low_level:100 ,high_level:110
|
||||
// So a color byte occupies 3 bytes of SPI.
|
||||
buf[0] = (data & BIT(5) ? BIT(1) | BIT(0) : BIT(1)) | (data & BIT(6) ? BIT(4) | BIT(3) : BIT(4)) | (data & BIT(7) ? BIT(7) | BIT(6) : BIT(7));
|
||||
buf[1] = (BIT(0)) | (data & BIT(3) ? BIT(3) | BIT(2) : BIT(3)) | (data & BIT(4) ? BIT(6) | BIT(5) : BIT(6));
|
||||
buf[2] = (data & BIT(0) ? BIT(2) | BIT(1) : BIT(2)) | (data & BIT(1) ? BIT(5) | BIT(4) : BIT(5)) | (data & BIT(2) ? BIT(7) : 0x00);
|
||||
}
|
||||
|
||||
esp_err_t led_strip_spi_refresh(led_strip_spi_obj * spi_strip)
|
||||
{
|
||||
spi_strip->tx_conf.length = spi_strip->strip_len * spi_strip->bytes_per_pixel * SPI_BITS_PER_COLOR_BYTE;
|
||||
spi_strip->tx_conf.tx_buffer = spi_strip->pixel_buf;
|
||||
spi_strip->tx_conf.rx_buffer = NULL;
|
||||
spi_device_transmit(spi_strip->spi_device, &spi_strip->tx_conf);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
void led_strip_transmit_buffer(led_strip_spi_obj * spi_strip, uint8_t * buffer_rgbw) {
|
||||
// Timing for 512 pixels (extreme test)
|
||||
// Copying to buffer: 418 us
|
||||
// sending pixels: 16.2 ms
|
||||
uint8_t * buf = buffer_rgbw;
|
||||
uint8_t * pix_buf = spi_strip->pixel_buf;
|
||||
for (int i = 0; i < spi_strip->strip_len; i++) {
|
||||
// LED_PIXEL_FORMAT_GRB takes 72bits(9bytes)
|
||||
__led_strip_spi_bit(*buf++, pix_buf); pix_buf += SPI_BYTES_PER_COLOR_BYTE;
|
||||
__led_strip_spi_bit(*buf++, pix_buf); pix_buf += SPI_BYTES_PER_COLOR_BYTE;
|
||||
__led_strip_spi_bit(*buf++, pix_buf); pix_buf += SPI_BYTES_PER_COLOR_BYTE;
|
||||
if (spi_strip->bytes_per_pixel > 3) {
|
||||
__led_strip_spi_bit(*buf++, pix_buf); pix_buf += SPI_BYTES_PER_COLOR_BYTE;
|
||||
}
|
||||
}
|
||||
/* Refresh the strip to send data */
|
||||
led_strip_spi_refresh(spi_strip);
|
||||
}
|
||||
|
||||
|
||||
TasmotaLEDPusherSPI::~TasmotaLEDPusherSPI() {
|
||||
if (_spi_strip.spi_device) {
|
||||
spi_bus_remove_device(_spi_strip.spi_device);
|
||||
}
|
||||
if (_spi_strip.spi_host) {
|
||||
spi_bus_free(_spi_strip.spi_host);
|
||||
}
|
||||
|
||||
if (_pin >= 0) {
|
||||
gpio_matrix_out(_pin, 0x100, false, false);
|
||||
pinMode(_pin, INPUT);
|
||||
_pin = -1;
|
||||
}
|
||||
}
|
||||
|
||||
TasmotaLEDPusherSPI::TasmotaLEDPusherSPI(int8_t pin) : _pin(pin) {
|
||||
spi_host_device_t spi_host = SPI2_HOST;
|
||||
spi_bus_config_t spi_bus_cfg = {
|
||||
.mosi_io_num = _pin,
|
||||
//Only use MOSI to generate the signal, set -1 when other pins are not used.
|
||||
.miso_io_num = -1,
|
||||
.sclk_io_num = -1,
|
||||
.quadwp_io_num = -1,
|
||||
.quadhd_io_num = -1,
|
||||
.max_transfer_sz = 0, // _pixel_count * _pixel_size * SPI_BYTES_PER_COLOR_BYTE,
|
||||
};
|
||||
_err = spi_bus_initialize(spi_host, &spi_bus_cfg, _with_dma ? SPI_DMA_CH_AUTO : SPI_DMA_DISABLED);
|
||||
if (_err == ESP_OK) {
|
||||
_spi_strip.spi_host = spi_host; // confirmed working, so keep it's value to free it later
|
||||
_initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool TasmotaLEDPusherSPI::Begin(uint16_t pixel_count, uint16_t pixel_size, const TasmotaLED_Timing * led_timing) {
|
||||
if (!_initialized) {
|
||||
return false;
|
||||
}
|
||||
TasmotaLEDPusher::Begin(pixel_count, pixel_size, led_timing);
|
||||
_spi_strip.bytes_per_pixel = _pixel_size;
|
||||
_spi_strip.strip_len = _pixel_count;
|
||||
|
||||
uint32_t mem_caps = MALLOC_CAP_DEFAULT;
|
||||
// spi_clock_source_t clk_src = SPI_CLK_SRC_DEFAULT;
|
||||
spi_device_interface_config_t spi_dev_cfg;
|
||||
int clock_resolution_khz = 0;
|
||||
|
||||
if (_with_dma) { // TODO
|
||||
// DMA buffer must be placed in internal SRAM
|
||||
mem_caps |= MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA;
|
||||
}
|
||||
_spi_strip.pixel_buf = (uint8_t *)heap_caps_calloc(1, _pixel_count * _pixel_size * SPI_BYTES_PER_COLOR_BYTE, mem_caps);
|
||||
if (_spi_strip.pixel_buf == nullptr) {
|
||||
AddLog(LOG_LEVEL_INFO, PSTR("LED: Error no mem for spi strip"));
|
||||
goto err;
|
||||
}
|
||||
|
||||
spi_dev_cfg = {
|
||||
.command_bits = 0,
|
||||
.address_bits = 0,
|
||||
.dummy_bits = 0,
|
||||
.mode = 0,
|
||||
//set -1 when CS is not used
|
||||
.clock_source = SPI_CLK_SRC_DEFAULT, // clk_src,
|
||||
.clock_speed_hz = LED_STRIP_SPI_DEFAULT_RESOLUTION,
|
||||
.spics_io_num = -1,
|
||||
.queue_size = LED_STRIP_SPI_DEFAULT_TRANS_QUEUE_SIZE,
|
||||
};
|
||||
_err = spi_bus_add_device(_spi_strip.spi_host, &spi_dev_cfg, &_spi_strip.spi_device);
|
||||
if (_err != ESP_OK) {
|
||||
// AddLog(LOG_LEVEL_INFO, "LED: Error failed to add spi device");
|
||||
goto err;
|
||||
}
|
||||
|
||||
_err = spi_device_get_actual_freq(_spi_strip.spi_device, &clock_resolution_khz);
|
||||
if (_err != ESP_OK) {
|
||||
// AddLog(LOG_LEVEL_INFO, "LED: Error failed to get spi frequency");
|
||||
goto err;
|
||||
}
|
||||
// TODO: ideally we should decide the SPI_BYTES_PER_COLOR_BYTE by the real clock resolution
|
||||
// But now, let's fixed the resolution, the downside is, we don't support a clock source whose frequency is not multiple of LED_STRIP_SPI_DEFAULT_RESOLUTION
|
||||
if (clock_resolution_khz != LED_STRIP_SPI_DEFAULT_RESOLUTION / 1000) {
|
||||
// AddLog(LOG_LEVEL_INFO, "LED: Error unsupported clock resolution: %dKHz", clock_resolution_khz);
|
||||
goto err;
|
||||
}
|
||||
return true;
|
||||
err:
|
||||
if (_spi_strip.spi_device) {
|
||||
spi_bus_remove_device(_spi_strip.spi_device);
|
||||
}
|
||||
if (_spi_strip.spi_host) {
|
||||
spi_bus_free(_spi_strip.spi_host);
|
||||
}
|
||||
_initialized = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TasmotaLEDPusherSPI::SetPixelCount(uint16_t pixel_count) {
|
||||
if (!_initialized) { return false; }
|
||||
if (pixel_count > 0 && _pixel_count != pixel_count) {
|
||||
_pixel_count = pixel_count;
|
||||
|
||||
if (_spi_strip.pixel_buf) {
|
||||
heap_caps_free(_spi_strip.pixel_buf);
|
||||
_spi_strip.pixel_buf = nullptr;
|
||||
}
|
||||
|
||||
_spi_strip.strip_len = _pixel_count;
|
||||
uint32_t mem_caps = MALLOC_CAP_DEFAULT;
|
||||
if (_with_dma) { // TODO
|
||||
// DMA buffer must be placed in internal SRAM
|
||||
mem_caps |= MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA;
|
||||
}
|
||||
_spi_strip.pixel_buf = (uint8_t *)heap_caps_calloc(1, _pixel_count * _pixel_size * SPI_BYTES_PER_COLOR_BYTE, mem_caps);
|
||||
if (_spi_strip.pixel_buf == nullptr) {
|
||||
AddLog(LOG_LEVEL_INFO, PSTR("LED: Error no mem for spi strip"));
|
||||
if (_spi_strip.spi_device) {
|
||||
spi_bus_remove_device(_spi_strip.spi_device);
|
||||
}
|
||||
if (_spi_strip.spi_host) {
|
||||
spi_bus_free(_spi_strip.spi_host);
|
||||
}
|
||||
_initialized = false;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TasmotaLEDPusherSPI::CanShow(void) {
|
||||
return _initialized; // TODO
|
||||
}
|
||||
|
||||
bool TasmotaLEDPusherSPI::Push(uint8_t *buf) {
|
||||
if (!_initialized) { return false; }
|
||||
if (CanShow()) {
|
||||
led_strip_transmit_buffer(&_spi_strip, buf);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // TASMOTALED_HARDWARE_SPI
|
||||
#endif // ESP32
|
@ -235,7 +235,7 @@ bool directRead(IO_REG_TYPE mask)
|
||||
static inline __attribute__((always_inline))
|
||||
IO_REG_TYPE directRead(IO_REG_TYPE pin)
|
||||
{
|
||||
#if SOC_GPIO_PIN_COUNT <= 32
|
||||
#if SOC_GPIO_PIN_COUNT <= 32 || CONFIG_IDF_TARGET_ESP32P4
|
||||
return (GPIO.in.val >> pin) & 0x1;
|
||||
#else // ESP32 with over 32 gpios
|
||||
if ( pin < 32 )
|
||||
@ -250,7 +250,7 @@ IO_REG_TYPE directRead(IO_REG_TYPE pin)
|
||||
static inline __attribute__((always_inline))
|
||||
void directWriteLow(IO_REG_TYPE pin)
|
||||
{
|
||||
#if SOC_GPIO_PIN_COUNT <= 32
|
||||
#if SOC_GPIO_PIN_COUNT <= 32 || CONFIG_IDF_TARGET_ESP32P4
|
||||
GPIO.out_w1tc.val = ((uint32_t)1 << pin);
|
||||
#else // ESP32 with over 32 gpios
|
||||
if ( pin < 32 )
|
||||
@ -263,7 +263,7 @@ void directWriteLow(IO_REG_TYPE pin)
|
||||
static inline __attribute__((always_inline))
|
||||
void directWriteHigh(IO_REG_TYPE pin)
|
||||
{
|
||||
#if SOC_GPIO_PIN_COUNT <= 32
|
||||
#if SOC_GPIO_PIN_COUNT <= 32 || CONFIG_IDF_TARGET_ESP32P4
|
||||
GPIO.out_w1ts.val = ((uint32_t)1 << pin);
|
||||
#else // ESP32 with over 32 gpios
|
||||
if ( pin < 32 )
|
||||
@ -280,7 +280,7 @@ void directModeInput(IO_REG_TYPE pin)
|
||||
if ( digitalPinIsValid(pin) )
|
||||
{
|
||||
// Input
|
||||
#if SOC_GPIO_PIN_COUNT <= 32
|
||||
#if SOC_GPIO_PIN_COUNT <= 32 || CONFIG_IDF_TARGET_ESP32P4
|
||||
GPIO.enable_w1tc.val = ((uint32_t)1 << (pin));
|
||||
#else // ESP32 with over 32 gpios
|
||||
if ( pin < 32 )
|
||||
@ -298,7 +298,7 @@ void directModeOutput(IO_REG_TYPE pin)
|
||||
if ( digitalPinCanOutput(pin) )
|
||||
{
|
||||
// Output
|
||||
#if SOC_GPIO_PIN_COUNT <= 32
|
||||
#if SOC_GPIO_PIN_COUNT <= 32 || CONFIG_IDF_TARGET_ESP32P4
|
||||
GPIO.enable_w1ts.val = ((uint32_t)1 << (pin));
|
||||
#else // ESP32 with over 32 gpios
|
||||
if ( pin < 32 )
|
||||
|
@ -680,14 +680,15 @@ uDisplay::uDisplay(char *lp) : Renderer(800, 600) {
|
||||
if (*lp == '\n' || *lp == ' ') { // Add space char
|
||||
lp++;
|
||||
} else {
|
||||
lp = strchr(lp, '\n');
|
||||
if (!lp) {
|
||||
lp = strchr(lp, ' ');
|
||||
if (!lp) {
|
||||
char *lp1;
|
||||
lp1 = strchr(lp, '\n');
|
||||
if (!lp1) {
|
||||
lp1 = strchr(lp, ' ');
|
||||
if (!lp1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
lp++;
|
||||
lp = lp1 + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1224,12 +1225,19 @@ Renderer *uDisplay::Init(void) {
|
||||
_panel_config->de_gpio_num = de;
|
||||
_panel_config->pclk_gpio_num = pclk;
|
||||
|
||||
// assume that byte swapping of 16-bit color is done only upon request
|
||||
// via display.ini and not by callers of pushColor()
|
||||
// -> swap bytes by swapping GPIO numbers
|
||||
int8_t *par_db8 = lvgl_param.swap_color ? par_dbl : par_dbh;
|
||||
for (uint32_t cnt = 0; cnt < 8; cnt ++) {
|
||||
_panel_config->data_gpio_nums[cnt] = par_dbh[cnt];
|
||||
_panel_config->data_gpio_nums[cnt] = par_db8[cnt];
|
||||
}
|
||||
par_db8 = lvgl_param.swap_color ? par_dbh : par_dbl;
|
||||
for (uint32_t cnt = 0; cnt < 8; cnt ++) {
|
||||
_panel_config->data_gpio_nums[cnt + 8] = par_dbl[cnt];
|
||||
_panel_config->data_gpio_nums[cnt + 8] = par_db8[cnt];
|
||||
}
|
||||
lvgl_param.swap_color = 0;
|
||||
|
||||
_panel_config->disp_gpio_num = GPIO_NUM_NC;
|
||||
|
||||
_panel_config->flags.disp_active_low = 0;
|
||||
@ -1780,9 +1788,6 @@ void uDisplay::drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) {
|
||||
|
||||
if (interface == _UDSP_RGB) {
|
||||
#ifdef USE_ESP32_S3
|
||||
if (lvgl_param.swap_color) {
|
||||
color = color << 8 | color >> 8;
|
||||
}
|
||||
if (cur_rot > 0) {
|
||||
while (h--) {
|
||||
drawPixel_RGB(x , y , color);
|
||||
@ -1853,9 +1858,6 @@ void uDisplay::drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) {
|
||||
|
||||
if (interface == _UDSP_RGB) {
|
||||
#ifdef USE_ESP32_S3
|
||||
if (lvgl_param.swap_color) {
|
||||
color = color << 8 | color >> 8;
|
||||
}
|
||||
if (cur_rot > 0) {
|
||||
while (w--) {
|
||||
drawPixel_RGB(x , y , color);
|
||||
@ -2227,7 +2229,6 @@ void uDisplay::pushColorsMono(uint16_t *data, uint16_t len, bool rgb16_swap) {
|
||||
static inline void lvgl_color_swap(uint16_t *data, uint16_t len) { for (uint32_t i = 0; i < len; i++) (data[i] = data[i] << 8 | data[i] >> 8); }
|
||||
|
||||
void uDisplay::pushColors(uint16_t *data, uint16_t len, boolean not_swapped) {
|
||||
uint16_t color;
|
||||
|
||||
if (lvgl_param.swap_color) {
|
||||
not_swapped = !not_swapped;
|
||||
@ -2237,63 +2238,21 @@ void uDisplay::pushColors(uint16_t *data, uint16_t len, boolean not_swapped) {
|
||||
|
||||
// Isolating _UDSP_RGB to increase code sharing
|
||||
//
|
||||
// LVGL documentation suggest to call the following:
|
||||
// lv_draw_sw_rgb565_swap() to invert bytes
|
||||
// esp_lcd_panel_draw_bitmap() to paste bytes
|
||||
// but it appears to be faster to include the color swap in the copy loop
|
||||
// because the CPU is much faster than PSRAM (SPI bus), therefore
|
||||
// swapping bytes on the fly costs zero performance
|
||||
//
|
||||
// not_swapped == false : called from LVGL bytes are swapped
|
||||
// not_swapped == true : called from displaytext, no byte swap, currently no dma here
|
||||
// Use ESP-IDF LCD driver to push colors and rely on the following assumptions:
|
||||
// * bytes swapping is already handled in the driver configuration (see uDisplay::Init()),
|
||||
// * pushColors() is only called with not_swapped equals true,
|
||||
// * cache flushing is done by the LCD driver.
|
||||
if (interface == _UDSP_RGB) {
|
||||
#ifdef USE_ESP32_S3
|
||||
if (!not_swapped) {
|
||||
// internal error -> write error message but continue (with possibly wrong colors)
|
||||
AddLog(LOG_LEVEL_ERROR, PSTR("DSP: Unexpected byte-swapping requested in pushColors()"));
|
||||
}
|
||||
|
||||
// check that bytes count matches the size of area, and remove from inner loop
|
||||
if ((seta_yp2 - seta_yp1) * (seta_xp2 - seta_xp2) > len) { return; }
|
||||
|
||||
uint16_t lenc = len;
|
||||
|
||||
if (cur_rot > 0) {
|
||||
for (uint32_t y = seta_yp1; y < seta_yp2; y++) {
|
||||
seta_yp1++;
|
||||
for (uint32_t x = seta_xp1; x < seta_xp2; x++) {
|
||||
uint16_t color = *data++;
|
||||
if (!not_swapped) { color = color << 8 | color >> 8; }
|
||||
drawPixel_RGB(x, y, color);
|
||||
lenc--;
|
||||
if (!lenc) return; // failsafe - exist if len (pixel number) is exhausted
|
||||
}
|
||||
}
|
||||
} else {
|
||||
uint16_t *fb_y = rgb_fb + (int32_t)seta_yp1 * _width;
|
||||
for (uint32_t y = seta_yp1; y < seta_yp2; y++) {
|
||||
uint16_t * fb_xy = fb_y + seta_xp1;
|
||||
// we get the 'not_swapped' test outside of the inner loop
|
||||
if (not_swapped) {
|
||||
for (uint32_t x = seta_xp1; x < seta_xp2; x++) {
|
||||
uint16_t color = *data++;
|
||||
*fb_xy = color;
|
||||
fb_xy++;
|
||||
lenc--;
|
||||
if (!lenc) break; // failsafe - exist if len (pixel number) is exhausted
|
||||
}
|
||||
} else {
|
||||
for (uint32_t x = seta_xp1; x < seta_xp2; x++) {
|
||||
uint16_t color = *data++;
|
||||
color = color << 8 | color >> 8;
|
||||
*fb_xy = color;
|
||||
fb_xy++;
|
||||
lenc--;
|
||||
if (!lenc) break; // failsafe - exist if len (pixel number) is exhausted
|
||||
}
|
||||
}
|
||||
uint16_t * flush_ptr = rgb_fb + (int32_t)seta_yp1 * _width + seta_xp1;
|
||||
Cache_WriteBack_Addr((uint32_t)flush_ptr, (seta_xp2 - seta_xp1) * 2);
|
||||
fb_y += _width;
|
||||
seta_yp1++;
|
||||
if (!lenc) break;
|
||||
}
|
||||
}
|
||||
esp_lcd_panel_draw_bitmap(_panel_handle, seta_xp1, seta_yp1, seta_xp2, seta_yp2, (void *)data);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@ -2328,6 +2287,7 @@ void uDisplay::pushColors(uint16_t *data, uint16_t len, boolean not_swapped) {
|
||||
uint8_t *line = (uint8_t*)malloc(len * 3);
|
||||
uint8_t *lp = line;
|
||||
if (line) {
|
||||
uint16_t color;
|
||||
for (uint32_t cnt = 0; cnt < len; cnt++) {
|
||||
color = *data++;
|
||||
color = (color << 8) | (color >> 8);
|
||||
@ -2462,9 +2422,6 @@ void uDisplay::drawPixel(int16_t x, int16_t y, uint16_t color) {
|
||||
|
||||
#ifdef USE_ESP32_S3
|
||||
if (interface == _UDSP_RGB) {
|
||||
if (lvgl_param.swap_color) {
|
||||
color = color << 8 | color >> 8;
|
||||
}
|
||||
drawPixel_RGB(x, y, color);
|
||||
return;
|
||||
}
|
||||
@ -2547,6 +2504,15 @@ void uDisplay::setRotation(uint8_t rotation) {
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef USE_ESP32_S3
|
||||
if (interface == _UDSP_RGB) {
|
||||
// utilize the ESP-IDF LCD driver's support for display rotation:
|
||||
// mirror x axis for rotation 1 and 2, mirror y axis for rotation 2 and 3
|
||||
esp_lcd_panel_mirror(_panel_handle, rotation == 1 || rotation == 2, rotation & 2);
|
||||
// swap x/y for rotation 1 and 3
|
||||
esp_lcd_panel_swap_xy(_panel_handle, rotation & 1);
|
||||
}
|
||||
#endif // USE_ESP32_S3
|
||||
}
|
||||
|
||||
void udisp_bpwr(uint8_t on);
|
||||
|
@ -97,7 +97,7 @@ enum uColorType { uCOLOR_BW, uCOLOR_COLOR };
|
||||
#define UDISP_WHITE 0xFFFF /* 255, 255, 255 */
|
||||
#define UDISP_ORANGE 0xFD20 /* 255, 165, 0 */
|
||||
#define UDISP_GREENYELLOW 0xAFE5 /* 173, 255, 47 */
|
||||
#define UDISP_PINK 0xF81F
|
||||
#define UDISP_PINK 0xFc18 /* 255, 128, 192 */
|
||||
|
||||
#ifdef ESP8266
|
||||
#define PIN_OUT_SET 0x60000304
|
||||
@ -112,7 +112,7 @@ enum uColorType { uCOLOR_BW, uCOLOR_COLOR };
|
||||
#undef GPIO_SET_SLOW
|
||||
#undef GPIO_CLR_SLOW
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
|
||||
#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32P4
|
||||
#define GPIO_CLR(A) GPIO.out_w1tc.val = (1 << A)
|
||||
#define GPIO_SET(A) GPIO.out_w1ts.val = (1 << A)
|
||||
#else // plain ESP32
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user