mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-07 12:07:09 +03:00
Compare commits
238 Commits
master
...
developmen
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbbc924fcd | ||
|
|
cc5fb49ff8 | ||
|
|
189bc763dd | ||
|
|
78b7639400 | ||
|
|
56954962a3 | ||
|
|
5ff673ae7d | ||
|
|
2eb995d621 | ||
|
|
573ddb6fda | ||
|
|
708a3f9c4a | ||
|
|
a73c659a1e | ||
|
|
b22143a3b6 | ||
|
|
6195750b41 | ||
|
|
889b1097cc | ||
|
|
41cdb8bcdd | ||
|
|
8c33acfd35 | ||
|
|
0222a34286 | ||
|
|
a90c9802ab | ||
|
|
94da8ca950 | ||
|
|
9a9a4fef65 | ||
|
|
3a7b1f48c7 | ||
|
|
a46bbb409f | ||
|
|
08d16c2ca2 | ||
|
|
b501352ddc | ||
|
|
1c51598366 | ||
|
|
db839a9ccd | ||
|
|
5aba426b98 | ||
|
|
6c184efa92 | ||
|
|
028a090864 | ||
|
|
7e097a7ee9 | ||
|
|
ce369638da | ||
|
|
c8054ff9d2 | ||
|
|
e0e02f1e5f | ||
|
|
7f671909bb | ||
|
|
d2ca0b3f33 | ||
|
|
e448a265c0 | ||
|
|
7a3774be7c | ||
|
|
07930f6a56 | ||
|
|
8172ab535f | ||
|
|
a9d75e3c35 | ||
|
|
a51e5fb4a7 | ||
|
|
cb3cd9d840 | ||
|
|
55123d236d | ||
|
|
13364b5806 | ||
|
|
7f1b92927c | ||
|
|
7ce65b3095 | ||
|
|
8e599e2d21 | ||
|
|
db6924deb6 | ||
|
|
86b64d0415 | ||
|
|
19a53fafd3 | ||
|
|
ea3c6696e2 | ||
|
|
f64a37a633 | ||
|
|
e816e011b1 | ||
|
|
5aa08cfd0c | ||
|
|
0a822211de | ||
|
|
2b049e1717 | ||
|
|
c01a83b466 | ||
|
|
089c856df3 | ||
|
|
603791de5b | ||
|
|
3caa2fc452 | ||
|
|
c78c66faf5 | ||
|
|
110ea17d69 | ||
|
|
da194eab14 | ||
|
|
fcfa8470b2 | ||
|
|
d092bd21c1 | ||
|
|
eafb2eedae | ||
|
|
05e3c59a46 | ||
|
|
0865496d76 | ||
|
|
e6a4c85adc | ||
|
|
3c76f6fcb5 | ||
|
|
c41d30f883 | ||
|
|
16fe532dc8 | ||
|
|
a429196d31 | ||
|
|
5f3643bd6a | ||
|
|
62824da779 | ||
|
|
e131b674fd | ||
|
|
c710cff9c8 | ||
|
|
68b8c489b2 | ||
|
|
5bb3bf6994 | ||
|
|
4169bcd6ae | ||
|
|
11802f58d1 | ||
|
|
a9cfecfc91 | ||
|
|
dda27c9194 | ||
|
|
596a277434 | ||
|
|
b5fcb6b235 | ||
|
|
84190e7c6e | ||
|
|
b6aa8f9e96 | ||
|
|
6308a4bc2d | ||
|
|
fe640249e4 | ||
|
|
56822f6bd6 | ||
|
|
8e639bd03f | ||
|
|
e125ff899f | ||
|
|
efb1ce0324 | ||
|
|
0999d439dd | ||
|
|
0521ecb250 | ||
|
|
a5a0cbc557 | ||
|
|
26a2519451 | ||
|
|
899ea8b9e8 | ||
|
|
4467081169 | ||
|
|
6d0128aec4 | ||
|
|
3007ad001e | ||
|
|
ba786a62f7 | ||
|
|
6eee8cecd8 | ||
|
|
1a2de11e92 | ||
|
|
293d08deec | ||
|
|
396f4e58de | ||
|
|
8100c090fa | ||
|
|
4513c372a8 | ||
|
|
0b3df3a155 | ||
|
|
04308e71de | ||
|
|
f2a6e8f54c | ||
|
|
9e73b51116 | ||
|
|
34e7b6741f | ||
|
|
db90f29513 | ||
|
|
24035683a9 | ||
|
|
29737f720e | ||
|
|
0caaadc774 | ||
|
|
e5601010e8 | ||
|
|
56396d11ef | ||
|
|
bb44b3f718 | ||
|
|
cac9d329e1 | ||
|
|
0a32f38f91 | ||
|
|
6c0cf516c0 | ||
|
|
fda25bbd30 | ||
|
|
495d947fe9 | ||
|
|
1b5297ab04 | ||
|
|
b136df86a1 | ||
|
|
5b44ecaae7 | ||
|
|
811451f24e | ||
|
|
602b5564b0 | ||
|
|
fcf86c5e75 | ||
|
|
c545c96fc1 | ||
|
|
15eccefecb | ||
|
|
671634b99c | ||
|
|
b8f0671227 | ||
|
|
70b6d54af7 | ||
|
|
8a81fe821f | ||
|
|
3870b86a31 | ||
|
|
b0b489704e | ||
|
|
1f508039e8 | ||
|
|
dfc5d0d0ad | ||
|
|
52d8fdd976 | ||
|
|
f53edaa75c | ||
|
|
e7feeaddbe | ||
|
|
d0afc66b27 | ||
|
|
ed8ff0db97 | ||
|
|
65dbd203ca | ||
|
|
c578803b62 | ||
|
|
e3b68fd02d | ||
|
|
d16b9fac7c | ||
|
|
ea873ae3bc | ||
|
|
993cdc7492 | ||
|
|
237d11e0c6 | ||
|
|
c3e794b4e8 | ||
|
|
7adc14a5aa | ||
|
|
2ab14d62be | ||
|
|
39058213fa | ||
|
|
804c67ef9a | ||
|
|
38645af1a9 | ||
|
|
879272dfe4 | ||
|
|
d93e691534 | ||
|
|
b2ea4a2cdd | ||
|
|
70aa420406 | ||
|
|
ca70068d88 | ||
|
|
3c9fc8f0c3 | ||
|
|
562bec14fe | ||
|
|
93dbaa516a | ||
|
|
69ba176990 | ||
|
|
f613487c4d | ||
|
|
5badd8fc51 | ||
|
|
95267d4b3e | ||
|
|
f998ea2a52 | ||
|
|
c97f9e2c59 | ||
|
|
b336198853 | ||
|
|
dfeaa4fdb7 | ||
|
|
4f72f284ce | ||
|
|
5ab1f04ea5 | ||
|
|
aa71866a17 | ||
|
|
dcec78b00e | ||
|
|
4944210ef1 | ||
|
|
e2d77684e3 | ||
|
|
d2eb9eb4aa | ||
|
|
a690b177ca | ||
|
|
aa94ba8b68 | ||
|
|
c999828197 | ||
|
|
6b17d862e2 | ||
|
|
439f5b8851 | ||
|
|
54844ecea1 | ||
|
|
2fadea10b0 | ||
|
|
e550c08273 | ||
|
|
d1e46104ae | ||
|
|
59a617a40d | ||
|
|
1bbd6c8225 | ||
|
|
5fcf08e4c5 | ||
|
|
6c256469e9 | ||
|
|
055d87ce9d | ||
|
|
0acb0dc3e7 | ||
|
|
47d7baaf5f | ||
|
|
fe4f7ffb58 | ||
|
|
c6eb24020b | ||
|
|
d0a086e84b | ||
|
|
5a7a7c9e60 | ||
|
|
75af26c55e | ||
|
|
64692a925b | ||
|
|
e19c9e12dc | ||
|
|
b70373ea31 | ||
|
|
e3ea0c8140 | ||
|
|
d881a0ae25 | ||
|
|
34459f54ef | ||
|
|
168c15ce02 | ||
|
|
d4576bbdd4 | ||
|
|
2dad83e965 | ||
|
|
22a1df82e1 | ||
|
|
4de4e07d99 | ||
|
|
0809a6e70c | ||
|
|
c9fab19ce8 | ||
|
|
8c3a52d40c | ||
|
|
69120bb4de | ||
|
|
b80faf911a | ||
|
|
fb2e1884f5 | ||
|
|
1d803af331 | ||
|
|
730b6d38a5 | ||
|
|
fdbb24962a | ||
|
|
4963579e20 | ||
|
|
46007853c7 | ||
|
|
74f99e9ee7 | ||
|
|
58a2d0bea7 | ||
|
|
dd594245f6 | ||
|
|
e6bad26ef0 | ||
|
|
acbc661efb | ||
|
|
0cdb34032e | ||
|
|
74c7b9e4f5 | ||
|
|
5b1abf0fc9 | ||
|
|
b680999e62 | ||
|
|
87255733a5 | ||
|
|
08a4a73b53 | ||
|
|
4b3fab563a | ||
|
|
583f8249cb | ||
|
|
3929f3e809 |
558
.cproject
558
.cproject
@@ -3,383 +3,13 @@
|
|||||||
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||||
|
|
||||||
<cconfiguration id="cdt.managedbuild.toolchain.gnu.cross.base.293933348">
|
<cconfiguration id="org.eclipse.cdt.core.default.config.959280881">
|
||||||
|
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.293933348" moduleId="org.eclipse.cdt.core.settings" name="Default">
|
<storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="org.eclipse.cdt.core.default.config.959280881" moduleId="org.eclipse.cdt.core.settings" name="Configuration">
|
||||||
|
|
||||||
<macros>
|
|
||||||
|
|
||||||
<stringMacro name="RECOVERY_APPLICATION" type="VALUE_TEXT" value="0"/>
|
|
||||||
|
|
||||||
</macros>
|
|
||||||
|
|
||||||
<externalSettings/>
|
<externalSettings/>
|
||||||
|
|
||||||
<extensions>
|
<extensions/>
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
</extensions>
|
|
||||||
|
|
||||||
</storageModule>
|
|
||||||
|
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
|
||||||
|
|
||||||
<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.cross.base.293933348" name="Default" optionalBuildProperties="" parent="org.eclipse.cdt.build.core.emptycfg">
|
|
||||||
|
|
||||||
<folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.949515869" name="/" resourcePath="">
|
|
||||||
|
|
||||||
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.base.1860816932" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.base">
|
|
||||||
|
|
||||||
<option id="cdt.managedbuild.option.gnu.cross.prefix.211558150" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/>
|
|
||||||
|
|
||||||
<option id="cdt.managedbuild.option.gnu.cross.path.660444977" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
|
|
||||||
|
|
||||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1109615480" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
|
|
||||||
|
|
||||||
<builder arguments="-j8 EXTRA_CPPFLAGS="-DRECOVERY_APPLICATION=0"" command="make" id="cdt.managedbuild.builder.gnu.cross.1247197310" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.924305212" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
|
|
||||||
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.c.compiler.option.preprocessor.def.symbols.237333664" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"/>
|
|
||||||
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.851339966" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
|
|
||||||
|
|
||||||
</tool>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1689301712" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
|
|
||||||
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.cpp.compiler.option.preprocessor.def.1320841573" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols"/>
|
|
||||||
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1117032298" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
|
|
||||||
|
|
||||||
</tool>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.69706729" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.1919651858" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
|
|
||||||
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1241928244" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
|
|
||||||
|
|
||||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
|
||||||
|
|
||||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
|
||||||
|
|
||||||
</inputType>
|
|
||||||
|
|
||||||
</tool>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.1543827445" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.1248561272" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
|
|
||||||
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.736707865" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
|
||||||
|
|
||||||
</tool>
|
|
||||||
|
|
||||||
</toolChain>
|
|
||||||
|
|
||||||
</folderInfo>
|
|
||||||
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
</storageModule>
|
|
||||||
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
|
||||||
|
|
||||||
</cconfiguration>
|
|
||||||
|
|
||||||
<cconfiguration id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934">
|
|
||||||
|
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934" moduleId="org.eclipse.cdt.core.settings" name="recovery">
|
|
||||||
|
|
||||||
<macros>
|
|
||||||
|
|
||||||
<stringMacro name="RECOVERY_APPLICATION" type="VALUE_TEXT" value="1"/>
|
|
||||||
|
|
||||||
</macros>
|
|
||||||
|
|
||||||
<externalSettings/>
|
|
||||||
|
|
||||||
<extensions>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
</extensions>
|
|
||||||
|
|
||||||
</storageModule>
|
|
||||||
|
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
|
||||||
|
|
||||||
<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934" name="recovery" optionalBuildProperties="" parent="org.eclipse.cdt.build.core.emptycfg">
|
|
||||||
|
|
||||||
<folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934." name="/" resourcePath="">
|
|
||||||
|
|
||||||
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.base.1561608239" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.base">
|
|
||||||
|
|
||||||
<option id="cdt.managedbuild.option.gnu.cross.prefix.878380733" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/>
|
|
||||||
|
|
||||||
<option id="cdt.managedbuild.option.gnu.cross.path.576225618" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
|
|
||||||
|
|
||||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1674304340" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
|
|
||||||
|
|
||||||
<builder arguments="-j8 EXTRA_CPPFLAGS="-DRECOVERY_APPLICATION=1"" command="make" id="cdt.managedbuild.builder.gnu.cross.1616827916" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1397900624" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
|
|
||||||
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.c.compiler.option.preprocessor.def.symbols.1168574489" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"/>
|
|
||||||
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.24917724" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
|
|
||||||
|
|
||||||
</tool>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.40066190" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
|
|
||||||
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.cpp.compiler.option.preprocessor.def.1538103313" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols"/>
|
|
||||||
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.773825889" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
|
|
||||||
|
|
||||||
</tool>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.750042642" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.791695355" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
|
|
||||||
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.363611836" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
|
|
||||||
|
|
||||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
|
||||||
|
|
||||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
|
||||||
|
|
||||||
</inputType>
|
|
||||||
|
|
||||||
</tool>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.788163154" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.747849588" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
|
|
||||||
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.597864277" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
|
||||||
|
|
||||||
</tool>
|
|
||||||
|
|
||||||
</toolChain>
|
|
||||||
|
|
||||||
</folderInfo>
|
|
||||||
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
</storageModule>
|
|
||||||
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
|
||||||
|
|
||||||
</cconfiguration>
|
|
||||||
|
|
||||||
<cconfiguration id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291">
|
|
||||||
|
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291" moduleId="org.eclipse.cdt.core.settings" name="recovery_windows">
|
|
||||||
|
|
||||||
<macros>
|
|
||||||
|
|
||||||
<stringMacro name="RECOVERY_APPLICATION" type="VALUE_TEXT" value="1"/>
|
|
||||||
|
|
||||||
</macros>
|
|
||||||
|
|
||||||
<externalSettings/>
|
|
||||||
|
|
||||||
<extensions>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
</extensions>
|
|
||||||
|
|
||||||
</storageModule>
|
|
||||||
|
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
|
||||||
|
|
||||||
<configuration artifactName="${ProjName}" buildProperties="" description="Building recovery in windows" id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291" name="recovery_windows" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="org.eclipse.cdt.build.core.emptycfg">
|
|
||||||
|
|
||||||
<folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291." name="/" resourcePath="">
|
|
||||||
|
|
||||||
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.base.845245133" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.base">
|
|
||||||
|
|
||||||
<option id="cdt.managedbuild.option.gnu.cross.prefix.1090509495" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/>
|
|
||||||
|
|
||||||
<option id="cdt.managedbuild.option.gnu.cross.path.447265559" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
|
|
||||||
|
|
||||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1831977109" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
|
|
||||||
|
|
||||||
<builder arguments=""c:/msys32/opt/esp-idf/tools/windows/eclipse_make.py" EXTRA_CPPFLAGS='-DRECOVERY_APPLICATION=${RECOVERY_APPLICATION}'" buildPath="${workspace_loc:/squeezelite-esp32}" command="python" id="cdt.managedbuild.builder.gnu.cross.1069921467" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.builder.gnu.cross"/>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1302011176" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
|
|
||||||
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.c.compiler.option.preprocessor.def.symbols.623798750" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"/>
|
|
||||||
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.539301587" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
|
|
||||||
|
|
||||||
</tool>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1722031516" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
|
|
||||||
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.cpp.compiler.option.preprocessor.def.2010227748" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols"/>
|
|
||||||
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.2073997022" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
|
|
||||||
|
|
||||||
</tool>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.746651743" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.149944553" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
|
|
||||||
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1372009292" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
|
|
||||||
|
|
||||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
|
||||||
|
|
||||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
|
||||||
|
|
||||||
</inputType>
|
|
||||||
|
|
||||||
</tool>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.649046248" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.2132030687" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
|
|
||||||
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1779870241" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
|
||||||
|
|
||||||
</tool>
|
|
||||||
|
|
||||||
</toolChain>
|
|
||||||
|
|
||||||
</folderInfo>
|
|
||||||
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
</storageModule>
|
|
||||||
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
|
||||||
|
|
||||||
</cconfiguration>
|
|
||||||
|
|
||||||
<cconfiguration id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736">
|
|
||||||
|
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736" moduleId="org.eclipse.cdt.core.settings" name="squeezelite_windows">
|
|
||||||
|
|
||||||
<macros>
|
|
||||||
|
|
||||||
<stringMacro name="RECOVERY_APPLICATION" type="VALUE_TEXT" value="0"/>
|
|
||||||
|
|
||||||
</macros>
|
|
||||||
|
|
||||||
<externalSettings/>
|
|
||||||
|
|
||||||
<extensions>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
|
|
||||||
</extensions>
|
|
||||||
|
|
||||||
</storageModule>
|
|
||||||
|
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
|
||||||
|
|
||||||
<configuration artifactName="${ProjName}" buildProperties="" description="building squeezelite app in windows" id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736" name="squeezelite_windows" optionalBuildProperties="" parent="org.eclipse.cdt.build.core.emptycfg">
|
|
||||||
|
|
||||||
<folderInfo id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736." name="/" resourcePath="">
|
|
||||||
|
|
||||||
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.base.1034176750" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.base">
|
|
||||||
|
|
||||||
<option id="cdt.managedbuild.option.gnu.cross.prefix.1038632104" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/>
|
|
||||||
|
|
||||||
<option id="cdt.managedbuild.option.gnu.cross.path.1589817380" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
|
|
||||||
|
|
||||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.784380822" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
|
|
||||||
|
|
||||||
<builder arguments=""C:/msys32/opt/esp-idf/tools/windows/eclipse_make.py" -j8 EXTRA_CPPFLAGS="-DRECOVERY_APPLICATION=0"" command="python" id="cdt.managedbuild.builder.gnu.cross.1150681639" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.824219909" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
|
|
||||||
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.c.compiler.option.preprocessor.def.symbols.217201640" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"/>
|
|
||||||
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.644208200" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
|
|
||||||
|
|
||||||
</tool>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1907231332" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
|
|
||||||
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.cpp.compiler.option.preprocessor.def.959275134" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols"/>
|
|
||||||
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.604467026" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
|
|
||||||
|
|
||||||
</tool>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1073903870" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.898376794" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
|
|
||||||
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1560070168" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
|
|
||||||
|
|
||||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
|
||||||
|
|
||||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
|
||||||
|
|
||||||
</inputType>
|
|
||||||
|
|
||||||
</tool>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.1462690215" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
|
|
||||||
|
|
||||||
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.40469999" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
|
|
||||||
|
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.798539361" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
|
||||||
|
|
||||||
</tool>
|
|
||||||
|
|
||||||
</toolChain>
|
|
||||||
|
|
||||||
</folderInfo>
|
|
||||||
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
</storageModule>
|
</storageModule>
|
||||||
|
|
||||||
@@ -389,190 +19,14 @@
|
|||||||
|
|
||||||
</storageModule>
|
</storageModule>
|
||||||
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.pathentry"/>
|
<storageModule moduleId="org.eclipse.cdt.core.pathentry">
|
||||||
|
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
|
||||||
|
|
||||||
<project id="squeezelite-esp32-merge.null.1711307563" name="squeezelite-esp32-merge"/>
|
<pathentry excluding="**/CMakeFiles/**" kind="out" path="build"/>
|
||||||
|
|
||||||
</storageModule>
|
</storageModule>
|
||||||
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||||
|
|
||||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||||
|
|
||||||
<configuration configurationName="squeezelite_windows">
|
|
||||||
|
|
||||||
<resource resourceType="PROJECT" workspacePath="/squeezelite-esp32-merge"/>
|
|
||||||
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
<configuration configurationName="recovery_windows">
|
|
||||||
|
|
||||||
<resource resourceType="PROJECT" workspacePath="/squeezelite-esp32"/>
|
|
||||||
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
<configuration configurationName="recovery">
|
|
||||||
|
|
||||||
<resource resourceType="PROJECT" workspacePath="/squeezelite-esp32"/>
|
|
||||||
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
<configuration configurationName="Default">
|
|
||||||
|
|
||||||
<resource resourceType="PROJECT" workspacePath="/squeezelite-esp32"/>
|
|
||||||
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
</storageModule>
|
|
||||||
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
|
|
||||||
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
|
|
||||||
|
|
||||||
<buildTargets>
|
|
||||||
|
|
||||||
<target name="all" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
|
|
||||||
<buildArguments>-j8 EXTRA_CPPFLAGS="-DRECOVERY_APPLICATION=1"</buildArguments>
|
|
||||||
|
|
||||||
<buildTarget>all</buildTarget>
|
|
||||||
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="app" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
|
|
||||||
<buildArguments>-j8 EXTRA_CPPFLAGS="-DRECOVERY_APPLICATION=1"</buildArguments>
|
|
||||||
|
|
||||||
<buildTarget>app</buildTarget>
|
|
||||||
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="clean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
|
||||||
|
|
||||||
<buildCommand>make</buildCommand>
|
|
||||||
|
|
||||||
<buildArguments>-j8 EXTRA_CPPFLAGS="-DRECOVERY_APPLICATION=1"</buildArguments>
|
|
||||||
|
|
||||||
<buildTarget>clean</buildTarget>
|
|
||||||
|
|
||||||
<stopOnError>true</stopOnError>
|
|
||||||
|
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
|
||||||
|
|
||||||
<runAllBuilders>true</runAllBuilders>
|
|
||||||
|
|
||||||
</target>
|
|
||||||
|
|
||||||
</buildTargets>
|
|
||||||
|
|
||||||
</storageModule>
|
|
||||||
|
|
||||||
<storageModule moduleId="scannerConfiguration">
|
|
||||||
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cygwin.base.58932738;cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.1067614858;cdt.managedbuild.tool.gnu.c.compiler.cygwin.base.1865841553;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1383814557">
|
|
||||||
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934;cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.40066190;cdt.managedbuild.tool.gnu.cpp.compiler.input.773825889">
|
|
||||||
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736;cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1907231332;cdt.managedbuild.tool.gnu.cpp.compiler.input.604467026">
|
|
||||||
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291;cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1722031516;cdt.managedbuild.tool.gnu.cpp.compiler.input.2073997022">
|
|
||||||
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291;cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.;cdt.managedbuild.tool.gnu.cross.c.compiler.1302011176;cdt.managedbuild.tool.gnu.c.compiler.input.539301587">
|
|
||||||
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cygwin.base.58932738;cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.1067614858;cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.base.410547198;cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.1499974240">
|
|
||||||
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736;cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736.;cdt.managedbuild.tool.gnu.cross.c.compiler.824219909;cdt.managedbuild.tool.gnu.c.compiler.input.644208200">
|
|
||||||
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707;cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.base.211315976;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.857914729">
|
|
||||||
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1943329896;cdt.managedbuild.toolchain.gnu.cross.base.1943329896.30011915;cdt.managedbuild.tool.gnu.cross.cpp.compiler.1749746745;cdt.managedbuild.tool.gnu.cpp.compiler.input.1914005798">
|
|
||||||
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1476804786;cdt.managedbuild.toolchain.gnu.cross.base.1476804786.1800826258;cdt.managedbuild.tool.gnu.cross.cpp.compiler.254690821;cdt.managedbuild.tool.gnu.cpp.compiler.input.1365876654">
|
|
||||||
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1943329896;cdt.managedbuild.toolchain.gnu.cross.base.1943329896.30011915;cdt.managedbuild.tool.gnu.cross.c.compiler.2083405506;cdt.managedbuild.tool.gnu.c.compiler.input.404320567">
|
|
||||||
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707;cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707.;cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.base.145410566;cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.1181636367">
|
|
||||||
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.1476804786;cdt.managedbuild.toolchain.gnu.cross.base.1476804786.1800826258;cdt.managedbuild.tool.gnu.cross.c.compiler.1502936757;cdt.managedbuild.tool.gnu.c.compiler.input.1614739014">
|
|
||||||
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
|
|
||||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934;cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934.;cdt.managedbuild.tool.gnu.cross.c.compiler.1397900624;cdt.managedbuild.tool.gnu.c.compiler.input.24917724">
|
|
||||||
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
|
|
||||||
</storageModule>
|
|
||||||
|
|
||||||
</cproject>
|
</cproject>
|
||||||
|
|||||||
30
.github/workflows/I2S-4MBFlash.yml
vendored
30
.github/workflows/I2S-4MBFlash.yml
vendored
@@ -1,30 +0,0 @@
|
|||||||
# This is a basic workflow to help you get started with Actions
|
|
||||||
|
|
||||||
name: I2S-4MBFlash
|
|
||||||
|
|
||||||
# Controls when the action will run. Triggers the workflow on push or pull request
|
|
||||||
# events but only for the master branch
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master-cmake ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master-cmake ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
- name: Cache build
|
|
||||||
id: cache-build
|
|
||||||
uses: actions/cache@v1
|
|
||||||
with:
|
|
||||||
path: ${{github.workspace}}/build
|
|
||||||
key: ${{ runner.os }}-I2S-4MBFlash
|
|
||||||
- name: Build the firmware
|
|
||||||
run: |
|
|
||||||
docker run --rm -v $PWD:/project -w /project espressif/idf:release-v4.0 /bin/bash -c "python3 -m pip install --upgrade pip setuptools wheel && pip3 install protobuf grpcio-tools && cp build-scripts/I2S-4MFlash-sdkconfig.defaults sdkconfig && idf.py build"
|
|
||||||
|
|
||||||
|
|
||||||
20
.github/workflows/cmake.yml
vendored
20
.github/workflows/cmake.yml
vendored
@@ -1,20 +0,0 @@
|
|||||||
# This is a basic workflow to help you get started with Actions
|
|
||||||
|
|
||||||
name: Test-workflow
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Set Target
|
|
||||||
run: echo "TARGET_BUILD_NAME=SqueezeAmp" >> $GITHUB_ENV
|
|
||||||
- name: Get Target
|
|
||||||
run: |
|
|
||||||
echo "Target is ${TARGET_BUILD_NAME}"
|
|
||||||
env
|
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -65,6 +65,7 @@ libs/
|
|||||||
|
|
||||||
/cdump.cmd
|
/cdump.cmd
|
||||||
/_*
|
/_*
|
||||||
sdkconfig
|
|
||||||
squeezelite-esp32-jsonblob.zip
|
squeezelite-esp32-jsonblob.zip
|
||||||
*.bak
|
/flash_cmd.txt
|
||||||
|
/writeSequeezeEsp.bat
|
||||||
|
/writeSequeezeEsp.sh
|
||||||
|
|||||||
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -2,6 +2,6 @@
|
|||||||
path = components/telnet/libtelnet
|
path = components/telnet/libtelnet
|
||||||
url = https://github.com/seanmiddleditch/libtelnet
|
url = https://github.com/seanmiddleditch/libtelnet
|
||||||
branch = develop
|
branch = develop
|
||||||
[submodule "esp-dsp"]
|
[submodule "components/esp-dsp"]
|
||||||
path = esp-dsp
|
path = components/esp-dsp
|
||||||
url = https://github.com/philippe44/esp-dsp
|
url = https://github.com/philippe44/esp-dsp.git
|
||||||
|
|||||||
16
.project
16
.project
@@ -1,28 +1,20 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<projectDescription>
|
<projectDescription>
|
||||||
<name>squeezelite-esp32</name>
|
<name>squeezelite-esp32-idfv4</name>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
<projects>
|
<projects>
|
||||||
<project>esp-idf</project>
|
|
||||||
</projects>
|
</projects>
|
||||||
<buildSpec>
|
<buildSpec>
|
||||||
<buildCommand>
|
<buildCommand>
|
||||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
<name>org.eclipse.cdt.core.cBuilder</name>
|
||||||
<triggers>clean,full,incremental,</triggers>
|
<triggers>clean,full,incremental,</triggers>
|
||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
|
||||||
<triggers>full,incremental,</triggers>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||||
<nature>org.eclipse.cdt.core.ccnature</nature>
|
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
<nature>com.espressif.idf.core.idfNature</nature>
|
||||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
5
.pydevproject
Normal file
5
.pydevproject
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<?eclipse-pydev version="1.0"?><pydev_project>
|
||||||
|
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
|
||||||
|
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python interpreter</pydev_property>
|
||||||
|
</pydev_project>
|
||||||
1
.settings/.gitignore
vendored
1
.settings/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
/org.eclipse.ltk.core.refactoring.prefs
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<project>
|
|
||||||
|
|
||||||
<configuration id="cdt.managedbuild.toolchain.gnu.cross.base.293933348" name="Default">
|
|
||||||
|
|
||||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
|
||||||
|
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
|
||||||
|
|
||||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
|
||||||
|
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
|
||||||
|
|
||||||
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="66711578333" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
|
||||||
|
|
||||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
|
||||||
|
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
|
||||||
|
|
||||||
</provider>
|
|
||||||
|
|
||||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
|
||||||
|
|
||||||
</extension>
|
|
||||||
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
<configuration id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934" name="recovery">
|
|
||||||
|
|
||||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
|
||||||
|
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
|
||||||
|
|
||||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
|
||||||
|
|
||||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="true" name="CDT GCC Build Output Parser" parameter="xtensa-esp32-elf-(gcc|g\+\+|c\+\+|cc|cpp|clang)" prefer-non-shared="true"/>
|
|
||||||
|
|
||||||
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="29929057949" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="xtensa-esp32-elf-gcc ${FLAGS} -std=c++11 -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
|
||||||
|
|
||||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
|
||||||
|
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
|
||||||
|
|
||||||
</provider>
|
|
||||||
|
|
||||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
|
||||||
|
|
||||||
</extension>
|
|
||||||
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
<configuration id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291" name="recovery_windows">
|
|
||||||
|
|
||||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
|
||||||
|
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
|
||||||
|
|
||||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
|
||||||
|
|
||||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="(g?cc)|([gc]\+\+)|(clang)" prefer-non-shared="true"/>
|
|
||||||
|
|
||||||
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1502478736382965477" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
|
||||||
|
|
||||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
|
||||||
|
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
|
||||||
|
|
||||||
</provider>
|
|
||||||
|
|
||||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
|
||||||
|
|
||||||
</extension>
|
|
||||||
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
<configuration id="cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736" name="squeezelite_windows">
|
|
||||||
|
|
||||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
|
||||||
|
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
|
||||||
|
|
||||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
|
||||||
|
|
||||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="true" name="CDT GCC Build Output Parser" parameter="xtensa-esp32-elf-(gcc|g\+\+|c\+\+|cc|cpp|clang)" prefer-non-shared="true"/>
|
|
||||||
|
|
||||||
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1766868238676867652" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="xtensa-esp32-elf-gcc ${FLAGS} -std=c++11 -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
|
||||||
|
|
||||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
|
||||||
|
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
|
||||||
|
|
||||||
</provider>
|
|
||||||
|
|
||||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
|
||||||
|
|
||||||
</extension>
|
|
||||||
|
|
||||||
</configuration>
|
|
||||||
|
|
||||||
</project>
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/BATCH_BUILD/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/BATCH_BUILD/operation=append
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/BATCH_BUILD/value=1
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/EXTRA_CFLAGS/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/EXTRA_CFLAGS/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/EXTRA_CFLAGS/value=-DRECOVERY_APPLICATION\=1
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/IDF_PATH/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/IDF_PATH/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/IDF_PATH/value=/var/opt/esp-idf
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/append=true
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786.212420495/appendContributed=true
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/BATCH_BUILD/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/BATCH_BUILD/operation=append
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/BATCH_BUILD/value=1
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/EXTRA_CFLAGS/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/EXTRA_CFLAGS/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/EXTRA_CFLAGS/value=
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/IDF_PATH/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/IDF_PATH/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/IDF_PATH/value=/var/opt/esp-idf
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/PATH/delimiter=;
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/PATH/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/PATH/value=C\:/msys2/opt/xtensa-esp32-elf/bin;C\:/jdk-12.0.2/bin/server;C\:/jdk-12.0.2/bin;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;C\:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C\:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C\:\\jdk-12.0.2\\bin;C\:\\Program Files\\PuTTY\\;C\:\\Program Files (x86)\\HP\\IdrsOCR_15.2.10.1114\\;C\:\\eclipse
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/append=true
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/appendContributed=true
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/BATCH_BUILD/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/BATCH_BUILD/operation=append
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/BATCH_BUILD/value=1
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/IDF_PATH/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/IDF_PATH/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/IDF_PATH/value=C\:/msys32/opt/esp-idf
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/PATH/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/PATH/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/PATH/value=C\:\\msys32\\usr\\bin;C\:\\msys32\\mingw32\\bin;C\:\\msys32\\opt\\xtensa-esp32-elf\\bin\\
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/PROJECT_NAME/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/PROJECT_NAME/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/PROJECT_NAME/value=recovery.custom
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/PROJECT_VER/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/PROJECT_VER/operation=append
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/PROJECT_VER/value=custom
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/append=true
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/appendContributed=true
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/BATCH_BUILD/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/BATCH_BUILD/operation=append
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/BATCH_BUILD/value=1
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/IDF_PATH/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/IDF_PATH/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/IDF_PATH/value=C\:/msys32/opt/esp-idf
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PATH/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PATH/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PATH/value=C\:\\msys32\\opt\\openocd-esp32\\bin;c\:\\msys32\\opt\\xtensa-esp32-elf\\bin\\;c\:\\msys32\\mingw32\\bin;C\:\\msys32\\usr\\bin;c\:\\Python27;C\:\\msys32\\usr\\bin\\vendor_perl;C\:\\msys32\\usr\\bin\\core_perl
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PROJECT_NAME/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PROJECT_NAME/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PROJECT_NAME/value=recovery
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PROJECT_VER/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PROJECT_VER/operation=append
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PROJECT_VER/value=custom
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/append=true
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/appendContributed=true
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/BATCH_BUILD/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/BATCH_BUILD/operation=append
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/BATCH_BUILD/value=1
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/IDF_PATH/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/IDF_PATH/operation=append
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/IDF_PATH/value=/var/opt/esp-idf/
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/PATH/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/PATH/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/PATH/value=/var/opt/xtensa-esp32-elf/bin/\:/sbin\:/bin\:/usr/bin\:/usr/local/bin\:/snap/bin\:/bin\:/sbin\:/usr/bin\:/usr/local/bin\:/snap/bin
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/PROJECT_NAME/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/PROJECT_NAME/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/PROJECT_NAME/value=recovery.custom
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/PROJECT_VER/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/PROJECT_VER/operation=append
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/PROJECT_VER/value=custom
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/append=true
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.839256934/appendContributed=true
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/BATCH_BUILD/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/BATCH_BUILD/operation=append
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/BATCH_BUILD/value=1
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/IDF_PATH/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/IDF_PATH/operation=append
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/IDF_PATH/value=/var/opt/esp-idf/
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/PATH/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/PATH/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/PATH/value=/var/opt/xtensa-esp32-elf/bin/\:/sbin\:/bin\:/usr/bin\:/usr/local/bin\:/snap/bin\:/bin\:/sbin\:/usr/bin\:/usr/local/bin\:/snap/bin
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/PROJECT_NAME/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/PROJECT_NAME/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/PROJECT_NAME/value=squeezelite.custom
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/PROJECT_VER/delimiter=\:
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/PROJECT_VER/operation=append
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/PROJECT_VER/value=custom
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/append=true
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348/appendContributed=true
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707/BATCH_BUILD/delimiter=;
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707/BATCH_BUILD/operation=append
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707/BATCH_BUILD/value=1
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707/IDF_PATH/delimiter=;
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707/IDF_PATH/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707/IDF_PATH/value=c\:/msys32/opt/esp-idf
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707/PATH/delimiter=;
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707/PATH/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707/PATH/value=C\:\\msys32\\usr\\bin;C\:\\msys32\\mingw32\\bin;C\:\\msys32\\opt\\xtensa-esp32-elf\\bin;C\:\\Python27
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707/append=true
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738.859326707/appendContributed=false
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738/BATCH_BUILD/delimiter=;
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738/BATCH_BUILD/operation=append
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738/BATCH_BUILD/value=1
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738/IDF_PATH/delimiter=;
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738/IDF_PATH/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738/IDF_PATH/value=c\:/msys32/opt/esp-idf
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738/PATH/delimiter=;
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738/PATH/operation=replace
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738/PATH/value=C\:\\msys32\\usr\\bin;C\:\\msys32\\mingw32\\bin;C\:\\msys32\\opt\\xtensa-esp32-elf\\bin;C\:\\Python27
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738/append=true
|
|
||||||
environment/project/cdt.managedbuild.toolchain.gnu.cygwin.base.58932738/appendContributed=false
|
|
||||||
@@ -1,3 +1,15 @@
|
|||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
set(EXTRA_COMPONENT_DIRS components/platform_console/app_recovery components/platform_console/app_squeezelite )
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
project(squeezelite-esp32)
|
|
||||||
|
message(STATUS "Building RECOVERY")
|
||||||
|
project(recovery)
|
||||||
|
set_property(TARGET recovery.elf PROPERTY RECOVERY_PREFIX app_recovery )
|
||||||
|
|
||||||
|
include(squeezelite.cmake)
|
||||||
|
|
||||||
|
|
||||||
|
set(PROJECT_VER $ENV{PROJECT_VER})
|
||||||
|
|
||||||
|
#target_compile_definitions(__idf_squeezelite-ota PRIVATE -DLOG_LOCAL_LEVEL=ESP_LOG_VERBOSE)
|
||||||
|
#target_compile_definitions(__idf_driver_bt PRIVATE -DLOG_LOCAL_LEVEL=ESP_LOG_VERBOSE)
|
||||||
10
Makefile
10
Makefile
@@ -10,9 +10,13 @@
|
|||||||
|
|
||||||
|
|
||||||
#recovery: PROJECT_NAME:=recovery.$(PROJECT_CONFIG_TARGET)
|
#recovery: PROJECT_NAME:=recovery.$(PROJECT_CONFIG_TARGET)
|
||||||
#recovery: CPPFLAGS+=-DRECOVERY_APPLICATION=1
|
#recovery: EXTRA_CPPFLAGS+=-DRECOVERY_APPLICATION=1
|
||||||
|
|
||||||
PROJECT_NAME?=squeezelite
|
PROJECT_NAME?=squeezelite
|
||||||
EXTRA_COMPONENT_DIRS := esp-dsp
|
EXTRA_CPPFLAGS+= -I$(PROJECT_PATH)/main
|
||||||
|
|
||||||
|
#/-Wno-error=maybe-uninitialized
|
||||||
include $(IDF_PATH)/make/project.mk
|
include $(IDF_PATH)/make/project.mk
|
||||||
CPPFLAGS+= -Wno-error=maybe-uninitialized
|
|
||||||
|
# for future gcc version, this could be needed: CPPFLAGS+= -Wno-error=format-overflow -Wno-error=stringop-truncation
|
||||||
|
|
||||||
|
|||||||
278
README.md
278
README.md
@@ -1,45 +1,9 @@
|
|||||||
# Squeezelite-esp32
|
# Squeezelite-esp32
|
||||||
## What is this
|
## Supported Hardware
|
||||||
Squeezelite-esp32 is an audio software suite made to run on espressif's ESP32 wifi (b/g/n) and bluetooth chipset. It offers the following capabilities
|
|
||||||
|
|
||||||
- Stream your local music and connect to all major on-line music providers (Spotify, Deezer, Tidal, Qobuz) using [Logitech Media Server - a.k.a LMS](https://forums.slimdevices.com/) and enjoy multi-room audio synchronization. LMS can be extended by numerous plugins and can be controlled using a Web browser or dedicated applications (iPhone, Android). It can also send audio to UPnP, Sonos, ChromeCast and AirPlay speakers/devices.
|
|
||||||
- Stream from a Bluetooth device (iPhone, Android)
|
|
||||||
- Stream from an AirPlay controller (iPhone, iTunes ...) and enjoy synchronization multiroom as well (although it's AirPlay 1 only)
|
|
||||||
|
|
||||||
Depending on the hardware connected to the ESP32, you can send audio to a local DAC, to SPDIF or to a Bluetooth speaker. The bare minimum required hardware is a WROVER module with 4MB of Flash and 4MB of PSRAM (https://www.espressif.com/en/products/modules/esp32). With that module standalone, just apply power and you can stream to a Bluetooth speaker. You can also send audio to most I2S DAC as well as to SPDIF receivers using just a cable or an optical transducer (you'll need *one* resistor...)
|
|
||||||
|
|
||||||
But squeezelite-esp32 is highly extensible and you can add
|
|
||||||
|
|
||||||
- Buttons and Rotary Encoder and map/combine them to various functions (play, pause, volume, next ...)
|
|
||||||
- IR receiver (no pullup resistor or capacitor needed, just the 38kHz receiver)
|
|
||||||
- Monochrome, GrayScale or Color displays using SPI or I2S (supported drivers are SH1106, SSD1306, SSD1322, SSD1326/7, SSD1351, ST7735 and ST7789).
|
|
||||||
|
|
||||||
Other features include
|
|
||||||
|
|
||||||
- Resampling
|
|
||||||
- 10-bands equalizer
|
|
||||||
- Automatic initial setup using any WiFi device
|
|
||||||
- Full web interface for further configuration/management
|
|
||||||
- Firmware over-the-air update
|
|
||||||
|
|
||||||
## Supported Hardware
|
|
||||||
Any esp32-based hardware with at least 4MB of flash and 4MB of PSRAM will be capable of running squeezelite-esp32 and there are various boards that include such chip. A few are mentionned below, but any should work.
|
|
||||||
### Raw WROVER module
|
|
||||||
Per above description, a [WROVER module](https://www.espressif.com/en/products/modules/esp32) is enough to run Squeezelite-esp32, but that requires a bit of tinkering to extend it to have analogue audio or hardware buttons (e.g.)
|
|
||||||
|
|
||||||
Please note that when sending to a Bluetooth speaker, then resampling *must* be enabled (using -R) option if you want to send audio with rate other than 44.1kHz. Similarly, when using SPDIF, only 44.1kHz and 48kHz are supported so you might have to enable resampling as well. If you connect a DAC, choice will depends on its capabilities. See below for more details.
|
|
||||||
|
|
||||||
Most DAC will work out-of-the-box with simply an I2S connection, but some require specific commands to be sent using I2C. See DAC option below to understand how to send these dedicated commands. There is build-in support for TAS575x, TAS5780, TAS5713 and AC101 DAC.
|
|
||||||
### SqueezeAMP
|
### SqueezeAMP
|
||||||
This is the main hardware companion of Squeezelite-esp32 and has been developped together. Details on capabilities can be found [here](https://forums.slimdevices.com/showthread.php?110926-pre-ANNOUNCE-SqueezeAMP-and-SqueezeliteESP32) and [here](https://github.com/philippe44/SqueezeAMP).
|
Works with the SqueezeAMP see [here](https://forums.slimdevices.com/showthread.php?110926-pre-ANNOUNCE-SqueezeAMP-and-SqueezeliteESP32) and [here](https://github.com/philippe44/SqueezeAMP/blob/master/README.md). Add repository https://raw.githubusercontent.com/sle118/squeezelite-esp32/master/plugin/repo.xml to LMS if you want to have a display
|
||||||
|
|
||||||
if you want to rebuild, use the `squeezelite-esp32-SqueezeAmp-sdkconfig.defaults` configuration file.
|
Use the `squeezelite-esp32-SqueezeAmp-sdkconfig.defaults` configuration file.
|
||||||
|
|
||||||
NB: You can use the pre-build binaries SqueezeAMP4MBFlash which has all the hardware I/O set properly. You can also use the generic binary I2S4MBFlash in which case the NVS parameters shall be set to get the exact same behavior
|
|
||||||
- set_GPIO: 12=green,13=red,34=jack,2=spkfault
|
|
||||||
- batt_config: channel=7,scale=20.24
|
|
||||||
- dac_config: model=TAS57xx,bck=33,ws=25,do=32,sda=27,scl=26,mute=14:0
|
|
||||||
- spdif_config: bck=33,ws=25,do=15
|
|
||||||
|
|
||||||
### ESP32-A1S
|
### ESP32-A1S
|
||||||
Works with [ESP32-A1S](https://docs.ai-thinker.com/esp32-a1s) module that includes audio codec and headset output. You still need to use a demo board like [this](https://www.aliexpress.com/item/4000765857347.html?spm=2114.12010615.8148356.11.5d963cd0j669ns) or an external amplifier if you want direct speaker connection.
|
Works with [ESP32-A1S](https://docs.ai-thinker.com/esp32-a1s) module that includes audio codec and headset output. You still need to use a demo board like [this](https://www.aliexpress.com/item/4000765857347.html?spm=2114.12010615.8148356.11.5d963cd0j669ns) or an external amplifier if you want direct speaker connection.
|
||||||
@@ -54,18 +18,11 @@ The board showed above has the following IO set
|
|||||||
|
|
||||||
So a possible config would be
|
So a possible config would be
|
||||||
- set_GPIO: 21=amp,22=green:0,39=jack:0
|
- set_GPIO: 21=amp,22=green:0,39=jack:0
|
||||||
- dac_config: model=AC101,bck=27,ws=26,do=25,di=35,sda=33,scl=32
|
|
||||||
- a button mapping:
|
- a button mapping:
|
||||||
```
|
```
|
||||||
[{"gpio":5,"normal":{"pressed":"ACTRLS_TOGGLE"}},{"gpio":18,"pull":true,"shifter_gpio":5,"normal":{"pressed":"ACTRLS_VOLUP"}, "shifted":{"pressed":"ACTRLS_NEXT"}}, {"gpio":23,"pull":true,"shifter_gpio":5,"normal":{"pressed":"ACTRLS_VOLDOWN"},"shifted":{"pressed":"ACTRLS_PREV"}}]
|
[{"gpio":5,"normal":{"pressed":"ACTRLS_TOGGLE"}},{"gpio":18,"pull":true,"shifter_gpio":5,"normal":{"pressed":"ACTRLS_VOLUP"}, "shifted":{"pressed":"ACTRLS_NEXT"}}, {"gpio":23,"pull":true,"shifter_gpio":5,"normal":{"pressed":"ACTRLS_VOLDOWN"},"shifted":{"pressed":"ACTRLS_PREV"}}]
|
||||||
```
|
```
|
||||||
### T-WATCH2020 by LilyGo
|
|
||||||
This is a fun [smartwatch](http://www.lilygo.cn/prod_view.aspx?TypeId=50036&Id=1290&FId=t3:50036:3) based on ESP32. It has a 240x240 ST7789 screen and onboard audio. Not very useful to listen to anything but it works. This is an example of a device that requires an I2C set of commands for its dac (see below). There is a build-option if you decide to rebuild everything by yourself, otherwise the I2S default option works with the following parameters
|
|
||||||
|
|
||||||
- dac_config: model=I2S,bck=26,ws=25,do=33,i2c=106,sda=21,scl=22
|
|
||||||
- dac_controlset: { "init": [ {"reg":41, "val":128}, {"reg":18, "val":255} ], "poweron": [ {"reg":18, "val":64, "mode":"or"} ], "poweroff": [ {"reg":18, "val":191, "mode":"and"} ] }
|
|
||||||
- spi_config: dc=27,data=19,clk=18
|
|
||||||
- display_config: SPI,driver=ST7789,width=240,height=240,cs=5,back=12,speed=16000000,HFlip,VFlip
|
|
||||||
### ESP32-WROVER + I2S DAC
|
### ESP32-WROVER + I2S DAC
|
||||||
Squeezelite-esp32 requires esp32 chipset and 4MB PSRAM. ESP32-WROVER meets these requirements. To get an audio output an I2S DAC can be used. Cheap PCM5102 I2S DACs work others may also work. PCM5012 DACs can be hooked up via:
|
Squeezelite-esp32 requires esp32 chipset and 4MB PSRAM. ESP32-WROVER meets these requirements. To get an audio output an I2S DAC can be used. Cheap PCM5102 I2S DACs work others may also work. PCM5012 DACs can be hooked up via:
|
||||||
|
|
||||||
@@ -84,10 +41,6 @@ XMT - 3.3V
|
|||||||
|
|
||||||
Use the `squeezelite-esp32-I2S-4MFlash-sdkconfig.defaults` configuration file.
|
Use the `squeezelite-esp32-I2S-4MFlash-sdkconfig.defaults` configuration file.
|
||||||
|
|
||||||
### SqueezeAmpToo !
|
|
||||||
|
|
||||||
And the super cool project https://github.com/rochuck/squeeze-amp-too
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
To access NVS, in the webUI, go to credits and select "shows nvs editor". Go into the NVS editor tab to change NFS parameters. In syntax description below \<\> means a value while \[\] describe optional parameters.
|
To access NVS, in the webUI, go to credits and select "shows nvs editor". Go into the NVS editor tab to change NFS parameters. In syntax description below \<\> means a value while \[\] describe optional parameters.
|
||||||
|
|
||||||
@@ -100,23 +53,12 @@ sda=<gpio>,scl=<gpio>[,port=0|1][,speed=<speed>]
|
|||||||
The NVS parameter "spi_config" set the spi's gpio used for generic purpose (e.g. display). Leave it blank to disable SPI usage. The DC parameter is needed for displays. Syntax is
|
The NVS parameter "spi_config" set the spi's gpio used for generic purpose (e.g. display). Leave it blank to disable SPI usage. The DC parameter is needed for displays. Syntax is
|
||||||
```
|
```
|
||||||
data=<gpio>,clk=<gpio>[,dc=<gpio>][,host=1|2]
|
data=<gpio>,clk=<gpio>[,dc=<gpio>][,host=1|2]
|
||||||
```
|
```
|
||||||
### DAC/I2S
|
### DAC/I2S
|
||||||
The NVS parameter "dac_config" set the gpio used for i2s communication with your DAC. You can define the defaults at compile time but nvs parameter takes precedence except for SqueezeAMP and A1S where these are forced at runtime. If your DAC also requires i2c, then you must go the re-compile route. Syntax is
|
The NVS parameter "dac_config" set the gpio used for i2s communication with your DAC. You can define the defaults at compile time but nvs parameter takes precedence except for SqueezeAMP and A1S where these are forced at runtime. If your DAC also requires i2c, then you must go the re-compile route. Syntax is
|
||||||
```
|
```
|
||||||
bck=<gpio>,ws=<gpio>,do=<gpio>[,mute=<gpio>[:0|1][,model=TAS57xx|TAS5713|AC101|I2S][,sda=<gpio>,scl=gpio[,i2c=<addr>]]
|
bck=<gpio>,ws=<gpio>,do=<gpio>
|
||||||
```
|
```
|
||||||
if "model" is not set or is not recognized, then default "I2S" is used. I2C parameters are optional an only needed if your dac requires an I2C control (See 'dac_controlset' below). Note that "i2c" parameters are decimal, hex notation is not allowed.
|
|
||||||
|
|
||||||
The parameter "dac_controlset" allows definition of simple commands to be sent over i2c for init, power on and off using a JSON syntax:
|
|
||||||
```
|
|
||||||
{ init: [ {"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"}, ... {{"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"} ],
|
|
||||||
poweron: [ {"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"}, ... {{"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"} ],
|
|
||||||
poweroff: [ {"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"}, ... {{"reg":<register>,"val":<value>,"mode":<nothing>|"or"|"and"} ] }
|
|
||||||
```
|
|
||||||
This is standard JSON notation, so if you are not familiar with it, Google is your best friend. Be aware that the '...' means you can have as many entries as you want, it's not part of the syntax. Every section is optional, but it does not make sense to set i2c in the 'dac_config' parameter and not setting anything here. The parameter 'mode' allows to *or* the register with the value or to *and* it. Don't set 'mode' if you simply want to write. **Note that all values must be decimal**. You can use a validator like [this](https://jsonlint.com) to verify your syntax
|
|
||||||
|
|
||||||
NB: For well-known configuration, this is ignored
|
|
||||||
### SPDIF
|
### SPDIF
|
||||||
The NVS parameter "spdif_config" sets the i2s's gpio needed for SPDIF.
|
The NVS parameter "spdif_config" sets the i2s's gpio needed for SPDIF.
|
||||||
|
|
||||||
@@ -128,29 +70,16 @@ Leave it blank to disable SPDIF usage, you can also define them at compile time
|
|||||||
```
|
```
|
||||||
bck=<gpio>,ws=<gpio>,do=<gpio>
|
bck=<gpio>,ws=<gpio>,do=<gpio>
|
||||||
```
|
```
|
||||||
NB: For well-known configuration, this is ignored
|
|
||||||
### Display
|
### Display
|
||||||
The NVS parameter "display_config" sets the parameters for an optional display. Syntax is
|
The NVS parameter "display_config" sets the parameters for an optional display. Syntax is
|
||||||
```
|
```
|
||||||
I2C,width=<pixels>,height=<pixels>[address=<i2c_address>][,reset=<gpio>][,HFlip][,VFlip][driver=SSD1306|SSD1326[:1|4]|SSD1327|SH1106]
|
I2C,width=<pixels>,height=<pixels>[address=<i2c_address>][,HFlip][,VFlip][driver=SSD1306|SSD1326|SH1106]
|
||||||
SPI,width=<pixels>,height=<pixels>,cs=<gpio>[,back=<gpio>][,reset=<gpio>][,speed=<speed>][,HFlip][,VFlip][driver=SSD1306|SSD1322|SSD1326[:1|4]|SSD1327|SH1106|SSD1675|ST7735|ST7789[,rotate]]
|
SPI,width=<pixels>,height=<pixels>,cs=<gpio>[,speed=<speed>][,HFlip][,VFlip][driver=SSD1306|SSD1326|SH1106]
|
||||||
```
|
```
|
||||||
- back: a LED backlight used by some older devices (ST7735). It is PWM controlled for brightness
|
|
||||||
- reset: some display have a reset pin that is should normally be pulled up if unused
|
|
||||||
- VFlip and HFlip are optional can be used to change display orientation
|
- VFlip and HFlip are optional can be used to change display orientation
|
||||||
- rotate: for non-square *drivers*, move to portrait mode. Note that *width* and *height* must be inverted then
|
|
||||||
- Default speed is 8000000 (8MHz) but SPI can work up to 26MHz or even 40MHz
|
- Default speed is 8000000 (8MHz) but SPI can work up to 26MHz or even 40MHz
|
||||||
- SH1106 is 128x64 monochrome I2C/SPI [here]((https://www.waveshare.com/wiki/1.3inch_OLED_HAT))
|
|
||||||
- SSD1306 is 128x32 monochrome I2C/SPI [here](https://www.buydisplay.com/i2c-blue-0-91-inch-oled-display-module-128x32-arduino-raspberry-pi)
|
|
||||||
- SSD1322 is 128x128 16-level grayscale SPI [here](https://www.amazon.com/gp/product/B079N1LLG8/ref=ox_sc_act_title_1?smid=A1N6DLY3NQK2VM&psc=1) - artwork can be up to 96x96 with vertical vu-meter/spectrum
|
|
||||||
- SSD1351 is 128x128 65k/262k color SPI [here](https://www.waveshare.com/product/displays/lcd-oled/lcd-oled-3/1.5inch-rgb-oled-module.htm)
|
|
||||||
- SSD1326 is 256x32 monochrome or grayscale 16-levels SPI [here](https://www.aliexpress.com/item/32833603664.html?spm=a2g0o.productlist.0.0.2d19776cyQvsBi&algo_pvid=c7a3db92-e019-4095-8a28-dfdf0a087f98&algo_expid=c7a3db92-e019-4095-8a28-dfdf0a087f98-1&btsid=0ab6f81e15955375483301352e4208&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_)
|
|
||||||
- SSD1327 is 256x64 grayscale 16-levels SPI in multiple sizes [here](https://www.buydisplay.com/oled-display/oled-display-module?resolution=159) - it is very nice
|
|
||||||
- SSD1675 is an e-ink paper and is experimental as e-ink is really not suitable for LMS du to its very low refresh rate
|
|
||||||
- ST7735 is a 128x160 65k color SPI [here](https://www.waveshare.com/product/displays/lcd-oled/lcd-oled-3/1.8inch-lcd-module.htm). This needs a backlight control
|
|
||||||
- ST7789 is a 240x320 65k (262k not enabled) color SPI [here](https://www.waveshare.com/product/displays/lcd-oled/lcd-oled-3/2inch-lcd-module.htm). It also exist with 240x240 displays. See **rotate** for use in portrait mode
|
|
||||||
|
|
||||||
To use the display on LMS, add repository https://raw.githubusercontent.com/sle118/squeezelite-esp32/master/plugin/repo.xml. You will then be able to tweak how the vu-meter and spectrum analyzer are displayed, as well as size of artwork. You can also install the excellent plugin "Music Information Screen" which is super useful to tweak the layout.
|
Currently 128x32/64 I2C and SPI display like [this](https://www.buydisplay.com/i2c-blue-0-91-inch-oled-display-module-128x32-arduino-raspberry-pi) and [this](https://www.waveshare.com/wiki/1.3inch_OLED_HAT) are supported
|
||||||
|
|
||||||
The NVS parameter "metadata_config" sets how metadata is displayed for AirPlay and Bluetooth. Syntax is
|
The NVS parameter "metadata_config" sets how metadata is displayed for AirPlay and Bluetooth. Syntax is
|
||||||
```
|
```
|
||||||
@@ -162,6 +91,8 @@ The NVS parameter "metadata_config" sets how metadata is displayed for AirPlay a
|
|||||||
|
|
||||||
- 'format' can contain free text and any of the 3 keywords %artist%, %album%, %title%. Using that format string, the keywords are replaced by their value to build the string to be displayed. Note that the plain text following a keyword that happens to be empty during playback of a track will be removed. For example, if you have set format=%artist% - %title% and there is no artist in the metadata then only <title> will be displayed not " - <title>".
|
- 'format' can contain free text and any of the 3 keywords %artist%, %album%, %title%. Using that format string, the keywords are replaced by their value to build the string to be displayed. Note that the plain text following a keyword that happens to be empty during playback of a track will be removed. For example, if you have set format=%artist% - %title% and there is no artist in the metadata then only <title> will be displayed not " - <title>".
|
||||||
|
|
||||||
|
You can install the excellent plugin "Music Information Screen" which is super useful to tweak the layout for these small displays.
|
||||||
|
|
||||||
### Infrared
|
### Infrared
|
||||||
You can use any IR receiver compatible with NEC protocol (38KHz). Vcc, GND and output are the only pins that need to be connected, no pullup, no filtering capacitor, it's a straight connection.
|
You can use any IR receiver compatible with NEC protocol (38KHz). Vcc, GND and output are the only pins that need to be connected, no pullup, no filtering capacitor, it's a straight connection.
|
||||||
|
|
||||||
@@ -172,11 +103,11 @@ In AirPlay and Bluetooth mode, only these native remotes are supported, I've not
|
|||||||
See "set GPIO" below to set the GPIO associated to infrared receiver (option "ir").
|
See "set GPIO" below to set the GPIO associated to infrared receiver (option "ir").
|
||||||
|
|
||||||
### Set GPIO
|
### Set GPIO
|
||||||
The parameter "set_GPIO" is used to assign GPIO to various functions.
|
The parameter "set_GPIO" is use to assign GPIO to various functions.
|
||||||
|
|
||||||
GPIO can be set to GND provide or Vcc at boot. This is convenient to power devices that consume less than 40mA from the side connector. Be careful because there is no conflict checks being made wrt which GPIO you're changing, so you might damage your board or create a conflict here.
|
GPIO can be set to GND provide or Vcc at boot. This is convenient to power devices that consume less than 40mA from the side connector. Be careful because there is no conflict checks being made wrt which GPIO you're changing, so you might damage your board or create a conflict here.
|
||||||
|
|
||||||
The \<amp\> parameter can use used to assign a GPIO that will be set to active level (default 1) when playback starts. It will be reset when squeezelite becomes idle. The idle timeout is set on the squeezelite command line through -C \<timeout\>
|
The \<amp\> parameter can use used to assign a GPIO that will be set to 1 when playback starts. It will be reset to 0 when squeezelite becomes idle. The idle timeout is set on the squeezelite command line through -C \<timeout\>
|
||||||
|
|
||||||
If you have an audio jack that supports insertion (use :0 or :1 to set the level when inserted), you can specify which GPIO it's connected to. Using the parameter jack_mutes_amp allows to mute the amp when headset (e.g.) is inserted.
|
If you have an audio jack that supports insertion (use :0 or :1 to set the level when inserted), you can specify which GPIO it's connected to. Using the parameter jack_mutes_amp allows to mute the amp when headset (e.g.) is inserted.
|
||||||
|
|
||||||
@@ -187,36 +118,23 @@ The \<ir\> parameter set the GPIO associated to an IR receiver. No need to add p
|
|||||||
Syntax is:
|
Syntax is:
|
||||||
|
|
||||||
```
|
```
|
||||||
<gpio>=Vcc|GND|amp[:1|0]|ir|jack[:0|1]|green[:0|1]|red[:0|1]|spkfault[:0|1][,<repeated sequence for next GPIO>]
|
<gpio>=Vcc|GND|amp|ir|jack[:0|1]|green[:0|1]|red[:0|1]|spkfault[:0|1][,<repeated sequence for next GPIO>]
|
||||||
```
|
```
|
||||||
You can define the defaults for jack, spkfault leds at compile time but nvs parameter takes precedence except for well-known configurations where these are forced at runtime.
|
You can define the defaults for jack, spkfault leds at compile time but nvs parameter takes precedence except for SqueezeAMP where these are forced at runtime.
|
||||||
### LED
|
|
||||||
See §**set_GPIO** for how to set the green and red LEDs. In addition, their brightness can be controlled using the "led_brigthness" parameter. The syntax is
|
|
||||||
```
|
|
||||||
[green=0..100][,red=0..100]
|
|
||||||
```
|
|
||||||
NB: For well-known configuration, this is ignored
|
|
||||||
### Rotary Encoder
|
### Rotary Encoder
|
||||||
One rotary encoder is supported, quadrature shift with press. Such encoders usually have 2 pins for encoders (A and B), and common C that must be set to ground and an optional SW pin for press. A, B and SW must be pulled up, so automatic pull-up is provided by ESP32, but you can add your own resistors. A bit of filtering on A and B (~470nF) helps for debouncing which is not made by software.
|
One rotary encoder is supported, quadrature shift with press. Such encoders usually have 2 pins for encoders (A and B), and common C that must be set to ground and an optional SW pin for press. A, B and SW must be pulled up, so automatic pull-up is provided by ESP32, but you can add your own resistors. A bit of filtering on A and B (~470nF) helps for debouncing which is not made by software.
|
||||||
|
|
||||||
Encoder is normally hard-coded to respectively knob left, right and push on LMS and to volume down/up/play toggle on BT and AirPlay. Using the option 'volume' makes it hard-coded to volume down/up/play toggle all the time (even in LMS). The option 'longpress' allows an alternate mode when SW is long-pressed. In that mode, left is previous, right is next and press is toggle. Every long press on SW alternates between modes (the main mode actual behavior depends on 'volume').
|
Encoder is normally hard-coded to respectively knob left, right and push on LMS and to volume down/up/play toggle on BT and AirPlay. Using the option 'volume' makes it hard-coded to volume down/up/play toggle all the time (even in LMS). The option 'longpress' allows an alternate mode when SW is long-pressed. In that mode, left is previous, right is next and press is toggle. Every long press on SW alternates between modes.
|
||||||
|
|
||||||
There is also the possibility to use 'knobonly' option (exclusive with 'volume' and 'longpress'). This mode attempts to offer a single knob full navigation which is a bit contorded due to LMS UI's principles. Left, Right and Press obey to LMS's navigation rules and especially Press always goes to lower submenu item, even when navigating in the Music Library. That causes a challenge as there is no 'Play', 'Back' or 'Pause' button. Workaround are as of below:
|
|
||||||
- longpress is 'Play'
|
|
||||||
- double press is 'Back' (Left in LMS's terminology).
|
|
||||||
- a quick left-right movement on the encoder is 'Pause'
|
|
||||||
|
|
||||||
The speed of double click (or left-right) can be set using the optional parameter of 'knobonly'. This is not a perfect solution, and other ideas are welcome. Be aware that the longer you set double click speed, the less responsive the interface will be. The reason is that I need to wait for that delay before deciding if it's a single or double click. It can also make menu navigation "hesitations" being easoly interpreted as 'Pause'
|
|
||||||
|
|
||||||
Use parameter rotary_config with the following syntax:
|
Use parameter rotary_config with the following syntax:
|
||||||
|
|
||||||
```
|
```
|
||||||
A=<gpio>,B=<gpio>[,SW=gpio>[[,knobonly[=<ms>]|[,volume][,longpress]]
|
A=<gpio>,B=<gpio>[,SW=gpio>[,volume][,longpress]]
|
||||||
```
|
```
|
||||||
|
|
||||||
HW note: all gpio used for rotary have internal pull-up so normally there is no need to provide Vcc to the encoder. Nevertheless if the encoder board you're using also has its own pull-up that are stronger than ESP32's ones (which is likely the case), then there will be crosstalk between gpio, so you must bring Vcc. Look at your board schematic and you'll understand that these board pull-up create a "winning" pull-down when any other pin is grounded.
|
HW note: all gpio used for rotary have internal pull-up so normally there is no need to provide Vcc to the encoder. Nevertheless if the encoder board you're using also has its own pull-up that are stronger than ESP32's ones (which is likely the case), then there will be crosstalk between gpio, so you must bring Vcc. Look at your board schematic and you'll understand that these board pull-up create a "winning" pull-down when any other pin is grounded.
|
||||||
|
|
||||||
See also the "IMPORTANT NOTE" on the "Buttons" section and remember that when 'lms_ctrls_raw' (see below) is activated, none of these knobonly,volume,longpress options apply, raw button codes (not actions) are simply sent to LMS
|
See also the "IMPORTANT NOTE" on the "Buttons" section
|
||||||
|
|
||||||
### Buttons
|
### Buttons
|
||||||
Buttons are described using a JSON string with the following syntax
|
Buttons are described using a JSON string with the following syntax
|
||||||
@@ -312,46 +230,81 @@ There is no good or bad option, it's your choice. Use the NVS parameter "lms_ctr
|
|||||||
### Battery / ADC
|
### Battery / ADC
|
||||||
The NVS parameter "bat_config" sets the ADC1 channel used to measure battery/DC voltage. Scale is a float ratio applied to every sample of the 12 bits ADC. A measure is taken every 10s and an average is made every 5 minutes (not a sliding window). Syntax is
|
The NVS parameter "bat_config" sets the ADC1 channel used to measure battery/DC voltage. Scale is a float ratio applied to every sample of the 12 bits ADC. A measure is taken every 10s and an average is made every 5 minutes (not a sliding window). Syntax is
|
||||||
```
|
```
|
||||||
channel=0..7,scale=<scale>,cells=<2|3>
|
channel=0..7,scale=<scale>
|
||||||
```
|
```
|
||||||
NB: Set parameter to empty to disable battery reading. For well-known configuration, this is ignored (except for SqueezeAMP where number of cells is required)
|
NB: Set parameter to empty to disable battery reading
|
||||||
|
## Setting up ESP-IDF
|
||||||
|
### Docker
|
||||||
|
#### **************** todo: Docker scripts needs some rework.
|
||||||
|
|
||||||
|
You can use docker to build squeezelite-esp32
|
||||||
|
First you need to build the Docker container:
|
||||||
|
```
|
||||||
|
docker build -t esp-idf .
|
||||||
|
```
|
||||||
|
Then you need to run the container:
|
||||||
|
```
|
||||||
|
docker run -i -t -v `pwd`:/workspace/squeezelite-esp32 esp-idf
|
||||||
|
```
|
||||||
|
The above command will mount this repo into the docker container and start a bash terminal
|
||||||
|
for you to then follow the below build steps
|
||||||
|
|
||||||
|
### Manual Install of ESP-IDF
|
||||||
|
<<<<<<< HEAD
|
||||||
|
Follow the instructions from https://docs.espressif.com/projects/esp-idf/en/v4.0/get-started/index.html to install the esp-idf v4.0. This is the currently supported release of the espressif software development system.
|
||||||
|
=======
|
||||||
|
<strong>Currently the master branch of this project requires this [IDF](https://github.com/espressif/esp-idf/tree/28f1cdf5ed7149d146ad5019c265c8bc3bfa2ac9) with gcc 5.2 (toolschain dated 20181001)
|
||||||
|
If you want to use a more recent version of gcc and IDF (4.0 stable), move to cmake-master branch</strong>
|
||||||
|
|
||||||
|
You can install IDF manually on Linux or Windows (using the Subsystem for Linux) following the instructions at: https://www.instructables.com/id/ESP32-Development-on-Windows-Subsystem-for-Linux/
|
||||||
|
You also need to use esp-dsp recent version or at least make sure you have this patch https://github.com/espressif/esp-dsp/pull/12/commits/8b082c1071497d49346ee6ed55351470c1cb4264
|
||||||
|
>>>>>>> refs/remotes/origin/master
|
||||||
|
|
||||||
|
## Building Squeezelite-esp32
|
||||||
|
MOST IMPORTANT: create the right default config file
|
||||||
|
- make defconfig
|
||||||
|
(Note: You can also copy over config files from the build-scripts folder to ./sdkconfig)
|
||||||
|
Then adapt the config file to your wifi/BT/I2C device (can also be done on the command line)
|
||||||
|
- make menuconfig
|
||||||
|
Then
|
||||||
|
|
||||||
|
```
|
||||||
|
idf.py -p PORT [-b BAUD] flash
|
||||||
|
idf.py -p PORT [-b BAUD] monitor
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
## Setup WiFi
|
1/ setup WiFi
|
||||||
- Boot the esp, look for a new wifi access point showing up and connect to it. Default build ssid and passwords are "squeezelite"/"squeezelite".
|
- Boot the esp, look for a new wifi access point showing up and connect to it. Default build ssid and passwords are "squeezelite"/"squeezelite".
|
||||||
- Once connected, navigate to 192.168.4.1
|
- Once connected, navigate to 192.168.4.1
|
||||||
- Wait for the list of access points visible from the device to populate in the web page.
|
- Wait for the list of access points visible from the device to populate in the web page.
|
||||||
- Choose an access point and enter any credential as needed
|
- Choose an access point and enter any credential as needed
|
||||||
- Once connection is established, note down the address the device received; this is the address you will use to configure it going forward
|
- Once connection is established, note down the address the device received; this is the address you will use to configure it going forward
|
||||||
|
|
||||||
## Setup squeezelite command line (optional)
|
2/ setup squeezelite command line (optional)
|
||||||
|
|
||||||
At this point, the device should have disabled its built-in access point and should be connected to a known WiFi network.
|
At this point, the device should have disabled its built-in access point and should be connected to a known WiFi network.
|
||||||
- navigate to the address that was noted in step #1
|
- navigate to the address that was noted in step #1
|
||||||
- Using the list of predefined options, choose the mode in which you want squeezelite to start
|
- Using the list of predefined options, hoose the mode in which you want squeezelite to start
|
||||||
- Generate the command
|
- Generate the command
|
||||||
- Add or change any additional command line option (for example player name, etc)
|
- Add or change any additional command line option (for example player name, etc)
|
||||||
- Activate squeezelite execution: this tells the device to automatiaclly run the command at start
|
- Activate squeezelite execution: this tells the device to automatiaclly run the command at start
|
||||||
- Update the configuration
|
- Update the configuration
|
||||||
- click on the "start toggle" button. This will force a reboot.
|
- click on the "start toggle" button. This will force a reboot.
|
||||||
- The toggle switch should be set to 'ON' to ensure that squeezelite is active after booting (you might have to fiddle with it a few times)
|
- The toggle switch should be set to 'ON' to ensure that squeezelite is active after booting
|
||||||
- You can enable accessto NVS parameters under 'credits'
|
|
||||||
|
|
||||||
## Monitor
|
3/ Updating Squeezelite
|
||||||
|
|
||||||
In addition of the esp-idf serial link monitor option, you can also enable a telnet server (see NVS parameters) where you'll have access to a ton of logs of what's happening inside the WROVER.
|
|
||||||
|
|
||||||
## Update Squeezelite
|
|
||||||
- From the firmware tab, click on "Check for Updates"
|
- From the firmware tab, click on "Check for Updates"
|
||||||
- Look for updated binaries
|
- Look for updated binaries
|
||||||
- Select a line
|
- Select a line
|
||||||
- Click on "Flash!"
|
- Click on "Flash!"
|
||||||
- The system will reboot into recovery mode (if not already in that mode), wipe the squeezelite partition and download/flash the selected version
|
- The system will reboot into recovery mode (if not already in that mode), wipe the squeezelite partition and download/flash the selected version
|
||||||
- You can choose a local file or have a local webserver
|
|
||||||
|
|
||||||
## Recovery
|
3/ Recovery
|
||||||
- From the firmware tab, click on the "Recovery" button. This will reboot the ESP32 into recovery, where additional configuration options are available from the NVS editor
|
- From the firmware tab, click on the "Recovery" button. This will reboot the ESP32 into recovery, where additional configuration options are available from the NVS editor
|
||||||
|
|
||||||
## Additional configuration notes (from the Web UI)
|
# Additional command line notes, configured from the http configuration
|
||||||
The squeezelite options are very similar to the regular Linux ones. Differences are :
|
The squeezelite options are very similar to the regular Linux ones. Differences are :
|
||||||
|
|
||||||
- the output is -o ["BT -n '<sinkname>' "] | [I2S]
|
- the output is -o ["BT -n '<sinkname>' "] | [I2S]
|
||||||
@@ -367,88 +320,12 @@ See squeezlite command line, but keys options are
|
|||||||
- Z <rate> : tell LMS what is the max sample rate supported before LMS resamples
|
- Z <rate> : tell LMS what is the max sample rate supported before LMS resamples
|
||||||
- R (see above)
|
- R (see above)
|
||||||
- r "<minrate>-<maxrate>"
|
- r "<minrate>-<maxrate>"
|
||||||
- C <sec> : set timeout to switch off amp gpio
|
|
||||||
- W : activate WAV and AIFF header parsing
|
|
||||||
# Building everything yourself
|
|
||||||
## Setting up ESP-IDF
|
|
||||||
### Docker
|
|
||||||
You can use docker to build squeezelite-esp32 (optional)
|
|
||||||
First you need to build the Docker container:
|
|
||||||
```
|
|
||||||
docker build -t esp-idf .
|
|
||||||
```
|
|
||||||
Then you need to run the container:
|
|
||||||
```
|
|
||||||
docker run -i -t -v `pwd`:/workspace/squeezelite-esp32 esp-idf
|
|
||||||
```
|
|
||||||
The above command will mount this repo into the docker container and start a bash terminal
|
|
||||||
for you to then follow the below build steps
|
|
||||||
|
|
||||||
### Manual Install of ESP-IDF
|
## Additional misc notes to do you build
|
||||||
<strong>Currently the master branch of this project requires this [IDF](https://github.com/espressif/esp-idf/tree/28f1cdf5ed7149d146ad5019c265c8bc3bfa2ac9) with gcc 5.2 (toolschain dated 20181001)
|
|
||||||
If you want to use a more recent version of gcc and IDF (4.0 stable), move to cmake-master branch</strong>
|
|
||||||
|
|
||||||
You can install IDF manually on Linux or Windows (using the Subsystem for Linux) following the instructions at: https://www.instructables.com/id/ESP32-Development-on-Windows-Subsystem-for-Linux/
|
|
||||||
And then copying the i2s.c patch file from this repo over to the esp-idf folder
|
|
||||||
You also need to use esp-dsp recent version or at least make sure you have this patch https://github.com/espressif/esp-dsp/pull/12/commits/8b082c1071497d49346ee6ed55351470c1cb4264. As of this writing (08.2020), espressif has patched esp-dsp so this is no more needed
|
|
||||||
|
|
||||||
## Building Squeezelite-esp32
|
|
||||||
Don't forget the to choose one of the config files in build_scripts/ and rename it sdkconfig.defaults or sdkconfig as many important WiFi/BT options are set there. The codecs libraries will not be rebuilt by these scripts (it's a tedious process - see below)
|
|
||||||
### Using make (deprecated)
|
|
||||||
MOST IMPORTANT: create the right default config file
|
|
||||||
- make defconfig
|
|
||||||
(Note: You can also copy over config files from the build-scripts folder to ./sdkconfig)
|
|
||||||
Then adapt the config file to your wifi/BT/I2C device (can also be done on the command line)
|
|
||||||
- make menuconfig
|
|
||||||
Then
|
|
||||||
|
|
||||||
```
|
|
||||||
# Build recovery.bin, bootloader.bin, ota_data_initial.bin, partitions.bin
|
|
||||||
# force appropriate rebuild by touching all the files which may have a RECOVERY_APPLICATION specific source compile logic
|
|
||||||
find . \( -name "*.cpp" -o -name "*.c" -o -name "*.h" \) -type f -print0 | xargs -0 grep -l "RECOVERY_APPLICATION" | xargs touch
|
|
||||||
export PROJECT_NAME="recovery"
|
|
||||||
make -j4 all EXTRA_CPPFLAGS='-DRECOVERY_APPLICATION=1'
|
|
||||||
make flash
|
|
||||||
#
|
|
||||||
# Build squeezelite.bin
|
|
||||||
# Now force a rebuild by touching all the files which may have a RECOVERY_APPLICATION specific source compile logic
|
|
||||||
find . \( -name "*.cpp" -o -name "*.c" -o -name "*.h" \) -type f -print0 | xargs -0 grep -l "RECOVERY_APPLICATION" | xargs touch
|
|
||||||
export PROJECT_NAME="squeezelite"
|
|
||||||
make -j4 app EXTRA_CPPFLAGS='-DRECOVERY_APPLICATION=0'
|
|
||||||
python ${IDF_PATH}/components/esptool_py/esptool/esptool.py --chip esp32 --port ${ESPPORT} --baud ${ESPBAUD} --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x150000 ./build/squeezelite.bin
|
|
||||||
# monitor serial output
|
|
||||||
make monitor
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also manually download the recovery & initial boot
|
|
||||||
```
|
|
||||||
python ${IDF_PATH}/components/esptool_py/esptool/esptool.py --chip esp32 --port ${ESPPORT} --baud ${ESPBAUD} --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xd000 ./build/ota_data_initial.bin 0x1000 ./build/bootloader/bootloader.bin 0x10000 ./build/recovery.bin 0x8000 ./build/partitions.bin
|
|
||||||
```
|
|
||||||
### Using cmake
|
|
||||||
Create you config using 'idf.py menuconfig' then build binaries using 'idf.py all'. It will build the recovery and the application (squeezelite) itself. See the recommended command to upload everything. Otherwise, if you just want to download squeezelite, do
|
|
||||||
```
|
|
||||||
python.exe <idf_path>\components\esptool_py\esptool\esptool.py -p COM<n> -b 921600 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size detect --flash_freq 80m 0x150000 build\squeezelite.bin
|
|
||||||
```
|
|
||||||
Use 'idf monitor' to monitor the application (see esp-idf documentation)
|
|
||||||
## Additional misc notes to do you build (kitchen sink)
|
|
||||||
- don't forget to set IDF_PATH, ESPPORT and ESPBAUD
|
|
||||||
- When initially cloning the repo, make sure you do it recursively. For example:
|
|
||||||
- git clone --recursive https://github.com/sle118/squeezelite-esp32.git
|
|
||||||
- If you have already cloned the repository and you are getting compile errors on one of the submodules (e.g. telnet), run the following git command in the root of the repository location
|
|
||||||
- git submodule update --init --recursive
|
|
||||||
- as of this writing, ESP-IDF has a bug int he way the PLL values are calculated for i2s, so you *must* use the i2s.c file in the patch directory
|
- as of this writing, ESP-IDF has a bug int he way the PLL values are calculated for i2s, so you *must* use the i2s.c file in the patch directory
|
||||||
- misc compiler #define
|
|
||||||
- use no resampling or set RESAMPLE (soxr - but overloads CPU) or set RESAMPLE16 for fast fixed 16 bits resampling
|
|
||||||
- use LOOPBACK (mandatory)
|
|
||||||
- use BYTES_PER_FRAME=4 (8 is not fully functionnal)
|
|
||||||
- LINKALL (mandatory)
|
|
||||||
- NO_FAAD unless you want to us faad, which currently overloads the CPU
|
|
||||||
- TREMOR_ONLY (mandatory)
|
|
||||||
### codecs
|
|
||||||
- for codecs libraries, add -mlongcalls if you want to rebuild them, but you should not (use the provided ones in codecs/lib). if you really want to rebuild them, open an issue
|
- for codecs libraries, add -mlongcalls if you want to rebuild them, but you should not (use the provided ones in codecs/lib). if you really want to rebuild them, open an issue
|
||||||
- libmad, libflac (no esp's version), libvorbis (tremor - not esp's version), alac work
|
- libmad, libflac (no esp's version), libvorbis (tremor - not esp's version), alac work
|
||||||
- libfaad does not really support real time, but if you want to try (but using helixaac is a better option)
|
- libfaad does not really support real time, but if you want to try
|
||||||
- -O3 -DFIXED_POINT -DSMALL_STACK
|
- -O3 -DFIXED_POINT -DSMALL_STACK
|
||||||
- change ac_link in configure and case ac_files, remove ''
|
- change ac_link in configure and case ac_files, remove ''
|
||||||
- compiler but in cfft.c and cffti1, must disable optimization using
|
- compiler but in cfft.c and cffti1, must disable optimization using
|
||||||
@@ -461,4 +338,19 @@ Use 'idf monitor' to monitor the application (see esp-idf documentation)
|
|||||||
- change ac_files to remove ''
|
- change ac_files to remove ''
|
||||||
- add DEPS_CFLAGS and DEPS_LIBS to avoid pkg-config to be required
|
- add DEPS_CFLAGS and DEPS_LIBS to avoid pkg-config to be required
|
||||||
- stack consumption can be very high with some codec variants, so set NONTHREADSAFE_PSEUDOSTACK and GLOBAL_STACK_SIZE=32000 and unset VAR_ARRAYS in config.h
|
- stack consumption can be very high with some codec variants, so set NONTHREADSAFE_PSEUDOSTACK and GLOBAL_STACK_SIZE=32000 and unset VAR_ARRAYS in config.h
|
||||||
- libmad has been patched to avoid using a lot of stack and is not provided here. There is an issue with sync detection in 1.15.1b from where the original stack patch was done but since a few fixes have been made wrt sync detection. This 1.15.1b-10 found on debian fixes the issue where mad thinks it has reached sync but has not and so returns a wrong sample rate. It comes at the expense of 8KB (!) of code where a simple check in squeezelite/mad.c that next_frame[0] is 0xff and next_frame[1] & 0xf0 is 0xf0 does the trick ...
|
- better use helixaac
|
||||||
|
- set IDF_PATH=/home/esp-idf
|
||||||
|
- set ESPPORT=COM9
|
||||||
|
- update flash partition size
|
||||||
|
- other compiler #define
|
||||||
|
- use no resampling or set RESAMPLE (soxr) or set RESAMPLE16 for fast fixed 16 bits resampling
|
||||||
|
- use LOOPBACK (mandatory)
|
||||||
|
- use BYTES_PER_FRAME=4 (8 is not fully functionnal)
|
||||||
|
- LINKALL (mandatory)
|
||||||
|
- NO_FAAD unless you want to us faad, which currently overloads the CPU
|
||||||
|
- TREMOR_ONLY (mandatory)
|
||||||
|
- When initially cloning the repo, make sure you do it recursively. For example:
|
||||||
|
- git clone --recursive https://github.com/sle118/squeezelite-esp32.git
|
||||||
|
- If you have already cloned the repository and you are getting compile errors on one of the submodules (e.g. telnet), run the following git command in the root of the repository location
|
||||||
|
- git submodule update --init --recursive
|
||||||
|
|
||||||
|
|||||||
3
TODO
3
TODO
@@ -1,4 +1,5 @@
|
|||||||
- in squeezelite some buffers (stream, output, header, recv) are allocated
|
- in squeezelite some buffers (stream, output, header, recv) are allocated
|
||||||
although they are almost static (expect output). This creates a risk of
|
although they are almost static (expect output). This creates a risk of
|
||||||
memory fragmentation, especially because the large output is re-allocated for
|
memory fragmentation, especially because the large output is re-allocated for
|
||||||
AirPlay
|
AirPlay
|
||||||
|
- libflac in lpc.c can be unrolled - that gains 43k of code, at the expense of 4% CPU
|
||||||
65
alltags.txt
65
alltags.txt
@@ -1,65 +0,0 @@
|
|||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.15
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.20
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.47
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.49
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.50
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.51
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.52
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.53
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.54
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.55
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.59
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.60
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.61
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.62
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.63
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.64
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.65
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.66
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/I2S-4MFlash-v0.1.67
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/SqueezeAmp-v0.1.13
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/SqueezeAmp-v0.1.14
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/SqueezeAmp-v0.1.15
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/SqueezeAmp-v0.1.20
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/WiFi-Manager/SqueezeAmp-v0.1.66
|
|
||||||
3bd886b8dff0fb5bc59079e83f1d283097a14697 refs/tags/v0.1.12-I2S-4MFlash
|
|
||||||
3bd886b8dff0fb5bc59079e83f1d283097a14697 refs/tags/v0.1.12-SqueezeAmp
|
|
||||||
3bd886b8dff0fb5bc59079e83f1d283097a14697 refs/tags/v0.1.16-I2S-4MFlash
|
|
||||||
3bd886b8dff0fb5bc59079e83f1d283097a14697 refs/tags/v0.1.16-SqueezeAmp
|
|
||||||
d9c6c78df2f3ba49d74d91cf246f300a881af742 refs/tags/v0.1.44-I2S-4MFlash
|
|
||||||
d9c6c78df2f3ba49d74d91cf246f300a881af742 refs/tags/v0.1.44-SqueezeAmp
|
|
||||||
d9c6c78df2f3ba49d74d91cf246f300a881af742 refs/tags/v0.1.45-I2S-4MFlash
|
|
||||||
d9c6c78df2f3ba49d74d91cf246f300a881af742 refs/tags/v0.1.45-SqueezeAmp
|
|
||||||
d9c6c78df2f3ba49d74d91cf246f300a881af742 refs/tags/v0.1.46-I2S-4MFlash
|
|
||||||
d9c6c78df2f3ba49d74d91cf246f300a881af742 refs/tags/v0.1.46-SqueezeAmp
|
|
||||||
d9c6c78df2f3ba49d74d91cf246f300a881af742 refs/tags/v0.1.47-I2S-4MFlash
|
|
||||||
d9c6c78df2f3ba49d74d91cf246f300a881af742 refs/tags/v0.1.47-SqueezeAmp
|
|
||||||
3bd886b8dff0fb5bc59079e83f1d283097a14697 refs/tags/v0.1.5-I2S-4MFlash
|
|
||||||
3bd886b8dff0fb5bc59079e83f1d283097a14697 refs/tags/v0.1.5-SqueezeAmp
|
|
||||||
c34cf06be18ea4ab14ce28d77e1d48d0a1bb70f7 refs/tags/v0.1.50-I2S-4MFlash
|
|
||||||
c34cf06be18ea4ab14ce28d77e1d48d0a1bb70f7 refs/tags/v0.1.50-SqueezeAmp
|
|
||||||
c34cf06be18ea4ab14ce28d77e1d48d0a1bb70f7 refs/tags/v0.1.51-I2S-4MFlash
|
|
||||||
c34cf06be18ea4ab14ce28d77e1d48d0a1bb70f7 refs/tags/v0.1.51-SqueezeAmp
|
|
||||||
20edae43287b4c2d8942ea4263ccf9547f310946 refs/tags/v0.1.52-I2S-4MFlash
|
|
||||||
20edae43287b4c2d8942ea4263ccf9547f310946 refs/tags/v0.1.52-SqueezeAmp
|
|
||||||
964bb4d57d35bca06badfb504534b42e9b3b8678 refs/tags/v0.1.53-I2S-4MFlash
|
|
||||||
964bb4d57d35bca06badfb504534b42e9b3b8678 refs/tags/v0.1.53-SqueezeAmp
|
|
||||||
71531bcdc20d7c7da254699855eb2e1e7b2bd48f refs/tags/v0.1.54-I2S-4MFlash
|
|
||||||
71531bcdc20d7c7da254699855eb2e1e7b2bd48f refs/tags/v0.1.54-SqueezeAmp
|
|
||||||
9c56cfb1d05862bca5763b3fbe9911b4bab9619a refs/tags/v0.1.55-I2S-4MFlash
|
|
||||||
9c56cfb1d05862bca5763b3fbe9911b4bab9619a refs/tags/v0.1.55-SqueezeAmp
|
|
||||||
53369475dc85471a4d7f2d78c62f37fcd7f6e3da refs/tags/v0.1.57-I2S-4MFlash
|
|
||||||
53369475dc85471a4d7f2d78c62f37fcd7f6e3da refs/tags/v0.1.57-SqueezeAmp
|
|
||||||
3bd886b8dff0fb5bc59079e83f1d283097a14697 refs/tags/v0.1.6-I2S-4MFlash
|
|
||||||
3bd886b8dff0fb5bc59079e83f1d283097a14697 refs/tags/v0.1.6-SqueezeAmp
|
|
||||||
eef9ae969cdfd1a62d7057d8edf2c31af60804f3 refs/tags/v0.1.67-WiFi-Manager/I2S-4MFlash
|
|
||||||
2cf87d5943caa0d0b15c8692482ff72308c0c0a8 refs/tags/v0.1.71-I2S-4MFlash
|
|
||||||
2cf87d5943caa0d0b15c8692482ff72308c0c0a8 refs/tags/v0.1.71-SqueezeAmp
|
|
||||||
2cf87d5943caa0d0b15c8692482ff72308c0c0a8 refs/tags/v0.1.72-I2S-4MFlash
|
|
||||||
2cf87d5943caa0d0b15c8692482ff72308c0c0a8 refs/tags/v0.1.72-SqueezeAmp
|
|
||||||
2cf87d5943caa0d0b15c8692482ff72308c0c0a8 refs/tags/v0.1.73-I2S-4MFlash
|
|
||||||
2cf87d5943caa0d0b15c8692482ff72308c0c0a8 refs/tags/v0.1.73-SqueezeAmp
|
|
||||||
2cf87d5943caa0d0b15c8692482ff72308c0c0a8 refs/tags/v0.1.74-I2S-4MFlash
|
|
||||||
2cf87d5943caa0d0b15c8692482ff72308c0c0a8 refs/tags/v0.1.74-SqueezeAmp
|
|
||||||
3bd886b8dff0fb5bc59079e83f1d283097a14697 refs/tags/v0.1.9-I2S-4MFlash
|
|
||||||
3bd886b8dff0fb5bc59079e83f1d283097a14697 refs/tags/v0.1.9-SqueezeAmp
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -529,6 +529,7 @@ CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=12
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CONFIG_ESP32_WIFI_NVS_ENABLED=y
|
CONFIG_ESP32_WIFI_NVS_ENABLED=y
|
||||||
CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y
|
CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
840
build-scripts/sdkconfig
Normal file
840
build-scripts/sdkconfig
Normal file
@@ -0,0 +1,840 @@
|
|||||||
|
#
|
||||||
|
# Automatically generated file. DO NOT EDIT.
|
||||||
|
# Espressif IoT Development Framework (ESP-IDF) Project Configuration
|
||||||
|
#
|
||||||
|
CONFIG_IDF_TARGET_ESP32=y
|
||||||
|
CONFIG_IDF_TARGET="esp32"
|
||||||
|
CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000
|
||||||
|
|
||||||
|
#
|
||||||
|
# SDK tool configuration
|
||||||
|
#
|
||||||
|
CONFIG_SDK_TOOLPREFIX="xtensa-esp32-elf-"
|
||||||
|
CONFIG_APP_COMPILE_TIME_DATE=y
|
||||||
|
# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set
|
||||||
|
# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set
|
||||||
|
# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set
|
||||||
|
# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set
|
||||||
|
# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set
|
||||||
|
CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
|
||||||
|
# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set
|
||||||
|
# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set
|
||||||
|
CONFIG_BOOTLOADER_LOG_LEVEL=3
|
||||||
|
CONFIG_BOOTLOADER_SPI_WP_PIN=7
|
||||||
|
CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y
|
||||||
|
# CONFIG_BOOTLOADER_FACTORY_RESET is not set
|
||||||
|
# CONFIG_BOOTLOADER_APP_TEST is not set
|
||||||
|
CONFIG_BOOTLOADER_WDT_ENABLE=y
|
||||||
|
# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set
|
||||||
|
CONFIG_BOOTLOADER_WDT_TIME_MS=9000
|
||||||
|
# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set
|
||||||
|
# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set
|
||||||
|
# CONFIG_SECURE_BOOT_ENABLED is not set
|
||||||
|
# CONFIG_SECURE_FLASH_ENC_ENABLED is not set
|
||||||
|
CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200
|
||||||
|
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
|
||||||
|
# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set
|
||||||
|
# CONFIG_ESPTOOLPY_FLASHMODE_DIO is not set
|
||||||
|
# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set
|
||||||
|
CONFIG_ESPTOOLPY_FLASHMODE="dio"
|
||||||
|
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
|
||||||
|
# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set
|
||||||
|
# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set
|
||||||
|
# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
|
||||||
|
CONFIG_ESPTOOLPY_FLASHFREQ="80m"
|
||||||
|
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
|
||||||
|
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
|
||||||
|
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
|
||||||
|
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
|
||||||
|
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
|
||||||
|
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
|
||||||
|
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
|
||||||
|
CONFIG_ESPTOOLPY_BEFORE_RESET=y
|
||||||
|
# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set
|
||||||
|
CONFIG_ESPTOOLPY_BEFORE="default_reset"
|
||||||
|
CONFIG_ESPTOOLPY_AFTER_RESET=y
|
||||||
|
# CONFIG_ESPTOOLPY_AFTER_NORESET is not set
|
||||||
|
CONFIG_ESPTOOLPY_AFTER="hard_reset"
|
||||||
|
# CONFIG_ESPTOOLPY_MONITOR_BAUD_9600B is not set
|
||||||
|
# CONFIG_ESPTOOLPY_MONITOR_BAUD_57600B is not set
|
||||||
|
CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y
|
||||||
|
# CONFIG_ESPTOOLPY_MONITOR_BAUD_230400B is not set
|
||||||
|
# CONFIG_ESPTOOLPY_MONITOR_BAUD_921600B is not set
|
||||||
|
# CONFIG_ESPTOOLPY_MONITOR_BAUD_2MB is not set
|
||||||
|
# CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER is not set
|
||||||
|
CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER_VAL=115200
|
||||||
|
CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
|
||||||
|
# CONFIG_PARTITION_TABLE_SINGLE_APP is not set
|
||||||
|
# CONFIG_PARTITION_TABLE_TWO_OTA is not set
|
||||||
|
CONFIG_PARTITION_TABLE_CUSTOM=y
|
||||||
|
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
||||||
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
|
CONFIG_PARTITION_TABLE_OFFSET=0x8000
|
||||||
|
CONFIG_PARTITION_TABLE_MD5=y
|
||||||
|
CONFIG_LOGGING_SLIMPROTO="info"
|
||||||
|
CONFIG_LOGGING_STREAM="info"
|
||||||
|
CONFIG_LOGGING_DECODE="info"
|
||||||
|
CONFIG_LOGGING_OUTPUT="info"
|
||||||
|
# CONFIG_SQUEEZEAMP is not set
|
||||||
|
# CONFIG_A1S is not set
|
||||||
|
CONFIG_BASIC_I2C_BT=y
|
||||||
|
CONFIG_I2S_NUM=0
|
||||||
|
CONFIG_I2S_BCK_IO=33
|
||||||
|
CONFIG_I2S_WS_IO=25
|
||||||
|
CONFIG_I2S_DO_IO=32
|
||||||
|
CONFIG_I2S_DI_IO=-1
|
||||||
|
CONFIG_SDIF_NUM=0
|
||||||
|
CONFIG_SPDIF_BCK_IO=33
|
||||||
|
CONFIG_SPDIF_WS_IO=25
|
||||||
|
CONFIG_SPDIF_DO_IO=15
|
||||||
|
CONFIG_A2DP_SINK_NAME="SMSL BT4.2"
|
||||||
|
CONFIG_A2DP_DEV_NAME="Squeezelite"
|
||||||
|
CONFIG_A2DP_CONTROL_DELAY_MS=500
|
||||||
|
CONFIG_A2DP_CONNECT_TIMEOUT_MS=1000
|
||||||
|
CONFIG_BT_SINK=y
|
||||||
|
CONFIG_BT_NAME="ESP32-BT"
|
||||||
|
CONFIG_BT_SINK_PIN=1234
|
||||||
|
CONFIG_AIRPLAY_SINK=y
|
||||||
|
CONFIG_AIRPLAY_NAME="ESP32-AirPlay"
|
||||||
|
CONFIG_AIRPLAY_PORT="5000"
|
||||||
|
CONFIG_DISPLAY_CONFIG=""
|
||||||
|
CONFIG_I2C_CONFIG=""
|
||||||
|
CONFIG_SPI_CONFIG=""
|
||||||
|
CONFIG_SET_GPIO=""
|
||||||
|
CONFIG_ROTARY_ENCODER=""
|
||||||
|
CONFIG_LED_GREEN_GPIO=-1
|
||||||
|
CONFIG_LED_RED_GPIO=-1
|
||||||
|
CONFIG_JACK_GPIO=-1
|
||||||
|
CONFIG_SPKFAULT_GPIO=-1
|
||||||
|
CONFIG_BAT_CHANNEL=-1
|
||||||
|
CONFIG_WIFI_MANAGER_TASK_PRIORITY=5
|
||||||
|
CONFIG_WIFI_MANAGER_MAX_RETRY=2
|
||||||
|
CONFIG_DEFAULT_AP_SSID="squeezelite"
|
||||||
|
CONFIG_DEFAULT_AP_PASSWORD="squeezelite"
|
||||||
|
CONFIG_DEFAULT_AP_CHANNEL=1
|
||||||
|
CONFIG_DEFAULT_AP_IP="192.168.4.1"
|
||||||
|
CONFIG_DEFAULT_AP_GATEWAY="192.168.4.1"
|
||||||
|
CONFIG_DEFAULT_AP_NETMASK="255.255.255.0"
|
||||||
|
CONFIG_DEFAULT_AP_MAX_CONNECTIONS=4
|
||||||
|
CONFIG_DEFAULT_AP_BEACON_INTERVAL=100
|
||||||
|
CONFIG_DEFAULT_COMMAND_LINE="squeezelite -o I2S -b 500:2000 -d all=info -C 30"
|
||||||
|
# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set
|
||||||
|
CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y
|
||||||
|
# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE is not set
|
||||||
|
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y
|
||||||
|
# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set
|
||||||
|
# CONFIG_COMPILER_CXX_EXCEPTIONS is not set
|
||||||
|
CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y
|
||||||
|
# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set
|
||||||
|
# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set
|
||||||
|
# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set
|
||||||
|
# CONFIG_COMPILER_STACK_CHECK is not set
|
||||||
|
# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set
|
||||||
|
# CONFIG_COMPILER_DISABLE_GCC8_WARNINGS is not set
|
||||||
|
# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set
|
||||||
|
CONFIG_ESP32_APPTRACE_DEST_NONE=y
|
||||||
|
# CONFIG_ESP32_APPTRACE_ENABLE is not set
|
||||||
|
CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y
|
||||||
|
CONFIG_BT_ENABLED=y
|
||||||
|
# CONFIG_BTDM_CTRL_MODE_BLE_ONLY is not set
|
||||||
|
CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y
|
||||||
|
# CONFIG_BTDM_CTRL_MODE_BTDM is not set
|
||||||
|
CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN=2
|
||||||
|
CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN=0
|
||||||
|
# CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_HCI is not set
|
||||||
|
CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_PCM=y
|
||||||
|
CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_EFF=1
|
||||||
|
# CONFIG_BTDM_CTRL_AUTO_LATENCY_EFF is not set
|
||||||
|
CONFIG_BTDM_CTRL_BLE_MAX_CONN_EFF=0
|
||||||
|
CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN_EFF=2
|
||||||
|
CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF=0
|
||||||
|
CONFIG_BTDM_CTRL_PINNED_TO_CORE_0=y
|
||||||
|
# CONFIG_BTDM_CTRL_PINNED_TO_CORE_1 is not set
|
||||||
|
CONFIG_BTDM_CTRL_PINNED_TO_CORE=0
|
||||||
|
CONFIG_BTDM_CTRL_HCI_MODE_VHCI=y
|
||||||
|
# CONFIG_BTDM_CTRL_HCI_MODE_UART_H4 is not set
|
||||||
|
CONFIG_BTDM_MODEM_SLEEP=y
|
||||||
|
CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG=y
|
||||||
|
# CONFIG_BTDM_MODEM_SLEEP_MODE_EVED is not set
|
||||||
|
CONFIG_BTDM_LPCLK_SEL_MAIN_XTAL=y
|
||||||
|
CONFIG_BTDM_BLE_SLEEP_CLOCK_ACCURACY_INDEX_EFF=1
|
||||||
|
# CONFIG_BTDM_COEX_BT_OPTIONS is not set
|
||||||
|
CONFIG_BT_BLUEDROID_ENABLED=y
|
||||||
|
# CONFIG_BT_NIMBLE_ENABLED is not set
|
||||||
|
# CONFIG_BT_CONTROLLER_ONLY is not set
|
||||||
|
CONFIG_BT_BTC_TASK_STACK_SIZE=3072
|
||||||
|
CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0=y
|
||||||
|
# CONFIG_BT_BLUEDROID_PINNED_TO_CORE_1 is not set
|
||||||
|
CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0
|
||||||
|
CONFIG_BT_BTU_TASK_STACK_SIZE=4096
|
||||||
|
# CONFIG_BT_BLUEDROID_MEM_DEBUG is not set
|
||||||
|
CONFIG_BT_CLASSIC_ENABLED=y
|
||||||
|
CONFIG_BT_A2DP_ENABLE=y
|
||||||
|
# CONFIG_BT_SPP_ENABLED is not set
|
||||||
|
# CONFIG_BT_HFP_ENABLE is not set
|
||||||
|
CONFIG_BT_SSP_ENABLED=y
|
||||||
|
CONFIG_BT_BLE_ENABLED=y
|
||||||
|
CONFIG_BT_GATTS_ENABLE=y
|
||||||
|
# CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set
|
||||||
|
CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_AUTO=y
|
||||||
|
CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0
|
||||||
|
CONFIG_BT_GATTC_ENABLE=y
|
||||||
|
# CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set
|
||||||
|
CONFIG_BT_BLE_SMP_ENABLE=y
|
||||||
|
# CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE is not set
|
||||||
|
CONFIG_BT_STACK_NO_LOG=y
|
||||||
|
CONFIG_BT_ACL_CONNECTIONS=4
|
||||||
|
CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y
|
||||||
|
CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y
|
||||||
|
# CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set
|
||||||
|
CONFIG_BT_SMP_ENABLE=y
|
||||||
|
CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30
|
||||||
|
CONFIG_BT_RESERVE_DRAM=0xdb5c
|
||||||
|
# CONFIG_BLE_MESH is not set
|
||||||
|
# CONFIG_ADC_FORCE_XPD_FSM is not set
|
||||||
|
CONFIG_ADC_DISABLE_DAC=y
|
||||||
|
# CONFIG_SPI_MASTER_IN_IRAM is not set
|
||||||
|
CONFIG_SPI_MASTER_ISR_IN_IRAM=y
|
||||||
|
# CONFIG_SPI_SLAVE_IN_IRAM is not set
|
||||||
|
CONFIG_SPI_SLAVE_ISR_IN_IRAM=y
|
||||||
|
# CONFIG_EFUSE_CUSTOM_TABLE is not set
|
||||||
|
# CONFIG_EFUSE_VIRTUAL is not set
|
||||||
|
# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set
|
||||||
|
CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y
|
||||||
|
# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set
|
||||||
|
CONFIG_EFUSE_MAX_BLK_LEN=192
|
||||||
|
# CONFIG_ESP_TLS_SERVER is not set
|
||||||
|
CONFIG_ESP32_REV_MIN_0=y
|
||||||
|
# CONFIG_ESP32_REV_MIN_1 is not set
|
||||||
|
# CONFIG_ESP32_REV_MIN_2 is not set
|
||||||
|
# CONFIG_ESP32_REV_MIN_3 is not set
|
||||||
|
CONFIG_ESP32_REV_MIN=0
|
||||||
|
CONFIG_ESP32_DPORT_WORKAROUND=y
|
||||||
|
# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set
|
||||||
|
# CONFIG_ESP32_DEFAULT_CPU_FREQ_160 is not set
|
||||||
|
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
|
||||||
|
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
|
||||||
|
CONFIG_ESP32_SPIRAM_SUPPORT=y
|
||||||
|
CONFIG_SPIRAM_BOOT_INIT=y
|
||||||
|
# CONFIG_SPIRAM_USE_MEMMAP is not set
|
||||||
|
# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set
|
||||||
|
CONFIG_SPIRAM_USE_MALLOC=y
|
||||||
|
CONFIG_SPIRAM_TYPE_AUTO=y
|
||||||
|
# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set
|
||||||
|
# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set
|
||||||
|
CONFIG_SPIRAM_SIZE=-1
|
||||||
|
# CONFIG_SPIRAM_SPEED_40M is not set
|
||||||
|
CONFIG_SPIRAM_SPEED_80M=y
|
||||||
|
CONFIG_SPIRAM_MEMTEST=y
|
||||||
|
CONFIG_SPIRAM_CACHE_WORKAROUND=y
|
||||||
|
CONFIG_SPIRAM_BANKSWITCH_ENABLE=y
|
||||||
|
CONFIG_SPIRAM_BANKSWITCH_RESERVE=8
|
||||||
|
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=256
|
||||||
|
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
|
||||||
|
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=65536
|
||||||
|
CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y
|
||||||
|
CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y
|
||||||
|
# CONFIG_SPIRAM_OCCUPY_HSPI_HOST is not set
|
||||||
|
CONFIG_SPIRAM_OCCUPY_VSPI_HOST=y
|
||||||
|
# CONFIG_SPIRAM_OCCUPY_NO_HOST is not set
|
||||||
|
CONFIG_D0WD_PSRAM_CLK_IO=17
|
||||||
|
CONFIG_D0WD_PSRAM_CS_IO=16
|
||||||
|
CONFIG_D2WD_PSRAM_CLK_IO=9
|
||||||
|
CONFIG_D2WD_PSRAM_CS_IO=10
|
||||||
|
CONFIG_PICO_PSRAM_CS_IO=10
|
||||||
|
# CONFIG_ESP32_MEMMAP_TRACEMEM is not set
|
||||||
|
# CONFIG_ESP32_MEMMAP_TRACEMEM_TWOBANKS is not set
|
||||||
|
# CONFIG_ESP32_TRAX is not set
|
||||||
|
CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0
|
||||||
|
# CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set
|
||||||
|
CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y
|
||||||
|
CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4
|
||||||
|
# CONFIG_ESP32_ULP_COPROC_ENABLED is not set
|
||||||
|
CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0
|
||||||
|
# CONFIG_ESP32_PANIC_PRINT_HALT is not set
|
||||||
|
CONFIG_ESP32_PANIC_PRINT_REBOOT=y
|
||||||
|
# CONFIG_ESP32_PANIC_SILENT_REBOOT is not set
|
||||||
|
# CONFIG_ESP32_PANIC_GDBSTUB is not set
|
||||||
|
CONFIG_ESP32_DEBUG_OCDAWARE=y
|
||||||
|
# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set
|
||||||
|
CONFIG_ESP32_BROWNOUT_DET=y
|
||||||
|
CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0=y
|
||||||
|
# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set
|
||||||
|
# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set
|
||||||
|
# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set
|
||||||
|
# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4 is not set
|
||||||
|
# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set
|
||||||
|
# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set
|
||||||
|
# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set
|
||||||
|
CONFIG_ESP32_BROWNOUT_DET_LVL=0
|
||||||
|
CONFIG_ESP32_REDUCE_PHY_TX_POWER=y
|
||||||
|
CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y
|
||||||
|
# CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set
|
||||||
|
# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set
|
||||||
|
# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set
|
||||||
|
CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y
|
||||||
|
# CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set
|
||||||
|
# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set
|
||||||
|
# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set
|
||||||
|
CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024
|
||||||
|
CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000
|
||||||
|
CONFIG_ESP32_XTAL_FREQ_40=y
|
||||||
|
# CONFIG_ESP32_XTAL_FREQ_26 is not set
|
||||||
|
# CONFIG_ESP32_XTAL_FREQ_AUTO is not set
|
||||||
|
CONFIG_ESP32_XTAL_FREQ=40
|
||||||
|
# CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set
|
||||||
|
# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set
|
||||||
|
# CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set
|
||||||
|
CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL=5
|
||||||
|
# CONFIG_PM_ENABLE is not set
|
||||||
|
CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y
|
||||||
|
CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y
|
||||||
|
CONFIG_ADC_CAL_LUT_ENABLE=y
|
||||||
|
# CONFIG_ESP_TIMER_PROFILING is not set
|
||||||
|
CONFIG_ESP_ERR_TO_NAME_LOOKUP=y
|
||||||
|
CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32
|
||||||
|
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304
|
||||||
|
CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192
|
||||||
|
CONFIG_ESP_IPC_TASK_STACK_SIZE=1024
|
||||||
|
CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584
|
||||||
|
CONFIG_ESP_CONSOLE_UART_DEFAULT=y
|
||||||
|
# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set
|
||||||
|
# CONFIG_ESP_CONSOLE_UART_NONE is not set
|
||||||
|
CONFIG_ESP_CONSOLE_UART_NUM=0
|
||||||
|
CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200
|
||||||
|
CONFIG_ESP_INT_WDT=y
|
||||||
|
CONFIG_ESP_INT_WDT_TIMEOUT_MS=800
|
||||||
|
CONFIG_ESP_INT_WDT_CHECK_CPU1=y
|
||||||
|
CONFIG_ESP_TASK_WDT=y
|
||||||
|
# CONFIG_ESP_TASK_WDT_PANIC is not set
|
||||||
|
CONFIG_ESP_TASK_WDT_TIMEOUT_S=5
|
||||||
|
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
|
||||||
|
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y
|
||||||
|
CONFIG_ETH_USE_ESP32_EMAC=y
|
||||||
|
CONFIG_ETH_PHY_INTERFACE_RMII=y
|
||||||
|
# CONFIG_ETH_PHY_INTERFACE_MII is not set
|
||||||
|
CONFIG_ETH_RMII_CLK_INPUT=y
|
||||||
|
# CONFIG_ETH_RMII_CLK_OUTPUT is not set
|
||||||
|
CONFIG_ETH_RMII_CLK_IN_GPIO=0
|
||||||
|
CONFIG_ETH_DMA_BUFFER_SIZE=512
|
||||||
|
CONFIG_ETH_DMA_RX_BUFFER_NUM=10
|
||||||
|
CONFIG_ETH_DMA_TX_BUFFER_NUM=10
|
||||||
|
# CONFIG_ETH_USE_SPI_ETHERNET is not set
|
||||||
|
# CONFIG_ESP_EVENT_LOOP_PROFILING is not set
|
||||||
|
CONFIG_ESP_EVENT_POST_FROM_ISR=y
|
||||||
|
CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y
|
||||||
|
CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y
|
||||||
|
# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set
|
||||||
|
CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024
|
||||||
|
CONFIG_HTTPD_MAX_URI_LEN=512
|
||||||
|
CONFIG_HTTPD_ERR_RESP_NO_DELAY=y
|
||||||
|
CONFIG_HTTPD_PURGE_BUF_LEN=32
|
||||||
|
# CONFIG_HTTPD_LOG_PURGE_DATA is not set
|
||||||
|
CONFIG_OTA_ALLOW_HTTP=y
|
||||||
|
# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set
|
||||||
|
CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y
|
||||||
|
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=12
|
||||||
|
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=40
|
||||||
|
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y
|
||||||
|
CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0
|
||||||
|
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=12
|
||||||
|
# CONFIG_ESP32_WIFI_CSI_ENABLED is not set
|
||||||
|
# CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED is not set
|
||||||
|
# CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED is not set
|
||||||
|
CONFIG_ESP32_WIFI_RX_BA_WIN=16
|
||||||
|
CONFIG_ESP32_WIFI_NVS_ENABLED=y
|
||||||
|
CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y
|
||||||
|
# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set
|
||||||
|
CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752
|
||||||
|
CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32
|
||||||
|
# CONFIG_ESP32_WIFI_DEBUG_LOG_ENABLE is not set
|
||||||
|
# CONFIG_ESP32_WIFI_IRAM_OPT is not set
|
||||||
|
# CONFIG_ESP32_WIFI_RX_IRAM_OPT is not set
|
||||||
|
CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y
|
||||||
|
#CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION=y
|
||||||
|
CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20
|
||||||
|
CONFIG_ESP32_PHY_MAX_TX_POWER=20
|
||||||
|
# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set
|
||||||
|
# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set
|
||||||
|
CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y
|
||||||
|
# CONFIG_ESP32_ENABLE_COREDUMP is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_DYNAMIC is not set
|
||||||
|
CONFIG_FATFS_CODEPAGE_437=y
|
||||||
|
# CONFIG_FATFS_CODEPAGE_720 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_737 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_771 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_775 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_850 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_852 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_855 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_857 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_860 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_861 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_862 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_863 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_864 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_865 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_866 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_869 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_932 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_936 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_949 is not set
|
||||||
|
# CONFIG_FATFS_CODEPAGE_950 is not set
|
||||||
|
CONFIG_FATFS_CODEPAGE=437
|
||||||
|
CONFIG_FATFS_LFN_NONE=y
|
||||||
|
# CONFIG_FATFS_LFN_HEAP is not set
|
||||||
|
# CONFIG_FATFS_LFN_STACK is not set
|
||||||
|
CONFIG_FATFS_FS_LOCK=0
|
||||||
|
CONFIG_FATFS_TIMEOUT_MS=10000
|
||||||
|
CONFIG_FATFS_PER_FILE_CACHE=y
|
||||||
|
CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y
|
||||||
|
CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND=150
|
||||||
|
CONFIG_FMB_MASTER_DELAY_MS_CONVERT=200
|
||||||
|
CONFIG_FMB_QUEUE_LENGTH=20
|
||||||
|
CONFIG_FMB_SERIAL_TASK_STACK_SIZE=2048
|
||||||
|
CONFIG_FMB_SERIAL_BUF_SIZE=256
|
||||||
|
CONFIG_FMB_SERIAL_TASK_PRIO=10
|
||||||
|
# CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT is not set
|
||||||
|
CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT=20
|
||||||
|
CONFIG_FMB_CONTROLLER_NOTIFY_QUEUE_SIZE=20
|
||||||
|
CONFIG_FMB_CONTROLLER_STACK_SIZE=4096
|
||||||
|
CONFIG_FMB_EVENT_QUEUE_TIMEOUT=20
|
||||||
|
CONFIG_FMB_TIMER_PORT_ENABLED=y
|
||||||
|
CONFIG_FMB_TIMER_GROUP=0
|
||||||
|
CONFIG_FMB_TIMER_INDEX=0
|
||||||
|
# CONFIG_FREERTOS_UNICORE is not set
|
||||||
|
CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF
|
||||||
|
CONFIG_FREERTOS_CORETIMER_0=y
|
||||||
|
# CONFIG_FREERTOS_CORETIMER_1 is not set
|
||||||
|
CONFIG_FREERTOS_HZ=100
|
||||||
|
CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y
|
||||||
|
# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set
|
||||||
|
# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set
|
||||||
|
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y
|
||||||
|
# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set
|
||||||
|
CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y
|
||||||
|
CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1
|
||||||
|
CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y
|
||||||
|
# CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE is not set
|
||||||
|
# CONFIG_FREERTOS_ASSERT_DISABLE is not set
|
||||||
|
CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536
|
||||||
|
CONFIG_FREERTOS_ISR_STACKSIZE=1536
|
||||||
|
# CONFIG_FREERTOS_LEGACY_HOOKS is not set
|
||||||
|
CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16
|
||||||
|
CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y
|
||||||
|
# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set
|
||||||
|
CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1
|
||||||
|
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2432
|
||||||
|
CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10
|
||||||
|
CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0
|
||||||
|
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
|
||||||
|
CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
|
||||||
|
CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID=y
|
||||||
|
CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y
|
||||||
|
CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER=y
|
||||||
|
# CONFIG_FREERTOS_RUN_TIME_STATS_USING_CPU_CLK is not set
|
||||||
|
# CONFIG_FREERTOS_DEBUG_INTERNALS is not set
|
||||||
|
CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y
|
||||||
|
# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set
|
||||||
|
CONFIG_HEAP_POISONING_DISABLED=y
|
||||||
|
# CONFIG_HEAP_POISONING_LIGHT is not set
|
||||||
|
# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set
|
||||||
|
CONFIG_HEAP_TRACING_OFF=y
|
||||||
|
# CONFIG_HEAP_TRACING_STANDALONE is not set
|
||||||
|
# CONFIG_HEAP_TRACING_TOHOST is not set
|
||||||
|
# CONFIG_HEAP_TRACING is not set
|
||||||
|
# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
|
||||||
|
# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
|
||||||
|
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
|
||||||
|
# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set
|
||||||
|
# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
|
||||||
|
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
|
||||||
|
CONFIG_LOG_DEFAULT_LEVEL=3
|
||||||
|
CONFIG_LOG_COLORS=y
|
||||||
|
CONFIG_LWIP_LOCAL_HOSTNAME="squeezelite-esp32"
|
||||||
|
# CONFIG_LWIP_L2_TO_L3_COPY is not set
|
||||||
|
# CONFIG_LWIP_IRAM_OPTIMIZATION is not set
|
||||||
|
CONFIG_LWIP_TIMERS_ONDEMAND=y
|
||||||
|
CONFIG_LWIP_MAX_SOCKETS=16
|
||||||
|
# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set
|
||||||
|
CONFIG_LWIP_SO_REUSE=y
|
||||||
|
CONFIG_LWIP_SO_REUSE_RXTOALL=y
|
||||||
|
# CONFIG_LWIP_SO_RCVBUF is not set
|
||||||
|
CONFIG_LWIP_IP_FRAG=y
|
||||||
|
# CONFIG_LWIP_IP_REASSEMBLY is not set
|
||||||
|
# CONFIG_LWIP_STATS is not set
|
||||||
|
# CONFIG_LWIP_ETHARP_TRUST_IP_MAC is not set
|
||||||
|
CONFIG_LWIP_ESP_GRATUITOUS_ARP=y
|
||||||
|
CONFIG_LWIP_GARP_TMR_INTERVAL=60
|
||||||
|
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32
|
||||||
|
CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y
|
||||||
|
CONFIG_LWIP_DHCP_RESTORE_LAST_IP=y
|
||||||
|
CONFIG_LWIP_DHCPS_LEASE_UNIT=60
|
||||||
|
CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8
|
||||||
|
# CONFIG_LWIP_AUTOIP is not set
|
||||||
|
# CONFIG_LWIP_IPV6_AUTOCONFIG is not set
|
||||||
|
CONFIG_LWIP_NETIF_LOOPBACK=y
|
||||||
|
CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8
|
||||||
|
CONFIG_LWIP_MAX_ACTIVE_TCP=16
|
||||||
|
CONFIG_LWIP_MAX_LISTENING_TCP=16
|
||||||
|
CONFIG_LWIP_TCP_MAXRTX=12
|
||||||
|
CONFIG_LWIP_TCP_SYNMAXRTX=6
|
||||||
|
CONFIG_LWIP_TCP_MSS=1440
|
||||||
|
CONFIG_LWIP_TCP_MSL=60000
|
||||||
|
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=8192
|
||||||
|
CONFIG_LWIP_TCP_WND_DEFAULT=32768
|
||||||
|
CONFIG_LWIP_TCP_RECVMBOX_SIZE=32
|
||||||
|
CONFIG_LWIP_TCP_QUEUE_OOSEQ=y
|
||||||
|
# CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set
|
||||||
|
CONFIG_LWIP_TCP_OVERSIZE_MSS=y
|
||||||
|
# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set
|
||||||
|
# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set
|
||||||
|
# CONFIG_LWIP_WND_SCALE is not set
|
||||||
|
CONFIG_LWIP_MAX_UDP_PCBS=16
|
||||||
|
CONFIG_LWIP_UDP_RECVMBOX_SIZE=32
|
||||||
|
CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072
|
||||||
|
CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y
|
||||||
|
# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set
|
||||||
|
# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set
|
||||||
|
CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF
|
||||||
|
# CONFIG_LWIP_PPP_SUPPORT is not set
|
||||||
|
# CONFIG_LWIP_MULTICAST_PING is not set
|
||||||
|
# CONFIG_LWIP_BROADCAST_PING is not set
|
||||||
|
CONFIG_LWIP_MAX_RAW_PCBS=16
|
||||||
|
CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=1
|
||||||
|
CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000
|
||||||
|
# CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC is not set
|
||||||
|
CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
|
||||||
|
# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set
|
||||||
|
# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set
|
||||||
|
CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y
|
||||||
|
CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384
|
||||||
|
CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096
|
||||||
|
# CONFIG_MBEDTLS_DEBUG is not set
|
||||||
|
# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set
|
||||||
|
# CONFIG_MBEDTLS_CMAC_C is not set
|
||||||
|
CONFIG_MBEDTLS_HARDWARE_AES=y
|
||||||
|
# CONFIG_MBEDTLS_HARDWARE_MPI is not set
|
||||||
|
CONFIG_MBEDTLS_HARDWARE_SHA=y
|
||||||
|
CONFIG_MBEDTLS_HAVE_TIME=y
|
||||||
|
# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set
|
||||||
|
# CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT is not set
|
||||||
|
# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set
|
||||||
|
CONFIG_MBEDTLS_TLS_CLIENT_ONLY=y
|
||||||
|
# CONFIG_MBEDTLS_TLS_DISABLED is not set
|
||||||
|
CONFIG_MBEDTLS_TLS_CLIENT=y
|
||||||
|
CONFIG_MBEDTLS_TLS_ENABLED=y
|
||||||
|
# CONFIG_MBEDTLS_PSK_MODES is not set
|
||||||
|
CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y
|
||||||
|
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA=y
|
||||||
|
CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y
|
||||||
|
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y
|
||||||
|
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y
|
||||||
|
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y
|
||||||
|
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y
|
||||||
|
CONFIG_MBEDTLS_SSL_RENEGOTIATION=y
|
||||||
|
# CONFIG_MBEDTLS_SSL_PROTO_SSL3 is not set
|
||||||
|
CONFIG_MBEDTLS_SSL_PROTO_TLS1=y
|
||||||
|
CONFIG_MBEDTLS_SSL_PROTO_TLS1_1=y
|
||||||
|
CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y
|
||||||
|
# CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set
|
||||||
|
CONFIG_MBEDTLS_SSL_ALPN=y
|
||||||
|
CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y
|
||||||
|
CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y
|
||||||
|
CONFIG_MBEDTLS_AES_C=y
|
||||||
|
# CONFIG_MBEDTLS_CAMELLIA_C is not set
|
||||||
|
# CONFIG_MBEDTLS_DES_C is not set
|
||||||
|
CONFIG_MBEDTLS_RC4_DISABLED=y
|
||||||
|
# CONFIG_MBEDTLS_RC4_ENABLED_NO_DEFAULT is not set
|
||||||
|
# CONFIG_MBEDTLS_RC4_ENABLED is not set
|
||||||
|
# CONFIG_MBEDTLS_BLOWFISH_C is not set
|
||||||
|
# CONFIG_MBEDTLS_XTEA_C is not set
|
||||||
|
CONFIG_MBEDTLS_CCM_C=y
|
||||||
|
CONFIG_MBEDTLS_GCM_C=y
|
||||||
|
# CONFIG_MBEDTLS_RIPEMD160_C is not set
|
||||||
|
CONFIG_MBEDTLS_PEM_PARSE_C=y
|
||||||
|
CONFIG_MBEDTLS_PEM_WRITE_C=y
|
||||||
|
CONFIG_MBEDTLS_X509_CRL_PARSE_C=y
|
||||||
|
CONFIG_MBEDTLS_X509_CSR_PARSE_C=y
|
||||||
|
CONFIG_MBEDTLS_ECP_C=y
|
||||||
|
CONFIG_MBEDTLS_ECDH_C=y
|
||||||
|
CONFIG_MBEDTLS_ECDSA_C=y
|
||||||
|
CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y
|
||||||
|
CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y
|
||||||
|
CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y
|
||||||
|
CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y
|
||||||
|
CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y
|
||||||
|
CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y
|
||||||
|
CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y
|
||||||
|
CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y
|
||||||
|
CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y
|
||||||
|
CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y
|
||||||
|
CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y
|
||||||
|
CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y
|
||||||
|
CONFIG_MBEDTLS_ECP_NIST_OPTIM=y
|
||||||
|
CONFIG_MDNS_MAX_SERVICES=10
|
||||||
|
CONFIG_MQTT_PROTOCOL_311=y
|
||||||
|
CONFIG_MQTT_TRANSPORT_SSL=y
|
||||||
|
CONFIG_MQTT_TRANSPORT_WEBSOCKET=y
|
||||||
|
CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y
|
||||||
|
# CONFIG_MQTT_USE_CUSTOM_CONFIG is not set
|
||||||
|
# CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set
|
||||||
|
# CONFIG_MQTT_CUSTOM_OUTBOX is not set
|
||||||
|
CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y
|
||||||
|
# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set
|
||||||
|
# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set
|
||||||
|
# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set
|
||||||
|
# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set
|
||||||
|
CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y
|
||||||
|
# CONFIG_NEWLIB_NANO_FORMAT is not set
|
||||||
|
# CONFIG_OPENSSL_DEBUG is not set
|
||||||
|
CONFIG_OPENSSL_ASSERT_DO_NOTHING=y
|
||||||
|
# CONFIG_OPENSSL_ASSERT_EXIT is not set
|
||||||
|
CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5
|
||||||
|
CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
|
||||||
|
CONFIG_PTHREAD_STACK_MIN=768
|
||||||
|
# CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY is not set
|
||||||
|
# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set
|
||||||
|
CONFIG_PTHREAD_DEFAULT_CORE_1=y
|
||||||
|
CONFIG_PTHREAD_TASK_CORE_DEFAULT=1
|
||||||
|
CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread"
|
||||||
|
# CONFIG_SPI_FLASH_VERIFY_WRITE is not set
|
||||||
|
# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set
|
||||||
|
CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y
|
||||||
|
CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y
|
||||||
|
# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set
|
||||||
|
# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set
|
||||||
|
# CONFIG_SPI_FLASH_USE_LEGACY_IMPL is not set
|
||||||
|
CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y
|
||||||
|
CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y
|
||||||
|
CONFIG_SPIFFS_MAX_PARTITIONS=3
|
||||||
|
CONFIG_SPIFFS_CACHE=y
|
||||||
|
CONFIG_SPIFFS_CACHE_WR=y
|
||||||
|
# CONFIG_SPIFFS_CACHE_STATS is not set
|
||||||
|
CONFIG_SPIFFS_PAGE_CHECK=y
|
||||||
|
CONFIG_SPIFFS_GC_MAX_RUNS=10
|
||||||
|
# CONFIG_SPIFFS_GC_STATS is not set
|
||||||
|
CONFIG_SPIFFS_PAGE_SIZE=256
|
||||||
|
CONFIG_SPIFFS_OBJ_NAME_LEN=32
|
||||||
|
CONFIG_SPIFFS_USE_MAGIC=y
|
||||||
|
CONFIG_SPIFFS_USE_MAGIC_LENGTH=y
|
||||||
|
CONFIG_SPIFFS_META_LENGTH=4
|
||||||
|
CONFIG_SPIFFS_USE_MTIME=y
|
||||||
|
# CONFIG_SPIFFS_DBG is not set
|
||||||
|
# CONFIG_SPIFFS_API_DBG is not set
|
||||||
|
# CONFIG_SPIFFS_GC_DBG is not set
|
||||||
|
# CONFIG_SPIFFS_CACHE_DBG is not set
|
||||||
|
# CONFIG_SPIFFS_CHECK_DBG is not set
|
||||||
|
# CONFIG_SPIFFS_TEST_VISUALISATION is not set
|
||||||
|
CONFIG_NETIF_IP_LOST_TIMER_INTERVAL=120
|
||||||
|
CONFIG_TCPIP_LWIP=y
|
||||||
|
CONFIG_UNITY_ENABLE_FLOAT=y
|
||||||
|
CONFIG_UNITY_ENABLE_DOUBLE=y
|
||||||
|
# CONFIG_UNITY_ENABLE_COLOR is not set
|
||||||
|
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
|
||||||
|
# CONFIG_UNITY_ENABLE_FIXTURE is not set
|
||||||
|
# CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set
|
||||||
|
CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y
|
||||||
|
CONFIG_VFS_SUPPORT_TERMIOS=y
|
||||||
|
CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1
|
||||||
|
CONFIG_SEMIHOSTFS_HOST_PATH_MAX_LEN=128
|
||||||
|
CONFIG_WL_SECTOR_SIZE_512=y
|
||||||
|
# CONFIG_WL_SECTOR_SIZE_4096 is not set
|
||||||
|
CONFIG_WL_SECTOR_SIZE=512
|
||||||
|
# CONFIG_WL_SECTOR_MODE_PERF is not set
|
||||||
|
CONFIG_WL_SECTOR_MODE_SAFE=y
|
||||||
|
CONFIG_WL_SECTOR_MODE=1
|
||||||
|
CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16
|
||||||
|
CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30
|
||||||
|
CONFIG_WPA_MBEDTLS_CRYPTO=y
|
||||||
|
# CONFIG_DSP_ANSI is not set
|
||||||
|
CONFIG_DSP_OPTIMIZED=y
|
||||||
|
CONFIG_DSP_OPTIMIZATION=1
|
||||||
|
CONFIG_DSP_MAX_FFT_SIZE_512=y
|
||||||
|
# CONFIG_DSP_MAX_FFT_SIZE_1024 is not set
|
||||||
|
# CONFIG_DSP_MAX_FFT_SIZE_2048 is not set
|
||||||
|
# CONFIG_DSP_MAX_FFT_SIZE_4096 is not set
|
||||||
|
# CONFIG_DSP_MAX_FFT_SIZE_8192 is not set
|
||||||
|
# CONFIG_DSP_MAX_FFT_SIZE_16384 is not set
|
||||||
|
# CONFIG_DSP_MAX_FFT_SIZE_32768 is not set
|
||||||
|
CONFIG_DSP_MAX_FFT_SIZE=512
|
||||||
|
# CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set
|
||||||
|
|
||||||
|
# Deprecated options for backward compatibility
|
||||||
|
CONFIG_TOOLPREFIX="xtensa-esp32-elf-"
|
||||||
|
# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set
|
||||||
|
# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set
|
||||||
|
# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set
|
||||||
|
CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y
|
||||||
|
# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set
|
||||||
|
# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set
|
||||||
|
CONFIG_LOG_BOOTLOADER_LEVEL=3
|
||||||
|
# CONFIG_APP_ROLLBACK_ENABLE is not set
|
||||||
|
# CONFIG_FLASH_ENCRYPTION_ENABLED is not set
|
||||||
|
CONFIG_FLASHMODE_QIO=y
|
||||||
|
# CONFIG_FLASHMODE_QOUT is not set
|
||||||
|
# CONFIG_FLASHMODE_DIO is not set
|
||||||
|
# CONFIG_FLASHMODE_DOUT is not set
|
||||||
|
# CONFIG_MONITOR_BAUD_9600B is not set
|
||||||
|
# CONFIG_MONITOR_BAUD_57600B is not set
|
||||||
|
CONFIG_MONITOR_BAUD_115200B=y
|
||||||
|
# CONFIG_MONITOR_BAUD_230400B is not set
|
||||||
|
# CONFIG_MONITOR_BAUD_921600B is not set
|
||||||
|
# CONFIG_MONITOR_BAUD_2MB is not set
|
||||||
|
# CONFIG_MONITOR_BAUD_OTHER is not set
|
||||||
|
CONFIG_MONITOR_BAUD_OTHER_VAL=115200
|
||||||
|
CONFIG_MONITOR_BAUD=115200
|
||||||
|
# CONFIG_OPTIMIZATION_LEVEL_DEBUG is not set
|
||||||
|
CONFIG_OPTIMIZATION_LEVEL_RELEASE=y
|
||||||
|
# CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED is not set
|
||||||
|
CONFIG_OPTIMIZATION_ASSERTIONS_SILENT=y
|
||||||
|
# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set
|
||||||
|
# CONFIG_CXX_EXCEPTIONS is not set
|
||||||
|
CONFIG_STACK_CHECK_NONE=y
|
||||||
|
# CONFIG_STACK_CHECK_NORM is not set
|
||||||
|
# CONFIG_STACK_CHECK_STRONG is not set
|
||||||
|
# CONFIG_STACK_CHECK_ALL is not set
|
||||||
|
# CONFIG_STACK_CHECK is not set
|
||||||
|
# CONFIG_WARN_WRITE_STRINGS is not set
|
||||||
|
# CONFIG_DISABLE_GCC8_WARNINGS is not set
|
||||||
|
# CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY is not set
|
||||||
|
CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY=y
|
||||||
|
# CONFIG_BTDM_CONTROLLER_MODE_BTDM is not set
|
||||||
|
CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN=2
|
||||||
|
CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN=0
|
||||||
|
CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF=0
|
||||||
|
CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF=2
|
||||||
|
CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF=0
|
||||||
|
CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0
|
||||||
|
CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI=y
|
||||||
|
# CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4 is not set
|
||||||
|
CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=y
|
||||||
|
CONFIG_BLUEDROID_ENABLED=y
|
||||||
|
CONFIG_BTC_TASK_STACK_SIZE=3072
|
||||||
|
CONFIG_BLUEDROID_PINNED_TO_CORE_0=y
|
||||||
|
# CONFIG_BLUEDROID_PINNED_TO_CORE_1 is not set
|
||||||
|
CONFIG_BLUEDROID_PINNED_TO_CORE=0
|
||||||
|
CONFIG_BTU_TASK_STACK_SIZE=4096
|
||||||
|
# CONFIG_BLUEDROID_MEM_DEBUG is not set
|
||||||
|
CONFIG_CLASSIC_BT_ENABLED=y
|
||||||
|
CONFIG_A2DP_ENABLE=y
|
||||||
|
# CONFIG_HFP_ENABLE is not set
|
||||||
|
CONFIG_GATTS_ENABLE=y
|
||||||
|
# CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set
|
||||||
|
CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO=y
|
||||||
|
CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE=0
|
||||||
|
CONFIG_GATTC_ENABLE=y
|
||||||
|
# CONFIG_GATTC_CACHE_NVS_FLASH is not set
|
||||||
|
CONFIG_BLE_SMP_ENABLE=y
|
||||||
|
# CONFIG_SMP_SLAVE_CON_PARAMS_UPD_ENABLE is not set
|
||||||
|
# CONFIG_BLE_HOST_QUEUE_CONGESTION_CHECK is not set
|
||||||
|
CONFIG_SMP_ENABLE=y
|
||||||
|
CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT=30
|
||||||
|
CONFIG_ADC2_DISABLE_DAC=y
|
||||||
|
CONFIG_SPIRAM_SUPPORT=y
|
||||||
|
CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST=y
|
||||||
|
# CONFIG_MEMMAP_TRACEMEM is not set
|
||||||
|
# CONFIG_MEMMAP_TRACEMEM_TWOBANKS is not set
|
||||||
|
CONFIG_TRACEMEM_RESERVE_DRAM=0x0
|
||||||
|
# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set
|
||||||
|
CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y
|
||||||
|
CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4
|
||||||
|
# CONFIG_ULP_COPROC_ENABLED is not set
|
||||||
|
CONFIG_ULP_COPROC_RESERVE_MEM=0
|
||||||
|
CONFIG_BROWNOUT_DET=y
|
||||||
|
CONFIG_BROWNOUT_DET_LVL_SEL_0=y
|
||||||
|
# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set
|
||||||
|
# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set
|
||||||
|
# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set
|
||||||
|
# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set
|
||||||
|
# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set
|
||||||
|
# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set
|
||||||
|
# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set
|
||||||
|
CONFIG_BROWNOUT_DET_LVL=0
|
||||||
|
CONFIG_REDUCE_PHY_TX_POWER=y
|
||||||
|
CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y
|
||||||
|
# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set
|
||||||
|
# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set
|
||||||
|
# CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set
|
||||||
|
# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set
|
||||||
|
# CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set
|
||||||
|
CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32
|
||||||
|
CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304
|
||||||
|
CONFIG_MAIN_TASK_STACK_SIZE=8192
|
||||||
|
CONFIG_IPC_TASK_STACK_SIZE=1024
|
||||||
|
CONFIG_TIMER_TASK_STACK_SIZE=3584
|
||||||
|
CONFIG_CONSOLE_UART_DEFAULT=y
|
||||||
|
# CONFIG_CONSOLE_UART_CUSTOM is not set
|
||||||
|
# CONFIG_CONSOLE_UART_NONE is not set
|
||||||
|
CONFIG_CONSOLE_UART_NUM=0
|
||||||
|
CONFIG_CONSOLE_UART_BAUDRATE=115200
|
||||||
|
CONFIG_INT_WDT=y
|
||||||
|
CONFIG_INT_WDT_TIMEOUT_MS=800
|
||||||
|
CONFIG_INT_WDT_CHECK_CPU1=y
|
||||||
|
CONFIG_TASK_WDT=y
|
||||||
|
# CONFIG_TASK_WDT_PANIC is not set
|
||||||
|
CONFIG_TASK_WDT_TIMEOUT_S=5
|
||||||
|
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
|
||||||
|
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y
|
||||||
|
# CONFIG_EVENT_LOOP_PROFILING is not set
|
||||||
|
CONFIG_POST_EVENTS_FROM_ISR=y
|
||||||
|
CONFIG_POST_EVENTS_FROM_IRAM_ISR=y
|
||||||
|
CONFIG_SW_COEXIST_ENABLE=y
|
||||||
|
CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150
|
||||||
|
CONFIG_MB_MASTER_DELAY_MS_CONVERT=200
|
||||||
|
CONFIG_MB_QUEUE_LENGTH=20
|
||||||
|
CONFIG_MB_SERIAL_TASK_STACK_SIZE=2048
|
||||||
|
CONFIG_MB_SERIAL_BUF_SIZE=256
|
||||||
|
CONFIG_MB_SERIAL_TASK_PRIO=10
|
||||||
|
# CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT is not set
|
||||||
|
CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT=20
|
||||||
|
CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE=20
|
||||||
|
CONFIG_MB_CONTROLLER_STACK_SIZE=4096
|
||||||
|
CONFIG_MB_EVENT_QUEUE_TIMEOUT=20
|
||||||
|
CONFIG_MB_TIMER_PORT_ENABLED=y
|
||||||
|
CONFIG_MB_TIMER_GROUP=0
|
||||||
|
CONFIG_MB_TIMER_INDEX=0
|
||||||
|
CONFIG_SUPPORT_STATIC_ALLOCATION=y
|
||||||
|
# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set
|
||||||
|
CONFIG_TIMER_TASK_PRIORITY=1
|
||||||
|
CONFIG_TIMER_TASK_STACK_DEPTH=2432
|
||||||
|
CONFIG_TIMER_QUEUE_LENGTH=10
|
||||||
|
# CONFIG_L2_TO_L3_COPY is not set
|
||||||
|
# CONFIG_USE_ONLY_LWIP_SELECT is not set
|
||||||
|
CONFIG_ESP_GRATUITOUS_ARP=y
|
||||||
|
CONFIG_GARP_TMR_INTERVAL=60
|
||||||
|
CONFIG_TCPIP_RECVMBOX_SIZE=32
|
||||||
|
CONFIG_TCP_MAXRTX=12
|
||||||
|
CONFIG_TCP_SYNMAXRTX=6
|
||||||
|
CONFIG_TCP_MSS=1440
|
||||||
|
CONFIG_TCP_MSL=60000
|
||||||
|
CONFIG_TCP_SND_BUF_DEFAULT=8192
|
||||||
|
CONFIG_TCP_WND_DEFAULT=32768
|
||||||
|
CONFIG_TCP_RECVMBOX_SIZE=32
|
||||||
|
CONFIG_TCP_QUEUE_OOSEQ=y
|
||||||
|
# CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set
|
||||||
|
CONFIG_TCP_OVERSIZE_MSS=y
|
||||||
|
# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set
|
||||||
|
# CONFIG_TCP_OVERSIZE_DISABLE is not set
|
||||||
|
CONFIG_UDP_RECVMBOX_SIZE=32
|
||||||
|
CONFIG_TCPIP_TASK_STACK_SIZE=3072
|
||||||
|
CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y
|
||||||
|
# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set
|
||||||
|
# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set
|
||||||
|
CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF
|
||||||
|
# CONFIG_PPP_SUPPORT is not set
|
||||||
|
CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5
|
||||||
|
CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
|
||||||
|
CONFIG_ESP32_PTHREAD_STACK_MIN=768
|
||||||
|
# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY is not set
|
||||||
|
# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set
|
||||||
|
CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1=y
|
||||||
|
CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=1
|
||||||
|
CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread"
|
||||||
|
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y
|
||||||
|
# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set
|
||||||
|
# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set
|
||||||
|
CONFIG_IP_LOST_TIMER_INTERVAL=120
|
||||||
|
CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y
|
||||||
|
CONFIG_SUPPORT_TERMIOS=y
|
||||||
|
# End of deprecated options
|
||||||
113
build_flash_cmd.sh
Normal file
113
build_flash_cmd.sh
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
echo
|
||||||
|
echo =================================================================
|
||||||
|
echo Build flash command
|
||||||
|
echo =================================================================
|
||||||
|
# Location of partitions.csv relative to this script
|
||||||
|
partitionsCsv="../partitions.csv"
|
||||||
|
|
||||||
|
# File to output readme instructions to
|
||||||
|
outputReadme="./flash_cmd.txt"
|
||||||
|
|
||||||
|
# File to output bash script to
|
||||||
|
outputBashScript="./writeSequeezeEsp.sh"
|
||||||
|
|
||||||
|
# File to output bat script to
|
||||||
|
outputBatScript="./writeSequeezeEsp.bat"
|
||||||
|
|
||||||
|
# The name of partitions to ignore from partitions.csv
|
||||||
|
paritionsToIgnore=(
|
||||||
|
"nvs"
|
||||||
|
"phy_init"
|
||||||
|
"storage"
|
||||||
|
"coredump"
|
||||||
|
"settings"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Function that maps partition name to actual bin file
|
||||||
|
# defaults to "[PARTION_NAME_FROM_CSV].bin"
|
||||||
|
function partitionNameToBinFile {
|
||||||
|
if [[ "$1" == "otadata" ]]; then
|
||||||
|
echo "ota_data_initial.bin"
|
||||||
|
elif [[ "$1" == "ota_0" || "$1" == "factory" ]]; then
|
||||||
|
echo "squeezelite.bin"
|
||||||
|
else
|
||||||
|
echo $1.bin
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# write parameters for esptool.py
|
||||||
|
writeParameters="$writeParameters write_flash"
|
||||||
|
writeParameters="$writeParameters --flash_mode dio --flash_freq 80m --flash_size detect"
|
||||||
|
|
||||||
|
# bootloader.bin and partitions.bin not in partitions.csv so manually add here
|
||||||
|
partitionsParameters=" 0x1000 bootloader/bootloader.bin"
|
||||||
|
partitionsParameters="$partitionsParameters 0x8000 partitions.bin"
|
||||||
|
|
||||||
|
# ==============================================================================
|
||||||
|
|
||||||
|
# Loop over partitions.csv and add partition bins and offsets to partitionsParameters
|
||||||
|
|
||||||
|
for line in $($IDF_PATH/components/partition_table/gen_esp32part.py --quiet build/partitions.bin | grep '^[^#]')
|
||||||
|
do
|
||||||
|
partitionName=$(echo $line | awk -F',' '{printf "%s", $1}' )
|
||||||
|
partitionOffset=$(echo $line |awk -F',' '{printf "%s", $4}' )
|
||||||
|
partitionFile=$(partitionNameToBinFile $partitionName)
|
||||||
|
|
||||||
|
if [[ " ${paritionsToIgnore[@]} " =~ " ${partitionName} " ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
partitionsParameters="$partitionsParameters $partitionOffset $partitionFile"
|
||||||
|
echo "$partitionsParameters"
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
# Write README Instructions
|
||||||
|
if [ ! -f "$outputReadme" ]; then
|
||||||
|
touch $outputReadme
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "" >> $outputReadme
|
||||||
|
echo "====LINUX====" >> $outputReadme
|
||||||
|
echo "To flash sequeezelite run the following script:" >> $outputReadme
|
||||||
|
echo "$outputBashScript [PORT_HERE] [BAUD_RATE]" >> $outputReadme
|
||||||
|
echo "e.g. $outputBashScript /dev/ttyUSB0 115200" >> $outputReadme
|
||||||
|
echo "" >> $outputReadme
|
||||||
|
echo "====WINDOWS====" >> $outputReadme
|
||||||
|
echo "To flash sequeezelite run the following script:" >> $outputReadme
|
||||||
|
echo "$outputBatScript [PORT_HERE] [BAUD_RATE]" >> $outputReadme
|
||||||
|
echo "e.g. $outputBatScript COM11 115200" >> $outputReadme
|
||||||
|
echo "" >> $outputReadme
|
||||||
|
echo "If you don't know how to run the BAT file with arguments then you can" >> $outputReadme
|
||||||
|
echo "edit the bat file in Notepad. Open the file up and edit the following:" >> $outputReadme
|
||||||
|
echo "Change 'set port=%1' to 'set port=[PORT_HERE]'. E.g. 'set port=COM11'" >> $outputReadme
|
||||||
|
echo "Change 'set baud=%2' to 'set baud=[BAUD_RATE]'. E.g. 'set baud=115200'" >> $outputReadme
|
||||||
|
echo "" >> $outputReadme
|
||||||
|
echo "====MANUAL====" >> $outputReadme
|
||||||
|
echo "Python esptool.py --port [PORT_HERE] --baud [BAUD_RATE] $writeParameters $partitionsParameters" >> $outputReadme
|
||||||
|
|
||||||
|
# Write Linux BASH File
|
||||||
|
if [ ! -f "$outputBashScript" ]; then
|
||||||
|
touch $outputBashScript
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "#!/bin/bash" >> $outputBashScript
|
||||||
|
echo >> $outputBashScript
|
||||||
|
echo "port=\$1" >> $outputBashScript
|
||||||
|
echo "baud=\$2" >> $outputBashScript
|
||||||
|
linuxFlashCommand="Python esptool.py --port \$port --baud \$baud"
|
||||||
|
echo "$linuxFlashCommand $writeParameters $partitionsParameters" >> $outputBashScript
|
||||||
|
|
||||||
|
# Write Windows BAT File
|
||||||
|
if [ ! -f "$outputBatScript" ]; then
|
||||||
|
touch $outputBatScript
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "echo off" >> $outputBatScript
|
||||||
|
echo "" >> $outputBatScript
|
||||||
|
echo "set port=%1" >> $outputBatScript
|
||||||
|
echo "set baud=%2" >> $outputBatScript
|
||||||
|
windowsFlashCommand="Python esptool.py --port %port% --baud %baud%"
|
||||||
|
echo "$windowsFlashCommand $writeParameters $partitionsParameters" >> $outputBatScript
|
||||||
|
|
||||||
10
components/audio/CMakeLists.txt
Normal file
10
components/audio/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
idf_component_register( SRC_DIRS .
|
||||||
|
INCLUDE_DIRS . inc
|
||||||
|
)
|
||||||
|
add_prebuilt_library(esp_processing lib/libesp_processing.a)
|
||||||
|
target_link_libraries(${COMPONENT_LIB} PRIVATE esp_processing)
|
||||||
|
#target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=")
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u pow")
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u cos")
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u sin")
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u sqrt")
|
||||||
3
components/audio/link_helper.c
Normal file
3
components/audio/link_helper.c
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
void dummy_obj() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
set(COMPONENT_SRCS "cmd_i2ctools.c")
|
|
||||||
set(COMPONENT_ADD_INCLUDEDIRS ".")
|
|
||||||
set(COMPONENT_REQUIRES console spi_flash)
|
|
||||||
|
|
||||||
register_component()
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#
|
|
||||||
# Main Makefile. This is basically the same as a component makefile.
|
|
||||||
#
|
|
||||||
COMPONENT_ADD_INCLUDEDIRS := .
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
set(COMPONENT_ADD_INCLUDEDIRS .)
|
|
||||||
|
|
||||||
set(COMPONENT_SRCS "cmd_nvs.c")
|
|
||||||
|
|
||||||
set(COMPONENT_REQUIRES console nvs_flash)
|
|
||||||
|
|
||||||
register_component()
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
set(COMPONENT_ADD_INCLUDEDIRS .)
|
|
||||||
|
|
||||||
set(COMPONENT_SRCS "cmd_system.c")
|
|
||||||
|
|
||||||
set(COMPONENT_REQUIRES console spi_flash)
|
|
||||||
|
|
||||||
register_component()
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#
|
|
||||||
# Component Makefile
|
|
||||||
#
|
|
||||||
# This Makefile should, at the very least, just include $(SDK_PATH)/Makefile. By default,
|
|
||||||
# this will take the sources in the src/ directory, compile them and link them into
|
|
||||||
# lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable,
|
|
||||||
# please read the SDK documents if you need to do this.
|
|
||||||
#
|
|
||||||
|
|
||||||
COMPONENT_ADD_INCLUDEDIRS := .
|
|
||||||
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/main/
|
|
||||||
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/components/tools/
|
|
||||||
23
components/codecs/CMakeLists.txt
Normal file
23
components/codecs/CMakeLists.txt
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
idf_component_register(
|
||||||
|
INCLUDE_DIRS . ./inc inc/alac inc/FLAC inc/helix-aac inc/mad inc/ogg inc/opus inc/opusfile inc/resample16 inc/soxr inc/vorbis
|
||||||
|
)
|
||||||
|
|
||||||
|
add_prebuilt_library(libmad lib/libmad.a)
|
||||||
|
add_prebuilt_library(libFLAC lib/libFLAC.a )
|
||||||
|
add_prebuilt_library(libhelix-aac lib/libhelix-aac.a )
|
||||||
|
add_prebuilt_library(libvorbisidec lib/libvorbisidec.a )
|
||||||
|
add_prebuilt_library(libogg lib/libogg.a )
|
||||||
|
add_prebuilt_library(libalac lib/libalac.a )
|
||||||
|
add_prebuilt_library(libresample16 lib/libresample16.a )
|
||||||
|
add_prebuilt_library(libopusfile lib/libopusfile.a )
|
||||||
|
add_prebuilt_library(libopus lib/libopus.a )
|
||||||
|
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE libmad)
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE libFLAC)
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE libhelix-aac)
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE libvorbisidec)
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE libogg)
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE libalac)
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE libresample16)
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE libopusfile)
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE libopus)
|
||||||
@@ -35,8 +35,8 @@
|
|||||||
|
|
||||||
#include "export.h"
|
#include "export.h"
|
||||||
|
|
||||||
#include "assert.h"
|
|
||||||
#include "callback.h"
|
#include "callback.h"
|
||||||
|
#include "flac_assert.h"
|
||||||
#include "format.h"
|
#include "format.h"
|
||||||
#include "metadata.h"
|
#include "metadata.h"
|
||||||
#include "ordinals.h"
|
#include "ordinals.h"
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
idf_component_register(SRCS "led.c" "audio_controls.c" "buttons.c" "services.c" "monitor.c"INCLUDE_DIRS
|
|
||||||
INCLUDE_DIRS . ../tools/
|
idf_component_register(SRC_DIRS . core core/ifaces fonts
|
||||||
|
INCLUDE_DIRS . fonts core
|
||||||
|
REQUIRES platform_config tools esp_common
|
||||||
|
PRIV_REQUIRES services freertos driver
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set_source_files_properties(display.c
|
||||||
|
PROPERTIES COMPILE_FLAGS
|
||||||
|
-Wno-format-overflow
|
||||||
|
)
|
||||||
|
|||||||
365
components/display/ILI9341.c
Normal file
365
components/display/ILI9341.c
Normal file
@@ -0,0 +1,365 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2017-2018 Tara Keeling
|
||||||
|
* 2020 Philippe G.
|
||||||
|
*
|
||||||
|
* This software is released under the MIT License.
|
||||||
|
* https://opensource.org/licenses/MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "freertos/FreeRTOS.h"
|
||||||
|
#include "freertos/task.h"
|
||||||
|
#include "driver/gpio.h"
|
||||||
|
|
||||||
|
#include <esp_heap_caps.h>
|
||||||
|
#include <esp_log.h>
|
||||||
|
|
||||||
|
#include "gds.h"
|
||||||
|
#include "gds_private.h"
|
||||||
|
|
||||||
|
//#define SHADOW_BUFFER
|
||||||
|
#define PAGE_BLOCK 1024
|
||||||
|
|
||||||
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
|
|
||||||
|
static char TAG[] = "ILI9341";
|
||||||
|
|
||||||
|
|
||||||
|
#define L1_CMD_NOP 0X00
|
||||||
|
#define L1_CMD_SOFTWARE_RESET 0X01
|
||||||
|
#define L1_CMD_READ_DISPLAY_IDENTIFICATION_INFORMATION 0X04
|
||||||
|
#define L1_CMD_READ_DISPLAY_STATUS 0X09
|
||||||
|
#define L1_CMD_READ_DISPLAY_POWER_MODE 0X0A
|
||||||
|
#define L1_CMD_READ_DISPLAY_MADCTL 0X0B
|
||||||
|
#define L1_CMD_READ_DISPLAY_PIXEL_FORMAT 0X0C
|
||||||
|
#define L1_CMD_READ_DISPLAY_IMAGE_FORMAT 0X0D
|
||||||
|
#define L1_CMD_READ_DISPLAY_SIGNAL_MODE 0X0E
|
||||||
|
#define L1_CMD_READ_DISPLAY_SELF_DIAGNOSTIC_RESULT 0X0F
|
||||||
|
#define L1_CMD_ENTER_SLEEP_MODE 0X10
|
||||||
|
#define L1_CMD_SLEEP_OUT 0X11
|
||||||
|
#define L1_CMD_PARTIAL_MODE_ON 0X12
|
||||||
|
#define L1_CMD_NORMAL_DISPLAY_MODE_ON 0X13
|
||||||
|
#define L1_CMD_DISPLAY_INVERSION_OFF 0X20
|
||||||
|
#define L1_CMD_DISPLAY_INVERSION_ON 0X21
|
||||||
|
#define L1_CMD_GAMMA_SET 0X26
|
||||||
|
#define L1_CMD_DISPLAY_OFF 0X28
|
||||||
|
#define L1_CMD_DISPLAY_ON 0X29
|
||||||
|
#define L1_CMD_COLUMN_ADDRESS_SET 0X2A
|
||||||
|
#define L1_CMD_PAGE_ADDRESS_SET 0X2B
|
||||||
|
#define L1_CMD_MEMORY_WRITE 0X2C
|
||||||
|
#define L1_CMD_COLOR_SET 0X2D
|
||||||
|
#define L1_CMD_MEMORY_READ 0X2E
|
||||||
|
#define L1_CMD_PARTIAL_AREA 0X30
|
||||||
|
#define L1_CMD_VERTICAL_SCROLLING_DEFINITION 0X33
|
||||||
|
#define L1_CMD_TEARING_EFFECT_LINE_OFF 0X34
|
||||||
|
#define L1_CMD_TEARING_EFFECT_LINE_ON 0X35
|
||||||
|
#define L1_CMD_MEMORY_ACCESS_CONTROL 0X36
|
||||||
|
#define L1_CMD_VERTICAL_SCROLLING_START_ADDRESS 0X37
|
||||||
|
#define L1_CMD_IDLE_MODE_OFF 0X38
|
||||||
|
#define L1_CMD_IDLE_MODE_ON 0X39
|
||||||
|
#define L1_CMD_COLMOD_PIXEL_FORMAT_SET 0X3A
|
||||||
|
#define L1_CMD_WRITE_MEMORY_CONTINUE 0X3C
|
||||||
|
#define L1_CMD_READ_MEMORY_CONTINUE 0X3E
|
||||||
|
#define L1_CMD_SET_TEAR_SCANLINE 0X44
|
||||||
|
#define L1_CMD_GET_SCANLINE 0X45
|
||||||
|
#define L1_CMD_WRITE_DISPLAY_BRIGHTNESS 0X51
|
||||||
|
#define L1_CMD_READ_DISPLAY_BRIGHTNESS 0X52
|
||||||
|
#define L1_CMD_WRITE_CTRL_DISPLAY 0X53
|
||||||
|
#define L1_CMD_READ_CTRL_DISPLAY 0X54
|
||||||
|
#define L1_CMD_WRITE_CONTENT_ADAPTIVE_BRIGHTNESS_CONTROL 0X55
|
||||||
|
#define L1_CMD_READ_CONTENT_ADAPTIVE_BRIGHTNESS_CONTROL 0X56
|
||||||
|
#define L1_CMD_WRITE_CABC_MINIMUM_BRIGHTNESS 0X5E
|
||||||
|
#define L1_CMD_READ_CABC_MINIMUM_BRIGHTNESS 0X5F
|
||||||
|
#define L1_CMD_READ_ID1 0XDA
|
||||||
|
#define L1_CMD_READ_ID2 0XDB
|
||||||
|
#define L1_CMD_READ_ID3 0XDC
|
||||||
|
|
||||||
|
#define L2_CMD_RGB_INTERFACE_SIGNAL_CONTROL 0XB0
|
||||||
|
#define L2_CMD_FRAME_RATE_CONTROL_IN_NORMAL_MODE_FULL_COLORS 0XB1
|
||||||
|
#define L2_CMD_FRAME_RATE_CONTROL_IN_IDLE_MODE_8_COLORS 0XB2
|
||||||
|
#define L2_CMD_FRAME_RATE_CONTROL_IN_PARTIAL_MODE_FULL_COLORS 0XB3
|
||||||
|
#define L2_CMD_DISPLAY_INVERSION_CONTROL 0XB4
|
||||||
|
#define L2_CMD_BLANKING_PORCH_CONTROL 0XB5
|
||||||
|
#define L2_CMD_DISPLAY_FUNCTION_CONTROL 0XB6
|
||||||
|
#define L2_CMD_ENTRY_MODE_SET 0XB7
|
||||||
|
#define L2_CMD_BACKLIGHT_CONTROL_1 0XB8
|
||||||
|
#define L2_CMD_BACKLIGHT_CONTROL_2 0XB9
|
||||||
|
#define L2_CMD_BACKLIGHT_CONTROL_3 0XBA
|
||||||
|
#define L2_CMD_BACKLIGHT_CONTROL_4 0XBB
|
||||||
|
#define L2_CMD_BACKLIGHT_CONTROL_5 0XBC
|
||||||
|
#define L2_CMD_BACKLIGHT_CONTROL_7 0XBE
|
||||||
|
#define L2_CMD_BACKLIGHT_CONTROL_8 0XBF
|
||||||
|
#define L2_CMD_POWER_CONTROL_1 0XC0
|
||||||
|
#define L2_CMD_POWER_CONTROL_2 0XC1
|
||||||
|
#define L2_CMD_VCOM_CONTROL_1 0XC5
|
||||||
|
#define L2_CMD_VCOM_CONTROL_2 0XC7
|
||||||
|
#define L2_CMD_NV_MEMORY_WRITE 0XD0
|
||||||
|
#define L2_CMD_NV_MEMORY_PROTECTION_KEY 0XD1
|
||||||
|
#define L2_CMD_NV_MEMORY_STATUS_READ 0XD2
|
||||||
|
#define L2_CMD_READ_ID4 0XD3
|
||||||
|
#define L2_CMD_POSITIVE_GAMMA_CORRECTION 0XE0
|
||||||
|
#define L2_CMD_NEGATIVE_GAMMA_CORRECTION 0XE1
|
||||||
|
#define L2_CMD_DIGITAL_GAMMA_CONTROL_1 0XE2
|
||||||
|
#define L2_CMD_DIGITAL_GAMMA_CONTROL_2 0XE3
|
||||||
|
#define L2_CMD_INTERFACE_CONTROL 0XF6
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
The LCD needs a bunch of command/argument values to be initialized. They are stored in this struct.
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
uint8_t cmd;
|
||||||
|
uint8_t data[16];
|
||||||
|
uint8_t databytes; //No of data in data; bit 7 = delay after set; 0xFF = end of cmds.
|
||||||
|
} lcd_init_cmd_t;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static const lcd_init_cmd_t ili_init_cmds[]={
|
||||||
|
/* Power contorl B, power control = 0, DC_ENA = 1 */
|
||||||
|
{0xCF, {0x00, 0x83, 0X30}, 3},
|
||||||
|
/* Power on sequence control,
|
||||||
|
* cp1 keeps 1 frame, 1st frame enable
|
||||||
|
* vcl = 0, ddvdh=3, vgh=1, vgl=2
|
||||||
|
* DDVDH_ENH=1
|
||||||
|
*/
|
||||||
|
{0xED, {0x64, 0x03, 0X12, 0X81}, 4},
|
||||||
|
/* Driver timing control A,
|
||||||
|
* non-overlap=default +1
|
||||||
|
* EQ=default - 1, CR=default
|
||||||
|
* pre-charge=default - 1
|
||||||
|
*/
|
||||||
|
{0xE8, {0x85, 0x01, 0x79}, 3},
|
||||||
|
/* Power control A, Vcore=1.6V, DDVDH=5.6V */
|
||||||
|
{0xCB, {0x39, 0x2C, 0x00, 0x34, 0x02}, 5},
|
||||||
|
/* Pump ratio control, DDVDH=2xVCl */
|
||||||
|
{0xF7, {0x20}, 1},
|
||||||
|
/* Driver timing control, all=0 unit */
|
||||||
|
{0xEA, {0x00, 0x00}, 2},
|
||||||
|
/* Power control 1, GVDD=4.75V */
|
||||||
|
{0xC0, {0x26}, 1},
|
||||||
|
/* Power control 2, DDVDH=VCl*2, VGH=VCl*7, VGL=-VCl*3 */
|
||||||
|
{0xC1, {0x11}, 1},
|
||||||
|
/* VCOM control 1, VCOMH=4.025V, VCOML=-0.950V */
|
||||||
|
{0xC5, {0x35, 0x3E}, 2},
|
||||||
|
/* VCOM control 2, VCOMH=VMH-2, VCOML=VML-2 */
|
||||||
|
{0xC7, {0xBE}, 1},
|
||||||
|
/* Memory access contorl, MX=MY=0, MV=1, ML=0, BGR=1, MH=0 */
|
||||||
|
{0x36, {0x28}, 1},
|
||||||
|
/* Pixel format, 16bits/pixel for RGB/MCU interface */
|
||||||
|
{0x3A, {0x55}, 1},
|
||||||
|
/* Frame rate control, f=fosc, 70Hz fps */
|
||||||
|
{0xB1, {0x00, 0x1B}, 2},
|
||||||
|
/* Enable 3G, disabled */
|
||||||
|
{0xF2, {0x08}, 1},
|
||||||
|
/* Gamma set, curve 1 */
|
||||||
|
{0x26, {0x01}, 1},
|
||||||
|
/* Positive gamma correction */
|
||||||
|
{0xE0, {0x1F, 0x1A, 0x18, 0x0A, 0x0F, 0x06, 0x45, 0X87, 0x32, 0x0A, 0x07, 0x02, 0x07, 0x05, 0x00}, 15},
|
||||||
|
/* Negative gamma correction */
|
||||||
|
{0XE1, {0x00, 0x25, 0x27, 0x05, 0x10, 0x09, 0x3A, 0x78, 0x4D, 0x05, 0x18, 0x0D, 0x38, 0x3A, 0x1F}, 15},
|
||||||
|
/* Column address set, SC=0, EC=0xEF */
|
||||||
|
{0x2A, {0x00, 0x00, 0x00, 0xEF}, 4},
|
||||||
|
/* Page address set, SP=0, EP=0x013F */
|
||||||
|
{0x2B, {0x00, 0x00, 0x01, 0x3f}, 4},
|
||||||
|
/* Memory write */
|
||||||
|
{0x2C, {0}, 0},
|
||||||
|
/* Entry mode set, Low vol detect disabled, normal display */
|
||||||
|
{0xB7, {0x07}, 1},
|
||||||
|
/* Display function control */
|
||||||
|
{0xB6, {0x0A, 0x82, 0x27, 0x00}, 4},
|
||||||
|
/* Sleep out */
|
||||||
|
{0x11, {0}, 0x80},
|
||||||
|
/* Display on */
|
||||||
|
{0x29, {0}, 0x80},
|
||||||
|
{0, {0}, 0xff},
|
||||||
|
};
|
||||||
|
|
||||||
|
//To speed up transfers, every SPI transfer sends a bunch of lines. This define specifies how many. More means more memory use,
|
||||||
|
//but less overhead for setting up / finishing transfers. Make sure 240 is dividable by this.
|
||||||
|
#define PARALLEL_LINES 16
|
||||||
|
|
||||||
|
struct PrivateSpace {
|
||||||
|
uint8_t *iRAM, *Shadowbuffer;
|
||||||
|
uint8_t ReMap, PageSize;
|
||||||
|
uint8_t Offset;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Functions are not declared to minimize # of lines
|
||||||
|
|
||||||
|
static void WriteDataByte( struct GDS_Device* Device, uint8_t Data ) {
|
||||||
|
Device->WriteData( Device, &Data, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void SetColumnAddress( struct GDS_Device* Device, uint8_t Start, uint8_t End ) {
|
||||||
|
Device->WriteCommand( Device, L1_CMD_COLUMN_ADDRESS_SET );
|
||||||
|
Device->WriteData( Device, &Start, 1 );
|
||||||
|
Device->WriteData( Device, &End, 1 );
|
||||||
|
}
|
||||||
|
static void SetRowAddress( struct GDS_Device* Device, uint8_t Start, uint8_t End ) {
|
||||||
|
Device->WriteCommand( Device, L1_CMD_PAGE_ADDRESS_SET );
|
||||||
|
Device->WriteData( Device, &Start, 1 );
|
||||||
|
Device->WriteData( Device, &End, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void Update( struct GDS_Device* Device ) {
|
||||||
|
struct PrivateSpace *Private = (struct PrivateSpace*) Device->Private;
|
||||||
|
|
||||||
|
//SetColumnAddress( Device, Private->Offset, Private->Offset + Device->Width / 4 - 1);
|
||||||
|
SetColumnAddress( Device, Private->Offset, Private->Offset + Device->Width - 1);
|
||||||
|
|
||||||
|
#ifdef SHADOW_BUFFER
|
||||||
|
uint16_t *optr = (uint16_t*) Private->Shadowbuffer, *iptr = (uint16_t*) Device->Framebuffer;
|
||||||
|
bool dirty = false;
|
||||||
|
|
||||||
|
for (int r = 0, page = 0; r < Device->Height; r++) {
|
||||||
|
// look for change and update shadow (cheap optimization = width always / by 2)
|
||||||
|
for (int c = Device->Width / 2 / 2; --c >= 0;) {
|
||||||
|
if (*optr != *iptr) {
|
||||||
|
dirty = true;
|
||||||
|
*optr = *iptr;
|
||||||
|
}
|
||||||
|
iptr++; optr++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// one line done, check for page boundary
|
||||||
|
if (++page == Private->PageSize) {
|
||||||
|
if (dirty) {
|
||||||
|
uint16_t *optr = (uint16_t*) Private->iRAM, *iptr = (uint16_t*) (Private->Shadowbuffer + (r - page + 1) * Device->Width / 2);
|
||||||
|
SetRowAddress( Device, r - page + 1, r );
|
||||||
|
for (int i = page * Device->Width / 2 / 2; --i >= 0; iptr++) *optr++ = (*iptr >> 8) | (*iptr << 8);
|
||||||
|
//memcpy(Private->iRAM, Private->Shadowbuffer + (r - page + 1) * Device->Width / 2, page * Device->Width / 2 );
|
||||||
|
Device->WriteCommand( Device, 0x5c );
|
||||||
|
Device->WriteData( Device, Private->iRAM, Device->Width * page / 2 );
|
||||||
|
dirty = false;
|
||||||
|
}
|
||||||
|
page = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
for (int r = 0; r < Device->Height; r += Private->PageSize) {
|
||||||
|
SetRowAddress( Device, r, r + Private->PageSize - 1 );
|
||||||
|
Device->WriteCommand( Device, L1_CMD_MEMORY_WRITE );
|
||||||
|
if (Private->iRAM) {
|
||||||
|
uint16_t *optr = (uint16_t*) Private->iRAM, *iptr = (uint16_t*) (Device->Framebuffer + r * Device->Width / 2);
|
||||||
|
for (int i = Private->PageSize * Device->Width / 2 / 2; --i >= 0; iptr++) *optr++ = (*iptr >> 8) | (*iptr << 8);
|
||||||
|
//memcpy(Private->iRAM, Device->Framebuffer + r * Device->Width / 2, Private->PageSize * Device->Width / 2 );
|
||||||
|
Device->WriteData( Device, Private->iRAM, Private->PageSize * Device->Width / 2 );
|
||||||
|
} else {
|
||||||
|
Device->WriteData( Device, Device->Framebuffer + r * Device->Width / 2, Private->PageSize * Device->Width / 2 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
//Bit Name Description
|
||||||
|
//--- --------------------------- ------------------------------------------------------
|
||||||
|
//MY Row Address Order MCU to memory write/read direction.
|
||||||
|
//MX Column Address Order MCU to memory write/read direction.
|
||||||
|
//MV Row / Column Exchange MCU to memory write/read direction.
|
||||||
|
//ML Vertical Refresh Order LCD vertical refresh direction control.
|
||||||
|
//BGR RGB-BGR Order Color selector switch control
|
||||||
|
// (0=RGB color filter panel, 1=BGR color filter panel)
|
||||||
|
//MH Horizontal Refresh ORDER LCD horizontal refreshing direction control.
|
||||||
|
// Bits 17-0
|
||||||
|
// XX XX XX XX XX XX XX XX XX XX MY MX MV ML BGR MH 0 0
|
||||||
|
typedef enum {
|
||||||
|
MAC_BIT_MH=2,
|
||||||
|
MAC_BIT_BGR,
|
||||||
|
MAC_BIT_ML,
|
||||||
|
MAC_BIT_MV,
|
||||||
|
MAC_BIT_MX,
|
||||||
|
MAC_BIT_MY,
|
||||||
|
} mac_bits;
|
||||||
|
|
||||||
|
uint16_t set_mac_bit(mac_bits bit, uint16_t val){
|
||||||
|
return (1 << bit) | val;
|
||||||
|
}
|
||||||
|
uint16_t unset_mac_bit(mac_bits bit, uint16_t val){
|
||||||
|
return ~(1 << bit) & val;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void SetLayout( struct GDS_Device* Device, bool HFlip, bool VFlip, bool Rotate ) {
|
||||||
|
struct PrivateSpace *Private = (struct PrivateSpace*) Device->Private;
|
||||||
|
Private->ReMap = HFlip ? (Private->ReMap & ~(1 << MAC_BIT_MX)) : (Private->ReMap | (1 << MAC_BIT_MX));
|
||||||
|
Private->ReMap = VFlip ? (Private->ReMap | (1 << MAC_BIT_MY)) : (Private->ReMap & ~(1 << MAC_BIT_MY));
|
||||||
|
Device->WriteCommand( Device, L1_CMD_MEMORY_ACCESS_CONTROL );
|
||||||
|
Device->WriteData( Device, &Private->ReMap, 1 );
|
||||||
|
WriteDataByte(Device,0x00);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void DisplayOn( struct GDS_Device* Device ) { Device->WriteCommand( Device, L1_CMD_DISPLAY_ON ); }
|
||||||
|
static void DisplayOff( struct GDS_Device* Device ) { Device->WriteCommand( Device, L1_CMD_DISPLAY_OFF ); }
|
||||||
|
|
||||||
|
static void SetContrast( struct GDS_Device* Device, uint8_t Contrast ) {
|
||||||
|
Device->WriteCommand( Device, L1_CMD_WRITE_DISPLAY_BRIGHTNESS );
|
||||||
|
uint8_t loc_contrast = (uint8_t)((float)Contrast/5.0f* 255.0f);
|
||||||
|
Device->WriteData( Device, &loc_contrast , 1 );
|
||||||
|
WriteDataByte(Device,0x00);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool Init( struct GDS_Device* Device ) {
|
||||||
|
struct PrivateSpace *Private = (struct PrivateSpace*) Device->Private;
|
||||||
|
|
||||||
|
|
||||||
|
// Private->Offset = (480 - Device->Width) / 4 / 2;
|
||||||
|
|
||||||
|
// find a page size that is not too small is an integer of height
|
||||||
|
Private->PageSize = min(8, PAGE_BLOCK / (Device->Width / 2));
|
||||||
|
Private->PageSize = Device->Height / (Device->Height / Private->PageSize) ;
|
||||||
|
|
||||||
|
#ifdef SHADOW_BUFFER
|
||||||
|
// Private->Shadowbuffer = malloc( Device->FramebufferSize );
|
||||||
|
// memset(Private->Shadowbuffer, 0xFF, Device->FramebufferSize);
|
||||||
|
#endif
|
||||||
|
Private->iRAM =NULL;
|
||||||
|
//Private->iRAM =heap_caps_malloc(320*PARALLEL_LINES*sizeof(uint16_t), MALLOC_CAP_DMA);
|
||||||
|
|
||||||
|
|
||||||
|
//ESP_LOGI(TAG, "ILI9341 with offset %u, page %u, iRAM %p", Private->Offset, Private->PageSize, Private->iRAM);
|
||||||
|
ESP_LOGI(TAG, "ILI9341 ");
|
||||||
|
|
||||||
|
// need to be off and disable display RAM
|
||||||
|
Device->DisplayOff( Device );
|
||||||
|
int cmd=0;
|
||||||
|
//Send all the commands
|
||||||
|
while (ili_init_cmds[cmd].databytes!=0xff) {
|
||||||
|
Device->WriteCommand( Device, ili_init_cmds[cmd].cmd );
|
||||||
|
Device->WriteData(Device,ili_init_cmds[cmd].data,ili_init_cmds[cmd].databytes&0x1F);
|
||||||
|
if (ili_init_cmds[cmd].databytes&0x80) {
|
||||||
|
vTaskDelay(100 / portTICK_RATE_MS);
|
||||||
|
}
|
||||||
|
cmd++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// gone with the wind
|
||||||
|
Device->DisplayOn( Device );
|
||||||
|
Device->Update( Device );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct GDS_Device ILI9341 = {
|
||||||
|
.DisplayOn = DisplayOn, .DisplayOff = DisplayOff, .SetContrast = SetContrast,
|
||||||
|
.SetLayout = SetLayout,
|
||||||
|
.Update = Update, .Init = Init,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct GDS_Device* ILI9341_Detect(char *Driver, struct GDS_Device* Device) {
|
||||||
|
if (!strcasestr(Driver, "ILI9341")) return NULL;
|
||||||
|
|
||||||
|
if (!Device) Device = calloc(1, sizeof(struct GDS_Device));
|
||||||
|
|
||||||
|
*Device = ILI9341;
|
||||||
|
Device->Depth = 4;
|
||||||
|
|
||||||
|
return Device;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "globdefs.h"
|
#include "globdefs.h"
|
||||||
#include "config.h"
|
#include "platform_config.h"
|
||||||
#include "tools.h"
|
#include "tools.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "gds.h"
|
#include "gds.h"
|
||||||
@@ -45,6 +45,17 @@ static EXT_RAM_ATTR struct {
|
|||||||
TickType_t tick;
|
TickType_t tick;
|
||||||
} displayer;
|
} displayer;
|
||||||
|
|
||||||
|
static const char *known_drivers[] = {"SH1106",
|
||||||
|
"SSD1306",
|
||||||
|
"SSD1322",
|
||||||
|
"SSD1326",
|
||||||
|
"SSD1327",
|
||||||
|
"SSD1675",
|
||||||
|
"SSD1351",
|
||||||
|
"ST77xx",
|
||||||
|
"ILI9341",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
static void displayer_task(void *args);
|
static void displayer_task(void *args);
|
||||||
|
|
||||||
struct GDS_Device *display;
|
struct GDS_Device *display;
|
||||||
@@ -365,4 +376,47 @@ void displayer_control(enum displayer_cmd_e cmd, ...) {
|
|||||||
|
|
||||||
xSemaphoreGive(displayer.mutex);
|
xSemaphoreGive(displayer.mutex);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
bool display_is_valid_driver(char * driver){
|
||||||
|
return display_conf_get_driver_name(driver)!=NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
const char *display_conf_get_driver_name(char * driver){
|
||||||
|
for(uint8_t i=0;known_drivers[i]!=NULL && strlen(known_drivers[i])>0;i++ ){
|
||||||
|
if(strcasestr(driver,known_drivers[i])){
|
||||||
|
return known_drivers[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
char * display_get_supported_drivers(void){
|
||||||
|
int total_size = 1;
|
||||||
|
char * supported_drivers=NULL;
|
||||||
|
const char * separator = "|";
|
||||||
|
int separator_len = strlen(separator);
|
||||||
|
|
||||||
|
for(uint8_t i=0;known_drivers[i]!=NULL && strlen(known_drivers[i])>0;i++ ){
|
||||||
|
total_size += strlen(known_drivers[i])+separator_len;
|
||||||
|
}
|
||||||
|
total_size+=2;
|
||||||
|
supported_drivers = malloc(total_size);
|
||||||
|
memset(supported_drivers,0x00,total_size);
|
||||||
|
strcat(supported_drivers,"<");
|
||||||
|
for(uint8_t i=0;known_drivers[i]!=NULL && strlen(known_drivers[i])>0;i++ ){
|
||||||
|
supported_drivers = strcat(supported_drivers,known_drivers[i]);
|
||||||
|
supported_drivers = strcat(supported_drivers,separator);
|
||||||
|
}
|
||||||
|
strcat(supported_drivers,">");
|
||||||
|
return supported_drivers;
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include "gds.h"
|
#include "gds.h"
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The displayer is not thread-safe and the caller must ensure use its own
|
The displayer is not thread-safe and the caller must ensure use its own
|
||||||
mutexes if it wants something better. Especially, text() line() and draw()
|
mutexes if it wants something better. Especially, text() line() and draw()
|
||||||
@@ -31,8 +32,11 @@ enum displayer_time_e { DISPLAYER_ELAPSED, DISPLAYER_REMAINING };
|
|||||||
|
|
||||||
enum display_bus_cmd_e { DISPLAY_BUS_TAKE, DISPLAY_BUS_GIVE };
|
enum display_bus_cmd_e { DISPLAY_BUS_TAKE, DISPLAY_BUS_GIVE };
|
||||||
bool (*display_bus)(void *from, enum display_bus_cmd_e cmd);
|
bool (*display_bus)(void *from, enum display_bus_cmd_e cmd);
|
||||||
|
const char *display_conf_get_driver_name(char * driver);
|
||||||
|
bool display_is_valid_driver(char * driver);
|
||||||
|
|
||||||
void displayer_scroll(char *string, int speed, int pause);
|
void displayer_scroll(char *string, int speed, int pause);
|
||||||
void displayer_control(enum displayer_cmd_e cmd, ...);
|
void displayer_control(enum displayer_cmd_e cmd, ...);
|
||||||
void displayer_metadata(char *artist, char *album, char *title);
|
void displayer_metadata(char *artist, char *album, char *title);
|
||||||
void displayer_timer(enum displayer_time_e mode, int elapsed, int duration);
|
void displayer_timer(enum displayer_time_e mode, int elapsed, int duration);
|
||||||
|
char * display_get_supported_drivers(void);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
idf_component_register(SRCS "bt_app_core.c" "bt_app_sink.c" "bt_app_source.c"
|
idf_component_register( SRC_DIRS .
|
||||||
INCLUDE_DIRS "." "../tools/"
|
INCLUDE_DIRS .
|
||||||
REQUIRES esp_common
|
PRIV_REQUIRES services bt display console tools platform_config
|
||||||
PRIV_REQUIRES freertos bt io nvs_flash esp32 spi_flash newlib log console pthread
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,9 @@
|
|||||||
CONDITIONS OF ANY KIND, either express or implied.
|
CONDITIONS OF ANY KIND, either express or implied.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include "bt_app_core.h"
|
#include "bt_app_core.h"
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "esp_a2dp_api.h"
|
#include "esp_a2dp_api.h"
|
||||||
#include "esp_avrc_api.h"
|
#include "esp_avrc_api.h"
|
||||||
#include "nvs.h"
|
#include "nvs.h"
|
||||||
#include "config.h"
|
#include "platform_config.h"
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
@@ -92,7 +92,7 @@ static void bt_volume_up(bool pressed) {
|
|||||||
// volume UP/DOWN buttons are not supported by iPhone/Android
|
// volume UP/DOWN buttons are not supported by iPhone/Android
|
||||||
volume_set_by_local_host(s_volume < 127-3 ? s_volume + 3 : 127);
|
volume_set_by_local_host(s_volume < 127-3 ? s_volume + 3 : 127);
|
||||||
(*bt_app_a2d_cmd_cb)(BT_SINK_VOLUME, s_volume);
|
(*bt_app_a2d_cmd_cb)(BT_SINK_VOLUME, s_volume);
|
||||||
ESP_LOGI(BT_AV_TAG, "BT volume up %u", s_volume);
|
ESP_LOGD(BT_AV_TAG, "BT volume up %u", s_volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bt_volume_down(bool pressed) {
|
static void bt_volume_down(bool pressed) {
|
||||||
@@ -148,7 +148,7 @@ void bt_disconnect(void) {
|
|||||||
displayer_control(DISPLAYER_SHUTDOWN);
|
displayer_control(DISPLAYER_SHUTDOWN);
|
||||||
if (s_audio == AUDIO_PLAYING) esp_avrc_ct_send_passthrough_cmd(tl++ & 0x0f, ESP_AVRC_PT_CMD_STOP, ESP_AVRC_PT_CMD_STATE_PRESSED);
|
if (s_audio == AUDIO_PLAYING) esp_avrc_ct_send_passthrough_cmd(tl++ & 0x0f, ESP_AVRC_PT_CMD_STOP, ESP_AVRC_PT_CMD_STATE_PRESSED);
|
||||||
actrls_unset();
|
actrls_unset();
|
||||||
ESP_LOGI(BT_AV_TAG, "forced disconnection %d", s_audio);
|
ESP_LOGD(BT_AV_TAG, "forced disconnection %d", s_audio);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update metadata if any */
|
/* update metadata if any */
|
||||||
@@ -277,7 +277,7 @@ static void bt_av_hdl_a2d_evt(uint16_t event, void *p_param)
|
|||||||
case ESP_A2D_CONNECTION_STATE_EVT: {
|
case ESP_A2D_CONNECTION_STATE_EVT: {
|
||||||
a2d = (esp_a2d_cb_param_t *)(p_param);
|
a2d = (esp_a2d_cb_param_t *)(p_param);
|
||||||
uint8_t *bda = a2d->conn_stat.remote_bda;
|
uint8_t *bda = a2d->conn_stat.remote_bda;
|
||||||
ESP_LOGI(BT_AV_TAG, "A2DP connection state: %s, [%02x:%02x:%02x:%02x:%02x:%02x]",
|
ESP_LOGD(BT_AV_TAG, "A2DP connection state: %s, [%02x:%02x:%02x:%02x:%02x:%02x]",
|
||||||
s_a2d_conn_state_str[a2d->conn_stat.state], bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]);
|
s_a2d_conn_state_str[a2d->conn_stat.state], bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]);
|
||||||
if (a2d->conn_stat.state == ESP_A2D_CONNECTION_STATE_DISCONNECTED) {
|
if (a2d->conn_stat.state == ESP_A2D_CONNECTION_STATE_DISCONNECTED) {
|
||||||
esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_GENERAL_DISCOVERABLE);
|
esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_GENERAL_DISCOVERABLE);
|
||||||
@@ -290,7 +290,7 @@ static void bt_av_hdl_a2d_evt(uint16_t event, void *p_param)
|
|||||||
}
|
}
|
||||||
case ESP_A2D_AUDIO_STATE_EVT: {
|
case ESP_A2D_AUDIO_STATE_EVT: {
|
||||||
a2d = (esp_a2d_cb_param_t *)(p_param);
|
a2d = (esp_a2d_cb_param_t *)(p_param);
|
||||||
ESP_LOGI(BT_AV_TAG, "A2DP audio state: %s", s_a2d_audio_state_str[a2d->audio_stat.state]);
|
ESP_LOGD(BT_AV_TAG, "A2DP audio state: %s", s_a2d_audio_state_str[a2d->audio_stat.state]);
|
||||||
|
|
||||||
if (ESP_A2D_AUDIO_STATE_STARTED == a2d->audio_stat.state) {
|
if (ESP_A2D_AUDIO_STATE_STARTED == a2d->audio_stat.state) {
|
||||||
s_audio = AUDIO_CONNECTED;
|
s_audio = AUDIO_CONNECTED;
|
||||||
@@ -320,7 +320,7 @@ static void bt_av_hdl_a2d_evt(uint16_t event, void *p_param)
|
|||||||
}
|
}
|
||||||
case ESP_A2D_AUDIO_CFG_EVT: {
|
case ESP_A2D_AUDIO_CFG_EVT: {
|
||||||
a2d = (esp_a2d_cb_param_t *)(p_param);
|
a2d = (esp_a2d_cb_param_t *)(p_param);
|
||||||
ESP_LOGI(BT_AV_TAG, "A2DP audio stream configuration, codec type %d", a2d->audio_cfg.mcc.type);
|
ESP_LOGD(BT_AV_TAG, "A2DP audio stream configuration, codec type %d", a2d->audio_cfg.mcc.type);
|
||||||
// for now only SBC stream is supported
|
// for now only SBC stream is supported
|
||||||
if (a2d->audio_cfg.mcc.type == ESP_A2D_MCT_SBC) {
|
if (a2d->audio_cfg.mcc.type == ESP_A2D_MCT_SBC) {
|
||||||
s_sample_rate = 16000;
|
s_sample_rate = 16000;
|
||||||
@@ -382,12 +382,12 @@ void bt_av_notify_evt_handler(uint8_t event_id, esp_avrc_rn_param_t *event_param
|
|||||||
{
|
{
|
||||||
switch (event_id) {
|
switch (event_id) {
|
||||||
case ESP_AVRC_RN_TRACK_CHANGE:
|
case ESP_AVRC_RN_TRACK_CHANGE:
|
||||||
ESP_LOGI(BT_AV_TAG, "Track changed");
|
ESP_LOGD(BT_AV_TAG, "Track changed");
|
||||||
bt_av_new_track();
|
bt_av_new_track();
|
||||||
(*bt_app_a2d_cmd_cb)(BT_SINK_PROGRESS, 0, 0);
|
(*bt_app_a2d_cmd_cb)(BT_SINK_PROGRESS, 0, 0);
|
||||||
break;
|
break;
|
||||||
case ESP_AVRC_RN_PLAY_STATUS_CHANGE:
|
case ESP_AVRC_RN_PLAY_STATUS_CHANGE:
|
||||||
ESP_LOGI(BT_AV_TAG, "Playback status changed: 0x%x", event_parameter->playback);
|
ESP_LOGD(BT_AV_TAG, "Playback status changed: 0x%x", event_parameter->playback);
|
||||||
if (s_audio != AUDIO_IDLE) {
|
if (s_audio != AUDIO_IDLE) {
|
||||||
switch (event_parameter->playback) {
|
switch (event_parameter->playback) {
|
||||||
case ESP_AVRC_PLAYBACK_PLAYING:
|
case ESP_AVRC_PLAYBACK_PLAYING:
|
||||||
@@ -410,7 +410,7 @@ void bt_av_notify_evt_handler(uint8_t event_id, esp_avrc_rn_param_t *event_param
|
|||||||
(*bt_app_a2d_cmd_cb)(BT_SINK_STOP);
|
(*bt_app_a2d_cmd_cb)(BT_SINK_STOP);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ESP_LOGI(BT_AV_TAG, "Un-handled event");
|
ESP_LOGW(BT_AV_TAG, "Un-handled event");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -433,7 +433,7 @@ static void bt_av_hdl_avrc_ct_evt(uint16_t event, void *p_param)
|
|||||||
switch (event) {
|
switch (event) {
|
||||||
case ESP_AVRC_CT_CONNECTION_STATE_EVT: {
|
case ESP_AVRC_CT_CONNECTION_STATE_EVT: {
|
||||||
uint8_t *bda = rc->conn_stat.remote_bda;
|
uint8_t *bda = rc->conn_stat.remote_bda;
|
||||||
ESP_LOGI(BT_RC_CT_TAG, "AVRC conn_state evt: state %d, [%02x:%02x:%02x:%02x:%02x:%02x]",
|
ESP_LOGD(BT_RC_CT_TAG, "AVRC conn_state evt: state %d, [%02x:%02x:%02x:%02x:%02x:%02x]",
|
||||||
rc->conn_stat.connected, bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]);
|
rc->conn_stat.connected, bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]);
|
||||||
|
|
||||||
if (rc->conn_stat.connected) {
|
if (rc->conn_stat.connected) {
|
||||||
@@ -446,11 +446,11 @@ static void bt_av_hdl_avrc_ct_evt(uint16_t event, void *p_param)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ESP_AVRC_CT_PASSTHROUGH_RSP_EVT: {
|
case ESP_AVRC_CT_PASSTHROUGH_RSP_EVT: {
|
||||||
ESP_LOGI(BT_RC_CT_TAG, "AVRC passthrough rsp: key_code 0x%x, key_state %d", rc->psth_rsp.key_code, rc->psth_rsp.key_state);
|
ESP_LOGD(BT_RC_CT_TAG, "AVRC passthrough rsp: key_code 0x%x, key_state %d", rc->psth_rsp.key_code, rc->psth_rsp.key_state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ESP_AVRC_CT_METADATA_RSP_EVT: {
|
case ESP_AVRC_CT_METADATA_RSP_EVT: {
|
||||||
ESP_LOGI(BT_RC_CT_TAG, "AVRC metadata rsp: attribute id 0x%x, %s", rc->meta_rsp.attr_id, rc->meta_rsp.attr_text);
|
ESP_LOGD(BT_RC_CT_TAG, "AVRC metadata rsp: attribute id 0x%x, %s", rc->meta_rsp.attr_id, rc->meta_rsp.attr_text);
|
||||||
|
|
||||||
if (rc->meta_rsp.attr_id == ESP_AVRC_MD_ATTR_PLAYING_TIME) s_metadata.duration = atoi((char*) rc->meta_rsp.attr_text);
|
if (rc->meta_rsp.attr_id == ESP_AVRC_MD_ATTR_PLAYING_TIME) s_metadata.duration = atoi((char*) rc->meta_rsp.attr_text);
|
||||||
else if (rc->meta_rsp.attr_id == ESP_AVRC_MD_ATTR_TITLE) strncpy(s_metadata.title, (char*) rc->meta_rsp.attr_text, METADATA_LEN);
|
else if (rc->meta_rsp.attr_id == ESP_AVRC_MD_ATTR_TITLE) strncpy(s_metadata.title, (char*) rc->meta_rsp.attr_text, METADATA_LEN);
|
||||||
@@ -467,11 +467,11 @@ static void bt_av_hdl_avrc_ct_evt(uint16_t event, void *p_param)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ESP_AVRC_CT_REMOTE_FEATURES_EVT: {
|
case ESP_AVRC_CT_REMOTE_FEATURES_EVT: {
|
||||||
ESP_LOGI(BT_RC_CT_TAG, "AVRC remote features %x, TG features %x", rc->rmt_feats.feat_mask, rc->rmt_feats.tg_feat_flag);
|
ESP_LOGD(BT_RC_CT_TAG, "AVRC remote features %x, TG features %x", rc->rmt_feats.feat_mask, rc->rmt_feats.tg_feat_flag);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ESP_AVRC_CT_GET_RN_CAPABILITIES_RSP_EVT: {
|
case ESP_AVRC_CT_GET_RN_CAPABILITIES_RSP_EVT: {
|
||||||
ESP_LOGI(BT_RC_CT_TAG, "remote rn_cap: count %d, bitmask 0x%x", rc->get_rn_caps_rsp.cap_count,
|
ESP_LOGD(BT_RC_CT_TAG, "remote rn_cap: count %d, bitmask 0x%x", rc->get_rn_caps_rsp.cap_count,
|
||||||
rc->get_rn_caps_rsp.evt_set.bits);
|
rc->get_rn_caps_rsp.evt_set.bits);
|
||||||
s_avrc_peer_rn_cap.bits = rc->get_rn_caps_rsp.evt_set.bits;
|
s_avrc_peer_rn_cap.bits = rc->get_rn_caps_rsp.evt_set.bits;
|
||||||
bt_av_new_track();
|
bt_av_new_track();
|
||||||
@@ -487,7 +487,7 @@ static void bt_av_hdl_avrc_ct_evt(uint16_t event, void *p_param)
|
|||||||
|
|
||||||
static void volume_set_by_controller(uint8_t volume)
|
static void volume_set_by_controller(uint8_t volume)
|
||||||
{
|
{
|
||||||
ESP_LOGI(BT_RC_TG_TAG, "Volume is set by remote controller %d%%\n", (uint32_t)volume * 100 / 0x7f);
|
ESP_LOGD(BT_RC_TG_TAG, "Volume is set by remote controller %d%%\n", (uint32_t)volume * 100 / 0x7f);
|
||||||
_lock_acquire(&s_volume_lock);
|
_lock_acquire(&s_volume_lock);
|
||||||
s_volume = volume;
|
s_volume = volume;
|
||||||
_lock_release(&s_volume_lock);
|
_lock_release(&s_volume_lock);
|
||||||
@@ -496,7 +496,7 @@ static void volume_set_by_controller(uint8_t volume)
|
|||||||
|
|
||||||
static void volume_set_by_local_host(uint8_t volume)
|
static void volume_set_by_local_host(uint8_t volume)
|
||||||
{
|
{
|
||||||
ESP_LOGI(BT_RC_TG_TAG, "Volume is set locally to: %d%%", (uint32_t)volume * 100 / 0x7f);
|
ESP_LOGD(BT_RC_TG_TAG, "Volume is set locally to: %d%%", (uint32_t)volume * 100 / 0x7f);
|
||||||
_lock_acquire(&s_volume_lock);
|
_lock_acquire(&s_volume_lock);
|
||||||
s_volume = volume;
|
s_volume = volume;
|
||||||
_lock_release(&s_volume_lock);
|
_lock_release(&s_volume_lock);
|
||||||
@@ -516,21 +516,21 @@ static void bt_av_hdl_avrc_tg_evt(uint16_t event, void *p_param)
|
|||||||
switch (event) {
|
switch (event) {
|
||||||
case ESP_AVRC_TG_CONNECTION_STATE_EVT: {
|
case ESP_AVRC_TG_CONNECTION_STATE_EVT: {
|
||||||
uint8_t *bda = rc->conn_stat.remote_bda;
|
uint8_t *bda = rc->conn_stat.remote_bda;
|
||||||
ESP_LOGI(BT_RC_TG_TAG, "AVRC conn_state evt: state %d, [%02x:%02x:%02x:%02x:%02x:%02x]",
|
ESP_LOGD(BT_RC_TG_TAG, "AVRC conn_state evt: state %d, [%02x:%02x:%02x:%02x:%02x:%02x]",
|
||||||
rc->conn_stat.connected, bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]);
|
rc->conn_stat.connected, bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ESP_AVRC_TG_PASSTHROUGH_CMD_EVT: {
|
case ESP_AVRC_TG_PASSTHROUGH_CMD_EVT: {
|
||||||
ESP_LOGI(BT_RC_TG_TAG, "AVRC passthrough cmd: key_code 0x%x, key_state %d", rc->psth_cmd.key_code, rc->psth_cmd.key_state);
|
ESP_LOGD(BT_RC_TG_TAG, "AVRC passthrough cmd: key_code 0x%x, key_state %d", rc->psth_cmd.key_code, rc->psth_cmd.key_state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ESP_AVRC_TG_SET_ABSOLUTE_VOLUME_CMD_EVT: {
|
case ESP_AVRC_TG_SET_ABSOLUTE_VOLUME_CMD_EVT: {
|
||||||
ESP_LOGI(BT_RC_TG_TAG, "AVRC set absolute volume: %d%%", (int)rc->set_abs_vol.volume * 100/ 0x7f);
|
ESP_LOGD(BT_RC_TG_TAG, "AVRC set absolute volume: %d%%", (int)rc->set_abs_vol.volume * 100/ 0x7f);
|
||||||
volume_set_by_controller(rc->set_abs_vol.volume);
|
volume_set_by_controller(rc->set_abs_vol.volume);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ESP_AVRC_TG_REGISTER_NOTIFICATION_EVT: {
|
case ESP_AVRC_TG_REGISTER_NOTIFICATION_EVT: {
|
||||||
ESP_LOGI(BT_RC_TG_TAG, "AVRC register event notification: %d, param: 0x%x", rc->reg_ntf.event_id, rc->reg_ntf.event_parameter);
|
ESP_LOGD(BT_RC_TG_TAG, "AVRC register event notification: %d, param: 0x%x", rc->reg_ntf.event_id, rc->reg_ntf.event_parameter);
|
||||||
if (rc->reg_ntf.event_id == ESP_AVRC_RN_VOLUME_CHANGE) {
|
if (rc->reg_ntf.event_id == ESP_AVRC_RN_VOLUME_CHANGE) {
|
||||||
s_volume_notify = true;
|
s_volume_notify = true;
|
||||||
esp_avrc_rn_param_t rn_param;
|
esp_avrc_rn_param_t rn_param;
|
||||||
@@ -540,7 +540,7 @@ static void bt_av_hdl_avrc_tg_evt(uint16_t event, void *p_param)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ESP_AVRC_TG_REMOTE_FEATURES_EVT: {
|
case ESP_AVRC_TG_REMOTE_FEATURES_EVT: {
|
||||||
ESP_LOGI(BT_RC_TG_TAG, "AVRC remote features %x, CT features %x", rc->rmt_feats.feat_mask, rc->rmt_feats.ct_feat_flag);
|
ESP_LOGD(BT_RC_TG_TAG, "AVRC remote features %x, CT features %x", rc->rmt_feats.feat_mask, rc->rmt_feats.ct_feat_flag);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -632,15 +632,15 @@ void bt_sink_deinit(void)
|
|||||||
{
|
{
|
||||||
/* this still does not work, can't figure out how to stop properly this BT stack */
|
/* this still does not work, can't figure out how to stop properly this BT stack */
|
||||||
bt_app_task_shut_down();
|
bt_app_task_shut_down();
|
||||||
ESP_LOGI(BT_AV_TAG, "bt_app_task shutdown successfully");
|
ESP_LOGD(BT_AV_TAG, "bt_app_task shutdown successfully");
|
||||||
if (esp_bluedroid_disable() != ESP_OK) return;
|
if (esp_bluedroid_disable() != ESP_OK) return;
|
||||||
ESP_LOGI(BT_AV_TAG, "esp_bluedroid_disable called successfully");
|
ESP_LOGD(BT_AV_TAG, "esp_bluedroid_disable called successfully");
|
||||||
if (esp_bluedroid_deinit() != ESP_OK) return;
|
if (esp_bluedroid_deinit() != ESP_OK) return;
|
||||||
ESP_LOGI(BT_AV_TAG, "esp_bluedroid_deinit called successfully");
|
ESP_LOGD(BT_AV_TAG, "esp_bluedroid_deinit called successfully");
|
||||||
if (esp_bt_controller_disable() != ESP_OK) return;
|
if (esp_bt_controller_disable() != ESP_OK) return;
|
||||||
ESP_LOGI(BT_AV_TAG, "esp_bt_controller_disable called successfully");
|
ESP_LOGD(BT_AV_TAG, "esp_bt_controller_disable called successfully");
|
||||||
if (esp_bt_controller_deinit() != ESP_OK) return;
|
if (esp_bt_controller_deinit() != ESP_OK) return;
|
||||||
ESP_LOGI(BT_AV_TAG, "bt stopped successfully");
|
ESP_LOGD(BT_AV_TAG, "bt stopped successfully");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bt_app_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *param)
|
static void bt_app_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *param)
|
||||||
@@ -648,7 +648,7 @@ static void bt_app_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *pa
|
|||||||
switch (event) {
|
switch (event) {
|
||||||
case ESP_BT_GAP_AUTH_CMPL_EVT: {
|
case ESP_BT_GAP_AUTH_CMPL_EVT: {
|
||||||
if (param->auth_cmpl.stat == ESP_BT_STATUS_SUCCESS) {
|
if (param->auth_cmpl.stat == ESP_BT_STATUS_SUCCESS) {
|
||||||
ESP_LOGI(BT_AV_TAG, "authentication success: %s", param->auth_cmpl.device_name);
|
ESP_LOGD(BT_AV_TAG, "authentication success: %s", param->auth_cmpl.device_name);
|
||||||
esp_log_buffer_hex(BT_AV_TAG, param->auth_cmpl.bda, ESP_BD_ADDR_LEN);
|
esp_log_buffer_hex(BT_AV_TAG, param->auth_cmpl.bda, ESP_BD_ADDR_LEN);
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGE(BT_AV_TAG, "authentication failed, status:%d", param->auth_cmpl.stat);
|
ESP_LOGE(BT_AV_TAG, "authentication failed, status:%d", param->auth_cmpl.stat);
|
||||||
@@ -658,19 +658,19 @@ static void bt_app_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *pa
|
|||||||
|
|
||||||
#if (CONFIG_BT_SSP_ENABLED == true)
|
#if (CONFIG_BT_SSP_ENABLED == true)
|
||||||
case ESP_BT_GAP_CFM_REQ_EVT:
|
case ESP_BT_GAP_CFM_REQ_EVT:
|
||||||
ESP_LOGI(BT_AV_TAG, "ESP_BT_GAP_CFM_REQ_EVT Please compare the numeric value: %d", param->cfm_req.num_val);
|
ESP_LOGD(BT_AV_TAG, "ESP_BT_GAP_CFM_REQ_EVT Please compare the numeric value: %d", param->cfm_req.num_val);
|
||||||
esp_bt_gap_ssp_confirm_reply(param->cfm_req.bda, true);
|
esp_bt_gap_ssp_confirm_reply(param->cfm_req.bda, true);
|
||||||
break;
|
break;
|
||||||
case ESP_BT_GAP_KEY_NOTIF_EVT:
|
case ESP_BT_GAP_KEY_NOTIF_EVT:
|
||||||
ESP_LOGI(BT_AV_TAG, "ESP_BT_GAP_KEY_NOTIF_EVT passkey:%d", param->key_notif.passkey);
|
ESP_LOGD(BT_AV_TAG, "ESP_BT_GAP_KEY_NOTIF_EVT passkey:%d", param->key_notif.passkey);
|
||||||
break;
|
break;
|
||||||
case ESP_BT_GAP_KEY_REQ_EVT:
|
case ESP_BT_GAP_KEY_REQ_EVT:
|
||||||
ESP_LOGI(BT_AV_TAG, "ESP_BT_GAP_KEY_REQ_EVT Please enter passkey!");
|
ESP_LOGD(BT_AV_TAG, "ESP_BT_GAP_KEY_REQ_EVT Please enter passkey!");
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
ESP_LOGI(BT_AV_TAG, "event: %d", event);
|
ESP_LOGD(BT_AV_TAG, "event: %d", event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "bt_app_core.h"
|
||||||
typedef enum { BT_SINK_CONNECTED, BT_SINK_DISCONNECTED, BT_SINK_AUDIO_STARTED, BT_SINK_AUDIO_STOPPED, BT_SINK_PLAY, BT_SINK_STOP, BT_SINK_PAUSE,
|
typedef enum { BT_SINK_CONNECTED, BT_SINK_DISCONNECTED, BT_SINK_AUDIO_STARTED, BT_SINK_AUDIO_STOPPED, BT_SINK_PLAY, BT_SINK_STOP, BT_SINK_PAUSE,
|
||||||
BT_SINK_RATE, BT_SINK_VOLUME, BT_SINK_METADATA, BT_SINK_PROGRESS } bt_sink_cmd_t;
|
BT_SINK_RATE, BT_SINK_VOLUME, BT_SINK_METADATA, BT_SINK_PROGRESS } bt_sink_cmd_t;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "bt_app_core.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "esp_bt.h"
|
#include "esp_bt.h"
|
||||||
#include "esp_bt_device.h"
|
#include "esp_bt_device.h"
|
||||||
@@ -15,11 +16,10 @@
|
|||||||
#include "esp_wifi.h"
|
#include "esp_wifi.h"
|
||||||
#include "freertos/timers.h"
|
#include "freertos/timers.h"
|
||||||
#include "argtable3/argtable3.h"
|
#include "argtable3/argtable3.h"
|
||||||
#include "config.h"
|
#include "platform_config.h"
|
||||||
#include "bt_app_core.h"
|
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
|
||||||
static const char * TAG = "platform";
|
static const char * TAG = "bt_app_source";
|
||||||
|
|
||||||
extern int32_t output_bt_data(uint8_t *data, int32_t len);
|
extern int32_t output_bt_data(uint8_t *data, int32_t len);
|
||||||
extern void output_bt_tick(void);
|
extern void output_bt_tick(void);
|
||||||
@@ -50,7 +50,6 @@ static const char * art_a2dp_connecting[]= {"\n",
|
|||||||
static void bt_app_av_state_connecting(uint16_t event, void *param);
|
static void bt_app_av_state_connecting(uint16_t event, void *param);
|
||||||
|
|
||||||
|
|
||||||
#define A2DP_TIMER_INIT connecting_timeout = esp_timer_get_time() +(CONFIG_A2DP_CONNECT_TIMEOUT_MS * 1000)
|
|
||||||
#define IS_A2DP_TIMER_OVER esp_timer_get_time() >= connecting_timeout
|
#define IS_A2DP_TIMER_OVER esp_timer_get_time() >= connecting_timeout
|
||||||
|
|
||||||
static void filter_inquiry_scan_result(esp_bt_gap_cb_param_t *param);
|
static void filter_inquiry_scan_result(esp_bt_gap_cb_param_t *param);
|
||||||
@@ -542,7 +541,15 @@ static void bt_av_hdl_stack_evt(uint16_t event, void *p_param)
|
|||||||
/* create and start heart beat timer */
|
/* create and start heart beat timer */
|
||||||
do {
|
do {
|
||||||
int tmr_id = 0;
|
int tmr_id = 0;
|
||||||
s_tmr = xTimerCreate("connTmr", (CONFIG_A2DP_CONTROL_DELAY_MS / portTICK_RATE_MS),
|
uint16_t ctr_delay_ms=CONFIG_A2DP_CONTROL_DELAY_MS;
|
||||||
|
char * value = config_alloc_get_default(NVS_TYPE_STR, "a2dp_ctrld", STR(CONFIG_A2DP_CONNECT_TIMEOUT_MS), 0);
|
||||||
|
if(value!=NULL){
|
||||||
|
ESP_LOGI(TAG, "A2DP ctrl delay: %s", value);
|
||||||
|
ctr_delay_ms=atoi(value);
|
||||||
|
}
|
||||||
|
FREE_AND_NULL(value);
|
||||||
|
|
||||||
|
s_tmr = xTimerCreate("connTmr", ( ctr_delay_ms/ portTICK_RATE_MS),
|
||||||
pdTRUE, (void *)tmr_id, a2d_app_heart_beat);
|
pdTRUE, (void *)tmr_id, a2d_app_heart_beat);
|
||||||
xTimerStart(s_tmr, portMAX_DELAY);
|
xTimerStart(s_tmr, portMAX_DELAY);
|
||||||
} while (0);
|
} while (0);
|
||||||
@@ -672,8 +679,16 @@ static void bt_app_av_state_unconnected(uint16_t event, void *param)
|
|||||||
ESP_LOGI(TAG,"%s",art_a2dp_connecting[l]);
|
ESP_LOGI(TAG,"%s",art_a2dp_connecting[l]);
|
||||||
}
|
}
|
||||||
ESP_LOGI(TAG,"Device: %s", s_peer_bdname);
|
ESP_LOGI(TAG,"Device: %s", s_peer_bdname);
|
||||||
|
int64_t connecting_timeout_offset=CONFIG_A2DP_CONNECT_TIMEOUT_MS;
|
||||||
if(esp_a2d_source_connect(s_peer_bda)==ESP_OK) {
|
if(esp_a2d_source_connect(s_peer_bda)==ESP_OK) {
|
||||||
A2DP_TIMER_INIT;
|
char * value = config_alloc_get_default(NVS_TYPE_STR, "a2dp_ctmt", STR(CONFIG_A2DP_CONNECT_TIMEOUT_MS), 0);
|
||||||
|
if(value!=NULL){
|
||||||
|
ESP_LOGI(TAG, "A2DP pairing timeout: %s", value);
|
||||||
|
connecting_timeout_offset=atoi(value);
|
||||||
|
}
|
||||||
|
FREE_AND_NULL(value);
|
||||||
|
|
||||||
|
connecting_timeout = esp_timer_get_time() +(connecting_timeout_offset * 1000);
|
||||||
s_a2d_state = APP_AV_STATE_CONNECTING;
|
s_a2d_state = APP_AV_STATE_CONNECTING;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
1
components/esp-dsp
Submodule
1
components/esp-dsp
Submodule
Submodule components/esp-dsp added at 8b082c1071
7
components/platform_config/CMakeLists.txt
Normal file
7
components/platform_config/CMakeLists.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
idf_component_register( SRC_DIRS .
|
||||||
|
INCLUDE_DIRS .
|
||||||
|
PRIV_REQUIRES tools newlib console esp_common freertos
|
||||||
|
REQUIRES nvs_flash json
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -10,11 +10,11 @@
|
|||||||
#include "driver/uart.h"
|
#include "driver/uart.h"
|
||||||
#include "linenoise/linenoise.h"
|
#include "linenoise/linenoise.h"
|
||||||
#include "argtable3/argtable3.h"
|
#include "argtable3/argtable3.h"
|
||||||
#include "esp_vfs_fat.h"
|
|
||||||
#include "nvs.h"
|
#include "nvs.h"
|
||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
#include "nvs_utilities.h"
|
#include "nvs_utilities.h"
|
||||||
#include "config.h"
|
#include "platform_config.h"
|
||||||
|
|
||||||
const char current_namespace[] = "config";
|
const char current_namespace[] = "config";
|
||||||
const char settings_partition[] = "settings";
|
const char settings_partition[] = "settings";
|
||||||
@@ -2,16 +2,27 @@
|
|||||||
* Squeezelite for esp32
|
* Squeezelite for esp32
|
||||||
*
|
*
|
||||||
* (c) Sebastien 2019
|
* (c) Sebastien 2019
|
||||||
* (c) Philippe G. 2019, philippe_44@outlook.com
|
* Philippe G. 2019, philippe_44@outlook.com
|
||||||
*
|
*
|
||||||
* This software is released under the MIT License.
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* https://opensource.org/licenses/MIT
|
* 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/>.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
//#define LOG_LOCAL_LEVEL ESP_LOG_VERBOSE
|
//#define LOG_LOCAL_LEVEL ESP_LOG_VERBOSE
|
||||||
#include "config.h"
|
#include "platform_config.h"
|
||||||
#include "nvs_utilities.h"
|
#include "nvs_utilities.h"
|
||||||
|
#include "platform_esp32.h"
|
||||||
|
#include "trace.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
@@ -21,7 +32,7 @@
|
|||||||
#include "driver/uart.h"
|
#include "driver/uart.h"
|
||||||
#include "linenoise/linenoise.h"
|
#include "linenoise/linenoise.h"
|
||||||
#include "argtable3/argtable3.h"
|
#include "argtable3/argtable3.h"
|
||||||
#include "esp_vfs_fat.h"
|
|
||||||
#include "nvs.h"
|
#include "nvs.h"
|
||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
#include "nvs_utilities.h"
|
#include "nvs_utilities.h"
|
||||||
@@ -47,7 +58,7 @@ extern esp_err_t nvs_load_config();
|
|||||||
void config_raise_change(bool flag);
|
void config_raise_change(bool flag);
|
||||||
cJSON_bool config_is_entry_changed(cJSON * entry);
|
cJSON_bool config_is_entry_changed(cJSON * entry);
|
||||||
bool config_set_group_bit(int bit_num,bool flag);
|
bool config_set_group_bit(int bit_num,bool flag);
|
||||||
cJSON * config_set_value_safe(nvs_type_t nvs_type, const char *key, void * value);
|
cJSON * config_set_value_safe(nvs_type_t nvs_type, const char *key,const void * value);
|
||||||
static void vCallbackFunction( TimerHandle_t xTimer );
|
static void vCallbackFunction( TimerHandle_t xTimer );
|
||||||
void config_set_entry_changed_flag(cJSON * entry, cJSON_bool flag);
|
void config_set_entry_changed_flag(cJSON * entry, cJSON_bool flag);
|
||||||
#define IMPLEMENT_SET_DEFAULT(t,nt) void config_set_default_## t (const char *key, t value){\
|
#define IMPLEMENT_SET_DEFAULT(t,nt) void config_set_default_## t (const char *key, t value){\
|
||||||
@@ -59,38 +70,18 @@ void config_set_entry_changed_flag(cJSON * entry, cJSON_bool flag);
|
|||||||
void * pval = config_alloc_get(nt, key);\
|
void * pval = config_alloc_get(nt, key);\
|
||||||
if(pval!=NULL){ *value = *(t * )pval; free(pval); return ESP_OK; }\
|
if(pval!=NULL){ *value = *(t * )pval; free(pval); return ESP_OK; }\
|
||||||
return ESP_FAIL;}
|
return ESP_FAIL;}
|
||||||
#if RECOVERY_APPLICATION==0
|
|
||||||
static void * malloc_fn(size_t sz){
|
static void * malloc_fn(size_t sz){
|
||||||
|
|
||||||
void * ptr = heap_caps_malloc(sz, MALLOC_CAP_SPIRAM);
|
void * ptr = is_recovery_running?malloc(sz):heap_caps_malloc(sz, MALLOC_CAP_SPIRAM);
|
||||||
if(ptr==NULL){
|
if(ptr==NULL){
|
||||||
ESP_LOGE(TAG,"malloc_fn: unable to allocate memory!");
|
ESP_LOGE(TAG,"malloc_fn: unable to allocate memory!");
|
||||||
}
|
}
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
static void * free_fn(void * ptr){
|
|
||||||
if(ptr!=NULL){
|
|
||||||
heap_caps_free(ptr);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ESP_LOGW(TAG,"free_fn: Cannot free null pointer!");
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
void init_cJSON(){
|
void init_cJSON(){
|
||||||
static cJSON_Hooks hooks;
|
static cJSON_Hooks hooks;
|
||||||
// initialize cJSON hooks it uses SPIRAM memory
|
|
||||||
// as opposed to IRAM
|
|
||||||
#if RECOVERY_APPLICATION==0
|
|
||||||
// In squeezelite mode, allocate memory from PSRAM. Otherwise allocate from internal RAM
|
|
||||||
// as recovery will lock flash access when erasing FLASH or writing to OTA partition.
|
|
||||||
hooks.malloc_fn=&malloc_fn;
|
hooks.malloc_fn=&malloc_fn;
|
||||||
//hooks.free_fn=&free_fn;
|
|
||||||
cJSON_InitHooks(&hooks);
|
cJSON_InitHooks(&hooks);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
void config_init(){
|
void config_init(){
|
||||||
ESP_LOGD(TAG, "Creating mutex for Config");
|
ESP_LOGD(TAG, "Creating mutex for Config");
|
||||||
@@ -135,7 +126,7 @@ nvs_type_t config_get_item_type(cJSON * entry){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cJSON * config_set_value_safe(nvs_type_t nvs_type, const char *key, void * value){
|
cJSON * config_set_value_safe(nvs_type_t nvs_type, const char *key, const void * value){
|
||||||
cJSON * entry = cJSON_CreateObject();
|
cJSON * entry = cJSON_CreateObject();
|
||||||
|
|
||||||
double numvalue = 0;
|
double numvalue = 0;
|
||||||
@@ -355,21 +346,24 @@ void * config_safe_alloc_get_entry_value(nvs_type_t nvs_type, cJSON * entry){
|
|||||||
char * entry_str = cJSON_PrintUnformatted(entry);
|
char * entry_str = cJSON_PrintUnformatted(entry);
|
||||||
if(entry_str!=NULL){
|
if(entry_str!=NULL){
|
||||||
ESP_LOGE(TAG, "requested value type string, config type is different. key: %s, value: %s, type %d, Object: \n%s",
|
ESP_LOGE(TAG, "requested value type string, config type is different. key: %s, value: %s, type %d, Object: \n%s",
|
||||||
entry_value->string,
|
str_or_null(entry_value->string),
|
||||||
entry_value->valuestring,
|
str_or_null(entry_value->valuestring),
|
||||||
entry_value->type,
|
entry_value->type,
|
||||||
entry_str);
|
str_or_null(entry_str));
|
||||||
free(entry_str);
|
free(entry_str);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ESP_LOGE(TAG, "requested value type string, config type is different. key: %s, value: %s, type %d",
|
ESP_LOGE(TAG, "requested value type string, config type is different. key: %s, value: %s, type %d",
|
||||||
entry_value->string,
|
str_or_null(entry_value->string),
|
||||||
entry_value->valuestring,
|
str_or_null(entry_value->valuestring),
|
||||||
entry_value->type);
|
entry_value->type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
value=(void *)strdup(cJSON_GetStringValue(entry_value));
|
size_t len=strlen(cJSON_GetStringValue(entry_value));
|
||||||
|
value=(void *)heap_caps_malloc(len+1, MALLOC_CAP_DMA);
|
||||||
|
memset(value,0x00,len+1);
|
||||||
|
memcpy(value,cJSON_GetStringValue(entry_value),len);
|
||||||
if(value==NULL){
|
if(value==NULL){
|
||||||
char * entry_str = cJSON_PrintUnformatted(entry);
|
char * entry_str = cJSON_PrintUnformatted(entry);
|
||||||
if(entry_str!=NULL){
|
if(entry_str!=NULL){
|
||||||
@@ -389,7 +383,6 @@ void * config_safe_alloc_get_entry_value(nvs_type_t nvs_type, cJSON * entry){
|
|||||||
|
|
||||||
void config_commit_to_nvs(){
|
void config_commit_to_nvs(){
|
||||||
ESP_LOGI(TAG,"Committing configuration to nvs. Locking config object.");
|
ESP_LOGI(TAG,"Committing configuration to nvs. Locking config object.");
|
||||||
ESP_LOGV(TAG,"config_commit_to_nvs. Locking config object.");
|
|
||||||
if(!config_lock(LOCK_MAX_WAIT/portTICK_PERIOD_MS)){
|
if(!config_lock(LOCK_MAX_WAIT/portTICK_PERIOD_MS)){
|
||||||
ESP_LOGE(TAG, "config_commit_to_nvs: Unable to lock config for commit ");
|
ESP_LOGE(TAG, "config_commit_to_nvs: Unable to lock config for commit ");
|
||||||
return ;
|
return ;
|
||||||
@@ -412,8 +405,14 @@ void config_commit_to_nvs(){
|
|||||||
nvs_type_t type = config_get_entry_type(entry);
|
nvs_type_t type = config_get_entry_type(entry);
|
||||||
void * value = config_safe_alloc_get_entry_value(type, entry);
|
void * value = config_safe_alloc_get_entry_value(type, entry);
|
||||||
if(value!=NULL){
|
if(value!=NULL){
|
||||||
esp_err_t err = store_nvs_value(type,entry->string,value);
|
size_t len=strlen(entry->string);
|
||||||
|
char * key=(void *)heap_caps_malloc(len+1, MALLOC_CAP_DMA);
|
||||||
|
memset(key,0x00,len+1);
|
||||||
|
memcpy(key,entry->string,len);
|
||||||
|
esp_err_t err = store_nvs_value(type,key,value);
|
||||||
|
free(key);
|
||||||
free(value);
|
free(value);
|
||||||
|
|
||||||
if(err!=ESP_OK){
|
if(err!=ESP_OK){
|
||||||
char * entry_str = cJSON_PrintUnformatted(entry);
|
char * entry_str = cJSON_PrintUnformatted(entry);
|
||||||
if(entry_str!=NULL){
|
if(entry_str!=NULL){
|
||||||
@@ -449,6 +448,7 @@ void config_commit_to_nvs(){
|
|||||||
config_raise_change(false);
|
config_raise_change(false);
|
||||||
ESP_LOGV(TAG,"config_commit_to_nvs. Releasing the lock object.");
|
ESP_LOGV(TAG,"config_commit_to_nvs. Releasing the lock object.");
|
||||||
config_unlock();
|
config_unlock();
|
||||||
|
ESP_LOGI(TAG,"Done Committing configuration to nvs.");
|
||||||
}
|
}
|
||||||
bool config_has_changes(){
|
bool config_has_changes(){
|
||||||
return (xEventGroupGetBits(config_group) & CONFIG_NO_COMMIT_PENDING)==0;
|
return (xEventGroupGetBits(config_group) & CONFIG_NO_COMMIT_PENDING)==0;
|
||||||
@@ -568,7 +568,7 @@ void config_delete_key(const char *key){
|
|||||||
ESP_LOGD(TAG, "Deleting nvs entry for [%s]", key);
|
ESP_LOGD(TAG, "Deleting nvs entry for [%s]", key);
|
||||||
if(!config_lock(LOCK_MAX_WAIT/portTICK_PERIOD_MS)){
|
if(!config_lock(LOCK_MAX_WAIT/portTICK_PERIOD_MS)){
|
||||||
ESP_LOGE(TAG, "Unable to lock config for delete");
|
ESP_LOGE(TAG, "Unable to lock config for delete");
|
||||||
return false;
|
return ;
|
||||||
}
|
}
|
||||||
esp_err_t err = nvs_open_from_partition(settings_partition, current_namespace, NVS_READWRITE, &nvs);
|
esp_err_t err = nvs_open_from_partition(settings_partition, current_namespace, NVS_READWRITE, &nvs);
|
||||||
if (err == ESP_OK) {
|
if (err == ESP_OK) {
|
||||||
@@ -684,7 +684,7 @@ char * config_alloc_get_json(bool bFormatted){
|
|||||||
config_unlock();
|
config_unlock();
|
||||||
return json_buffer;
|
return json_buffer;
|
||||||
}
|
}
|
||||||
esp_err_t config_set_value(nvs_type_t nvs_type, const char *key, void * value){
|
esp_err_t config_set_value(nvs_type_t nvs_type, const char *key, const void * value){
|
||||||
esp_err_t result = ESP_OK;
|
esp_err_t result = ESP_OK;
|
||||||
if(!config_lock(LOCK_MAX_WAIT/portTICK_PERIOD_MS)){
|
if(!config_lock(LOCK_MAX_WAIT/portTICK_PERIOD_MS)){
|
||||||
ESP_LOGE(TAG, "Unable to lock config after %d ms",LOCK_MAX_WAIT);
|
ESP_LOGE(TAG, "Unable to lock config after %d ms",LOCK_MAX_WAIT);
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "nvs.h"
|
#include "nvs.h"
|
||||||
|
#include "assert.h"
|
||||||
|
#include "cJSON.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@@ -11,7 +13,9 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
#define DECLARE_SET_DEFAULT(t) void config_set_default_## t (const char *key, t value);
|
#define DECLARE_SET_DEFAULT(t) void config_set_default_## t (const char *key, t value);
|
||||||
#define DECLARE_GET_NUM(t) esp_err_t config_get_## t (const char *key, t * value);
|
#define DECLARE_GET_NUM(t) esp_err_t config_get_## t (const char *key, t * value);
|
||||||
|
#ifndef FREE_RESET
|
||||||
|
#define FREE_RESET(p) if(p!=NULL) { free(p); p=NULL; }
|
||||||
|
#endif
|
||||||
|
|
||||||
DECLARE_SET_DEFAULT(uint8_t);
|
DECLARE_SET_DEFAULT(uint8_t);
|
||||||
DECLARE_SET_DEFAULT(uint16_t);
|
DECLARE_SET_DEFAULT(uint16_t);
|
||||||
@@ -31,11 +35,13 @@ void config_commit_to_nvs();
|
|||||||
void config_start_timer();
|
void config_start_timer();
|
||||||
void config_init();
|
void config_init();
|
||||||
void * config_alloc_get_default(nvs_type_t type, const char *key, void * default_value, size_t blob_size);
|
void * config_alloc_get_default(nvs_type_t type, const char *key, void * default_value, size_t blob_size);
|
||||||
|
void * config_alloc_get_str(const char *key, char *lead, char *fallback);
|
||||||
void config_delete_key(const char *key);
|
void config_delete_key(const char *key);
|
||||||
void config_set_default(nvs_type_t type, const char *key, void * default_value, size_t blob_size);
|
void config_set_default(nvs_type_t type, const char *key, void * default_value, size_t blob_size);
|
||||||
void * config_alloc_get(nvs_type_t nvs_type, const char *key) ;
|
void * config_alloc_get(nvs_type_t nvs_type, const char *key) ;
|
||||||
void * config_alloc_get_str(const char *key, char *lead, char *fallback);
|
|
||||||
bool wait_for_commit();
|
bool wait_for_commit();
|
||||||
char * config_alloc_get_json(bool bFormatted);
|
char * config_alloc_get_json(bool bFormatted);
|
||||||
esp_err_t config_set_value(nvs_type_t nvs_type, const char *key, void * value);
|
esp_err_t config_set_value(nvs_type_t nvs_type, const char *key, const void * value);
|
||||||
|
nvs_type_t config_get_item_type(cJSON * entry);
|
||||||
|
void * config_safe_alloc_get_entry_value(nvs_type_t nvs_type, cJSON * entry);
|
||||||
|
|
||||||
12
components/platform_console/CMakeLists.txt
Normal file
12
components/platform_console/CMakeLists.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
idf_component_register( SRCS
|
||||||
|
cmd_i2ctools.c
|
||||||
|
cmd_nvs.c
|
||||||
|
cmd_ota.c
|
||||||
|
cmd_system.c
|
||||||
|
cmd_wifi.c
|
||||||
|
platform_console.c
|
||||||
|
INCLUDE_DIRS .
|
||||||
|
REQUIRES nvs_flash
|
||||||
|
PRIV_REQUIRES console app_update tools services spi_flash platform_config vfs pthread wifi-manager platform_config newlib telnet display )
|
||||||
|
target_link_libraries(${COMPONENT_LIB} "-Wl,--undefined=GDS_DrawPixelFast")
|
||||||
|
target_link_libraries(${COMPONENT_LIB} ${build_dir}/esp-idf/$<TARGET_PROPERTY:RECOVERY_PREFIX>/lib$<TARGET_PROPERTY:RECOVERY_PREFIX>.a )
|
||||||
9
components/platform_console/app_recovery/CMakeLists.txt
Normal file
9
components/platform_console/app_recovery/CMakeLists.txt
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
idf_component_register( SRC_DIRS .
|
||||||
|
INCLUDE_DIRS .
|
||||||
|
PRIV_REQUIRES bootloader_support
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=esp_app_desc")
|
||||||
|
idf_build_get_property(project_ver PROJECT_VER)
|
||||||
|
string(SUBSTRING "${project_ver}" 0 31 PROJECT_VER_CUT)
|
||||||
|
set_source_files_properties(recovery.c PROPERTIES COMPILE_DEFINITIONS "PROJECT_VER=\"${PROJECT_VER_CUT}\"; PROJECT_NAME=\"recovery\"")
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#pragma once
|
||||||
|
#define PROJECT_NAME "recovery"
|
||||||
36
components/platform_console/app_recovery/recovery.c
Normal file
36
components/platform_console/app_recovery/recovery.c
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "esp_err.h"
|
||||||
|
#include "esp_app_format.h"
|
||||||
|
extern esp_err_t process_recovery_ota(const char * bin_url, char * bin_buffer, uint32_t length);
|
||||||
|
|
||||||
|
const __attribute__((section(".rodata_desc"))) esp_app_desc_t esp_app_desc = {
|
||||||
|
.magic_word = ESP_APP_DESC_MAGIC_WORD,
|
||||||
|
.version = PROJECT_VER,
|
||||||
|
.project_name = PROJECT_NAME,
|
||||||
|
.idf_ver = IDF_VER,
|
||||||
|
|
||||||
|
#ifdef CONFIG_BOOTLOADER_APP_SECURE_VERSION
|
||||||
|
.secure_version = CONFIG_BOOTLOADER_APP_SECURE_VERSION,
|
||||||
|
#else
|
||||||
|
.secure_version = 0,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_APP_COMPILE_TIME_DATE
|
||||||
|
.time = __TIME__,
|
||||||
|
.date = __DATE__,
|
||||||
|
#else
|
||||||
|
.time = "",
|
||||||
|
.date = "",
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
int main(int argc, char **argv){
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
void register_squeezelite(){
|
||||||
|
}
|
||||||
|
esp_err_t start_ota(const char * bin_url, char * bin_buffer, uint32_t length)
|
||||||
|
{
|
||||||
|
return process_recovery_ota(bin_url,bin_buffer,length);
|
||||||
|
}
|
||||||
19
components/platform_console/app_squeezelite/CMakeLists.txt
Normal file
19
components/platform_console/app_squeezelite/CMakeLists.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
idf_build_get_property(idf_path IDF_PATH)
|
||||||
|
idf_component_register( SRCS cmd_squeezelite.c
|
||||||
|
INCLUDE_DIRS .
|
||||||
|
PRIV_REQUIRES spi_flash bootloader_support partition_table bootloader_support console codecs squeezelite newlib pthread tools platform_config display )
|
||||||
|
|
||||||
|
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=feof")
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=log")
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=fdopen")
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=fileno")
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=fstat")
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=lround")
|
||||||
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=esp_app_desc")
|
||||||
|
|
||||||
|
idf_build_get_property(project_ver PROJECT_VER)
|
||||||
|
string(SUBSTRING "${project_ver}" 0 31 PROJECT_VER_CUT)
|
||||||
|
set_source_files_properties(cmd_squeezelite.c PROPERTIES COMPILE_DEFINITIONS "PROJECT_VER=\"${PROJECT_VER_CUT}\"; PROJECT_NAME=\"squeezelite\"")
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#pragma once
|
||||||
|
#define PROJECT_NAME "squeezelite"
|
||||||
@@ -1,22 +1,45 @@
|
|||||||
//size_t esp_console_split_argv(char *line, char **argv, size_t argv_size);
|
|
||||||
#include "cmd_squeezelite.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "cmd_decl.h"
|
|
||||||
|
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "esp_console.h"
|
#include "esp_console.h"
|
||||||
#include "esp_pthread.h"
|
#include "esp_pthread.h"
|
||||||
|
#include "../cmd_system.h"
|
||||||
#include "argtable3/argtable3.h"
|
#include "argtable3/argtable3.h"
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/event_groups.h"
|
#include "freertos/event_groups.h"
|
||||||
#include "pthread.h"
|
#include "pthread.h"
|
||||||
#include "platform_esp32.h"
|
#include "platform_esp32.h"
|
||||||
#include "config.h"
|
#include "platform_config.h"
|
||||||
|
#include "esp_app_format.h"
|
||||||
|
extern esp_err_t process_recovery_ota(const char * bin_url, char * bin_buffer, uint32_t length);
|
||||||
static const char * TAG = "squeezelite_cmd";
|
static const char * TAG = "squeezelite_cmd";
|
||||||
#define SQUEEZELITE_THREAD_STACK_SIZE (6*1024)
|
#define SQUEEZELITE_THREAD_STACK_SIZE (6*1024)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const __attribute__((section(".rodata_desc"))) esp_app_desc_t esp_app_desc = {
|
||||||
|
|
||||||
|
.magic_word = ESP_APP_DESC_MAGIC_WORD,
|
||||||
|
.version = PROJECT_VER,
|
||||||
|
.project_name = PROJECT_NAME,
|
||||||
|
.idf_ver = IDF_VER,
|
||||||
|
|
||||||
|
#ifdef CONFIG_BOOTLOADER_APP_SECURE_VERSION
|
||||||
|
.secure_version = CONFIG_BOOTLOADER_APP_SECURE_VERSION,
|
||||||
|
#else
|
||||||
|
.secure_version = 0,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_APP_COMPILE_TIME_DATE
|
||||||
|
.time = __TIME__,
|
||||||
|
.date = __DATE__,
|
||||||
|
#else
|
||||||
|
.time = "",
|
||||||
|
.date = "",
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
extern int main(int argc, char **argv);
|
extern int main(int argc, char **argv);
|
||||||
static int launchsqueezelite(int argc, char **argv);
|
static int launchsqueezelite(int argc, char **argv);
|
||||||
pthread_t thread_squeezelite;
|
pthread_t thread_squeezelite;
|
||||||
@@ -127,3 +150,24 @@ void register_squeezelite(){
|
|||||||
ESP_ERROR_CHECK( esp_console_cmd_register(&launch_squeezelite) );
|
ESP_ERROR_CHECK( esp_console_cmd_register(&launch_squeezelite) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
esp_err_t start_ota(const char * bin_url, char * bin_buffer, uint32_t length)
|
||||||
|
{
|
||||||
|
if(!bin_url){
|
||||||
|
ESP_LOGE(TAG,"missing URL parameter. Unable to start OTA");
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
ESP_LOGW(TAG, "Called to update the firmware from url: %s",bin_url);
|
||||||
|
if(config_set_value(NVS_TYPE_STR, "fwurl", bin_url) != ESP_OK){
|
||||||
|
ESP_LOGE(TAG,"Failed to save the OTA url into nvs cache");
|
||||||
|
return ESP_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!wait_for_commit()){
|
||||||
|
ESP_LOGW(TAG,"Unable to commit configuration. ");
|
||||||
|
}
|
||||||
|
|
||||||
|
ESP_LOGW(TAG, "Rebooting to recovery to complete the installation");
|
||||||
|
return guided_factory();
|
||||||
|
return ESP_OK;
|
||||||
|
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,8 @@ extern "C" {
|
|||||||
#include "cmd_nvs.h"
|
#include "cmd_nvs.h"
|
||||||
#include "nvs.h"
|
#include "nvs.h"
|
||||||
#include "nvs_utilities.h"
|
#include "nvs_utilities.h"
|
||||||
|
#include "platform_console.h"
|
||||||
|
#include "messaging.h"
|
||||||
|
|
||||||
|
|
||||||
static const char *ARG_TYPE_STR = "type can be: i8, u8, i16, u16 i32, u32 i64, u64, str, blob";
|
static const char *ARG_TYPE_STR = "type can be: i8, u8, i16, u16 i32, u32 i64, u64, str, blob";
|
||||||
@@ -70,7 +71,7 @@ static esp_err_t store_blob(nvs_handle nvs, const char *key, const char *str_val
|
|||||||
size_t blob_len = str_len / 2;
|
size_t blob_len = str_len / 2;
|
||||||
|
|
||||||
if (str_len % 2) {
|
if (str_len % 2) {
|
||||||
ESP_LOGE(TAG, "Blob data must contain even number of characters");
|
log_send_messaging(MESSAGING_ERROR, "Blob data must contain even number of characters");
|
||||||
return ESP_ERR_NVS_TYPE_MISMATCH;
|
return ESP_ERR_NVS_TYPE_MISMATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,7 +89,7 @@ static esp_err_t store_blob(nvs_handle nvs, const char *key, const char *str_val
|
|||||||
} else if (ch >= 'a' && ch <= 'f') {
|
} else if (ch >= 'a' && ch <= 'f') {
|
||||||
value = ch - 'a' + 10;
|
value = ch - 'a' + 10;
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGE(TAG, "Blob data contain invalid character");
|
log_send_messaging(MESSAGING_ERROR, "Blob data contain invalid character");
|
||||||
free(blob);
|
free(blob);
|
||||||
return ESP_ERR_NVS_TYPE_MISMATCH;
|
return ESP_ERR_NVS_TYPE_MISMATCH;
|
||||||
}
|
}
|
||||||
@@ -187,10 +188,10 @@ static esp_err_t set_value_in_nvs(const char *key, const char *str_type, const c
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (err == ESP_OK) {
|
if (err == ESP_OK) {
|
||||||
ESP_LOGI(TAG, "Set value ok. Committing '%s'", key);
|
log_send_messaging(MESSAGING_INFO, "Set value ok. Committing '%s'", key);
|
||||||
err = nvs_commit(nvs);
|
err = nvs_commit(nvs);
|
||||||
if (err == ESP_OK) {
|
if (err == ESP_OK) {
|
||||||
ESP_LOGI(TAG, "Value stored under key '%s'", key);
|
log_send_messaging(MESSAGING_INFO, "Value stored under key '%s'", key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,51 +219,51 @@ static esp_err_t get_value_from_nvs(const char *key, const char *str_type)
|
|||||||
int8_t value;
|
int8_t value;
|
||||||
err = nvs_get_i8(nvs, key, &value);
|
err = nvs_get_i8(nvs, key, &value);
|
||||||
if (err == ESP_OK) {
|
if (err == ESP_OK) {
|
||||||
printf("Value associated with key '%s' is %d \n", key, value);
|
log_send_messaging(MESSAGING_INFO,"Value associated with key '%s' is %d \n", key, value);
|
||||||
}
|
}
|
||||||
} else if (type == NVS_TYPE_U8) {
|
} else if (type == NVS_TYPE_U8) {
|
||||||
uint8_t value;
|
uint8_t value;
|
||||||
err = nvs_get_u8(nvs, key, &value);
|
err = nvs_get_u8(nvs, key, &value);
|
||||||
if (err == ESP_OK) {
|
if (err == ESP_OK) {
|
||||||
printf("Value associated with key '%s' is %u \n", key, value);
|
log_send_messaging(MESSAGING_INFO,"Value associated with key '%s' is %u \n", key, value);
|
||||||
}
|
}
|
||||||
} else if (type == NVS_TYPE_I16) {
|
} else if (type == NVS_TYPE_I16) {
|
||||||
int16_t value;
|
int16_t value;
|
||||||
err = nvs_get_i16(nvs, key, &value);
|
err = nvs_get_i16(nvs, key, &value);
|
||||||
if (err == ESP_OK) {
|
if (err == ESP_OK) {
|
||||||
printf("Value associated with key '%s' is %d \n", key, value);
|
log_send_messaging(MESSAGING_INFO,"Value associated with key '%s' is %d \n", key, value);
|
||||||
}
|
}
|
||||||
} else if (type == NVS_TYPE_U16) {
|
} else if (type == NVS_TYPE_U16) {
|
||||||
uint16_t value;
|
uint16_t value;
|
||||||
if ((err = nvs_get_u16(nvs, key, &value)) == ESP_OK) {
|
if ((err = nvs_get_u16(nvs, key, &value)) == ESP_OK) {
|
||||||
printf("Value associated with key '%s' is %u", key, value);
|
log_send_messaging(MESSAGING_INFO,"Value associated with key '%s' is %u", key, value);
|
||||||
}
|
}
|
||||||
} else if (type == NVS_TYPE_I32) {
|
} else if (type == NVS_TYPE_I32) {
|
||||||
int32_t value;
|
int32_t value;
|
||||||
if ((err = nvs_get_i32(nvs, key, &value)) == ESP_OK) {
|
if ((err = nvs_get_i32(nvs, key, &value)) == ESP_OK) {
|
||||||
printf("Value associated with key '%s' is %d \n", key, value);
|
log_send_messaging(MESSAGING_INFO,"Value associated with key '%s' is %d \n", key, value);
|
||||||
}
|
}
|
||||||
} else if (type == NVS_TYPE_U32) {
|
} else if (type == NVS_TYPE_U32) {
|
||||||
uint32_t value;
|
uint32_t value;
|
||||||
if ((err = nvs_get_u32(nvs, key, &value)) == ESP_OK) {
|
if ((err = nvs_get_u32(nvs, key, &value)) == ESP_OK) {
|
||||||
printf("Value associated with key '%s' is %u \n", key, value);
|
log_send_messaging(MESSAGING_INFO,"Value associated with key '%s' is %u \n", key, value);
|
||||||
}
|
}
|
||||||
} else if (type == NVS_TYPE_I64) {
|
} else if (type == NVS_TYPE_I64) {
|
||||||
int64_t value;
|
int64_t value;
|
||||||
if ((err = nvs_get_i64(nvs, key, &value)) == ESP_OK) {
|
if ((err = nvs_get_i64(nvs, key, &value)) == ESP_OK) {
|
||||||
printf("Value associated with key '%s' is %lld \n", key, value);
|
log_send_messaging(MESSAGING_INFO,"Value associated with key '%s' is %lld \n", key, value);
|
||||||
}
|
}
|
||||||
} else if (type == NVS_TYPE_U64) {
|
} else if (type == NVS_TYPE_U64) {
|
||||||
uint64_t value;
|
uint64_t value;
|
||||||
if ( (err = nvs_get_u64(nvs, key, &value)) == ESP_OK) {
|
if ( (err = nvs_get_u64(nvs, key, &value)) == ESP_OK) {
|
||||||
printf("Value associated with key '%s' is %llu \n", key, value);
|
log_send_messaging(MESSAGING_INFO,"Value associated with key '%s' is %llu \n", key, value);
|
||||||
}
|
}
|
||||||
} else if (type == NVS_TYPE_STR) {
|
} else if (type == NVS_TYPE_STR) {
|
||||||
size_t len=0;
|
size_t len=0;
|
||||||
if ( (err = nvs_get_str(nvs, key, NULL, &len)) == ESP_OK) {
|
if ( (err = nvs_get_str(nvs, key, NULL, &len)) == ESP_OK) {
|
||||||
char *str = (char *)malloc(len);
|
char *str = (char *)malloc(len);
|
||||||
if ( (err = nvs_get_str(nvs, key, str, &len)) == ESP_OK) {
|
if ( (err = nvs_get_str(nvs, key, str, &len)) == ESP_OK) {
|
||||||
printf("String associated with key '%s' is %s \n", key, str);
|
log_send_messaging(MESSAGING_INFO,"String associated with key '%s' is %s \n", key, str);
|
||||||
}
|
}
|
||||||
free(str);
|
free(str);
|
||||||
}
|
}
|
||||||
@@ -271,7 +272,7 @@ static esp_err_t get_value_from_nvs(const char *key, const char *str_type)
|
|||||||
if ( (err = nvs_get_blob(nvs, key, NULL, &len)) == ESP_OK) {
|
if ( (err = nvs_get_blob(nvs, key, NULL, &len)) == ESP_OK) {
|
||||||
char *blob = (char *)malloc(len);
|
char *blob = (char *)malloc(len);
|
||||||
if ( (err = nvs_get_blob(nvs, key, blob, &len)) == ESP_OK) {
|
if ( (err = nvs_get_blob(nvs, key, blob, &len)) == ESP_OK) {
|
||||||
printf("Blob associated with key '%s' is %d bytes long: \n", key, len);
|
log_send_messaging(MESSAGING_INFO,"Blob associated with key '%s' is %d bytes long: \n", key, len);
|
||||||
print_blob(blob, len);
|
print_blob(blob, len);
|
||||||
}
|
}
|
||||||
free(blob);
|
free(blob);
|
||||||
@@ -292,7 +293,7 @@ static esp_err_t erase(const char *key)
|
|||||||
if (err == ESP_OK) {
|
if (err == ESP_OK) {
|
||||||
err = nvs_commit(nvs);
|
err = nvs_commit(nvs);
|
||||||
if (err == ESP_OK) {
|
if (err == ESP_OK) {
|
||||||
ESP_LOGI(TAG, "Value with key '%s' erased", key);
|
log_send_messaging(MESSAGING_INFO, "Value with key '%s' erased", key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nvs_close(nvs);
|
nvs_close(nvs);
|
||||||
@@ -313,7 +314,7 @@ static esp_err_t erase_all(const char *name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGI(TAG, "Namespace '%s' was %s erased", name, (err == ESP_OK) ? "" : "not");
|
log_send_messaging(MESSAGING_INFO, "Namespace '%s' was %s erased", name, (err == ESP_OK) ? "" : "not");
|
||||||
nvs_close(nvs);
|
nvs_close(nvs);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
@@ -321,22 +322,19 @@ static esp_err_t erase_all(const char *name)
|
|||||||
static int set_value(int argc, char **argv)
|
static int set_value(int argc, char **argv)
|
||||||
{
|
{
|
||||||
ESP_LOGD(TAG, "%s %u - Parsing keys ",__func__,__LINE__);
|
ESP_LOGD(TAG, "%s %u - Parsing keys ",__func__,__LINE__);
|
||||||
int nerrors = arg_parse(argc, argv, (void **) &set_args);
|
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&set_args);
|
||||||
|
|
||||||
if (nerrors != 0) {
|
if (nerrors != 0) {
|
||||||
ESP_LOGE(TAG, "%s %u - Error Parsing keys ",__func__,__LINE__);
|
|
||||||
arg_print_errors(stderr, set_args.end, argv[0]);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *key = set_args.key->sval[0];
|
const char *key = set_args.key->sval[0];
|
||||||
const char *type = set_args.type->sval[0];
|
const char *type = set_args.type->sval[0];
|
||||||
const char *values = set_args.value->sval[0];
|
const char *values = set_args.value->sval[0];
|
||||||
ESP_LOGI(TAG, "Setting '%s' (type %s)", key,type);
|
log_send_messaging(MESSAGING_INFO, "Setting '%s' (type %s)", key,type);
|
||||||
esp_err_t err = set_value_in_nvs(key, type, values);
|
esp_err_t err = set_value_in_nvs(key, type, values);
|
||||||
|
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
ESP_LOGE(TAG, "%s", esp_err_to_name(err));
|
log_send_messaging(MESSAGING_ERROR, "%s", esp_err_to_name(err));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,9 +344,8 @@ static int set_value(int argc, char **argv)
|
|||||||
|
|
||||||
static int get_value(int argc, char **argv)
|
static int get_value(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int nerrors = arg_parse(argc, argv, (void **) &get_args);
|
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&get_args);
|
||||||
if (nerrors != 0) {
|
if (nerrors != 0) {
|
||||||
arg_print_errors(stderr, get_args.end, argv[0]);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -358,7 +355,7 @@ static int get_value(int argc, char **argv)
|
|||||||
esp_err_t err = get_value_from_nvs(key, type);
|
esp_err_t err = get_value_from_nvs(key, type);
|
||||||
|
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
ESP_LOGE(TAG, "%s", esp_err_to_name(err));
|
log_send_messaging(MESSAGING_ERROR, "%s", esp_err_to_name(err));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,9 +364,8 @@ static int get_value(int argc, char **argv)
|
|||||||
|
|
||||||
static int erase_value(int argc, char **argv)
|
static int erase_value(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int nerrors = arg_parse(argc, argv, (void **) &erase_args);
|
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&erase_args);
|
||||||
if (nerrors != 0) {
|
if (nerrors != 0) {
|
||||||
arg_print_errors(stderr, erase_args.end, argv[0]);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -378,7 +374,7 @@ static int erase_value(int argc, char **argv)
|
|||||||
esp_err_t err = erase(key);
|
esp_err_t err = erase(key);
|
||||||
|
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
ESP_LOGE(TAG, "%s", esp_err_to_name(err));
|
log_send_messaging(MESSAGING_ERROR, "%s", esp_err_to_name(err));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,9 +383,8 @@ static int erase_value(int argc, char **argv)
|
|||||||
|
|
||||||
static int erase_namespace(int argc, char **argv)
|
static int erase_namespace(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int nerrors = arg_parse(argc, argv, (void **) &erase_all_args);
|
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&erase_all_args);
|
||||||
if (nerrors != 0) {
|
if (nerrors != 0) {
|
||||||
arg_print_errors(stderr, erase_all_args.end, argv[0]);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,7 +392,7 @@ static int erase_namespace(int argc, char **argv)
|
|||||||
|
|
||||||
esp_err_t err = erase_all(name);
|
esp_err_t err = erase_all(name);
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
ESP_LOGE(TAG, "%s", esp_err_to_name(err));
|
log_send_messaging(MESSAGING_ERROR, "%s", esp_err_to_name(err));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -416,11 +411,11 @@ static int erase_wifi_manager(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
nvs_close(nvs);
|
nvs_close(nvs);
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
ESP_LOGE(TAG, "wifi manager configuration was not erase. %s", esp_err_to_name(err));
|
log_send_messaging(MESSAGING_ERROR, "wifi manager configuration was not erase. %s", esp_err_to_name(err));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ESP_LOGW(TAG, "Wifi manager configuration was erased");
|
log_send_messaging(MESSAGING_WARNING, "Wifi manager configuration was erased");
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -432,7 +427,7 @@ static int list(const char *part, const char *name, const char *str_type)
|
|||||||
|
|
||||||
nvs_iterator_t it = nvs_entry_find(part, NULL, type);
|
nvs_iterator_t it = nvs_entry_find(part, NULL, type);
|
||||||
if (it == NULL) {
|
if (it == NULL) {
|
||||||
ESP_LOGE(TAG, "No such enty was found");
|
log_send_messaging(MESSAGING_ERROR, "No such enty was found");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -441,7 +436,7 @@ static int list(const char *part, const char *name, const char *str_type)
|
|||||||
nvs_entry_info(it, &info);
|
nvs_entry_info(it, &info);
|
||||||
it = nvs_entry_next(it);
|
it = nvs_entry_next(it);
|
||||||
|
|
||||||
printf("namespace '%s', key '%s', type '%s' \n",
|
log_send_messaging(MESSAGING_INFO, "namespace '%s', key '%s', type '%s' \n",
|
||||||
info.namespace_name, info.key, type_to_str(info.type));
|
info.namespace_name, info.key, type_to_str(info.type));
|
||||||
} while (it != NULL);
|
} while (it != NULL);
|
||||||
|
|
||||||
@@ -453,9 +448,8 @@ static int list_entries(int argc, char **argv)
|
|||||||
list_args.namespace->sval[0] = "";
|
list_args.namespace->sval[0] = "";
|
||||||
list_args.type->sval[0] = "";
|
list_args.type->sval[0] = "";
|
||||||
|
|
||||||
int nerrors = arg_parse(argc, argv, (void **) &list_args);
|
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&list_args);
|
||||||
if (nerrors != 0) {
|
if (nerrors != 0) {
|
||||||
arg_print_errors(stderr, list_args.end, argv[0]);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,6 +25,8 @@
|
|||||||
#include "soc/rtc_cntl_reg.h"
|
#include "soc/rtc_cntl_reg.h"
|
||||||
#include "esp32/rom/uart.h"
|
#include "esp32/rom/uart.h"
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
|
#include "platform_console.h"
|
||||||
|
#include "messaging.h"
|
||||||
|
|
||||||
static const char * TAG = "ota";
|
static const char * TAG = "ota";
|
||||||
extern esp_err_t start_ota(const char * bin_url);
|
extern esp_err_t start_ota(const char * bin_url);
|
||||||
@@ -35,9 +37,8 @@ static struct {
|
|||||||
/* 'heap' command prints minumum heap size */
|
/* 'heap' command prints minumum heap size */
|
||||||
static int perform_ota_update(int argc, char **argv)
|
static int perform_ota_update(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int nerrors = arg_parse(argc, argv, (void **) &ota_args);
|
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&ota_args);
|
||||||
if (nerrors != 0) {
|
if (nerrors != 0) {
|
||||||
arg_print_errors(stderr, ota_args.end, argv[0]);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||||
CONDITIONS OF ANY KIND, either express or implied.
|
CONDITIONS OF ANY KIND, either express or implied.
|
||||||
*/
|
*/
|
||||||
#define LOG_LOCAL_LEVEL ESP_LOG_INFO
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@@ -26,18 +26,27 @@
|
|||||||
#include "esp_partition.h"
|
#include "esp_partition.h"
|
||||||
#include "esp_ota_ops.h"
|
#include "esp_ota_ops.h"
|
||||||
#include "platform_esp32.h"
|
#include "platform_esp32.h"
|
||||||
#include "config.h"
|
#include "platform_config.h"
|
||||||
#include "esp_sleep.h"
|
#include "esp_sleep.h"
|
||||||
#include "driver/uart.h" // for the uart driver access
|
#include "driver/uart.h" // for the uart driver access
|
||||||
|
#include "messaging.h"
|
||||||
|
#include "platform_console.h"
|
||||||
|
#include "trace.h"
|
||||||
|
|
||||||
#ifdef CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS
|
#ifdef CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS
|
||||||
#define WITH_TASKS_INFO 1
|
#define WITH_TASKS_INFO 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static struct {
|
||||||
|
struct arg_str *name;
|
||||||
|
struct arg_end *end;
|
||||||
|
} name_args;
|
||||||
|
|
||||||
static const char * TAG = "cmd_system";
|
static const char * TAG = "cmd_system";
|
||||||
|
|
||||||
|
static void register_setbtsource();
|
||||||
static void register_free();
|
static void register_free();
|
||||||
|
static void register_setdevicename();
|
||||||
static void register_heap();
|
static void register_heap();
|
||||||
static void register_version();
|
static void register_version();
|
||||||
static void register_restart();
|
static void register_restart();
|
||||||
@@ -45,18 +54,22 @@ static void register_deep_sleep();
|
|||||||
static void register_light_sleep();
|
static void register_light_sleep();
|
||||||
static void register_factory_boot();
|
static void register_factory_boot();
|
||||||
static void register_restart_ota();
|
static void register_restart_ota();
|
||||||
|
static void register_update_certs();
|
||||||
#if WITH_TASKS_INFO
|
#if WITH_TASKS_INFO
|
||||||
static void register_tasks();
|
static void register_tasks();
|
||||||
#endif
|
#endif
|
||||||
|
extern BaseType_t wifi_manager_task;
|
||||||
void register_system()
|
void register_system()
|
||||||
{
|
{
|
||||||
|
register_setbtsource();
|
||||||
register_free();
|
register_free();
|
||||||
register_heap();
|
register_heap();
|
||||||
|
register_setdevicename();
|
||||||
register_version();
|
register_version();
|
||||||
register_restart();
|
register_restart();
|
||||||
register_deep_sleep();
|
register_deep_sleep();
|
||||||
register_light_sleep();
|
register_light_sleep();
|
||||||
|
register_update_certs();
|
||||||
register_factory_boot();
|
register_factory_boot();
|
||||||
register_restart_ota();
|
register_restart_ota();
|
||||||
#if WITH_TASKS_INFO
|
#if WITH_TASKS_INFO
|
||||||
@@ -69,17 +82,19 @@ static int get_version(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
esp_chip_info_t info;
|
esp_chip_info_t info;
|
||||||
esp_chip_info(&info);
|
esp_chip_info(&info);
|
||||||
printf("IDF Version:%s\r\n", esp_get_idf_version());
|
log_send_messaging(MESSAGING_INFO,
|
||||||
printf("Chip info:\r\n");
|
"IDF Version:%s\r\n"
|
||||||
printf("\tmodel:%s\r\n", info.model == CHIP_ESP32 ? "ESP32" : "Unknow");
|
"Chip info:\r\n"
|
||||||
printf("\tcores:%d\r\n", info.cores);
|
"\tmodel:%s\r\n"
|
||||||
printf("\tfeature:%s%s%s%s%d%s\r\n",
|
"\tcores:%d\r\n"
|
||||||
info.features & CHIP_FEATURE_WIFI_BGN ? "/802.11bgn" : "",
|
"\tfeature:%s%s%s%s%d%s\r\n"
|
||||||
info.features & CHIP_FEATURE_BLE ? "/BLE" : "",
|
"\trevision number:%d\r\n",
|
||||||
info.features & CHIP_FEATURE_BT ? "/BT" : "",
|
esp_get_idf_version(), info.model == CHIP_ESP32 ? "ESP32" : "Unknow", info.cores,
|
||||||
info.features & CHIP_FEATURE_EMB_FLASH ? "/Embedded-Flash:" : "/External-Flash:",
|
info.features & CHIP_FEATURE_WIFI_BGN ? "/802.11bgn" : "",
|
||||||
spi_flash_get_chip_size() / (1024 * 1024), " MB");
|
info.features & CHIP_FEATURE_BLE ? "/BLE" : "",
|
||||||
printf("\trevision number:%d\r\n", info.revision);
|
info.features & CHIP_FEATURE_BT ? "/BT" : "",
|
||||||
|
info.features & CHIP_FEATURE_EMB_FLASH ? "/Embedded-Flash:" : "/External-Flash:",
|
||||||
|
spi_flash_get_chip_size() / (1024 * 1024), " MB", info.revision);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,6 +106,7 @@ static void register_version()
|
|||||||
.hint = NULL,
|
.hint = NULL,
|
||||||
.func = &get_version,
|
.func = &get_version,
|
||||||
};
|
};
|
||||||
|
cmd_to_json(&cmd);
|
||||||
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,38 +115,38 @@ static void register_version()
|
|||||||
|
|
||||||
esp_err_t guided_boot(esp_partition_subtype_t partition_subtype)
|
esp_err_t guided_boot(esp_partition_subtype_t partition_subtype)
|
||||||
{
|
{
|
||||||
#if RECOVERY_APPLICATION
|
if(is_recovery_running){
|
||||||
if(partition_subtype ==ESP_PARTITION_SUBTYPE_APP_FACTORY){
|
if(partition_subtype ==ESP_PARTITION_SUBTYPE_APP_FACTORY){
|
||||||
ESP_LOGW(TAG,"RECOVERY application is already active");
|
log_send_messaging(MESSAGING_WARNING,"RECOVERY application is already active");
|
||||||
if(!wait_for_commit()){
|
if(!wait_for_commit()){
|
||||||
ESP_LOGW(TAG,"Unable to commit configuration. ");
|
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
||||||
}
|
}
|
||||||
ESP_LOGW(TAG, "Restarting after tx complete");
|
|
||||||
uart_wait_tx_done(UART_NUM_1, 500 / portTICK_RATE_MS);
|
vTaskDelay(750/ portTICK_PERIOD_MS);
|
||||||
esp_restart();
|
esp_restart();
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
#else
|
}
|
||||||
|
else {
|
||||||
if(partition_subtype !=ESP_PARTITION_SUBTYPE_APP_FACTORY){
|
if(partition_subtype !=ESP_PARTITION_SUBTYPE_APP_FACTORY){
|
||||||
ESP_LOGW(TAG,"SQUEEZELITE application is already active");
|
log_send_messaging(MESSAGING_WARNING,"SQUEEZELITE application is already active");
|
||||||
if(!wait_for_commit()){
|
if(!wait_for_commit()){
|
||||||
ESP_LOGW(TAG,"Unable to commit configuration. ");
|
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
||||||
}
|
}
|
||||||
ESP_LOGW(TAG, "Restarting after tx complete");
|
|
||||||
uart_wait_tx_done(UART_NUM_1, 500 / portTICK_RATE_MS);
|
vTaskDelay(750/ portTICK_PERIOD_MS);
|
||||||
esp_restart();
|
esp_restart();
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
esp_err_t err = ESP_OK;
|
esp_err_t err = ESP_OK;
|
||||||
bool bFound=false;
|
bool bFound=false;
|
||||||
ESP_LOGI(TAG, "Looking for partition type %u",partition_subtype);
|
log_send_messaging(MESSAGING_INFO, "Looking for partition type %u",partition_subtype);
|
||||||
const esp_partition_t *partition;
|
const esp_partition_t *partition;
|
||||||
esp_partition_iterator_t it = esp_partition_find(ESP_PARTITION_TYPE_APP, partition_subtype, NULL);
|
esp_partition_iterator_t it = esp_partition_find(ESP_PARTITION_TYPE_APP, partition_subtype, NULL);
|
||||||
|
|
||||||
if(it == NULL){
|
if(it == NULL){
|
||||||
ESP_LOGE(TAG,"Unable initialize partition iterator!");
|
log_send_messaging(MESSAGING_ERROR,"Reboot failed. Cannot iterate through partitions");
|
||||||
set_status_message(ERROR, "Reboot failed. Cannot iterate through partitions");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -139,33 +155,31 @@ esp_err_t guided_boot(esp_partition_subtype_t partition_subtype)
|
|||||||
ESP_LOGD(TAG, "Releasing partition iterator");
|
ESP_LOGD(TAG, "Releasing partition iterator");
|
||||||
esp_partition_iterator_release(it);
|
esp_partition_iterator_release(it);
|
||||||
if(partition != NULL){
|
if(partition != NULL){
|
||||||
ESP_LOGI(TAG, "Found application partition %s sub type %u", partition->label,partition_subtype);
|
log_send_messaging(MESSAGING_INFO, "Found application partition %s sub type %u", partition->label,partition_subtype);
|
||||||
err=esp_ota_set_boot_partition(partition);
|
err=esp_ota_set_boot_partition(partition);
|
||||||
if(err!=ESP_OK){
|
if(err!=ESP_OK){
|
||||||
ESP_LOGE(TAG,"Unable to set partition as active for next boot. %s",esp_err_to_name(err));
|
|
||||||
bFound=false;
|
bFound=false;
|
||||||
set_status_message(ERROR, "Unable to select partition for reboot.");
|
log_send_messaging(MESSAGING_ERROR,"Unable to select partition for reboot: %s",esp_err_to_name(err));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
ESP_LOGW(TAG, "Application partition %s sub type %u is selected for boot", partition->label,partition_subtype);
|
log_send_messaging(MESSAGING_WARNING, "Application partition %s sub type %u is selected for boot", partition->label,partition_subtype);
|
||||||
bFound=true;
|
bFound=true;
|
||||||
set_status_message(WARNING, "Rebooting!");
|
messaging_post_message(MESSAGING_WARNING,MESSAGING_CLASS_SYSTEM,"Reboot failed. Cannot iterate through partitions");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ESP_LOGE(TAG,"partition type %u not found! Unable to reboot to recovery.",partition_subtype);
|
log_send_messaging(MESSAGING_ERROR,"partition type %u not found! Unable to reboot to recovery.",partition_subtype);
|
||||||
set_status_message(ERROR, "Partition not found.");
|
|
||||||
}
|
}
|
||||||
ESP_LOGD(TAG, "Yielding to other processes");
|
ESP_LOGD(TAG, "Yielding to other processes");
|
||||||
taskYIELD();
|
taskYIELD();
|
||||||
if(bFound) {
|
if(bFound) {
|
||||||
ESP_LOGW(TAG,"Configuration %s changes. ",config_has_changes()?"has":"does not have");
|
log_send_messaging(MESSAGING_WARNING,"Configuration %s changes. ",config_has_changes()?"has":"does not have");
|
||||||
if(!wait_for_commit()){
|
if(!wait_for_commit()){
|
||||||
ESP_LOGW(TAG,"Unable to commit configuration. ");
|
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
||||||
}
|
}
|
||||||
ESP_LOGW(TAG, "Restarting after tx complete");
|
vTaskDelay(750/ portTICK_PERIOD_MS);
|
||||||
uart_wait_tx_done(UART_NUM_1, 500 / portTICK_RATE_MS);
|
|
||||||
esp_restart();
|
esp_restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -175,47 +189,46 @@ esp_err_t guided_boot(esp_partition_subtype_t partition_subtype)
|
|||||||
|
|
||||||
static int restart(int argc, char **argv)
|
static int restart(int argc, char **argv)
|
||||||
{
|
{
|
||||||
ESP_LOGW(TAG, "\n\nPerforming a simple restart to the currently active partition.");
|
log_send_messaging(MESSAGING_WARNING, "\n\nPerforming a simple restart to the currently active partition.");
|
||||||
if(!wait_for_commit()){
|
if(!wait_for_commit()){
|
||||||
ESP_LOGW(TAG,"Unable to commit configuration. ");
|
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
||||||
}
|
}
|
||||||
ESP_LOGW(TAG, "Restarting after tx complete");
|
vTaskDelay(750/ portTICK_PERIOD_MS);
|
||||||
uart_wait_tx_done(UART_NUM_1, 500 / portTICK_RATE_MS);
|
|
||||||
esp_restart();
|
esp_restart();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void simple_restart()
|
void simple_restart()
|
||||||
{
|
{
|
||||||
ESP_LOGW(TAG,"\n\n Called to perform a simple system reboot.");
|
log_send_messaging(MESSAGING_WARNING,"\n\n Called to perform a simple system reboot.");
|
||||||
if(!wait_for_commit()){
|
if(!wait_for_commit()){
|
||||||
ESP_LOGW(TAG,"Unable to commit configuration. ");
|
log_send_messaging(MESSAGING_WARNING,"Unable to commit configuration. ");
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGW(TAG, "Restarting after tx complete");
|
|
||||||
uart_wait_tx_done(UART_NUM_1, 500 / portTICK_RATE_MS);
|
vTaskDelay(750/ portTICK_PERIOD_MS);
|
||||||
esp_restart();
|
esp_restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
esp_err_t guided_restart_ota(){
|
esp_err_t guided_restart_ota(){
|
||||||
ESP_LOGW(TAG,"\n\nCalled for a reboot to OTA Application");
|
log_send_messaging(MESSAGING_WARNING,"\n\nCalled for a reboot to OTA Application");
|
||||||
guided_boot(ESP_PARTITION_SUBTYPE_APP_OTA_0);
|
guided_boot(ESP_PARTITION_SUBTYPE_APP_OTA_0);
|
||||||
return ESP_FAIL; // return fail. This should never return... we're rebooting!
|
return ESP_FAIL; // return fail. This should never return... we're rebooting!
|
||||||
}
|
}
|
||||||
esp_err_t guided_factory(){
|
esp_err_t guided_factory(){
|
||||||
ESP_LOGW(TAG,"\n\nCalled for a reboot to recovery application");
|
log_send_messaging(MESSAGING_WARNING,"\n\nCalled for a reboot to recovery application");
|
||||||
guided_boot(ESP_PARTITION_SUBTYPE_APP_FACTORY);
|
guided_boot(ESP_PARTITION_SUBTYPE_APP_FACTORY);
|
||||||
return ESP_FAIL; // return fail. This should never return... we're rebooting!
|
return ESP_FAIL; // return fail. This should never return... we're rebooting!
|
||||||
}
|
}
|
||||||
static int restart_factory(int argc, char **argv)
|
static int restart_factory(int argc, char **argv)
|
||||||
{
|
{
|
||||||
ESP_LOGW(TAG, "Executing guided boot into recovery");
|
log_send_messaging(MESSAGING_WARNING, "Executing guided boot into recovery");
|
||||||
guided_boot(ESP_PARTITION_SUBTYPE_APP_FACTORY);
|
guided_boot(ESP_PARTITION_SUBTYPE_APP_FACTORY);
|
||||||
return 0; // return fail. This should never return... we're rebooting!
|
return 0; // return fail. This should never return... we're rebooting!
|
||||||
}
|
}
|
||||||
static int restart_ota(int argc, char **argv)
|
static int restart_ota(int argc, char **argv)
|
||||||
{
|
{
|
||||||
ESP_LOGW(TAG, "Executing guided boot into ota app 0");
|
log_send_messaging(MESSAGING_WARNING, "Executing guided boot into ota app 0");
|
||||||
guided_boot(ESP_PARTITION_SUBTYPE_APP_OTA_0);
|
guided_boot(ESP_PARTITION_SUBTYPE_APP_OTA_0);
|
||||||
return 0; // return fail. This should never return... we're rebooting!
|
return 0; // return fail. This should never return... we're rebooting!
|
||||||
}
|
}
|
||||||
@@ -227,6 +240,7 @@ static void register_restart()
|
|||||||
.hint = NULL,
|
.hint = NULL,
|
||||||
.func = &restart,
|
.func = &restart,
|
||||||
};
|
};
|
||||||
|
cmd_to_json(&cmd);
|
||||||
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||||
}
|
}
|
||||||
static void register_restart_ota()
|
static void register_restart_ota()
|
||||||
@@ -237,6 +251,7 @@ static void register_restart_ota()
|
|||||||
.hint = NULL,
|
.hint = NULL,
|
||||||
.func = &restart_ota,
|
.func = &restart_ota,
|
||||||
};
|
};
|
||||||
|
cmd_to_json(&cmd);
|
||||||
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,16 +263,102 @@ static void register_factory_boot()
|
|||||||
.hint = NULL,
|
.hint = NULL,
|
||||||
.func = &restart_factory,
|
.func = &restart_factory,
|
||||||
};
|
};
|
||||||
|
cmd_to_json(&cmd);
|
||||||
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||||
}
|
}
|
||||||
/** 'free' command prints available heap memory */
|
/** 'free' command prints available heap memory */
|
||||||
|
|
||||||
static int free_mem(int argc, char **argv)
|
static int free_mem(int argc, char **argv)
|
||||||
{
|
{
|
||||||
printf("%d\n", esp_get_free_heap_size());
|
log_send_messaging(MESSAGING_INFO,"%d", esp_get_free_heap_size());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
static struct {
|
||||||
|
struct arg_str *a2dp_dev_name;
|
||||||
|
struct arg_str *a2dp_sink_name;
|
||||||
|
struct arg_str *wakeup_gpio_level;
|
||||||
|
struct arg_str *bt_sink_pin;
|
||||||
|
struct arg_str *enable_bt_sink;
|
||||||
|
struct arg_end *end;
|
||||||
|
} set_btsource_args;
|
||||||
|
*/
|
||||||
|
|
||||||
|
//static int do_set_btsource(int argc, char **argv)
|
||||||
|
//{
|
||||||
|
// a2dp_dev_name;
|
||||||
|
// a2dp_sink_name;
|
||||||
|
// wakeup_gpio_level;
|
||||||
|
// bt_sink_pin;
|
||||||
|
// enable_bt_sink;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&deep_sleep_args);
|
||||||
|
// if (nerrors != 0) {
|
||||||
|
// return 1;
|
||||||
|
// }
|
||||||
|
// if (deep_sleep_args.wakeup_time->count) {
|
||||||
|
// uint64_t timeout = 1000ULL * deep_sleep_args.wakeup_time->ival[0];
|
||||||
|
// log_send_messaging(MESSAGING_INFO, "Enabling timer wakeup, timeout=%lluus", timeout);
|
||||||
|
// ESP_ERROR_CHECK( esp_sleep_enable_timer_wakeup(timeout) );
|
||||||
|
// }
|
||||||
|
// if (deep_sleep_args.wakeup_gpio_num->count) {
|
||||||
|
// int io_num = deep_sleep_args.wakeup_gpio_num->ival[0];
|
||||||
|
// if (!rtc_gpio_is_valid_gpio(io_num)) {
|
||||||
|
// log_send_messaging(MESSAGING_ERROR, "GPIO %d is not an RTC IO", io_num);
|
||||||
|
// return 1;
|
||||||
|
// }
|
||||||
|
// int level = 0;
|
||||||
|
// if (deep_sleep_args.wakeup_gpio_level->count) {
|
||||||
|
// level = deep_sleep_args.wakeup_gpio_level->ival[0];
|
||||||
|
// if (level != 0 && level != 1) {
|
||||||
|
// log_send_messaging(MESSAGING_ERROR, "Invalid wakeup level: %d", level);
|
||||||
|
// return 1;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// log_send_messaging(MESSAGING_INFO, "Enabling wakeup on GPIO%d, wakeup on %s level",
|
||||||
|
// io_num, level ? "HIGH" : "LOW");
|
||||||
|
//
|
||||||
|
// ESP_ERROR_CHECK( esp_sleep_enable_ext1_wakeup(1ULL << io_num, level) );
|
||||||
|
// }
|
||||||
|
// rtc_gpio_isolate(GPIO_NUM_12);
|
||||||
|
// esp_deep_sleep_start();
|
||||||
|
//return 0;
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void register_setbtsource(){
|
||||||
|
|
||||||
|
// a2dp_dev_name;
|
||||||
|
// a2dp_sink_name;
|
||||||
|
// wakeup_gpio_level;
|
||||||
|
// bt_sink_pin;
|
||||||
|
// enable_bt_sink;
|
||||||
|
//
|
||||||
|
// set_btsource_args.wakeup_time =
|
||||||
|
// arg_int0("t", "time", "<t>", "Wake up time, ms");
|
||||||
|
// set_btsource_args.wakeup_gpio_num =
|
||||||
|
// arg_int0(NULL, "io", "<n>",
|
||||||
|
// "If specified, wakeup using GPIO with given number");
|
||||||
|
// set_btsource_args.wakeup_gpio_level =
|
||||||
|
// arg_int0(NULL, "io_level", "<0|1>", "GPIO level to trigger wakeup");
|
||||||
|
// set_btsource_args.end = arg_end(3);
|
||||||
|
//
|
||||||
|
// const esp_console_cmd_t cmd = {
|
||||||
|
// .command = "deep_sleep",
|
||||||
|
// .help = "Enter deep sleep mode. "
|
||||||
|
// "Two wakeup modes are supported: timer and GPIO. "
|
||||||
|
// "If no wakeup option is specified, will sleep indefinitely.",
|
||||||
|
// .hint = NULL,
|
||||||
|
// .func = &do_set_btsource,
|
||||||
|
// .argtable = &set_btsource_args
|
||||||
|
// };
|
||||||
|
// ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||||
|
}
|
||||||
|
|
||||||
static void register_free()
|
static void register_free()
|
||||||
{
|
{
|
||||||
const esp_console_cmd_t cmd = {
|
const esp_console_cmd_t cmd = {
|
||||||
@@ -266,6 +367,7 @@ static void register_free()
|
|||||||
.hint = NULL,
|
.hint = NULL,
|
||||||
.func = &free_mem,
|
.func = &free_mem,
|
||||||
};
|
};
|
||||||
|
cmd_to_json(&cmd);
|
||||||
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,22 +375,94 @@ static void register_free()
|
|||||||
static int heap_size(int argc, char **argv)
|
static int heap_size(int argc, char **argv)
|
||||||
{
|
{
|
||||||
uint32_t heap_size = heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT);
|
uint32_t heap_size = heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT);
|
||||||
ESP_LOGI(TAG, "min heap size: %u", heap_size);
|
log_send_messaging(MESSAGING_INFO, "min heap size: %u", heap_size);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
cJSON * setdevicename_cb(){
|
||||||
|
char * default_host_name = config_alloc_get_str("host_name",NULL,"Squeezelite");
|
||||||
|
cJSON * values = cJSON_CreateObject();
|
||||||
|
cJSON_AddStringToObject(values,"name",default_host_name);
|
||||||
|
free(default_host_name);
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
static int setnamevar(char * nvsname, FILE *f, char * value){
|
||||||
|
esp_err_t err=ESP_OK;
|
||||||
|
if((err=config_set_value(NVS_TYPE_STR, nvsname, value))!=ESP_OK){
|
||||||
|
fprintf(f,"Unable to set %s=%s. %s\n",nvsname,value,esp_err_to_name(err));
|
||||||
|
}
|
||||||
|
return err==ESP_OK?0:1;
|
||||||
|
}
|
||||||
|
static int setdevicename(int argc, char **argv)
|
||||||
|
{
|
||||||
|
char * name = NULL;
|
||||||
|
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&name_args);
|
||||||
|
if (nerrors != 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check "--name" option */
|
||||||
|
if (name_args.name->count) {
|
||||||
|
name=strdup(name_args.name->sval[0]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
log_send_messaging(MESSAGING_ERROR,"Name must be specified.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *buf = NULL;
|
||||||
|
size_t buf_size = 0;
|
||||||
|
FILE *f = open_memstream(&buf, &buf_size);
|
||||||
|
if (f == NULL) {
|
||||||
|
log_send_messaging(MESSAGING_ERROR,"Unable to open memory stream.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
nerrors+=setnamevar("a2dp_dev_name", f, name);
|
||||||
|
nerrors+=setnamevar("airplay_name", f, name);
|
||||||
|
nerrors+=setnamevar("ap_ssid", f, name);
|
||||||
|
nerrors+=setnamevar("bt_name", f, name);
|
||||||
|
nerrors+=setnamevar("host_name", f, name);
|
||||||
|
if(nerrors==0){
|
||||||
|
fprintf(f,"Device name changed to %s\n",name);
|
||||||
|
}
|
||||||
|
|
||||||
|
FREE_AND_NULL(name);
|
||||||
|
fflush (f);
|
||||||
|
log_send_messaging(nerrors>0?MESSAGING_ERROR:MESSAGING_INFO,"%s", buf);
|
||||||
|
fclose(f);
|
||||||
|
FREE_AND_NULL(buf);
|
||||||
|
return nerrors==0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static void register_heap()
|
static void register_heap()
|
||||||
{
|
{
|
||||||
const esp_console_cmd_t heap_cmd = {
|
const esp_console_cmd_t heap_cmd = {
|
||||||
.command = "heap",
|
.command = "heap",
|
||||||
.help = "Get minimum size of free heap memory that was available during program execution",
|
.help = "Get minimum size of free heap memory found during execution",
|
||||||
.hint = NULL,
|
.hint = NULL,
|
||||||
.func = &heap_size,
|
.func = &heap_size,
|
||||||
};
|
};
|
||||||
|
cmd_to_json(&heap_cmd);
|
||||||
ESP_ERROR_CHECK( esp_console_cmd_register(&heap_cmd) );
|
ESP_ERROR_CHECK( esp_console_cmd_register(&heap_cmd) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void register_setdevicename()
|
||||||
|
{
|
||||||
|
char * default_host_name = config_alloc_get_str("host_name",NULL,"Squeezelite");
|
||||||
|
name_args.name = arg_str0("n", "name", default_host_name, "New Name");
|
||||||
|
name_args.end = arg_end(8);
|
||||||
|
const esp_console_cmd_t set_name= {
|
||||||
|
.command = "setname",
|
||||||
|
.help="Device Name",
|
||||||
|
.hint = NULL,
|
||||||
|
.func = &setdevicename,
|
||||||
|
.argtable = &name_args
|
||||||
|
};
|
||||||
|
cmd_to_json_with_cb(&set_name,&setdevicename_cb);
|
||||||
|
ESP_ERROR_CHECK(esp_console_cmd_register(&set_name));
|
||||||
|
}
|
||||||
/** 'tasks' command prints the list of tasks and related information */
|
/** 'tasks' command prints the list of tasks and related information */
|
||||||
#if WITH_TASKS_INFO
|
#if WITH_TASKS_INFO
|
||||||
|
|
||||||
@@ -297,16 +471,16 @@ static int tasks_info(int argc, char **argv)
|
|||||||
const size_t bytes_per_task = 40; /* see vTaskList description */
|
const size_t bytes_per_task = 40; /* see vTaskList description */
|
||||||
char *task_list_buffer = malloc(uxTaskGetNumberOfTasks() * bytes_per_task);
|
char *task_list_buffer = malloc(uxTaskGetNumberOfTasks() * bytes_per_task);
|
||||||
if (task_list_buffer == NULL) {
|
if (task_list_buffer == NULL) {
|
||||||
ESP_LOGE(TAG, "failed to allocate buffer for vTaskList output");
|
log_send_messaging(MESSAGING_ERROR, "failed to allocate buffer for vTaskList output");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
fputs("Task Name\tStatus\tPrio\tHWM\tTask#", stdout);
|
log_send_messaging(MESSAGING_INFO,"Task Name\tStatus\tPrio\tHWM\tTask#"
|
||||||
#ifdef CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID
|
#ifdef CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID
|
||||||
fputs("\tAffinity", stdout);
|
"\tAffinity"
|
||||||
#endif
|
#endif
|
||||||
fputs("\n", stdout);
|
"\n");
|
||||||
vTaskList(task_list_buffer);
|
vTaskList(task_list_buffer);
|
||||||
fputs(task_list_buffer, stdout);
|
log_send_messaging(MESSAGING_INFO,"%s", task_list_buffer);
|
||||||
free(task_list_buffer);
|
free(task_list_buffer);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -324,6 +498,24 @@ static void register_tasks()
|
|||||||
|
|
||||||
#endif // WITH_TASKS_INFO
|
#endif // WITH_TASKS_INFO
|
||||||
|
|
||||||
|
extern esp_err_t update_certificates(bool force);
|
||||||
|
static int force_update_cert(int argc, char **argv){
|
||||||
|
return update_certificates(true)==ESP_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void register_update_certs()
|
||||||
|
{
|
||||||
|
const esp_console_cmd_t cmd = {
|
||||||
|
.command = "update_certificates",
|
||||||
|
.help = "Force updating the certificates from binary",
|
||||||
|
.hint = NULL,
|
||||||
|
.func = &force_update_cert,
|
||||||
|
};
|
||||||
|
ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** 'deep_sleep' command puts the chip into deep sleep mode */
|
/** 'deep_sleep' command puts the chip into deep sleep mode */
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
@@ -336,31 +528,30 @@ static struct {
|
|||||||
|
|
||||||
static int deep_sleep(int argc, char **argv)
|
static int deep_sleep(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int nerrors = arg_parse(argc, argv, (void **) &deep_sleep_args);
|
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&deep_sleep_args);
|
||||||
if (nerrors != 0) {
|
if (nerrors != 0) {
|
||||||
arg_print_errors(stderr, deep_sleep_args.end, argv[0]);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (deep_sleep_args.wakeup_time->count) {
|
if (deep_sleep_args.wakeup_time->count) {
|
||||||
uint64_t timeout = 1000ULL * deep_sleep_args.wakeup_time->ival[0];
|
uint64_t timeout = 1000ULL * deep_sleep_args.wakeup_time->ival[0];
|
||||||
ESP_LOGI(TAG, "Enabling timer wakeup, timeout=%lluus", timeout);
|
log_send_messaging(MESSAGING_INFO, "Enabling timer wakeup, timeout=%lluus", timeout);
|
||||||
ESP_ERROR_CHECK( esp_sleep_enable_timer_wakeup(timeout) );
|
ESP_ERROR_CHECK( esp_sleep_enable_timer_wakeup(timeout) );
|
||||||
}
|
}
|
||||||
if (deep_sleep_args.wakeup_gpio_num->count) {
|
if (deep_sleep_args.wakeup_gpio_num->count) {
|
||||||
int io_num = deep_sleep_args.wakeup_gpio_num->ival[0];
|
int io_num = deep_sleep_args.wakeup_gpio_num->ival[0];
|
||||||
if (!rtc_gpio_is_valid_gpio(io_num)) {
|
if (!rtc_gpio_is_valid_gpio(io_num)) {
|
||||||
ESP_LOGE(TAG, "GPIO %d is not an RTC IO", io_num);
|
log_send_messaging(MESSAGING_ERROR, "GPIO %d is not an RTC IO", io_num);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
int level = 0;
|
int level = 0;
|
||||||
if (deep_sleep_args.wakeup_gpio_level->count) {
|
if (deep_sleep_args.wakeup_gpio_level->count) {
|
||||||
level = deep_sleep_args.wakeup_gpio_level->ival[0];
|
level = deep_sleep_args.wakeup_gpio_level->ival[0];
|
||||||
if (level != 0 && level != 1) {
|
if (level != 0 && level != 1) {
|
||||||
ESP_LOGE(TAG, "Invalid wakeup level: %d", level);
|
log_send_messaging(MESSAGING_ERROR, "Invalid wakeup level: %d", level);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ESP_LOGI(TAG, "Enabling wakeup on GPIO%d, wakeup on %s level",
|
log_send_messaging(MESSAGING_INFO, "Enabling wakeup on GPIO%d, wakeup on %s level",
|
||||||
io_num, level ? "HIGH" : "LOW");
|
io_num, level ? "HIGH" : "LOW");
|
||||||
|
|
||||||
ESP_ERROR_CHECK( esp_sleep_enable_ext1_wakeup(1ULL << io_num, level) );
|
ESP_ERROR_CHECK( esp_sleep_enable_ext1_wakeup(1ULL << io_num, level) );
|
||||||
@@ -403,30 +594,29 @@ static struct {
|
|||||||
|
|
||||||
static int light_sleep(int argc, char **argv)
|
static int light_sleep(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int nerrors = arg_parse(argc, argv, (void **) &light_sleep_args);
|
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&light_sleep_args);
|
||||||
if (nerrors != 0) {
|
if (nerrors != 0) {
|
||||||
arg_print_errors(stderr, light_sleep_args.end, argv[0]);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_ALL);
|
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_ALL);
|
||||||
if (light_sleep_args.wakeup_time->count) {
|
if (light_sleep_args.wakeup_time->count) {
|
||||||
uint64_t timeout = 1000ULL * light_sleep_args.wakeup_time->ival[0];
|
uint64_t timeout = 1000ULL * light_sleep_args.wakeup_time->ival[0];
|
||||||
ESP_LOGI(TAG, "Enabling timer wakeup, timeout=%lluus", timeout);
|
log_send_messaging(MESSAGING_INFO, "Enabling timer wakeup, timeout=%lluus", timeout);
|
||||||
ESP_ERROR_CHECK( esp_sleep_enable_timer_wakeup(timeout) );
|
ESP_ERROR_CHECK( esp_sleep_enable_timer_wakeup(timeout) );
|
||||||
}
|
}
|
||||||
int io_count = light_sleep_args.wakeup_gpio_num->count;
|
int io_count = light_sleep_args.wakeup_gpio_num->count;
|
||||||
if (io_count != light_sleep_args.wakeup_gpio_level->count) {
|
if (io_count != light_sleep_args.wakeup_gpio_level->count) {
|
||||||
ESP_LOGE(TAG, "Should have same number of 'io' and 'io_level' arguments");
|
log_send_messaging(MESSAGING_INFO, "Should have same number of 'io' and 'io_level' arguments");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < io_count; ++i) {
|
for (int i = 0; i < io_count; ++i) {
|
||||||
int io_num = light_sleep_args.wakeup_gpio_num->ival[i];
|
int io_num = light_sleep_args.wakeup_gpio_num->ival[i];
|
||||||
int level = light_sleep_args.wakeup_gpio_level->ival[i];
|
int level = light_sleep_args.wakeup_gpio_level->ival[i];
|
||||||
if (level != 0 && level != 1) {
|
if (level != 0 && level != 1) {
|
||||||
ESP_LOGE(TAG, "Invalid wakeup level: %d", level);
|
log_send_messaging(MESSAGING_ERROR, "Invalid wakeup level: %d", level);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
ESP_LOGI(TAG, "Enabling wakeup on GPIO%d, wakeup on %s level",
|
log_send_messaging(MESSAGING_INFO, "Enabling wakeup on GPIO%d, wakeup on %s level",
|
||||||
io_num, level ? "HIGH" : "LOW");
|
io_num, level ? "HIGH" : "LOW");
|
||||||
|
|
||||||
ESP_ERROR_CHECK( gpio_wakeup_enable(io_num, level ? GPIO_INTR_HIGH_LEVEL : GPIO_INTR_LOW_LEVEL) );
|
ESP_ERROR_CHECK( gpio_wakeup_enable(io_num, level ? GPIO_INTR_HIGH_LEVEL : GPIO_INTR_LOW_LEVEL) );
|
||||||
@@ -434,13 +624,13 @@ static int light_sleep(int argc, char **argv)
|
|||||||
if (io_count > 0) {
|
if (io_count > 0) {
|
||||||
ESP_ERROR_CHECK( esp_sleep_enable_gpio_wakeup() );
|
ESP_ERROR_CHECK( esp_sleep_enable_gpio_wakeup() );
|
||||||
}
|
}
|
||||||
if (CONFIG_CONSOLE_UART_NUM <= UART_NUM_1) {
|
if (CONFIG_ESP_CONSOLE_UART_NUM <= UART_NUM_1) {
|
||||||
ESP_LOGI(TAG, "Enabling UART wakeup (press ENTER to exit light sleep)");
|
log_send_messaging(MESSAGING_INFO, "Enabling UART wakeup (press ENTER to exit light sleep)");
|
||||||
ESP_ERROR_CHECK( uart_set_wakeup_threshold(CONFIG_CONSOLE_UART_NUM, 3) );
|
ESP_ERROR_CHECK( uart_set_wakeup_threshold(CONFIG_ESP_CONSOLE_UART_NUM, 3) );
|
||||||
ESP_ERROR_CHECK( esp_sleep_enable_uart_wakeup(CONFIG_CONSOLE_UART_NUM) );
|
ESP_ERROR_CHECK( esp_sleep_enable_uart_wakeup(CONFIG_ESP_CONSOLE_UART_NUM) );
|
||||||
}
|
}
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
uart_tx_wait_idle(CONFIG_CONSOLE_UART_NUM);
|
uart_tx_wait_idle(CONFIG_ESP_CONSOLE_UART_NUM);
|
||||||
esp_light_sleep_start();
|
esp_light_sleep_start();
|
||||||
esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause();
|
esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause();
|
||||||
const char *cause_str;
|
const char *cause_str;
|
||||||
@@ -458,7 +648,7 @@ static int light_sleep(int argc, char **argv)
|
|||||||
cause_str = "unknown";
|
cause_str = "unknown";
|
||||||
printf("%d\n", cause);
|
printf("%d\n", cause);
|
||||||
}
|
}
|
||||||
ESP_LOGI(TAG, "Woke up from: %s", cause_str);
|
log_send_messaging(MESSAGING_INFO, "Woke up from: %s", cause_str);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,6 +34,8 @@
|
|||||||
#include "led.h"
|
#include "led.h"
|
||||||
extern bool bypass_wifi_manager;
|
extern bool bypass_wifi_manager;
|
||||||
#define JOIN_TIMEOUT_MS (10000)
|
#define JOIN_TIMEOUT_MS (10000)
|
||||||
|
#include "platform_console.h"
|
||||||
|
|
||||||
|
|
||||||
extern EventGroupHandle_t wifi_event_group;
|
extern EventGroupHandle_t wifi_event_group;
|
||||||
extern const int CONNECTED_BIT;
|
extern const int CONNECTED_BIT;
|
||||||
@@ -46,6 +48,11 @@ static struct {
|
|||||||
struct arg_end *end;
|
struct arg_end *end;
|
||||||
} join_args;
|
} join_args;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// todo: implement access point config - cmd_to_json(&i2cdetect_cmd);
|
||||||
|
|
||||||
|
|
||||||
///** Arguments used by 'join' function */
|
///** Arguments used by 'join' function */
|
||||||
//static struct {
|
//static struct {
|
||||||
// struct arg_int *autoconnect;
|
// struct arg_int *autoconnect;
|
||||||
@@ -151,9 +158,8 @@ static bool wifi_join(const char *ssid, const char *pass, int timeout_ms)
|
|||||||
|
|
||||||
static int connect(int argc, char **argv)
|
static int connect(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int nerrors = arg_parse(argc, argv, (void **) &join_args);
|
int nerrors = arg_parse_msg(argc, argv,(struct arg_hdr **)&join_args);
|
||||||
if (nerrors != 0) {
|
if (nerrors != 0) {
|
||||||
arg_print_errors(stderr, join_args.end, argv[0]);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
ESP_LOGI(__func__, "Connecting to '%s'",
|
ESP_LOGI(__func__, "Connecting to '%s'",
|
||||||
@@ -8,6 +8,5 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
COMPONENT_ADD_INCLUDEDIRS := .
|
COMPONENT_ADD_INCLUDEDIRS := .
|
||||||
CFLAGS += -I$(COMPONENT_PATH)/../squeezelite-ota
|
|
||||||
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/components/tools/
|
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/components/tools/
|
||||||
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/main
|
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/main
|
||||||
410
components/platform_console/platform_console.c
Normal file
410
components/platform_console/platform_console.c
Normal file
@@ -0,0 +1,410 @@
|
|||||||
|
/* Console example
|
||||||
|
|
||||||
|
This example code is in the Public Domain (or CC0 licensed, at your option.)
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, this
|
||||||
|
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||||
|
CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "platform_console.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "esp_log.h"
|
||||||
|
#include "esp_console.h"
|
||||||
|
#include "esp_vfs_dev.h"
|
||||||
|
#include "driver/uart.h"
|
||||||
|
#include "linenoise/linenoise.h"
|
||||||
|
#include "argtable3/argtable3.h"
|
||||||
|
#include "nvs.h"
|
||||||
|
#include "nvs_flash.h"
|
||||||
|
#include "pthread.h"
|
||||||
|
#include "platform_esp32.h"
|
||||||
|
#include "cmd_decl.h"
|
||||||
|
#include "trace.h"
|
||||||
|
#include "platform_config.h"
|
||||||
|
#include "telnet.h"
|
||||||
|
|
||||||
|
#include "messaging.h"
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
pthread_t thread_console;
|
||||||
|
static void * console_thread();
|
||||||
|
void console_start();
|
||||||
|
static const char * TAG = "console";
|
||||||
|
extern bool bypass_wifi_manager;
|
||||||
|
extern void register_squeezelite();
|
||||||
|
|
||||||
|
/* Prompt to be printed before each line.
|
||||||
|
* This can be customized, made dynamic, etc.
|
||||||
|
*/
|
||||||
|
const char* prompt = LOG_COLOR_I "squeezelite-esp32> " LOG_RESET_COLOR;
|
||||||
|
const char* recovery_prompt = LOG_COLOR_E "recovery-squeezelite-esp32> " LOG_RESET_COLOR;
|
||||||
|
|
||||||
|
/* Console command history can be stored to and loaded from a file.
|
||||||
|
* The easiest way to do this is to use FATFS filesystem on top of
|
||||||
|
* wear_levelling library.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define MOUNT_PATH "/data"
|
||||||
|
#define HISTORY_PATH MOUNT_PATH "/history.txt"
|
||||||
|
void run_command(char * line);
|
||||||
|
#define ADD_TO_JSON(o,t,n) if (t->n) cJSON_AddStringToObject(o,QUOTE(n),t->n);
|
||||||
|
#define ADD_PARMS_TO_CMD(o,t,n) { cJSON * parms = ParmsToJSON(&t.n->hdr); if(parms) cJSON_AddItemToObject(o,QUOTE(n),parms); }
|
||||||
|
cJSON * cmdList;
|
||||||
|
cJSON * values_fn_list;
|
||||||
|
cJSON * get_cmd_list(){
|
||||||
|
cJSON * element;
|
||||||
|
cJSON * values=cJSON_CreateObject();
|
||||||
|
cJSON * list = cJSON_CreateObject();
|
||||||
|
cJSON_AddItemReferenceToObject(list,"commands",cmdList);
|
||||||
|
cJSON_AddItemToObject(list,"values",values);
|
||||||
|
cJSON_ArrayForEach(element,cmdList){
|
||||||
|
cJSON * name = cJSON_GetObjectItem(element,"name");
|
||||||
|
cJSON * vals_fn = cJSON_GetObjectItem(values_fn_list,cJSON_GetStringValue(name));
|
||||||
|
if(vals_fn!=NULL ){
|
||||||
|
parm_values_fn_t *parm_values_fn = (parm_values_fn_t *)strtoul(cJSON_GetStringValue(vals_fn), NULL, 16);;
|
||||||
|
|
||||||
|
if(parm_values_fn){
|
||||||
|
cJSON_AddItemToObject(values,cJSON_GetStringValue(name),parm_values_fn());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct arg_end *getParmsEnd(struct arg_hdr * * argtable){
|
||||||
|
if(!argtable) return NULL;
|
||||||
|
struct arg_hdr * *table = (struct arg_hdr * *)argtable;
|
||||||
|
int tabindex = 0;
|
||||||
|
while (!(table[tabindex]->flag & ARG_TERMINATOR))
|
||||||
|
{
|
||||||
|
tabindex++;
|
||||||
|
}
|
||||||
|
return (struct arg_end *)table[tabindex];
|
||||||
|
}
|
||||||
|
cJSON * ParmsToJSON(struct arg_hdr * * argtable){
|
||||||
|
if(!argtable) return NULL;
|
||||||
|
cJSON * arg_list = cJSON_CreateArray();
|
||||||
|
struct arg_hdr * *table = (struct arg_hdr * *)argtable;
|
||||||
|
int tabindex = 0;
|
||||||
|
while (!(table[tabindex]->flag & ARG_TERMINATOR))
|
||||||
|
{
|
||||||
|
cJSON * entry = cJSON_CreateObject();
|
||||||
|
ADD_TO_JSON(entry,table[tabindex],datatype);
|
||||||
|
ADD_TO_JSON(entry,table[tabindex],glossary);
|
||||||
|
ADD_TO_JSON(entry,table[tabindex],longopts);
|
||||||
|
ADD_TO_JSON(entry,table[tabindex],shortopts);
|
||||||
|
cJSON_AddBoolToObject(entry, "checkbox", (table[tabindex]->flag & ARG_HASOPTVALUE)==0 && (table[tabindex]->flag & ARG_HASVALUE)==0);
|
||||||
|
cJSON_AddBoolToObject(entry, "hasvalue", table[tabindex]->flag & ARG_HASVALUE);
|
||||||
|
cJSON_AddItemToArray(arg_list, entry);
|
||||||
|
tabindex++;
|
||||||
|
}
|
||||||
|
return arg_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_err_t cmd_to_json(const esp_console_cmd_t *cmd){
|
||||||
|
return cmd_to_json_with_cb(cmd, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_err_t cmd_to_json_with_cb(const esp_console_cmd_t *cmd, parm_values_fn_t parm_values_fn){
|
||||||
|
if(!cmdList){
|
||||||
|
cmdList=cJSON_CreateArray();
|
||||||
|
}
|
||||||
|
if(!values_fn_list){
|
||||||
|
values_fn_list=cJSON_CreateObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmd->command == NULL) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
if (strchr(cmd->command, ' ') != NULL) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
cJSON * jsoncmd = cJSON_CreateObject();
|
||||||
|
ADD_TO_JSON(jsoncmd,cmd,help);
|
||||||
|
ADD_TO_JSON(jsoncmd,cmd,hint);
|
||||||
|
if(parm_values_fn){
|
||||||
|
char addr[11]={0};
|
||||||
|
snprintf(addr,sizeof(addr),"%lx",(unsigned long)parm_values_fn);
|
||||||
|
cJSON_AddStringToObject(values_fn_list,cmd->command,addr);
|
||||||
|
}
|
||||||
|
cJSON_AddBoolToObject(jsoncmd,"hascb",parm_values_fn!=NULL);
|
||||||
|
|
||||||
|
if(cmd->argtable){
|
||||||
|
cJSON_AddItemToObject(jsoncmd,"argtable",ParmsToJSON(cmd->argtable));
|
||||||
|
}
|
||||||
|
if (cmd->hint) {
|
||||||
|
cJSON_AddStringToObject(jsoncmd, "hint", cmd->hint);
|
||||||
|
}
|
||||||
|
else if (cmd->argtable) {
|
||||||
|
/* Generate hint based on cmd->argtable */
|
||||||
|
char *buf = NULL;
|
||||||
|
size_t buf_size = 0;
|
||||||
|
FILE *f = open_memstream(&buf, &buf_size);
|
||||||
|
if (f != NULL) {
|
||||||
|
arg_print_syntax(f, cmd->argtable, NULL);
|
||||||
|
fflush(f);
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
cJSON_AddStringToObject(jsoncmd, "hint", buf);
|
||||||
|
FREE_AND_NULL(buf);
|
||||||
|
}
|
||||||
|
cJSON_AddStringToObject(jsoncmd, "name", cmd->command);
|
||||||
|
char * b=cJSON_Print(jsoncmd);
|
||||||
|
if(b){
|
||||||
|
ESP_LOGD(TAG,"Adding command table %s",b);
|
||||||
|
free(b);
|
||||||
|
}
|
||||||
|
cJSON_AddItemToArray(cmdList, jsoncmd);
|
||||||
|
return ESP_OK;
|
||||||
|
}
|
||||||
|
int arg_parse_msg(int argc, char **argv, struct arg_hdr ** args){
|
||||||
|
int nerrors = arg_parse(argc, argv, (void **)args);
|
||||||
|
|
||||||
|
if (nerrors != 0) {
|
||||||
|
char *buf = NULL;
|
||||||
|
size_t buf_size = 0;
|
||||||
|
FILE *f = open_memstream(&buf, &buf_size);
|
||||||
|
if (f != NULL) {
|
||||||
|
arg_print_errors(f, getParmsEnd(args), argv[0]);
|
||||||
|
fflush (f);
|
||||||
|
log_send_messaging(MESSAGING_ERROR,"%s", buf);
|
||||||
|
}
|
||||||
|
fclose(f);
|
||||||
|
FREE_AND_NULL(buf);
|
||||||
|
}
|
||||||
|
return nerrors;
|
||||||
|
}
|
||||||
|
void process_autoexec(){
|
||||||
|
int i=1;
|
||||||
|
char autoexec_name[21]={0};
|
||||||
|
char * autoexec_value=NULL;
|
||||||
|
uint8_t autoexec_flag=0;
|
||||||
|
|
||||||
|
char * str_flag = config_alloc_get(NVS_TYPE_STR, "autoexec");
|
||||||
|
if(!bypass_wifi_manager){
|
||||||
|
ESP_LOGW(TAG, "Processing autoexec commands while wifi_manager active. Wifi related commands will be ignored.");
|
||||||
|
}
|
||||||
|
if(is_recovery_running){
|
||||||
|
ESP_LOGD(TAG, "Processing autoexec commands in recovery mode. Squeezelite commands will be ignored.");
|
||||||
|
}
|
||||||
|
if(str_flag !=NULL ){
|
||||||
|
autoexec_flag=atoi(str_flag);
|
||||||
|
ESP_LOGI(TAG,"autoexec is set to %s auto-process", autoexec_flag>0?"perform":"skip");
|
||||||
|
if(autoexec_flag == 1) {
|
||||||
|
do {
|
||||||
|
snprintf(autoexec_name,sizeof(autoexec_name)-1,"autoexec%u",i++);
|
||||||
|
ESP_LOGD(TAG,"Getting command name %s", autoexec_name);
|
||||||
|
autoexec_value= config_alloc_get(NVS_TYPE_STR, autoexec_name);
|
||||||
|
if(autoexec_value!=NULL ){
|
||||||
|
if(!bypass_wifi_manager && strstr(autoexec_value, "join ")!=NULL ){
|
||||||
|
ESP_LOGW(TAG,"Ignoring wifi join command.");
|
||||||
|
}
|
||||||
|
else if(is_recovery_running && !strstr(autoexec_value, "squeezelite " ) ){
|
||||||
|
ESP_LOGW(TAG,"Ignoring command. ");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ESP_LOGI(TAG,"Running command %s = %s", autoexec_name, autoexec_value);
|
||||||
|
run_command(autoexec_value);
|
||||||
|
}
|
||||||
|
ESP_LOGD(TAG,"Freeing memory for command %s name", autoexec_name);
|
||||||
|
free(autoexec_value);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ESP_LOGD(TAG,"No matching command found for name %s", autoexec_name);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} while(1);
|
||||||
|
}
|
||||||
|
free(str_flag);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ESP_LOGD(TAG,"No matching command found for name autoexec.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void initialize_console() {
|
||||||
|
|
||||||
|
/* Disable buffering on stdin */
|
||||||
|
setvbuf(stdin, NULL, _IONBF, 0);
|
||||||
|
|
||||||
|
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
||||||
|
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
||||||
|
/* Move the caret to the beginning of the next line on '\n' */
|
||||||
|
esp_vfs_dev_uart_set_tx_line_endings(ESP_LINE_ENDINGS_CRLF);
|
||||||
|
|
||||||
|
/* Configure UART. Note that REF_TICK is used so that the baud rate remains
|
||||||
|
* correct while APB frequency is changing in light sleep mode.
|
||||||
|
*/
|
||||||
|
const uart_config_t uart_config = { .baud_rate =
|
||||||
|
CONFIG_CONSOLE_UART_BAUDRATE, .data_bits = UART_DATA_8_BITS,
|
||||||
|
.parity = UART_PARITY_DISABLE, .stop_bits = UART_STOP_BITS_1,
|
||||||
|
.use_ref_tick = true };
|
||||||
|
ESP_ERROR_CHECK(uart_param_config(CONFIG_ESP_CONSOLE_UART_NUM, &uart_config));
|
||||||
|
|
||||||
|
/* Install UART driver for interrupt-driven reads and writes */
|
||||||
|
ESP_ERROR_CHECK( uart_driver_install(CONFIG_ESP_CONSOLE_UART_NUM, 256, 0, 0, NULL, 0));
|
||||||
|
|
||||||
|
/* Tell VFS to use UART driver */
|
||||||
|
esp_vfs_dev_uart_use_driver(CONFIG_ESP_CONSOLE_UART_NUM);
|
||||||
|
|
||||||
|
/* Initialize the console */
|
||||||
|
esp_console_config_t console_config = { .max_cmdline_args = 22,
|
||||||
|
.max_cmdline_length = 600,
|
||||||
|
#if CONFIG_LOG_COLORS
|
||||||
|
.hint_color = atoi(LOG_COLOR_CYAN)
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
ESP_ERROR_CHECK(esp_console_init(&console_config));
|
||||||
|
|
||||||
|
/* Configure linenoise line completion library */
|
||||||
|
/* Enable multiline editing. If not set, long commands will scroll within
|
||||||
|
* single line.
|
||||||
|
*/
|
||||||
|
linenoiseSetMultiLine(1);
|
||||||
|
|
||||||
|
/* Tell linenoise where to get command completions and hints */
|
||||||
|
linenoiseSetCompletionCallback(&esp_console_get_completion);
|
||||||
|
linenoiseSetHintsCallback((linenoiseHintsCallback*) &esp_console_get_hint);
|
||||||
|
|
||||||
|
/* Set command history size */
|
||||||
|
linenoiseHistorySetMaxLen(100);
|
||||||
|
|
||||||
|
/* Load command history from filesystem */
|
||||||
|
//linenoiseHistoryLoad(HISTORY_PATH);
|
||||||
|
}
|
||||||
|
|
||||||
|
void console_start() {
|
||||||
|
if(!is_serial_suppressed()){
|
||||||
|
initialize_console();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* Initialize the console */
|
||||||
|
esp_console_config_t console_config = { .max_cmdline_args = 22,
|
||||||
|
.max_cmdline_length = 600,
|
||||||
|
#if CONFIG_LOG_COLORS
|
||||||
|
.hint_color = atoi(LOG_COLOR_CYAN)
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
ESP_ERROR_CHECK(esp_console_init(&console_config));
|
||||||
|
}
|
||||||
|
/* Register commands */
|
||||||
|
esp_console_register_help_command();
|
||||||
|
register_system();
|
||||||
|
register_nvs();
|
||||||
|
register_wifi();
|
||||||
|
if(!is_recovery_running){
|
||||||
|
register_squeezelite();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
register_ota_cmd();
|
||||||
|
}
|
||||||
|
register_i2ctools();
|
||||||
|
|
||||||
|
if(!is_serial_suppressed()){
|
||||||
|
printf("\n");
|
||||||
|
if(is_recovery_running){
|
||||||
|
printf("****************************************************************\n"
|
||||||
|
"RECOVERY APPLICATION\n"
|
||||||
|
"This mode is used to flash Squeezelite into the OTA partition\n"
|
||||||
|
"****\n\n");
|
||||||
|
}
|
||||||
|
printf("Type 'help' to get the list of commands.\n"
|
||||||
|
"Use UP/DOWN arrows to navigate through command history.\n"
|
||||||
|
"Press TAB when typing command name to auto-complete.\n"
|
||||||
|
"\n");
|
||||||
|
if(!is_recovery_running){
|
||||||
|
printf("To automatically execute lines at startup:\n"
|
||||||
|
"\tSet NVS variable autoexec (U8) = 1 to enable, 0 to disable automatic execution.\n"
|
||||||
|
"\tSet NVS variable autoexec[1~9] (string)to a command that should be executed automatically\n");
|
||||||
|
}
|
||||||
|
printf("\n\n");
|
||||||
|
|
||||||
|
/* Figure out if the terminal supports escape sequences */
|
||||||
|
int probe_status = linenoiseProbe();
|
||||||
|
if (probe_status) { /* zero indicates success */
|
||||||
|
printf("\n****************************\n"
|
||||||
|
"Your terminal application does not support escape sequences.\n"
|
||||||
|
"Line editing and history features are disabled.\n"
|
||||||
|
"On Windows, try using Putty instead.\n"
|
||||||
|
"****************************\n");
|
||||||
|
linenoiseSetDumbMode(1);
|
||||||
|
#if CONFIG_LOG_COLORS
|
||||||
|
/* Since the terminal doesn't support escape sequences,
|
||||||
|
* don't use color codes in the prompt.
|
||||||
|
*/
|
||||||
|
if(is_recovery_running){
|
||||||
|
recovery_prompt= "recovery-squeezelite-esp32>";
|
||||||
|
}
|
||||||
|
prompt = "squeezelite-esp32> ";
|
||||||
|
|
||||||
|
#endif //CONFIG_LOG_COLORS
|
||||||
|
}
|
||||||
|
esp_pthread_cfg_t cfg = esp_pthread_get_default_config();
|
||||||
|
cfg.thread_name= "console";
|
||||||
|
cfg.inherit_cfg = true;
|
||||||
|
if(is_recovery_running){
|
||||||
|
prompt = recovery_prompt;
|
||||||
|
cfg.stack_size = 4096 ;
|
||||||
|
}
|
||||||
|
esp_pthread_set_cfg(&cfg);
|
||||||
|
pthread_attr_t attr;
|
||||||
|
pthread_attr_init(&attr);
|
||||||
|
|
||||||
|
pthread_create(&thread_console, &attr, console_thread, NULL);
|
||||||
|
pthread_attr_destroy(&attr);
|
||||||
|
}
|
||||||
|
else if(!is_recovery_running){
|
||||||
|
process_autoexec();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
void run_command(char * line){
|
||||||
|
/* Try to run the command */
|
||||||
|
int ret;
|
||||||
|
esp_err_t err = esp_console_run(line, &ret);
|
||||||
|
|
||||||
|
if (err == ESP_ERR_NOT_FOUND) {
|
||||||
|
ESP_LOGE(TAG,"Unrecognized command: %s", line);
|
||||||
|
} else if (err == ESP_ERR_INVALID_ARG) {
|
||||||
|
// command was empty
|
||||||
|
} else if (err == ESP_OK && ret != ESP_OK) {
|
||||||
|
ESP_LOGW(TAG,"Command returned non-zero error code: 0x%x (%s)", ret,
|
||||||
|
esp_err_to_name(err));
|
||||||
|
} else if (err != ESP_OK) {
|
||||||
|
ESP_LOGE(TAG,"Internal error: %s", esp_err_to_name(err));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
static void * console_thread() {
|
||||||
|
if(!is_recovery_running){
|
||||||
|
process_autoexec();
|
||||||
|
}
|
||||||
|
/* Main loop */
|
||||||
|
while (1) {
|
||||||
|
/* Get a line using linenoise.
|
||||||
|
* The line is returned when ENTER is pressed.
|
||||||
|
*/
|
||||||
|
char* line = linenoise(prompt);
|
||||||
|
if (line == NULL) { /* Ignore empty lines */
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
/* Add the command to the history */
|
||||||
|
linenoiseHistoryAdd(line);
|
||||||
|
|
||||||
|
/* Save command history to filesystem */
|
||||||
|
linenoiseHistorySave(HISTORY_PATH);
|
||||||
|
printf("\n");
|
||||||
|
run_command(line);
|
||||||
|
/* linenoise allocates line buffer on the heap, so need to free it */
|
||||||
|
linenoiseFree(line);
|
||||||
|
taskYIELD();
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -7,12 +7,17 @@
|
|||||||
CONDITIONS OF ANY KIND, either express or implied.
|
CONDITIONS OF ANY KIND, either express or implied.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include "esp_console.h"
|
||||||
|
#include "argtable3/argtable3.h"
|
||||||
|
#include "cJSON.h"
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
typedef cJSON * parm_values_fn_t(void);
|
||||||
|
esp_err_t cmd_to_json(const esp_console_cmd_t *cmd);
|
||||||
|
esp_err_t cmd_to_json_with_cb(const esp_console_cmd_t *cmd, parm_values_fn_t parm_values_fn);
|
||||||
|
int arg_parse_msg(int argc, char **argv, struct arg_hdr ** args);
|
||||||
|
cJSON * get_cmd_list();
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
10
components/raop/CMakeLists.txt
Normal file
10
components/raop/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
idf_component_register(SRC_DIRS .
|
||||||
|
INCLUDE_DIRS .
|
||||||
|
PRIV_REQUIRES newlib freertos pthread platform_config mdns services codecs tools display
|
||||||
|
|
||||||
|
)
|
||||||
|
set_source_files_properties(raop.c
|
||||||
|
PROPERTIES COMPILE_FLAGS
|
||||||
|
-Wno-misleading-indentation
|
||||||
|
)
|
||||||
@@ -7,7 +7,9 @@
|
|||||||
# please read the SDK documents if you need to do this.
|
# please read the SDK documents if you need to do this.
|
||||||
#
|
#
|
||||||
|
|
||||||
CFLAGS += -fstack-usage \
|
CFLAGS += -fstack-usage\
|
||||||
-I$(COMPONENT_PATH)/../tools \
|
-I$(PROJECT_PATH)/components/tools \
|
||||||
-I$(COMPONENT_PATH)/../codecs/inc/alac \
|
-I$(PROJECT_PATH)/components/codecs/inc/alac \
|
||||||
-I$(PROJECT_PATH)/main/
|
-I$(PROJECT_PATH)/main/
|
||||||
|
COMPONENT_ADD_INCLUDEDIRS := .
|
||||||
|
COMPONENT_SRCDIRS := .
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -6,12 +6,13 @@
|
|||||||
#include "mdns.h"
|
#include "mdns.h"
|
||||||
#include "nvs.h"
|
#include "nvs.h"
|
||||||
#include "tcpip_adapter.h"
|
#include "tcpip_adapter.h"
|
||||||
|
// IDF-V4++ #include "esp_netif.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "esp_console.h"
|
#include "esp_console.h"
|
||||||
#include "esp_pthread.h"
|
#include "esp_pthread.h"
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
#include "freertos/timers.h"
|
#include "freertos/timers.h"
|
||||||
#include "config.h"
|
#include "platform_config.h"
|
||||||
#include "raop.h"
|
#include "raop.h"
|
||||||
#include "audio_controls.h"
|
#include "audio_controls.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -14,6 +14,7 @@
|
|||||||
#include <iphlpapi.h>
|
#include <iphlpapi.h>
|
||||||
#else
|
#else
|
||||||
#include "tcpip_adapter.h"
|
#include "tcpip_adapter.h"
|
||||||
|
// IDF-V4++ #include "esp_netif.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -404,7 +405,7 @@ bool http_parse(int sock, char *method, key_data_t *rkd, char **body, int *len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (*len) {
|
if (*len) {
|
||||||
int size = 0;
|
int size = 0;
|
||||||
|
|
||||||
*body = malloc(*len + 1);
|
*body = malloc(*len + 1);
|
||||||
while (*body && size < *len) {
|
while (*body && size < *len) {
|
||||||
@@ -578,7 +579,8 @@ void free_metadata(struct metadata_s *metadata)
|
|||||||
NFREE(metadata->remote_title);
|
NFREE(metadata->remote_title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
int _fprintf(FILE *file, ...)
|
int _fprintf(FILE *file, ...)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
idf_component_register(SRCS "led.c" "audio_controls.c" "buttons.c" "services.c" "monitor.c"INCLUDE_DIRS
|
idf_component_register(SRC_DIRS .
|
||||||
INCLUDE_DIRS . ../tools/
|
INCLUDE_DIRS . ${IDF_PATH}/components/driver
|
||||||
|
REQUIRES json tools platform_config display
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,13 +11,27 @@
|
|||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
#include "driver/i2c.h"
|
#include "driver/i2c.h"
|
||||||
#include "driver/spi_master.h"
|
#include "driver/spi_master.h"
|
||||||
#include "config.h"
|
#include "platform_config.h"
|
||||||
#include "accessors.h"
|
#include "accessors.h"
|
||||||
#include "globdefs.h"
|
#include "globdefs.h"
|
||||||
|
#include "display.h"
|
||||||
|
#include "display.h"
|
||||||
|
#include "cJSON.h"
|
||||||
|
#include "driver/gpio.h"
|
||||||
|
#include "stdbool.h"
|
||||||
|
#include "driver/adc.h"
|
||||||
|
|
||||||
static const char *TAG = "services";
|
static const char *TAG = "services";
|
||||||
|
static const char *i2c_name="I2C";
|
||||||
|
static const char *spi_name="SPI";
|
||||||
|
static cJSON * gpio_list=NULL;
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
|
#ifndef QUOTE
|
||||||
|
#define QUOTE(name) #name
|
||||||
|
#endif
|
||||||
|
#ifndef STR
|
||||||
|
#define STR(macro) QUOTE(macro)
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
*
|
*
|
||||||
@@ -33,6 +47,52 @@ esp_err_t config_i2c_set(const i2c_config_t * config, int port){
|
|||||||
}
|
}
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t config_spi_set(const spi_bus_config_t * config, int host, int dc){
|
||||||
|
int buffer_size=255;
|
||||||
|
char * config_buffer=calloc(buffer_size,1);
|
||||||
|
if(config_buffer) {
|
||||||
|
snprintf(config_buffer,buffer_size,"data=%u,clk=%u,dc=%u,host=%u",config->mosi_io_num,config->sclk_io_num,dc,host);
|
||||||
|
ESP_LOGI(TAG,"Updating SPI configuration to %s",config_buffer);
|
||||||
|
config_set_value(NVS_TYPE_STR, "spi_config", config_buffer);
|
||||||
|
free(config_buffer);
|
||||||
|
}
|
||||||
|
return ESP_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
const display_config_t * config_display_get(){
|
||||||
|
static display_config_t dstruct;
|
||||||
|
char *config = config_alloc_get(NVS_TYPE_STR, "display_config");
|
||||||
|
if (!config) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
char * p=NULL;
|
||||||
|
|
||||||
|
if ((p = strcasestr(config, "driver")) != NULL){
|
||||||
|
dstruct.drivername = display_conf_get_driver_name(strchr(p, '=') + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
dstruct.drivername=dstruct.drivername?dstruct.drivername:"SSD1306";
|
||||||
|
if ((p = strcasestr(config, "width")) != NULL) dstruct.width = atoi(strchr(p, '=') + 1);
|
||||||
|
if ((p = strcasestr(config, "height")) != NULL) dstruct.height = atoi(strchr(p, '=') + 1);
|
||||||
|
if ((p = strcasestr(config, "reset")) != NULL) dstruct.RST_pin = atoi(strchr(p, '=') + 1);
|
||||||
|
dstruct.i2c_system_port=i2c_system_port;
|
||||||
|
if (strstr(config, "I2C") ) dstruct.type=i2c_name;
|
||||||
|
if ((p = strcasestr(config, "address")) != NULL) dstruct.address = atoi(strchr(p, '=') + 1);
|
||||||
|
if (strstr(config, "SPI") ) dstruct.type=spi_name;
|
||||||
|
if ((p = strcasestr(config, "cs")) != NULL) dstruct.CS_pin = atoi(strchr(p, '=') + 1);
|
||||||
|
if ((p = strcasestr(config, "speed")) != NULL) dstruct.speed = atoi(strchr(p, '=') + 1);
|
||||||
|
dstruct.hflip= strcasestr(config, "HFlip") ? true : false;
|
||||||
|
dstruct.vflip= strcasestr(config, "VFlip") ? true : false;
|
||||||
|
dstruct.rotate= strcasestr(config, "rotate") ? true : false;
|
||||||
|
return &dstruct;
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
*
|
*
|
||||||
@@ -104,4 +164,229 @@ void parse_set_GPIO(void (*cb)(int gpio, char *value)) {
|
|||||||
} while (p++);
|
} while (p++);
|
||||||
|
|
||||||
free(nvs_item);
|
free(nvs_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
cJSON * get_gpio_entry(const char * name, const char * prefix, int gpio, bool fixed){
|
||||||
|
cJSON * entry = cJSON_CreateObject();
|
||||||
|
cJSON_AddNumberToObject(entry,"gpio",gpio);
|
||||||
|
cJSON_AddStringToObject(entry,"name",name);
|
||||||
|
cJSON_AddStringToObject(entry,"group",prefix);
|
||||||
|
cJSON_AddBoolToObject(entry,"fixed",fixed);
|
||||||
|
return entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
cJSON * get_GPIO_list() {
|
||||||
|
cJSON * list = cJSON_CreateArray();
|
||||||
|
char *nvs_item, *p, type[16];
|
||||||
|
int gpio;
|
||||||
|
|
||||||
|
if ((nvs_item = config_alloc_get(NVS_TYPE_STR, "set_GPIO")) == NULL) return list;
|
||||||
|
|
||||||
|
p = nvs_item;
|
||||||
|
|
||||||
|
do {
|
||||||
|
if (sscanf(p, "%d=%15[^,]", &gpio, type) > 0 && (GPIO_IS_VALID_GPIO(gpio) || gpio==GPIO_NUM_NC)){
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(type,"gpio", gpio, false));
|
||||||
|
}
|
||||||
|
p = strchr(p, ',');
|
||||||
|
} while (p++);
|
||||||
|
|
||||||
|
free(nvs_item);
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
cJSON * get_GPIO_from_string(const char * nvs_item, const char * prefix, cJSON * list, bool fixed){
|
||||||
|
cJSON * llist = list;
|
||||||
|
int gpio=0,offset=0,soffset=0,ret1=0,sret=0;
|
||||||
|
|
||||||
|
if(!llist){
|
||||||
|
llist = cJSON_CreateArray();
|
||||||
|
}
|
||||||
|
const char *p=NULL;
|
||||||
|
char type[16];
|
||||||
|
int slen=strlen(nvs_item)+1;
|
||||||
|
char * buf1=malloc(slen);
|
||||||
|
char * buf2=malloc(slen);
|
||||||
|
ESP_LOGD(TAG,"Parsing string %s",nvs_item);
|
||||||
|
p = strchr(nvs_item, ':');
|
||||||
|
p=p?p+1:nvs_item;
|
||||||
|
while((((ret1=sscanf(p, "%[^=]=%d%n", type,&gpio,&offset)) ==2) || ((sret=sscanf(p, "%[^=]=%[^, ],%n", buf1,buf2,&soffset)) > 0 )) && (offset || soffset)){
|
||||||
|
if(ret1==2 && (GPIO_IS_VALID_GPIO(gpio) || gpio==GPIO_NUM_NC)){
|
||||||
|
cJSON_AddItemToArray(list,get_gpio_entry(type,prefix,gpio,fixed));
|
||||||
|
p+=offset;
|
||||||
|
} else {
|
||||||
|
p+=soffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
while(*p==' ' || *p==',') p++;
|
||||||
|
gpio=-1;
|
||||||
|
}
|
||||||
|
free(buf1);
|
||||||
|
free(buf2);
|
||||||
|
return llist;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
cJSON * get_GPIO_from_nvs(const char * item, const char * prefix, cJSON * list, bool fixed){
|
||||||
|
char * nvs_item=NULL;
|
||||||
|
cJSON * llist=list;
|
||||||
|
if ((nvs_item = config_alloc_get(NVS_TYPE_STR, item)) == NULL) return list;
|
||||||
|
llist = get_GPIO_from_string(nvs_item,prefix,list, fixed);
|
||||||
|
free(nvs_item);
|
||||||
|
return llist;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t get_gpio_structure(cJSON * gpio_entry, gpio_entry_t ** gpio){
|
||||||
|
esp_err_t err = ESP_OK;
|
||||||
|
*gpio = malloc(sizeof(gpio_entry_t));
|
||||||
|
//gpio,name,fixed
|
||||||
|
cJSON * val = cJSON_GetObjectItem(gpio_entry,"gpio");
|
||||||
|
if(val){
|
||||||
|
(*gpio)->gpio= (int)val->valuedouble;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ESP_LOGE(TAG,"gpio pin not found");
|
||||||
|
err=ESP_FAIL;
|
||||||
|
}
|
||||||
|
val = cJSON_GetObjectItem(gpio_entry,"name");
|
||||||
|
if(val){
|
||||||
|
(*gpio)->name= strdup(cJSON_GetStringValue(val));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ESP_LOGE(TAG,"gpio name value not found");
|
||||||
|
err=ESP_FAIL;
|
||||||
|
}
|
||||||
|
val = cJSON_GetObjectItem(gpio_entry,"group");
|
||||||
|
if(val){
|
||||||
|
(*gpio)->group= strdup(cJSON_GetStringValue(val));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ESP_LOGE(TAG,"gpio group value not found");
|
||||||
|
err=ESP_FAIL;
|
||||||
|
}
|
||||||
|
val = cJSON_GetObjectItem(gpio_entry,"fixed");
|
||||||
|
if(val){
|
||||||
|
(*gpio)->fixed= cJSON_IsTrue(val);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ESP_LOGE(TAG,"gpio fixed indicator not found");
|
||||||
|
err=ESP_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t free_gpio_entry( gpio_entry_t ** gpio) {
|
||||||
|
if(* gpio){
|
||||||
|
free((* gpio)->name);
|
||||||
|
free((* gpio)->group);
|
||||||
|
free(* gpio);
|
||||||
|
* gpio=NULL;
|
||||||
|
return ESP_OK;
|
||||||
|
}
|
||||||
|
return ESP_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
gpio_entry_t * get_gpio_by_no(int gpionum, bool refresh){
|
||||||
|
cJSON * gpio_header=NULL;
|
||||||
|
gpio_entry_t * gpio=NULL;
|
||||||
|
if(refresh){
|
||||||
|
get_gpio_list();
|
||||||
|
}
|
||||||
|
cJSON_ArrayForEach(gpio_header,gpio_list)
|
||||||
|
{
|
||||||
|
if(get_gpio_structure(gpio_header, &gpio)==ESP_OK && gpio->gpio==gpionum){
|
||||||
|
ESP_LOGD(TAG,"Found GPIO: %s=%d %s", gpio->name,gpio->gpio,gpio->fixed?"(FIXED)":"(VARIABLE)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return gpio;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
gpio_entry_t * get_gpio_by_name(char * name,char * group, bool refresh){
|
||||||
|
cJSON * gpio_header=NULL;
|
||||||
|
if(refresh){
|
||||||
|
get_gpio_list();
|
||||||
|
}
|
||||||
|
gpio_entry_t * gpio=NULL;
|
||||||
|
cJSON_ArrayForEach(gpio_header,gpio_list)
|
||||||
|
{
|
||||||
|
if(get_gpio_structure(gpio_header, &gpio)==ESP_OK && strcasecmp(gpio->name,name)&& strcasecmp(gpio->group,group)){
|
||||||
|
ESP_LOGD(TAG,"Found GPIO: %s=%d %s", gpio->name,gpio->gpio,gpio->fixed?"(FIXED)":"(VARIABLE)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return gpio;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
cJSON * get_gpio_list() {
|
||||||
|
gpio_num_t gpio_num;
|
||||||
|
if(gpio_list){
|
||||||
|
cJSON_free(gpio_list);
|
||||||
|
}
|
||||||
|
gpio_list = get_GPIO_list();
|
||||||
|
|
||||||
|
#ifndef CONFIG_BAT_LOCKED
|
||||||
|
char *bat_config = config_alloc_get_default(NVS_TYPE_STR, "bat_config", NULL, 0);
|
||||||
|
if (bat_config) {
|
||||||
|
char *p;
|
||||||
|
int channel;
|
||||||
|
if ((p = strcasestr(bat_config, "channel") ) != NULL)
|
||||||
|
{
|
||||||
|
channel = atoi(strchr(p, '=') + 1);
|
||||||
|
if(channel != -1){
|
||||||
|
if(adc1_pad_get_io_num(channel,&gpio_num )==ESP_OK){
|
||||||
|
cJSON_AddItemToArray(gpio_list,get_gpio_entry("bat","",gpio_num,false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free(bat_config);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
if(adc1_pad_get_io_num(CONFIG_BAT_CHANNEL,&gpio_num )==ESP_OK){
|
||||||
|
cJSON_AddItemToArray(gpio_list,get_gpio_entry("bat","",gpio_num,true));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
gpio_list = get_GPIO_from_nvs("i2c_config","i2c", gpio_list, false);
|
||||||
|
gpio_list = get_GPIO_from_nvs("spi_config","spi", gpio_list, false);
|
||||||
|
|
||||||
|
char *spdif_config = config_alloc_get_str("spdif_config", CONFIG_SPDIF_CONFIG, "bck=" STR(CONFIG_SPDIF_BCK_IO)
|
||||||
|
",ws=" STR(CONFIG_SPDIF_WS_IO) ",do=" STR(CONFIG_SPDIF_DO_IO));
|
||||||
|
|
||||||
|
gpio_list=get_GPIO_from_string(spdif_config,"spdif", gpio_list, (strlen(CONFIG_SPDIF_CONFIG)>0 || CONFIG_SPDIF_DO_IO>0 ));
|
||||||
|
char *dac_config = config_alloc_get_str("dac_config", CONFIG_DAC_CONFIG, "model=i2s,bck=" STR(CONFIG_I2S_BCK_IO)
|
||||||
|
",ws=" STR(CONFIG_I2S_WS_IO) ",do=" STR(CONFIG_I2S_DO_IO)
|
||||||
|
",sda=" STR(CONFIG_I2C_SDA) ",scl=" STR(CONFIG_I2C_SCL)
|
||||||
|
",mute=" STR(CONFIG_MUTE_GPIO));
|
||||||
|
|
||||||
|
gpio_list=get_GPIO_from_string(dac_config,"dac", gpio_list, (strlen(CONFIG_DAC_CONFIG)>0 || CONFIG_I2S_DO_IO>0 ));
|
||||||
|
free(spdif_config);
|
||||||
|
free(dac_config);
|
||||||
|
return gpio_list;
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,8 +11,34 @@
|
|||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
#include "driver/i2c.h"
|
#include "driver/i2c.h"
|
||||||
#include "driver/spi_master.h"
|
#include "driver/spi_master.h"
|
||||||
|
typedef struct {
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
int RST_pin;
|
||||||
|
int i2c_system_port;
|
||||||
|
int address;
|
||||||
|
int CS_pin;
|
||||||
|
int speed;
|
||||||
|
const char *drivername;
|
||||||
|
const char *type;
|
||||||
|
bool hflip;
|
||||||
|
bool vflip;
|
||||||
|
bool rotate;
|
||||||
|
} display_config_t;
|
||||||
|
const display_config_t * config_display_get();
|
||||||
esp_err_t config_i2c_set(const i2c_config_t * config, int port);
|
esp_err_t config_i2c_set(const i2c_config_t * config, int port);
|
||||||
|
esp_err_t config_spi_set(const spi_bus_config_t * config, int host, int dc);
|
||||||
const i2c_config_t * config_i2c_get(int * i2c_port);
|
const i2c_config_t * config_i2c_get(int * i2c_port);
|
||||||
const spi_bus_config_t * config_spi_get(spi_host_device_t * spi_host);
|
const spi_bus_config_t * config_spi_get(spi_host_device_t * spi_host);
|
||||||
void parse_set_GPIO(void (*cb)(int gpio, char *value));
|
void parse_set_GPIO(void (*cb)(int gpio, char *value));
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
bool fixed;
|
||||||
|
char * name;
|
||||||
|
char * group;
|
||||||
|
int gpio;
|
||||||
|
} gpio_entry_t;
|
||||||
|
esp_err_t free_gpio_entry( gpio_entry_t ** gpio);
|
||||||
|
gpio_entry_t * get_gpio_by_name(char * name,char * group, bool refresh);
|
||||||
|
gpio_entry_t * get_gpio_by_no(int gpionum, bool refresh);
|
||||||
|
cJSON * get_gpio_list();
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "cJSON.h"
|
#include "cJSON.h"
|
||||||
#include "buttons.h"
|
#include "buttons.h"
|
||||||
#include "config.h"
|
#include "platform_config.h"
|
||||||
#include "accessors.h"
|
#include "accessors.h"
|
||||||
#include "audio_controls.h"
|
#include "audio_controls.h"
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "driver/adc.h"
|
#include "driver/adc.h"
|
||||||
#include "battery.h"
|
#include "battery.h"
|
||||||
#include "config.h"
|
#include "platform_config.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
There is a bug in esp32 which causes a spurious interrupt on gpio 36/39 when
|
There is a bug in esp32 which causes a spurious interrupt on gpio 36/39 when
|
||||||
@@ -43,7 +43,7 @@ static struct {
|
|||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int battery_value_svc(void) {
|
float battery_value_svc(void) {
|
||||||
return battery.avg;
|
return battery.avg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,3 +9,4 @@
|
|||||||
|
|
||||||
COMPONENT_SRCDIRS := .
|
COMPONENT_SRCDIRS := .
|
||||||
COMPONENT_ADD_INCLUDEDIRS := .
|
COMPONENT_ADD_INCLUDEDIRS := .
|
||||||
|
CFLAGS += -D LOG_LOCAL_LEVEL=ESP_LOG_DEBUG
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
#include "driver/i2s.h"
|
#include "driver/i2s.h"
|
||||||
#include "driver/rtc_io.h"
|
#include "driver/rtc_io.h"
|
||||||
#include "driver/dac.h"
|
#include "driver/dac.h"
|
||||||
#include "adc1_i2s_private.h"
|
#include <adc1_i2s_private.h>
|
||||||
|
|
||||||
#include "esp_intr_alloc.h"
|
#include "esp_intr_alloc.h"
|
||||||
#include "esp_err.h"
|
#include "esp_err.h"
|
||||||
@@ -96,7 +96,8 @@ typedef struct {
|
|||||||
} i2s_obj_t;
|
} i2s_obj_t;
|
||||||
|
|
||||||
static i2s_obj_t *p_i2s_obj[I2S_NUM_MAX] = {0};
|
static i2s_obj_t *p_i2s_obj[I2S_NUM_MAX] = {0};
|
||||||
static i2s_dev_t* I2S[I2S_NUM_MAX] = {&I2S0, &I2S1};
|
/* DRAM_ATTR is required to avoid I2S array placed in flash, due to accessed from ISR */
|
||||||
|
static DRAM_ATTR i2s_dev_t* I2S[I2S_NUM_MAX] = {&I2S0, &I2S1};
|
||||||
static portMUX_TYPE i2s_spinlock[I2S_NUM_MAX] = {portMUX_INITIALIZER_UNLOCKED, portMUX_INITIALIZER_UNLOCKED};
|
static portMUX_TYPE i2s_spinlock[I2S_NUM_MAX] = {portMUX_INITIALIZER_UNLOCKED, portMUX_INITIALIZER_UNLOCKED};
|
||||||
static int _i2s_adc_unit = -1;
|
static int _i2s_adc_unit = -1;
|
||||||
static int _i2s_adc_channel = -1;
|
static int _i2s_adc_channel = -1;
|
||||||
@@ -240,14 +241,14 @@ static float i2s_apll_get_fi2s(int bits_per_sample, int sdm0, int sdm1, int sdm2
|
|||||||
*
|
*
|
||||||
* @return ESP_ERR_INVALID_ARG or ESP_OK
|
* @return ESP_ERR_INVALID_ARG or ESP_OK
|
||||||
*/
|
*/
|
||||||
static esp_err_t i2s_apll_calculate_fi2s(int rate, int bits_per_sample, int *sdm0, int *sdm1, int *sdm2, int *odir)
|
static esp_err_t i2s_apll_calculate_fi2s(int rate, int bits_per_sample, int *sdm0, int *sdm1, int *sdm2, int *odir)
|
||||||
{
|
{
|
||||||
int _odir, _sdm0, _sdm1, _sdm2;
|
int _odir, _sdm0, _sdm1, _sdm2;
|
||||||
float r = rtc_clk_xtal_freq_get() * 1000000. / (rate * 2 * 2);
|
float r = rtc_clk_xtal_freq_get() * 1000000. / (rate * 2 * 2);
|
||||||
int _sdm2_max;
|
int _sdm2_max;
|
||||||
uint32_t prec = -1;
|
uint32_t prec = -1;
|
||||||
int o, s1, s0;
|
int o, s1, s0;
|
||||||
|
|
||||||
if (rate/bits_per_sample/2/8 < APLL_I2S_MIN_RATE) {
|
if (rate/bits_per_sample/2/8 < APLL_I2S_MIN_RATE) {
|
||||||
return ESP_ERR_INVALID_ARG;
|
return ESP_ERR_INVALID_ARG;
|
||||||
}
|
}
|
||||||
@@ -291,80 +292,11 @@ static esp_err_t i2s_apll_calculate_fi2s(int rate, int bits_per_sample, int *sdm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*sdm2 + *sdm0 + *sdm0 + *odir) return ESP_OK;
|
if (*sdm2 + *sdm0 + *sdm0 + *odir) return ESP_OK;
|
||||||
else return ESP_ERR_INVALID_ARG;
|
else return ESP_ERR_INVALID_ARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
static esp_err_t i2s_apll_calculate_fi2s(int rate, int bits_per_sample, int *sdm0, int *sdm1, int *sdm2, int *odir)
|
|
||||||
{
|
|
||||||
int _odir, _sdm0, _sdm1, _sdm2;
|
|
||||||
float avg;
|
|
||||||
float min_rate, max_rate, min_diff;
|
|
||||||
if (rate/bits_per_sample/2/8 < APLL_I2S_MIN_RATE) {
|
|
||||||
return ESP_ERR_INVALID_ARG;
|
|
||||||
}
|
|
||||||
|
|
||||||
*sdm0 = 0;
|
|
||||||
*sdm1 = 0;
|
|
||||||
*sdm2 = 0;
|
|
||||||
*odir = 0;
|
|
||||||
min_diff = APLL_MAX_FREQ;
|
|
||||||
|
|
||||||
for (_sdm2 = 4; _sdm2 < 9; _sdm2 ++) {
|
|
||||||
max_rate = i2s_apll_get_fi2s(bits_per_sample, 255, 255, _sdm2, 0);
|
|
||||||
min_rate = i2s_apll_get_fi2s(bits_per_sample, 0, 0, _sdm2, 31);
|
|
||||||
avg = (max_rate + min_rate)/2;
|
|
||||||
if (abs(avg - rate) < min_diff) {
|
|
||||||
min_diff = abs(avg - rate);
|
|
||||||
*sdm2 = _sdm2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
min_diff = APLL_MAX_FREQ;
|
|
||||||
for (_odir = 0; _odir < 32; _odir ++) {
|
|
||||||
max_rate = i2s_apll_get_fi2s(bits_per_sample, 255, 255, *sdm2, _odir);
|
|
||||||
min_rate = i2s_apll_get_fi2s(bits_per_sample, 0, 0, *sdm2, _odir);
|
|
||||||
avg = (max_rate + min_rate)/2;
|
|
||||||
if (abs(avg - rate) < min_diff) {
|
|
||||||
min_diff = abs(avg - rate);
|
|
||||||
*odir = _odir;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
min_diff = APLL_MAX_FREQ;
|
|
||||||
for (_sdm2 = 4; _sdm2 < 9; _sdm2 ++) {
|
|
||||||
max_rate = i2s_apll_get_fi2s(bits_per_sample, 255, 255, _sdm2, *odir);
|
|
||||||
min_rate = i2s_apll_get_fi2s(bits_per_sample, 0, 0, _sdm2, *odir);
|
|
||||||
avg = (max_rate + min_rate)/2;
|
|
||||||
if (abs(avg - rate) < min_diff) {
|
|
||||||
min_diff = abs(avg - rate);
|
|
||||||
*sdm2 = _sdm2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
min_diff = APLL_MAX_FREQ;
|
|
||||||
for (_sdm1 = 0; _sdm1 < 256; _sdm1 ++) {
|
|
||||||
max_rate = i2s_apll_get_fi2s(bits_per_sample, 255, _sdm1, *sdm2, *odir);
|
|
||||||
min_rate = i2s_apll_get_fi2s(bits_per_sample, 0, _sdm1, *sdm2, *odir);
|
|
||||||
avg = (max_rate + min_rate)/2;
|
|
||||||
if (abs(avg - rate) < min_diff) {
|
|
||||||
min_diff = abs(avg - rate);
|
|
||||||
*sdm1 = _sdm1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
min_diff = APLL_MAX_FREQ;
|
|
||||||
for (_sdm0 = 0; _sdm0 < 256; _sdm0 ++) {
|
|
||||||
avg = i2s_apll_get_fi2s(bits_per_sample, _sdm0, *sdm1, *sdm2, *odir);
|
|
||||||
if (abs(avg - rate) < min_diff) {
|
|
||||||
min_diff = abs(avg - rate);
|
|
||||||
*sdm0 = _sdm0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ESP_OK;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
esp_err_t i2s_set_clk(i2s_port_t i2s_num, uint32_t rate, i2s_bits_per_sample_t bits, i2s_channel_t ch)
|
esp_err_t i2s_set_clk(i2s_port_t i2s_num, uint32_t rate, i2s_bits_per_sample_t bits, i2s_channel_t ch)
|
||||||
{
|
{
|
||||||
int factor = (256%bits)? 384 : 256; // According to hardware codec requirement(supported 256fs or 384fs)
|
int factor = (256%bits)? 384 : 256; // According to hardware codec requirement(supported 256fs or 384fs)
|
||||||
@@ -797,7 +729,7 @@ esp_err_t i2s_set_dac_mode(i2s_dac_mode_t dac_mode)
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static esp_err_t _i2s_adc_mode_recover(void)
|
static esp_err_t _i2s_adc_mode_recover()
|
||||||
{
|
{
|
||||||
I2S_CHECK(((_i2s_adc_unit != -1) && (_i2s_adc_channel != -1)), "i2s ADC recover error, not initialized...", ESP_ERR_INVALID_ARG);
|
I2S_CHECK(((_i2s_adc_unit != -1) && (_i2s_adc_channel != -1)), "i2s ADC recover error, not initialized...", ESP_ERR_INVALID_ARG);
|
||||||
return adc_i2s_mode_init(_i2s_adc_unit, _i2s_adc_channel);
|
return adc_i2s_mode_init(_i2s_adc_unit, _i2s_adc_channel);
|
||||||
@@ -943,12 +875,6 @@ static esp_err_t i2s_param_config(i2s_port_t i2s_num, const i2s_config_t *i2s_co
|
|||||||
I2S_CHECK(!((i2s_config->mode & I2S_MODE_DAC_BUILT_IN) && (i2s_num != I2S_NUM_0)), "I2S DAC built-in only support on I2S0", ESP_ERR_INVALID_ARG);
|
I2S_CHECK(!((i2s_config->mode & I2S_MODE_DAC_BUILT_IN) && (i2s_num != I2S_NUM_0)), "I2S DAC built-in only support on I2S0", ESP_ERR_INVALID_ARG);
|
||||||
I2S_CHECK(!((i2s_config->mode & I2S_MODE_PDM) && (i2s_num != I2S_NUM_0)), "I2S DAC PDM only support on I2S0", ESP_ERR_INVALID_ARG);
|
I2S_CHECK(!((i2s_config->mode & I2S_MODE_PDM) && (i2s_num != I2S_NUM_0)), "I2S DAC PDM only support on I2S0", ESP_ERR_INVALID_ARG);
|
||||||
|
|
||||||
if (i2s_num == I2S_NUM_1) {
|
|
||||||
periph_module_enable(PERIPH_I2S1_MODULE);
|
|
||||||
} else {
|
|
||||||
periph_module_enable(PERIPH_I2S0_MODULE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(i2s_config->mode & I2S_MODE_ADC_BUILT_IN) {
|
if(i2s_config->mode & I2S_MODE_ADC_BUILT_IN) {
|
||||||
//in ADC built-in mode, we need to call i2s_set_adc_mode to
|
//in ADC built-in mode, we need to call i2s_set_adc_mode to
|
||||||
//initialize the specific ADC channel.
|
//initialize the specific ADC channel.
|
||||||
@@ -1001,6 +927,7 @@ static esp_err_t i2s_param_config(i2s_port_t i2s_num, const i2s_config_t *i2s_co
|
|||||||
I2S[i2s_num]->conf.rx_start = 0;
|
I2S[i2s_num]->conf.rx_start = 0;
|
||||||
|
|
||||||
if (i2s_config->mode & I2S_MODE_TX) {
|
if (i2s_config->mode & I2S_MODE_TX) {
|
||||||
|
// PATCH
|
||||||
I2S[i2s_num]->conf.tx_msb_right = 1;
|
I2S[i2s_num]->conf.tx_msb_right = 1;
|
||||||
I2S[i2s_num]->conf.tx_right_first = 0;
|
I2S[i2s_num]->conf.tx_right_first = 0;
|
||||||
|
|
||||||
@@ -1013,7 +940,8 @@ static esp_err_t i2s_param_config(i2s_port_t i2s_num, const i2s_config_t *i2s_co
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (i2s_config->mode & I2S_MODE_RX) {
|
if (i2s_config->mode & I2S_MODE_RX) {
|
||||||
I2S[i2s_num]->conf.rx_msb_right = 1;
|
// PATCH
|
||||||
|
I2S[i2s_num]->conf.rx_msb_right = 1;
|
||||||
I2S[i2s_num]->conf.rx_right_first = 0;
|
I2S[i2s_num]->conf.rx_right_first = 0;
|
||||||
I2S[i2s_num]->conf.rx_slave_mod = 0; // Master
|
I2S[i2s_num]->conf.rx_slave_mod = 0; // Master
|
||||||
I2S[i2s_num]->fifo_conf.rx_fifo_mod_force_en = 1;
|
I2S[i2s_num]->fifo_conf.rx_fifo_mod_force_en = 1;
|
||||||
@@ -1156,8 +1084,10 @@ esp_err_t i2s_driver_install(i2s_port_t i2s_num, const i2s_config_t *i2s_config,
|
|||||||
|
|
||||||
//To make sure hardware is enabled before any hardware register operations.
|
//To make sure hardware is enabled before any hardware register operations.
|
||||||
if (i2s_num == I2S_NUM_1) {
|
if (i2s_num == I2S_NUM_1) {
|
||||||
|
periph_module_reset(PERIPH_I2S1_MODULE);
|
||||||
periph_module_enable(PERIPH_I2S1_MODULE);
|
periph_module_enable(PERIPH_I2S1_MODULE);
|
||||||
} else {
|
} else {
|
||||||
|
periph_module_reset(PERIPH_I2S0_MODULE);
|
||||||
periph_module_enable(PERIPH_I2S0_MODULE);
|
periph_module_enable(PERIPH_I2S0_MODULE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1241,18 +1171,6 @@ esp_err_t i2s_driver_uninstall(i2s_port_t i2s_num)
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int i2s_write_bytes(i2s_port_t i2s_num, const void *src, size_t size, TickType_t ticks_to_wait)
|
|
||||||
{
|
|
||||||
size_t bytes_written = 0;
|
|
||||||
int res = 0;
|
|
||||||
res = i2s_write(i2s_num, src, size, &bytes_written, ticks_to_wait);
|
|
||||||
if (res != ESP_OK) {
|
|
||||||
return ESP_FAIL;
|
|
||||||
} else {
|
|
||||||
return bytes_written;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
esp_err_t i2s_write(i2s_port_t i2s_num, const void *src, size_t size, size_t *bytes_written, TickType_t ticks_to_wait)
|
esp_err_t i2s_write(i2s_port_t i2s_num, const void *src, size_t size, size_t *bytes_written, TickType_t ticks_to_wait)
|
||||||
{
|
{
|
||||||
char *data_ptr, *src_byte;
|
char *data_ptr, *src_byte;
|
||||||
@@ -1378,18 +1296,6 @@ esp_err_t i2s_write_expand(i2s_port_t i2s_num, const void *src, size_t size, siz
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int i2s_read_bytes(i2s_port_t i2s_num, void *dest, size_t size, TickType_t ticks_to_wait)
|
|
||||||
{
|
|
||||||
size_t bytes_read = 0;
|
|
||||||
int res = 0;
|
|
||||||
res = i2s_read(i2s_num, dest, size, &bytes_read, ticks_to_wait);
|
|
||||||
if (res != ESP_OK) {
|
|
||||||
return ESP_FAIL;
|
|
||||||
} else {
|
|
||||||
return bytes_read;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
esp_err_t i2s_read(i2s_port_t i2s_num, void *dest, size_t size, size_t *bytes_read, TickType_t ticks_to_wait)
|
esp_err_t i2s_read(i2s_port_t i2s_num, void *dest, size_t size, size_t *bytes_read, TickType_t ticks_to_wait)
|
||||||
{
|
{
|
||||||
char *data_ptr, *dest_byte;
|
char *data_ptr, *dest_byte;
|
||||||
@@ -1428,29 +1334,3 @@ esp_err_t i2s_read(i2s_port_t i2s_num, void *dest, size_t size, size_t *bytes_re
|
|||||||
xSemaphoreGive(p_i2s_obj[i2s_num]->rx->mux);
|
xSemaphoreGive(p_i2s_obj[i2s_num]->rx->mux);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int i2s_push_sample(i2s_port_t i2s_num, const void *sample, TickType_t ticks_to_wait)
|
|
||||||
{
|
|
||||||
size_t bytes_push = 0;
|
|
||||||
int res = 0;
|
|
||||||
I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_FAIL);
|
|
||||||
res = i2s_write(i2s_num, sample, p_i2s_obj[i2s_num]->bytes_per_sample, &bytes_push, ticks_to_wait);
|
|
||||||
if (res != ESP_OK) {
|
|
||||||
return ESP_FAIL;
|
|
||||||
} else {
|
|
||||||
return bytes_push;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int i2s_pop_sample(i2s_port_t i2s_num, void *sample, TickType_t ticks_to_wait)
|
|
||||||
{
|
|
||||||
size_t bytes_pop = 0;
|
|
||||||
int res = 0;
|
|
||||||
I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_FAIL);
|
|
||||||
res = i2s_read(i2s_num, sample, p_i2s_obj[i2s_num]->bytes_per_sample, &bytes_pop, ticks_to_wait);
|
|
||||||
if (res != ESP_OK) {
|
|
||||||
return ESP_FAIL;
|
|
||||||
} else {
|
|
||||||
return bytes_pop;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -39,7 +39,7 @@ static const char* TAG = "IR";
|
|||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
inline bool nec_check_in_range(int duration_ticks, int target_us, int margin_us) {
|
static bool nec_check_in_range(int duration_ticks, int target_us, int margin_us) {
|
||||||
if(( NEC_ITEM_DURATION(duration_ticks) < (target_us + margin_us))
|
if(( NEC_ITEM_DURATION(duration_ticks) < (target_us + margin_us))
|
||||||
&& ( NEC_ITEM_DURATION(duration_ticks) > (target_us - margin_us))) {
|
&& ( NEC_ITEM_DURATION(duration_ticks) > (target_us - margin_us))) {
|
||||||
return true;
|
return true;
|
||||||
@@ -174,4 +174,4 @@ void infrared_init(RingbufHandle_t *rb, int gpio) {
|
|||||||
// get RMT RX ringbuffer
|
// get RMT RX ringbuffer
|
||||||
rmt_get_ringbuf_handle(RMT_RX_CHANNEL, rb);
|
rmt_get_ringbuf_handle(RMT_RX_CHANNEL, rb);
|
||||||
rmt_rx_start(RMT_RX_CHANNEL, 1);
|
rmt_rx_start(RMT_RX_CHANNEL, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,10 @@
|
|||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
#include "driver/ledc.h"
|
#include "driver/ledc.h"
|
||||||
|
#include "platform_config.h"
|
||||||
#include "led.h"
|
#include "led.h"
|
||||||
#include "globdefs.h"
|
#include "globdefs.h"
|
||||||
#include "accessors.h"
|
#include "accessors.h"
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#define MAX_LED 8
|
#define MAX_LED 8
|
||||||
#define BLOCKTIME 10 // up to portMAX_DELAY
|
#define BLOCKTIME 10 // up to portMAX_DELAY
|
||||||
@@ -85,7 +85,7 @@ static void vCallbackFunction( TimerHandle_t xTimer ) {
|
|||||||
bool led_blink_core(int idx, int ontime, int offtime, bool pushed) {
|
bool led_blink_core(int idx, int ontime, int offtime, bool pushed) {
|
||||||
if (!leds[idx].gpio || leds[idx].gpio < 0 ) return false;
|
if (!leds[idx].gpio || leds[idx].gpio < 0 ) return false;
|
||||||
|
|
||||||
ESP_LOGD(TAG,"led_blink_core");
|
ESP_LOGD(TAG,"led_blink_core %d on:%d off:%d, pushed:%u", idx, ontime, offtime, pushed);
|
||||||
if (leds[idx].timer) {
|
if (leds[idx].timer) {
|
||||||
// normal requests waits if a pop is pending
|
// normal requests waits if a pop is pending
|
||||||
if (!pushed && leds[idx].pushed) {
|
if (!pushed && leds[idx].pushed) {
|
||||||
@@ -231,8 +231,7 @@ void led_svc_init(void) {
|
|||||||
#ifndef CONFIG_LED_LOCKED
|
#ifndef CONFIG_LED_LOCKED
|
||||||
parse_set_GPIO(set_led_gpio);
|
parse_set_GPIO(set_led_gpio);
|
||||||
#endif
|
#endif
|
||||||
ESP_LOGI(TAG,"Configuring LEDs green:%d (active:%d %d%%), red:%d (active:%d %d%%)", green.gpio, green.active, green.pwm, green.gpio, green.active, green.pwm );
|
|
||||||
|
|
||||||
char *nvs_item = config_alloc_get(NVS_TYPE_STR, "led_brightness"), *p;
|
char *nvs_item = config_alloc_get(NVS_TYPE_STR, "led_brightness"), *p;
|
||||||
if (nvs_item) {
|
if (nvs_item) {
|
||||||
if ((p = strcasestr(nvs_item, "green")) != NULL) green.pwm = atoi(strchr(p, '=') + 1);
|
if ((p = strcasestr(nvs_item, "green")) != NULL) green.pwm = atoi(strchr(p, '=') + 1);
|
||||||
@@ -242,4 +241,6 @@ void led_svc_init(void) {
|
|||||||
|
|
||||||
led_config(LED_GREEN, green.gpio, green.active, green.pwm);
|
led_config(LED_GREEN, green.gpio, green.active, green.pwm);
|
||||||
led_config(LED_RED, red.gpio, red.active, red.pwm);
|
led_config(LED_RED, red.gpio, red.active, red.pwm);
|
||||||
|
|
||||||
|
ESP_LOGI(TAG,"Configuring LEDs green:%d (active:%d %d%%), red:%d (active:%d %d%%)", green.gpio, green.active, green.pwm, red.gpio, red.active, red.pwm );
|
||||||
}
|
}
|
||||||
|
|||||||
264
components/services/messaging.c
Normal file
264
components/services/messaging.c
Normal file
@@ -0,0 +1,264 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#include <stdlib.h> // Required for libtelnet.h
|
||||||
|
#include <esp_log.h>
|
||||||
|
#include "stdbool.h"
|
||||||
|
#include <lwip/def.h>
|
||||||
|
#include <lwip/sockets.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "esp_app_trace.h"
|
||||||
|
#include "esp_attr.h"
|
||||||
|
#include "config.h"
|
||||||
|
#include "nvs_utilities.h"
|
||||||
|
#include "platform_esp32.h"
|
||||||
|
#include "messaging.h"
|
||||||
|
#include "trace.h"
|
||||||
|
/************************************
|
||||||
|
* Globals
|
||||||
|
*/
|
||||||
|
|
||||||
|
const static char tag[] = "messaging";
|
||||||
|
typedef struct {
|
||||||
|
struct messaging_list_t * next;
|
||||||
|
char * subscriber_name;
|
||||||
|
size_t max_count;
|
||||||
|
RingbufHandle_t buf_handle;
|
||||||
|
} messaging_list_t;
|
||||||
|
static messaging_list_t top;
|
||||||
|
#define MSG_LENGTH_AVG 1024
|
||||||
|
|
||||||
|
messaging_list_t * get_struct_ptr(messaging_handle_t handle){
|
||||||
|
return (messaging_list_t *)handle;
|
||||||
|
}
|
||||||
|
messaging_handle_t get_handle_ptr(messaging_list_t * handle){
|
||||||
|
return (messaging_handle_t )handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
RingbufHandle_t messaging_create_ring_buffer(uint8_t max_count){
|
||||||
|
RingbufHandle_t buf_handle = NULL;
|
||||||
|
StaticRingbuffer_t *buffer_struct = malloc(sizeof(StaticRingbuffer_t));
|
||||||
|
if (buffer_struct != NULL) {
|
||||||
|
size_t buf_size = (size_t )(sizeof(single_message_t)+8+MSG_LENGTH_AVG)*(size_t )(max_count>0?max_count:5); // no-split buffer requires an additional 8 bytes
|
||||||
|
buf_size = buf_size - (buf_size % 4);
|
||||||
|
uint8_t *buffer_storage = (uint8_t *)heap_caps_malloc(buf_size, MALLOC_CAP_SPIRAM | MALLOC_CAP_32BIT);
|
||||||
|
if (buffer_storage== NULL) {
|
||||||
|
ESP_LOGE(tag,"buff alloc failed");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
buf_handle = xRingbufferCreateStatic(buf_size, RINGBUF_TYPE_NOSPLIT, buffer_storage, buffer_struct);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ESP_LOGE(tag,"ringbuf alloc failed");
|
||||||
|
}
|
||||||
|
return buf_handle;
|
||||||
|
}
|
||||||
|
void messaging_fill_messages(messaging_list_t * target_subscriber){
|
||||||
|
single_message_t * message=NULL;
|
||||||
|
UBaseType_t uxItemsWaiting;
|
||||||
|
|
||||||
|
vRingbufferGetInfo(top.buf_handle, NULL, NULL, NULL, NULL, &uxItemsWaiting);
|
||||||
|
for(size_t i=0;i<uxItemsWaiting;i++){
|
||||||
|
message= messaging_retrieve_message(top.buf_handle);
|
||||||
|
if(message){
|
||||||
|
//re-post to original queue so it is available to future subscribers
|
||||||
|
messaging_post_to_queue(get_handle_ptr(&top), message, message->msg_size);
|
||||||
|
// post to new subscriber
|
||||||
|
messaging_post_to_queue(get_handle_ptr(target_subscriber) , message, message->msg_size);
|
||||||
|
FREE_AND_NULL(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
messaging_handle_t messaging_register_subscriber(uint8_t max_count, char * name){
|
||||||
|
messaging_list_t * cur=⊤
|
||||||
|
while(cur->next){
|
||||||
|
cur = get_struct_ptr(cur->next);
|
||||||
|
}
|
||||||
|
cur->next=heap_caps_malloc(sizeof(messaging_list_t), MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
|
||||||
|
if(!cur->next){
|
||||||
|
ESP_LOGE(tag,"subscriber alloc failed");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
memset(cur->next,0x00,sizeof(messaging_list_t));
|
||||||
|
cur = get_struct_ptr(cur->next);
|
||||||
|
cur->max_count=max_count;
|
||||||
|
cur->subscriber_name=strdup(name);
|
||||||
|
cur->buf_handle = messaging_create_ring_buffer(max_count);
|
||||||
|
if(cur->buf_handle){
|
||||||
|
messaging_fill_messages(cur);
|
||||||
|
}
|
||||||
|
return cur->buf_handle;
|
||||||
|
}
|
||||||
|
void messaging_service_init(){
|
||||||
|
size_t max_count=15;
|
||||||
|
top.buf_handle = messaging_create_ring_buffer(max_count);
|
||||||
|
if(!top.buf_handle){
|
||||||
|
ESP_LOGE(tag, "messaging service init failed.");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
top.max_count = max_count;
|
||||||
|
top.subscriber_name = strdup("messaging");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char * messaging_get_type_desc(messaging_types msg_type){
|
||||||
|
switch (msg_type) {
|
||||||
|
CASE_TO_STR(MESSAGING_INFO);
|
||||||
|
CASE_TO_STR(MESSAGING_WARNING);
|
||||||
|
CASE_TO_STR(MESSAGING_ERROR);
|
||||||
|
default:
|
||||||
|
return "Unknown";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const char * messaging_get_class_desc(messaging_classes msg_class){
|
||||||
|
switch (msg_class) {
|
||||||
|
CASE_TO_STR(MESSAGING_CLASS_OTA);
|
||||||
|
CASE_TO_STR(MESSAGING_CLASS_SYSTEM);
|
||||||
|
CASE_TO_STR(MESSAGING_CLASS_STATS);
|
||||||
|
default:
|
||||||
|
return "Unknown";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cJSON * messaging_retrieve_messages(RingbufHandle_t buf_handle){
|
||||||
|
single_message_t * message=NULL;
|
||||||
|
cJSON * json_messages=cJSON_CreateArray();
|
||||||
|
cJSON * json_message=NULL;
|
||||||
|
size_t item_size;
|
||||||
|
UBaseType_t uxItemsWaiting;
|
||||||
|
vRingbufferGetInfo(buf_handle, NULL, NULL, NULL, NULL, &uxItemsWaiting);
|
||||||
|
for(int i = 0;i<uxItemsWaiting;i++){
|
||||||
|
message = (single_message_t *)xRingbufferReceive(buf_handle, &item_size, pdMS_TO_TICKS(50));
|
||||||
|
//Check received data
|
||||||
|
if (message== NULL) {
|
||||||
|
ESP_LOGE(tag,"received null ptr");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
json_message = cJSON_CreateObject();
|
||||||
|
cJSON_AddStringToObject(json_message, "message", message->message);
|
||||||
|
vRingbufferReturnItem(buf_handle, (void *)message);
|
||||||
|
cJSON_AddStringToObject(json_message, "type", messaging_get_type_desc(message->type));
|
||||||
|
cJSON_AddStringToObject(json_message, "class", messaging_get_class_desc(message->msg_class));
|
||||||
|
cJSON_AddNumberToObject(json_message,"sent_time",message->sent_time);
|
||||||
|
cJSON_AddNumberToObject(json_message,"current_time",esp_timer_get_time() / 1000);
|
||||||
|
cJSON_AddItemToArray(json_messages,json_message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return json_messages;
|
||||||
|
}
|
||||||
|
single_message_t * messaging_retrieve_message(RingbufHandle_t buf_handle){
|
||||||
|
single_message_t * message=NULL;
|
||||||
|
single_message_t * message_copy=NULL;
|
||||||
|
size_t item_size;
|
||||||
|
UBaseType_t uxItemsWaiting;
|
||||||
|
vRingbufferGetInfo(buf_handle, NULL, NULL, NULL, NULL, &uxItemsWaiting);
|
||||||
|
if(uxItemsWaiting>0){
|
||||||
|
message = (single_message_t *)xRingbufferReceive(buf_handle, &item_size, pdMS_TO_TICKS(50));
|
||||||
|
message_copy = heap_caps_malloc(item_size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
|
||||||
|
if(message_copy){
|
||||||
|
memcpy(message_copy,message,item_size);
|
||||||
|
}
|
||||||
|
vRingbufferReturnItem(buf_handle, (void *)message);
|
||||||
|
}
|
||||||
|
return message_copy;
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_err_t messaging_post_to_queue(messaging_handle_t subscriber_handle, single_message_t * message, size_t message_size){
|
||||||
|
size_t item_size=0;
|
||||||
|
messaging_list_t * subscriber=get_struct_ptr(subscriber_handle);
|
||||||
|
if(!subscriber->buf_handle){
|
||||||
|
ESP_LOGE(tag,"post failed: null buffer for %s", str_or_unknown(subscriber->subscriber_name));
|
||||||
|
return ESP_FAIL;
|
||||||
|
}
|
||||||
|
void * pItem=NULL;
|
||||||
|
UBaseType_t res=pdFALSE;
|
||||||
|
while(1){
|
||||||
|
ESP_LOGD(tag,"Attempting to reserve %d bytes for %s",message_size, str_or_unknown(subscriber->subscriber_name));
|
||||||
|
res = xRingbufferSendAcquire(subscriber->buf_handle, &pItem, message_size, pdMS_TO_TICKS(50));
|
||||||
|
if(res == pdTRUE && pItem){
|
||||||
|
ESP_LOGD(tag,"Reserving complete for %s", str_or_unknown(subscriber->subscriber_name));
|
||||||
|
memcpy(pItem,message,message_size);
|
||||||
|
xRingbufferSendComplete(subscriber->buf_handle, pItem);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ESP_LOGD(tag,"Dropping for %s",str_or_unknown(subscriber->subscriber_name));
|
||||||
|
single_message_t * dummy = (single_message_t *)xRingbufferReceive(subscriber->buf_handle, &item_size, pdMS_TO_TICKS(50));
|
||||||
|
if (dummy== NULL) {
|
||||||
|
ESP_LOGE(tag,"Dropping message failed");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ESP_LOGD(tag,"Dropping message of %d bytes for %s",item_size, str_or_unknown(subscriber->subscriber_name));
|
||||||
|
vRingbufferReturnItem(subscriber->buf_handle, (void *)dummy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (res != pdTRUE) {
|
||||||
|
ESP_LOGE(tag,"post to %s failed",str_or_unknown(subscriber->subscriber_name));
|
||||||
|
return ESP_FAIL;
|
||||||
|
}
|
||||||
|
return ESP_OK;
|
||||||
|
}
|
||||||
|
esp_err_t messaging_type_to_err_type(messaging_types type){
|
||||||
|
switch (type) {
|
||||||
|
case MESSAGING_INFO:
|
||||||
|
return ESP_LOG_INFO;
|
||||||
|
break;
|
||||||
|
case MESSAGING_ERROR:
|
||||||
|
return ESP_LOG_ERROR;
|
||||||
|
break;
|
||||||
|
case MESSAGING_WARNING:
|
||||||
|
return ESP_LOG_WARN;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return ESP_LOG_DEBUG;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return ESP_LOG_DEBUG;
|
||||||
|
}
|
||||||
|
void messaging_post_message(messaging_types type,messaging_classes msg_class, const char *fmt, ...){
|
||||||
|
single_message_t * message=NULL;
|
||||||
|
size_t msg_size=0;
|
||||||
|
size_t ln =0;
|
||||||
|
messaging_list_t * cur=⊤
|
||||||
|
va_list va;
|
||||||
|
va_start(va, fmt);
|
||||||
|
ln = vsnprintf(NULL, 0, fmt, va)+1;
|
||||||
|
msg_size = sizeof(single_message_t)+ln;
|
||||||
|
message = (single_message_t *)heap_caps_malloc(msg_size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
|
||||||
|
vsprintf(message->message, fmt, va);
|
||||||
|
va_end(va);
|
||||||
|
message->msg_size = msg_size;
|
||||||
|
message->type = type;
|
||||||
|
message->msg_class = msg_class;
|
||||||
|
message->sent_time = esp_timer_get_time() / 1000;
|
||||||
|
ESP_LOGD(tag,"Post: %s",message->message);
|
||||||
|
while(cur){
|
||||||
|
messaging_post_to_queue(get_handle_ptr(cur), message, msg_size);
|
||||||
|
cur = get_struct_ptr(cur->next);
|
||||||
|
}
|
||||||
|
FREE_AND_NULL(message);
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
|
void log_send_messaging(messaging_types msgtype,const char *fmt, ...) {
|
||||||
|
va_list va;
|
||||||
|
va_start(va, fmt);
|
||||||
|
size_t ln = vsnprintf(NULL, 0, fmt, va)+1;
|
||||||
|
char * message_txt = malloc(ln);
|
||||||
|
if(message_txt){
|
||||||
|
vsprintf(message_txt, fmt, va);
|
||||||
|
va_end(va);
|
||||||
|
ESP_LOG_LEVEL_LOCAL(messaging_type_to_err_type(msgtype),tag, "%s",message_txt);
|
||||||
|
messaging_post_message(msgtype, MESSAGING_CLASS_SYSTEM, message_txt );
|
||||||
|
free(message_txt);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
ESP_LOGE(tag, "Memory allocation failed while sending message");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
46
components/services/messaging.h
Normal file
46
components/services/messaging.h
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
#include "sdkconfig.h"
|
||||||
|
#include "freertos/ringbuf.h"
|
||||||
|
#include "cJSON.h"
|
||||||
|
#pragma once
|
||||||
|
typedef enum {
|
||||||
|
MESSAGING_INFO,
|
||||||
|
MESSAGING_WARNING,
|
||||||
|
MESSAGING_ERROR
|
||||||
|
} messaging_types;
|
||||||
|
typedef enum {
|
||||||
|
MESSAGING_CLASS_OTA,
|
||||||
|
MESSAGING_CLASS_SYSTEM,
|
||||||
|
MESSAGING_CLASS_STATS
|
||||||
|
} messaging_classes;
|
||||||
|
|
||||||
|
typedef struct messaging_list_t *messaging_handle_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
time_t sent_time;
|
||||||
|
messaging_types type;
|
||||||
|
messaging_classes msg_class;
|
||||||
|
size_t msg_size;
|
||||||
|
char message[];
|
||||||
|
} single_message_t;
|
||||||
|
|
||||||
|
cJSON * messaging_retrieve_messages(RingbufHandle_t buf_handle);
|
||||||
|
messaging_handle_t messaging_register_subscriber(uint8_t max_count, char * name);
|
||||||
|
esp_err_t messaging_post_to_queue(messaging_handle_t subscriber_handle, single_message_t * message, size_t message_size);
|
||||||
|
void messaging_post_message(messaging_types type,messaging_classes msg_class, const char * fmt, ...);
|
||||||
|
cJSON * messaging_retrieve_messages(RingbufHandle_t buf_handle);
|
||||||
|
single_message_t * messaging_retrieve_message(RingbufHandle_t buf_handle);
|
||||||
|
void log_send_messaging(messaging_types msgtype,const char *fmt, ...);
|
||||||
|
esp_err_t messaging_type_to_err_type(messaging_types type);
|
||||||
|
void messaging_service_init();
|
||||||
|
|
||||||
|
#define REALLOC_CAT(e,n) e=realloc(e,strlen(n)); e=strcat(e,n)
|
||||||
|
#define LOG_SEND(y, ...) \
|
||||||
|
{ \
|
||||||
|
ESP_LOG_LEVEL_LOCAL(messaging_type_to_err_type(y),TAG, ##__VA_ARGS__); \
|
||||||
|
messaging_post_message(y, MESSAGING_CLASS_SYSTEM, ##__VA_ARGS__); }
|
||||||
|
|
||||||
|
#define LOG_SEND_ERROR( ...) LOG_SEND(MESSAGING_ERROR,##__VA_ARGS__)
|
||||||
|
#define LOG_SEND_INFO( ...) LOG_SEND(MESSAGING_INFO,##__VA_ARGS__)
|
||||||
|
#define LOG_SEND_WARN( ...) LOG_SEND(MESSAGING_WARNING,##__VA_ARGS__)
|
||||||
|
|
||||||
|
|
||||||
@@ -19,8 +19,11 @@
|
|||||||
#include "buttons.h"
|
#include "buttons.h"
|
||||||
#include "led.h"
|
#include "led.h"
|
||||||
#include "globdefs.h"
|
#include "globdefs.h"
|
||||||
#include "config.h"
|
#include "platform_config.h"
|
||||||
#include "accessors.h"
|
#include "accessors.h"
|
||||||
|
#include "messaging.h"
|
||||||
|
#include "cJSON.h"
|
||||||
|
#include "trace.h"
|
||||||
|
|
||||||
#define MONITOR_TIMER (10*1000)
|
#define MONITOR_TIMER (10*1000)
|
||||||
#define SCRATCH_SIZE 256
|
#define SCRATCH_SIZE 256
|
||||||
@@ -44,16 +47,17 @@ bool spkfault_svc(void);
|
|||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void task_stats( void ) {
|
static void task_stats( cJSON* top ) {
|
||||||
#ifdef CONFIG_FREERTOS_USE_TRACE_FACILITY
|
#ifdef CONFIG_FREERTOS_USE_TRACE_FACILITY
|
||||||
static struct {
|
static struct {
|
||||||
TaskStatus_t *tasks;
|
TaskStatus_t *tasks;
|
||||||
uint32_t total, n;
|
uint32_t total, n;
|
||||||
} current, previous;
|
} current, previous;
|
||||||
|
cJSON * tlist=cJSON_CreateArray();
|
||||||
current.n = uxTaskGetNumberOfTasks();
|
current.n = uxTaskGetNumberOfTasks();
|
||||||
current.tasks = malloc( current.n * sizeof( TaskStatus_t ) );
|
current.tasks = malloc( current.n * sizeof( TaskStatus_t ) );
|
||||||
current.n = uxTaskGetSystemState( current.tasks, current.n, ¤t.total );
|
current.n = uxTaskGetSystemState( current.tasks, current.n, ¤t.total );
|
||||||
|
cJSON_AddNumberToObject(top,"ntasks",current.n);
|
||||||
|
|
||||||
static EXT_RAM_ATTR char scratch[SCRATCH_SIZE];
|
static EXT_RAM_ATTR char scratch[SCRATCH_SIZE];
|
||||||
*scratch = '\0';
|
*scratch = '\0';
|
||||||
@@ -68,6 +72,15 @@ static void task_stats( void ) {
|
|||||||
current.tasks[i].eCurrentState,
|
current.tasks[i].eCurrentState,
|
||||||
100 * (current.tasks[i].ulRunTimeCounter - previous.tasks[j].ulRunTimeCounter) / elapsed,
|
100 * (current.tasks[i].ulRunTimeCounter - previous.tasks[j].ulRunTimeCounter) / elapsed,
|
||||||
current.tasks[i].usStackHighWaterMark);
|
current.tasks[i].usStackHighWaterMark);
|
||||||
|
cJSON * t=cJSON_CreateObject();
|
||||||
|
cJSON_AddNumberToObject(t,"cpu",100 * (current.tasks[i].ulRunTimeCounter - previous.tasks[j].ulRunTimeCounter) / elapsed);
|
||||||
|
cJSON_AddNumberToObject(t,"minstk",current.tasks[i].usStackHighWaterMark);
|
||||||
|
cJSON_AddNumberToObject(t,"bprio",current.tasks[i].uxBasePriority);
|
||||||
|
cJSON_AddNumberToObject(t,"cprio",current.tasks[i].uxCurrentPriority);
|
||||||
|
cJSON_AddStringToObject(t,"nme",current.tasks[i].pcTaskName);
|
||||||
|
cJSON_AddNumberToObject(t,"st",current.tasks[i].eCurrentState);
|
||||||
|
cJSON_AddNumberToObject(t,"num",current.tasks[i].xTaskNumber);
|
||||||
|
cJSON_AddItemToArray(tlist,t);
|
||||||
if (i % 3 == 2 || i == current.n - 1) {
|
if (i % 3 == 2 || i == current.n - 1) {
|
||||||
ESP_LOGI(TAG, "%s", scratch);
|
ESP_LOGI(TAG, "%s", scratch);
|
||||||
n = 0;
|
n = 0;
|
||||||
@@ -79,13 +92,21 @@ static void task_stats( void ) {
|
|||||||
#else
|
#else
|
||||||
for (int i = 0, n = 0; i < current.n; i ++) {
|
for (int i = 0, n = 0; i < current.n; i ++) {
|
||||||
n += sprintf(scratch + n, "%16s s:%5u\t", current.tasks[i].pcTaskName, current.tasks[i].usStackHighWaterMark);
|
n += sprintf(scratch + n, "%16s s:%5u\t", current.tasks[i].pcTaskName, current.tasks[i].usStackHighWaterMark);
|
||||||
|
cJSON * t=cJSON_CreateObject();
|
||||||
|
cJSON_AddNumberToObject(t,"minstk",current.tasks[i].usStackHighWaterMark);
|
||||||
|
cJSON_AddNumberToObject(t,"bprio",current.tasks[i].uxBasePriority);
|
||||||
|
cJSON_AddNumberToObject(t,"cprio",current.tasks[i].uxCurrentPriority);
|
||||||
|
cJSON_AddStringToObject(t,"nme",current.tasks[i].pcTaskName);
|
||||||
|
cJSON_AddNumberToObject(t,"st",current.tasks[i].eCurrentState);
|
||||||
|
cJSON_AddNumberToObject(t,"num",current.tasks[i].xTaskNumber);
|
||||||
|
cJSON_AddItemToArray(tlist,t);
|
||||||
if (i % 3 == 2 || i == current.n - 1) {
|
if (i % 3 == 2 || i == current.n - 1) {
|
||||||
ESP_LOGI(TAG, "%s", scratch);
|
ESP_LOGI(TAG, "%s", scratch);
|
||||||
n = 0;
|
n = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
cJSON_AddItemToObject(top,"tasks",tlist);
|
||||||
if (previous.tasks) free(previous.tasks);
|
if (previous.tasks) free(previous.tasks);
|
||||||
previous = current;
|
previous = current;
|
||||||
#endif
|
#endif
|
||||||
@@ -95,13 +116,25 @@ static void task_stats( void ) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void monitor_callback(TimerHandle_t xTimer) {
|
static void monitor_callback(TimerHandle_t xTimer) {
|
||||||
|
cJSON * top=cJSON_CreateObject();
|
||||||
|
cJSON_AddNumberToObject(top,"free_iram",heap_caps_get_free_size(MALLOC_CAP_INTERNAL));
|
||||||
|
cJSON_AddNumberToObject(top,"min_free_iram",heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL));
|
||||||
|
cJSON_AddNumberToObject(top,"free_spiram",heap_caps_get_free_size(MALLOC_CAP_SPIRAM));
|
||||||
|
cJSON_AddNumberToObject(top,"min_free_spiram",heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM));
|
||||||
|
|
||||||
ESP_LOGI(TAG, "Heap internal:%zu (min:%zu) external:%zu (min:%zu)",
|
ESP_LOGI(TAG, "Heap internal:%zu (min:%zu) external:%zu (min:%zu)",
|
||||||
heap_caps_get_free_size(MALLOC_CAP_INTERNAL),
|
heap_caps_get_free_size(MALLOC_CAP_INTERNAL),
|
||||||
heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL),
|
heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL),
|
||||||
heap_caps_get_free_size(MALLOC_CAP_SPIRAM),
|
heap_caps_get_free_size(MALLOC_CAP_SPIRAM),
|
||||||
heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM));
|
heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM));
|
||||||
|
|
||||||
task_stats();
|
task_stats(top);
|
||||||
|
char * top_a= cJSON_PrintUnformatted(top);
|
||||||
|
if(top_a){
|
||||||
|
messaging_post_message(MESSAGING_INFO, MESSAGING_CLASS_STATS,top_a);
|
||||||
|
FREE_AND_NULL(top_a);
|
||||||
|
}
|
||||||
|
cJSON_Delete(top);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
@@ -109,6 +142,7 @@ static void monitor_callback(TimerHandle_t xTimer) {
|
|||||||
*/
|
*/
|
||||||
static void jack_handler_default(void *id, button_event_e event, button_press_e mode, bool long_press) {
|
static void jack_handler_default(void *id, button_event_e event, button_press_e mode, bool long_press) {
|
||||||
ESP_LOGD(TAG, "Jack %s", event == BUTTON_PRESSED ? "inserted" : "removed");
|
ESP_LOGD(TAG, "Jack %s", event == BUTTON_PRESSED ? "inserted" : "removed");
|
||||||
|
messaging_post_message(MESSAGING_INFO, MESSAGING_CLASS_SYSTEM,"jack is %s",BUTTON_PRESSED ? "inserted" : "removed");
|
||||||
if (jack_handler_svc) (*jack_handler_svc)(event == BUTTON_PRESSED);
|
if (jack_handler_svc) (*jack_handler_svc)(event == BUTTON_PRESSED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,6 @@ extern bool jack_inserted_svc(void);
|
|||||||
extern void (*spkfault_handler_svc)(bool inserted);
|
extern void (*spkfault_handler_svc)(bool inserted);
|
||||||
extern bool spkfault_svc(void);
|
extern bool spkfault_svc(void);
|
||||||
|
|
||||||
extern int battery_value_svc(void);
|
extern float battery_value_svc(void);
|
||||||
extern uint8_t battery_level_svc(void);
|
extern uint8_t battery_level_svc(void);
|
||||||
|
|
||||||
|
|||||||
@@ -11,12 +11,13 @@
|
|||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
#include "driver/ledc.h"
|
#include "driver/ledc.h"
|
||||||
#include "driver/i2c.h"
|
#include "driver/i2c.h"
|
||||||
#include "config.h"
|
#include "platform_config.h"
|
||||||
#include "battery.h"
|
#include "battery.h"
|
||||||
#include "led.h"
|
#include "led.h"
|
||||||
#include "monitor.h"
|
#include "monitor.h"
|
||||||
#include "globdefs.h"
|
#include "globdefs.h"
|
||||||
#include "accessors.h"
|
#include "accessors.h"
|
||||||
|
#include "messaging.h"
|
||||||
|
|
||||||
extern void battery_svc_init(void);
|
extern void battery_svc_init(void);
|
||||||
extern void monitor_svc_init(void);
|
extern void monitor_svc_init(void);
|
||||||
@@ -58,6 +59,7 @@ void set_power_gpio(int gpio, char *value) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void services_init(void) {
|
void services_init(void) {
|
||||||
|
messaging_service_init();
|
||||||
gpio_install_isr_service(0);
|
gpio_install_isr_service(0);
|
||||||
|
|
||||||
#ifdef CONFIG_I2C_LOCKED
|
#ifdef CONFIG_I2C_LOCKED
|
||||||
@@ -81,7 +83,7 @@ void services_init(void) {
|
|||||||
i2c_system_port = -1;
|
i2c_system_port = -1;
|
||||||
ESP_LOGW(TAG, "no I2C configured");
|
ESP_LOGW(TAG, "no I2C configured");
|
||||||
}
|
}
|
||||||
|
|
||||||
const spi_bus_config_t * spi_config = config_spi_get((spi_host_device_t*) &spi_system_host);
|
const spi_bus_config_t * spi_config = config_spi_get((spi_host_device_t*) &spi_system_host);
|
||||||
ESP_LOGI(TAG,"Configuring SPI data:%d clk:%d host:%u dc:%d", spi_config->mosi_io_num, spi_config->sclk_io_num, spi_system_host, spi_system_dc_gpio);
|
ESP_LOGI(TAG,"Configuring SPI data:%d clk:%d host:%u dc:%d", spi_config->mosi_io_num, spi_config->sclk_io_num, spi_system_host, spi_system_dc_gpio);
|
||||||
|
|
||||||
@@ -97,7 +99,7 @@ void services_init(void) {
|
|||||||
spi_system_host = -1;
|
spi_system_host = -1;
|
||||||
ESP_LOGW(TAG, "no SPI configured");
|
ESP_LOGW(TAG, "no SPI configured");
|
||||||
}
|
}
|
||||||
|
|
||||||
// system-wide PWM timer configuration
|
// system-wide PWM timer configuration
|
||||||
ledc_timer_config_t pwm_timer = {
|
ledc_timer_config_t pwm_timer = {
|
||||||
.duty_resolution = LEDC_TIMER_13_BIT,
|
.duty_resolution = LEDC_TIMER_13_BIT,
|
||||||
@@ -111,4 +113,4 @@ void services_init(void) {
|
|||||||
led_svc_init();
|
led_svc_init();
|
||||||
battery_svc_init();
|
battery_svc_init();
|
||||||
monitor_svc_init();
|
monitor_svc_init();
|
||||||
}
|
}
|
||||||
|
|||||||
5
components/squeezelite-ota/CMakeLists.txt
Normal file
5
components/squeezelite-ota/CMakeLists.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
idf_component_register(SRC_DIRS .
|
||||||
|
INCLUDE_DIRS .
|
||||||
|
REQUIRES app_update esp_https_ota
|
||||||
|
PRIV_REQUIRES console tools display services platform_config spi_flash vfs console freertos platform_console
|
||||||
|
)
|
||||||
@@ -5,9 +5,6 @@
|
|||||||
|
|
||||||
# todo: add support for https
|
# todo: add support for https
|
||||||
COMPONENT_ADD_INCLUDEDIRS := .
|
COMPONENT_ADD_INCLUDEDIRS := .
|
||||||
COMPONENT_ADD_INCLUDEDIRS += include
|
|
||||||
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/main/
|
|
||||||
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/components/tools
|
|
||||||
CFLAGS += -D LOG_LOCAL_LEVEL=ESP_LOG_INFO -DCONFIG_OTA_ALLOW_HTTP=1
|
CFLAGS += -D LOG_LOCAL_LEVEL=ESP_LOG_INFO -DCONFIG_OTA_ALLOW_HTTP=1
|
||||||
#CFLAGS += -DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG -DCONFIG_OTA_ALLOW_HTTP=1
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ extern "C" {
|
|||||||
|
|
||||||
#include "esp_err.h"
|
#include "esp_err.h"
|
||||||
#include "tcpip_adapter.h"
|
#include "tcpip_adapter.h"
|
||||||
|
// IDF-V4++ #include "esp_netif.h"
|
||||||
|
|
||||||
#ifdef CONFIG_EXAMPLE_CONNECT_ETHERNET
|
#ifdef CONFIG_EXAMPLE_CONNECT_ETHERNET
|
||||||
#define EXAMPLE_INTERFACE TCPIP_ADAPTER_IF_ETH
|
#define EXAMPLE_INTERFACE TCPIP_ADAPTER_IF_ETH
|
||||||
|
|||||||
@@ -6,9 +6,7 @@
|
|||||||
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||||
CONDITIONS OF ANY KIND, either express or implied.
|
CONDITIONS OF ANY KIND, either express or implied.
|
||||||
*/
|
*/
|
||||||
#ifndef LOG_LOCAL_LEVEL
|
|
||||||
#define LOG_LOCAL_LEVEL ESP_LOG_INFO
|
|
||||||
#endif
|
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
@@ -21,9 +19,10 @@
|
|||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
#include "cmd_system.h"
|
#include "cmd_system.h"
|
||||||
#include "esp_err.h"
|
#include "esp_err.h"
|
||||||
#include "tcpip_adapter.h"
|
|
||||||
#include "squeezelite-ota.h"
|
#include "squeezelite-ota.h"
|
||||||
#include "config.h"
|
#include "tcpip_adapter.h"
|
||||||
|
// IDF-V4++ #include "esp_netif.h"
|
||||||
|
#include "platform_config.h"
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
@@ -31,36 +30,67 @@
|
|||||||
#include "esp_flash_encrypt.h"
|
#include "esp_flash_encrypt.h"
|
||||||
#include "esp_spi_flash.h"
|
#include "esp_spi_flash.h"
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
|
#include "messaging.h"
|
||||||
|
#include "trace.h"
|
||||||
#include "esp_ota_ops.h"
|
#include "esp_ota_ops.h"
|
||||||
|
#include "display.h"
|
||||||
|
#include "gds.h"
|
||||||
|
#include "gds_text.h"
|
||||||
|
#include "gds_draw.h"
|
||||||
|
#include "platform_esp32.h"
|
||||||
|
|
||||||
extern const char * get_certificate();
|
extern const char * get_certificate();
|
||||||
|
#define IF_DISPLAY(x) if(display) { x; }
|
||||||
|
|
||||||
|
#ifdef CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1
|
||||||
|
#define OTA_CORE 0
|
||||||
|
#else
|
||||||
|
#define OTA_CORE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char *TAG = "squeezelite-ota";
|
static const char *TAG = "squeezelite-ota";
|
||||||
char * ota_write_data = NULL;
|
|
||||||
esp_http_client_handle_t ota_http_client = NULL;
|
esp_http_client_handle_t ota_http_client = NULL;
|
||||||
#define IMAGE_HEADER_SIZE sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t) + sizeof(esp_app_desc_t) + 1
|
#define IMAGE_HEADER_SIZE sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t) + sizeof(esp_app_desc_t) + 1
|
||||||
#define BUFFSIZE 4096
|
#define BUFFSIZE 4096
|
||||||
#define HASH_LEN 32 /* SHA-256 digest length */
|
#define HASH_LEN 32 /* SHA-256 digest length */
|
||||||
|
typedef struct {
|
||||||
|
char * url;
|
||||||
|
char * bin;
|
||||||
|
uint32_t length;
|
||||||
|
} ota_thread_parms_t ;
|
||||||
|
static ota_thread_parms_t ota_thread_parms;
|
||||||
|
typedef enum {
|
||||||
|
OTA_TYPE_HTTP,
|
||||||
|
OTA_TYPE_BUFFER,
|
||||||
|
OTA_TYPE_INVALID
|
||||||
|
} ota_type_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
static struct {
|
size_t actual_image_len;
|
||||||
char status_text[81];
|
float downloaded_image_len;
|
||||||
uint32_t ota_actual_len;
|
float total_image_len;
|
||||||
uint32_t ota_total_len;
|
float remain_image_len;
|
||||||
char * redirected_url;
|
ota_type_t ota_type;
|
||||||
char * current_url;
|
char * ota_write_data;
|
||||||
|
char * bin_data;
|
||||||
bool bOTAStarted;
|
bool bOTAStarted;
|
||||||
bool bInitialized;
|
size_t buffer_size;
|
||||||
uint8_t lastpct;
|
uint8_t lastpct;
|
||||||
uint8_t newpct;
|
uint8_t newpct;
|
||||||
|
uint8_t newdownloadpct;
|
||||||
struct timeval OTA_start;
|
struct timeval OTA_start;
|
||||||
bool bOTAThreadStarted;
|
bool bOTAThreadStarted;
|
||||||
|
const esp_partition_t *configured;
|
||||||
|
const esp_partition_t *running;
|
||||||
|
const esp_partition_t * update_partition;
|
||||||
|
const esp_partition_t* last_invalid_app ;
|
||||||
|
const esp_partition_t * ota_partition;
|
||||||
|
} ota_status_t;
|
||||||
|
|
||||||
|
ota_status_t * ota_status;
|
||||||
|
|
||||||
} ota_status;
|
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
static esp_http_client_config_t ota_config;
|
static esp_http_client_config_t http_client_config;
|
||||||
|
|
||||||
extern void wifi_manager_refresh_ota_json();
|
|
||||||
|
|
||||||
void _printMemStats(){
|
void _printMemStats(){
|
||||||
ESP_LOGD(TAG,"Heap internal:%zu (min:%zu) external:%zu (min:%zu)",
|
ESP_LOGD(TAG,"Heap internal:%zu (min:%zu) external:%zu (min:%zu)",
|
||||||
@@ -69,34 +99,115 @@ void _printMemStats(){
|
|||||||
heap_caps_get_free_size(MALLOC_CAP_SPIRAM),
|
heap_caps_get_free_size(MALLOC_CAP_SPIRAM),
|
||||||
heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM));
|
heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM));
|
||||||
}
|
}
|
||||||
void triggerStatusJsonRefresh(bool bDelay,const char * status, ...){
|
uint8_t ota_get_pct_complete(){
|
||||||
va_list args;
|
return ota_status->total_image_len==0?0:
|
||||||
va_start(args, status);
|
(uint8_t)((float)ota_status->actual_image_len/ota_status->total_image_len*100.0f);
|
||||||
vsnprintf(ota_status.status_text,sizeof(ota_status.status_text)-1,status, args);
|
}
|
||||||
va_end(args);
|
uint8_t ota_get_pct_downloaded(){
|
||||||
_printMemStats();
|
return ota_status->total_image_len==0?0:
|
||||||
wifi_manager_refresh_ota_json();
|
(uint8_t)(ota_status->downloaded_image_len/ota_status->total_image_len*100.0f);
|
||||||
if(bDelay){
|
}
|
||||||
ESP_LOGD(TAG,"Holding task...");
|
typedef struct {
|
||||||
vTaskDelay(200 / portTICK_PERIOD_MS); // wait here for a short amount of time. This will help with refreshing the UI status
|
int x1,y1,x2,y2,width,height;
|
||||||
ESP_LOGD(TAG,"Done holding task...");
|
} rect_t;
|
||||||
|
typedef struct _progress {
|
||||||
|
int border_thickness;
|
||||||
|
int sides_margin;
|
||||||
|
int vertical_margin;
|
||||||
|
int bar_tot_height;
|
||||||
|
int bar_fill_height;
|
||||||
|
rect_t border;
|
||||||
|
rect_t filler;
|
||||||
|
} progress_t;
|
||||||
|
|
||||||
|
static progress_t * loc_displayer_get_progress_dft(){
|
||||||
|
|
||||||
|
int start_coord_offset=0;
|
||||||
|
static progress_t def={
|
||||||
|
.border_thickness = 2,
|
||||||
|
.sides_margin = 2,
|
||||||
|
.bar_tot_height = 7,
|
||||||
|
};
|
||||||
|
def.bar_fill_height= def.bar_tot_height-(def.border_thickness*2);
|
||||||
|
def.border.x1=start_coord_offset+def.sides_margin;
|
||||||
|
IF_DISPLAY(def.border.x2=GDS_GetWidth(display)-def.sides_margin);
|
||||||
|
// progress bar will be drawn at the bottom of the display
|
||||||
|
IF_DISPLAY( def.border.y2= GDS_GetHeight(display)-def.border_thickness);
|
||||||
|
def.border.y1= def.border.y2-def.bar_tot_height;
|
||||||
|
def.border.width=def.border.x2-def.border.x1;
|
||||||
|
def.border.height=def.border.y2-def.border.y1;
|
||||||
|
def.filler.x1= def.border.x1+def.border_thickness;
|
||||||
|
def.filler.x2= def.border.x2-def.border_thickness;
|
||||||
|
def.filler.y1= def.border.y1+def.border_thickness;
|
||||||
|
def.filler.y2= def.border.y2-def.border_thickness;
|
||||||
|
def.filler.width=def.filler.x2-def.filler.x1;
|
||||||
|
def.filler.height=def.filler.y2-def.filler.y1;
|
||||||
|
assert(def.filler.width>0);
|
||||||
|
assert(def.filler.height>0);
|
||||||
|
assert(def.border.width>0);
|
||||||
|
assert(def.border.height>0);
|
||||||
|
assert(def.border.width>def.filler.width);
|
||||||
|
assert(def.border.height>def.filler.height);
|
||||||
|
return &def;
|
||||||
|
|
||||||
|
}
|
||||||
|
static void loc_displayer_progressbar(uint8_t pct){
|
||||||
|
static progress_t * progress_coordinates;
|
||||||
|
if(!display){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!progress_coordinates) progress_coordinates = loc_displayer_get_progress_dft();
|
||||||
|
int filler_x=progress_coordinates->filler.x1+(int)((float)progress_coordinates->filler.width*(float)pct/(float)100);
|
||||||
|
|
||||||
|
ESP_LOGD(TAG,"Drawing %d,%d,%d,%d",progress_coordinates->border.x1,progress_coordinates->border.y1,progress_coordinates->border.x2,progress_coordinates->border.y2);
|
||||||
|
GDS_DrawBox(display,progress_coordinates->border.x1,progress_coordinates->border.y1,progress_coordinates->border.x2,progress_coordinates->border.y2,GDS_COLOR_WHITE,false);
|
||||||
|
ESP_LOGD(TAG,"Drawing %d,%d,%d,%d",progress_coordinates->filler.x1,progress_coordinates->filler.y1,filler_x,progress_coordinates->filler.y2);
|
||||||
|
if(filler_x > progress_coordinates->filler.x1){
|
||||||
|
GDS_DrawBox(display,progress_coordinates->filler.x1,progress_coordinates->filler.y1,filler_x,progress_coordinates->filler.y2,GDS_COLOR_WHITE,true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ESP_LOGI(TAG,"%s",ota_status.status_text);
|
// Clear the inner box
|
||||||
taskYIELD();
|
GDS_DrawBox(display,progress_coordinates->filler.x1,progress_coordinates->filler.y1,progress_coordinates->filler.x2,progress_coordinates->filler.y2,GDS_COLOR_BLACK,true);
|
||||||
}
|
}
|
||||||
|
ESP_LOGD(TAG,"Updating Display");
|
||||||
|
GDS_Update(display);
|
||||||
}
|
}
|
||||||
const char * ota_get_status(){
|
void sendMessaging(messaging_types type,const char * fmt, ...){
|
||||||
if(!ota_status.bInitialized)
|
va_list args;
|
||||||
{
|
cJSON * msg = cJSON_CreateObject();
|
||||||
memset(ota_status.status_text, 0x00,sizeof(ota_status.status_text));
|
size_t str_len=0;
|
||||||
ota_status.bInitialized = true;
|
char * msg_str=NULL;
|
||||||
}
|
|
||||||
return ota_status.status_text;
|
va_start(args, fmt);
|
||||||
}
|
str_len = vsnprintf(NULL,0,fmt,args)+1;
|
||||||
uint8_t ota_get_pct_complete(){
|
if(str_len>0){
|
||||||
return ota_status.ota_total_len==0?0:
|
msg_str = malloc(str_len);
|
||||||
(uint8_t)((float)ota_status.ota_actual_len/(float)ota_status.ota_total_len*100.0f);
|
vsnprintf(msg_str,str_len,fmt,args);
|
||||||
|
if(type == MESSAGING_WARNING){
|
||||||
|
ESP_LOGW(TAG,"%s",msg_str);
|
||||||
|
}
|
||||||
|
else if (type == MESSAGING_ERROR){
|
||||||
|
ESP_LOGE(TAG,"%s",msg_str);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ESP_LOGI(TAG,"%s",msg_str);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ESP_LOGW(TAG, "Sending empty string message");
|
||||||
|
}
|
||||||
|
va_end(args);
|
||||||
|
if(type!=MESSAGING_INFO){
|
||||||
|
IF_DISPLAY(GDS_TextLine(display, 2, GDS_TEXT_LEFT, GDS_TEXT_CLEAR | GDS_TEXT_UPDATE, msg_str));
|
||||||
|
}
|
||||||
|
|
||||||
|
cJSON_AddStringToObject(msg,"ota_dsc",str_or_unknown(msg_str));
|
||||||
|
free(msg_str);
|
||||||
|
cJSON_AddNumberToObject(msg,"ota_pct", ota_get_pct_complete() );
|
||||||
|
char * json_msg = cJSON_PrintUnformatted(msg);
|
||||||
|
messaging_post_message(type, MESSAGING_CLASS_OTA, json_msg);
|
||||||
|
free(json_msg);
|
||||||
|
cJSON_Delete(msg);
|
||||||
|
_printMemStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __attribute__((noreturn)) task_fatal_error(void)
|
static void __attribute__((noreturn)) task_fatal_error(void)
|
||||||
@@ -108,7 +219,49 @@ static void __attribute__((noreturn)) task_fatal_error(void)
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#define FREE_RESET(p) if(p!=NULL) { free(p); p=NULL; }
|
|
||||||
|
esp_err_t handle_http_on_data(esp_http_client_event_t *evt){
|
||||||
|
|
||||||
|
int http_status= esp_http_client_get_status_code(evt->client);
|
||||||
|
static char * recv_ptr=NULL;
|
||||||
|
|
||||||
|
if(http_status == 200){
|
||||||
|
|
||||||
|
|
||||||
|
if(!ota_status->bOTAStarted)
|
||||||
|
{
|
||||||
|
sendMessaging(MESSAGING_INFO,"Downloading firmware");
|
||||||
|
ota_status->bOTAStarted = true;
|
||||||
|
ota_status->total_image_len=esp_http_client_get_content_length(evt->client);
|
||||||
|
ota_status->downloaded_image_len = 0;
|
||||||
|
ota_status->newdownloadpct = 0;
|
||||||
|
ota_status->bin_data= malloc(ota_status->total_image_len);
|
||||||
|
if(ota_status->bin_data==NULL){
|
||||||
|
sendMessaging(MESSAGING_ERROR,"Error: buffer alloc error");
|
||||||
|
return ESP_FAIL;
|
||||||
|
}
|
||||||
|
recv_ptr=ota_status->bin_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
// we're downloading the binary data file
|
||||||
|
if (!esp_http_client_is_chunked_response(evt->client)) {
|
||||||
|
memcpy(recv_ptr,evt->data,evt->data_len);
|
||||||
|
ota_status->downloaded_image_len +=evt->data_len;
|
||||||
|
recv_ptr+=evt->data_len;
|
||||||
|
}
|
||||||
|
if(ota_get_pct_downloaded()%5 == 0 && ota_get_pct_downloaded()%5!=ota_status->newdownloadpct) {
|
||||||
|
ota_status->newdownloadpct= ota_get_pct_downloaded();
|
||||||
|
loc_displayer_progressbar(ota_status->newdownloadpct);
|
||||||
|
gettimeofday(&tv, NULL);
|
||||||
|
uint32_t elapsed_ms= (tv.tv_sec-ota_status->OTA_start.tv_sec )*1000+(tv.tv_usec-ota_status->OTA_start.tv_usec)/1000;
|
||||||
|
ESP_LOGI(TAG,"OTA download progress : %f/%f (%d pct), %f KB/s", ota_status->downloaded_image_len, ota_status->total_image_len, ota_status->newdownloadpct, elapsed_ms>0?ota_status->downloaded_image_len*1000/elapsed_ms/1024:0);
|
||||||
|
sendMessaging(MESSAGING_INFO,"Downloading firmware %%%3d.",ota_status->newdownloadpct);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return ESP_OK;
|
||||||
|
}
|
||||||
esp_err_t _http_event_handler(esp_http_client_event_t *evt)
|
esp_err_t _http_event_handler(esp_http_client_event_t *evt)
|
||||||
{
|
{
|
||||||
// --------------
|
// --------------
|
||||||
@@ -127,42 +280,35 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
|
|||||||
// char *header_value For HTTP_EVENT_ON_HEADER event_id, it<69>s store current http header value
|
// char *header_value For HTTP_EVENT_ON_HEADER event_id, it<69>s store current http header value
|
||||||
// --------------
|
// --------------
|
||||||
switch (evt->event_id) {
|
switch (evt->event_id) {
|
||||||
|
|
||||||
case HTTP_EVENT_ERROR:
|
case HTTP_EVENT_ERROR:
|
||||||
ESP_LOGD(TAG, "HTTP_EVENT_ERROR");
|
ESP_LOGD(TAG, "HTTP_EVENT_ERROR");
|
||||||
_printMemStats();
|
_printMemStats();
|
||||||
//strncpy(ota_status,"HTTP_EVENT_ERROR",sizeof(ota_status)-1);
|
|
||||||
break;
|
break;
|
||||||
case HTTP_EVENT_ON_CONNECTED:
|
case HTTP_EVENT_ON_CONNECTED:
|
||||||
ESP_LOGD(TAG, "HTTP_EVENT_ON_CONNECTED");
|
ESP_LOGD(TAG, "HTTP_EVENT_ON_CONNECTED");
|
||||||
|
if(ota_status->bOTAStarted) sendMessaging(MESSAGING_INFO,"HTTP Connected");
|
||||||
if(ota_status.bOTAStarted) triggerStatusJsonRefresh(true,"Installing...");
|
ota_status->total_image_len=0;
|
||||||
ota_status.ota_total_len=0;
|
ota_status->actual_image_len=0;
|
||||||
ota_status.ota_actual_len=0;
|
ota_status->lastpct=0;
|
||||||
ota_status.lastpct=0;
|
ota_status->remain_image_len=0;
|
||||||
ota_status.newpct=0;
|
ota_status->newpct=0;
|
||||||
gettimeofday(&ota_status.OTA_start, NULL);
|
gettimeofday(&ota_status->OTA_start, NULL);
|
||||||
|
break;
|
||||||
break;
|
|
||||||
case HTTP_EVENT_HEADER_SENT:
|
case HTTP_EVENT_HEADER_SENT:
|
||||||
ESP_LOGD(TAG, "HTTP_EVENT_HEADER_SENT");
|
ESP_LOGD(TAG, "HTTP_EVENT_HEADER_SENT");
|
||||||
break;
|
break;
|
||||||
case HTTP_EVENT_ON_HEADER:
|
case HTTP_EVENT_ON_HEADER:
|
||||||
ESP_LOGD(TAG, "HTTP_EVENT_ON_HEADER, key=%s, value=%s",evt->header_key, evt->header_value);
|
ESP_LOGD(TAG, "HTTP_EVENT_ON_HEADER, key=%s, value=%s",evt->header_key, evt->header_value);
|
||||||
if (strcasecmp(evt->header_key, "location") == 0) {
|
// if (strcasecmp(evt->header_key, "location") == 0) {
|
||||||
FREE_RESET(ota_status.redirected_url);
|
// ESP_LOGW(TAG,"OTA will redirect to url: %s",evt->header_value);
|
||||||
ota_status.redirected_url=strdup(evt->header_value);
|
// }
|
||||||
ESP_LOGW(TAG,"OTA will redirect to url: %s",ota_status.redirected_url);
|
// if (strcasecmp(evt->header_key, "content-length") == 0) {
|
||||||
}
|
// ota_status->total_image_len = atol(evt->header_value);
|
||||||
if (strcasecmp(evt->header_key, "content-length") == 0) {
|
// ESP_LOGW(TAG, "Content length found: %s, parsed to %d", evt->header_value, ota_status->total_image_len);
|
||||||
ota_status.ota_total_len = atol(evt->header_value);
|
// }
|
||||||
ESP_LOGW(TAG, "Content length found: %s, parsed to %d", evt->header_value, ota_status.ota_total_len);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case HTTP_EVENT_ON_DATA:
|
case HTTP_EVENT_ON_DATA:
|
||||||
if(!ota_status.bOTAStarted) {
|
return handle_http_on_data(evt);
|
||||||
ESP_LOGD(TAG, "HTTP_EVENT_ON_DATA, status_code=%d, len=%d",esp_http_client_get_status_code(evt->client), evt->data_len);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case HTTP_EVENT_ON_FINISH:
|
case HTTP_EVENT_ON_FINISH:
|
||||||
ESP_LOGD(TAG, "HTTP_EVENT_ON_FINISH");
|
ESP_LOGD(TAG, "HTTP_EVENT_ON_FINISH");
|
||||||
@@ -174,34 +320,56 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
esp_err_t init_config(char * url){
|
esp_err_t init_config(ota_thread_parms_t * p_ota_thread_parms){
|
||||||
memset(&ota_config, 0x00, sizeof(ota_config));
|
memset(&http_client_config, 0x00, sizeof(http_client_config));
|
||||||
ota_status.bInitialized = true;
|
sendMessaging(MESSAGING_INFO,"Initializing...");
|
||||||
triggerStatusJsonRefresh(true,"Initializing...");
|
loc_displayer_progressbar(0);
|
||||||
if(url==NULL || strlen(url)==0){
|
ota_status->ota_type= OTA_TYPE_INVALID;
|
||||||
ESP_LOGE(TAG,"HTTP OTA called without a url");
|
if(p_ota_thread_parms->url !=NULL && strlen(p_ota_thread_parms->url)>0 ){
|
||||||
|
ota_status->ota_type= OTA_TYPE_HTTP;
|
||||||
|
}
|
||||||
|
else if(p_ota_thread_parms->bin!=NULL && p_ota_thread_parms->length > 0) {
|
||||||
|
ota_status->ota_type= OTA_TYPE_BUFFER;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ota_status->ota_type== OTA_TYPE_INVALID ){
|
||||||
|
ESP_LOGE(TAG,"HTTP OTA called without a url or a binary buffer");
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
ota_status->buffer_size = BUFFSIZE;
|
||||||
|
ota_status->ota_write_data = heap_caps_malloc(ota_status->buffer_size+1 , (MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT));
|
||||||
|
if(ota_status->ota_write_data== NULL){
|
||||||
|
ESP_LOGE(TAG,"Error allocating the ota buffer");
|
||||||
|
return ESP_ERR_NO_MEM;
|
||||||
|
}
|
||||||
|
switch (ota_status->ota_type) {
|
||||||
|
case OTA_TYPE_HTTP:
|
||||||
|
http_client_config.cert_pem =get_certificate();
|
||||||
|
http_client_config.event_handler = _http_event_handler;
|
||||||
|
http_client_config.disable_auto_redirect=false;
|
||||||
|
http_client_config.skip_cert_common_name_check = false;
|
||||||
|
http_client_config.url = strdup(p_ota_thread_parms->url);
|
||||||
|
http_client_config.max_redirection_count = 4;
|
||||||
|
// buffer size below is for http read chunks
|
||||||
|
http_client_config.buffer_size = 8192; //1024 ;
|
||||||
|
http_client_config.buffer_size_tx = 8192;
|
||||||
|
//http_client_config.timeout_ms = 5000;
|
||||||
|
break;
|
||||||
|
case OTA_TYPE_BUFFER:
|
||||||
|
ota_status->bin_data = p_ota_thread_parms->bin;
|
||||||
|
ota_status->total_image_len = p_ota_thread_parms->length;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
ota_status.current_url= url;
|
|
||||||
ota_config.cert_pem =get_certificate();
|
|
||||||
ota_config.event_handler = _http_event_handler;
|
|
||||||
ota_config.buffer_size = BUFFSIZE;
|
|
||||||
//ota_config.disable_auto_redirect=true;
|
|
||||||
ota_config.disable_auto_redirect=false;
|
|
||||||
ota_config.skip_cert_common_name_check = false;
|
|
||||||
ota_config.url = strdup(url);
|
|
||||||
ota_config.max_redirection_count = 3;
|
|
||||||
ota_write_data = heap_caps_malloc(ota_config.buffer_size+1 , MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
|
|
||||||
//ota_write_data = malloc(ota_config.buffer_size+1);
|
|
||||||
if(ota_write_data== NULL){
|
|
||||||
ESP_LOGE(TAG,"Error allocating the ota buffer");
|
|
||||||
return ESP_ERR_NO_MEM;
|
|
||||||
}
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
esp_partition_t * _get_ota_partition(esp_partition_subtype_t subtype){
|
esp_partition_t * _get_ota_partition(esp_partition_subtype_t subtype){
|
||||||
esp_partition_t *ota_partition=NULL;
|
esp_partition_t *ota_partition=NULL;
|
||||||
ESP_LOGI(TAG, "Looking for OTA partition.");
|
ESP_LOGD(TAG, "Looking for OTA partition.");
|
||||||
|
|
||||||
esp_partition_iterator_t it = esp_partition_find(ESP_PARTITION_TYPE_APP, subtype , NULL);
|
esp_partition_iterator_t it = esp_partition_find(ESP_PARTITION_TYPE_APP, subtype , NULL);
|
||||||
if(it == NULL){
|
if(it == NULL){
|
||||||
@@ -210,7 +378,7 @@ esp_partition_t * _get_ota_partition(esp_partition_subtype_t subtype){
|
|||||||
else {
|
else {
|
||||||
ota_partition = (esp_partition_t *) esp_partition_get(it);
|
ota_partition = (esp_partition_t *) esp_partition_get(it);
|
||||||
if(ota_partition != NULL){
|
if(ota_partition != NULL){
|
||||||
ESP_LOGI(TAG, "Found OTA partition: %s.",ota_partition->label);
|
ESP_LOGD(TAG, "Found OTA partition: %s.",ota_partition->label);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ESP_LOGE(TAG,"OTA partition not found! Unable update application.");
|
ESP_LOGE(TAG,"OTA partition not found! Unable update application.");
|
||||||
@@ -223,7 +391,7 @@ esp_partition_t * _get_ota_partition(esp_partition_subtype_t subtype){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
esp_err_t _erase_last_boot_app_partition(esp_partition_t *ota_partition)
|
esp_err_t _erase_last_boot_app_partition(const esp_partition_t *ota_partition)
|
||||||
{
|
{
|
||||||
uint16_t num_passes=0;
|
uint16_t num_passes=0;
|
||||||
uint16_t remain_size=0;
|
uint16_t remain_size=0;
|
||||||
@@ -246,7 +414,7 @@ esp_err_t _erase_last_boot_app_partition(esp_partition_t *ota_partition)
|
|||||||
ESP_LOGW(TAG,"Invalid erase block size of %u. Value should be a multiple of %d and will be adjusted to %u.", single_pass_size, SPI_FLASH_SEC_SIZE,temp_single_pass_size);
|
ESP_LOGW(TAG,"Invalid erase block size of %u. Value should be a multiple of %d and will be adjusted to %u.", single_pass_size, SPI_FLASH_SEC_SIZE,temp_single_pass_size);
|
||||||
single_pass_size=temp_single_pass_size;
|
single_pass_size=temp_single_pass_size;
|
||||||
}
|
}
|
||||||
ESP_LOGI(TAG,"Erasing flash partition of size %u in blocks of %d bytes", ota_partition->size, single_pass_size);
|
ESP_LOGD(TAG,"Erasing flash partition of size %u in blocks of %d bytes", ota_partition->size, single_pass_size);
|
||||||
num_passes=ota_partition->size/single_pass_size;
|
num_passes=ota_partition->size/single_pass_size;
|
||||||
remain_size=ota_partition->size-(num_passes*single_pass_size);
|
remain_size=ota_partition->size-(num_passes*single_pass_size);
|
||||||
ESP_LOGI(TAG,"Erasing in %d passes with blocks of %d bytes ", num_passes,single_pass_size);
|
ESP_LOGI(TAG,"Erasing in %d passes with blocks of %d bytes ", num_passes,single_pass_size);
|
||||||
@@ -255,282 +423,244 @@ esp_err_t _erase_last_boot_app_partition(esp_partition_t *ota_partition)
|
|||||||
ESP_LOGD(TAG,"Pass %d of %d, with chunks of %d bytes, from %d to %d", i+1, num_passes,single_pass_size,i*single_pass_size,i*single_pass_size+single_pass_size);
|
ESP_LOGD(TAG,"Pass %d of %d, with chunks of %d bytes, from %d to %d", i+1, num_passes,single_pass_size,i*single_pass_size,i*single_pass_size+single_pass_size);
|
||||||
err=esp_partition_erase_range(ota_partition, i*single_pass_size, single_pass_size);
|
err=esp_partition_erase_range(ota_partition, i*single_pass_size, single_pass_size);
|
||||||
if(err!=ESP_OK) return err;
|
if(err!=ESP_OK) return err;
|
||||||
// triggerStatusJsonRefresh(i%10==0?true:false,"Erasing flash (%u/%u)",i,num_passes);
|
|
||||||
if(i%2) {
|
if(i%2) {
|
||||||
triggerStatusJsonRefresh(false,"Erasing flash (%u/%u)",i,num_passes);
|
loc_displayer_progressbar((int)(((float)i/(float)num_passes)*100.0f));
|
||||||
|
sendMessaging(MESSAGING_INFO,"Erasing flash (%u/%u)",i,num_passes);
|
||||||
}
|
}
|
||||||
vTaskDelay(200/ portTICK_PERIOD_MS); // wait here for a short amount of time. This will help with reducing WDT errors
|
vTaskDelay(100/ portTICK_PERIOD_MS); // wait here for a short amount of time. This will help with reducing WDT errors
|
||||||
}
|
}
|
||||||
if(remain_size>0){
|
if(remain_size>0){
|
||||||
err=esp_partition_erase_range(ota_partition, ota_partition->size-remain_size, remain_size);
|
err=esp_partition_erase_range(ota_partition, ota_partition->size-remain_size, remain_size);
|
||||||
|
|
||||||
if(err!=ESP_OK) return err;
|
if(err!=ESP_OK) return err;
|
||||||
}
|
}
|
||||||
triggerStatusJsonRefresh(true,"Erasing flash complete.");
|
sendMessaging(MESSAGING_INFO,"Erasing flash complete.");
|
||||||
taskYIELD();
|
loc_displayer_progressbar(100);
|
||||||
|
vTaskDelay(200/ portTICK_PERIOD_MS);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool process_again(int status_code)
|
|
||||||
{
|
|
||||||
switch (status_code) {
|
|
||||||
case HttpStatus_MovedPermanently:
|
|
||||||
case HttpStatus_Found:
|
|
||||||
case HttpStatus_Unauthorized:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
static esp_err_t _http_handle_response_code(esp_http_client_handle_t http_client, int status_code)
|
|
||||||
{
|
|
||||||
esp_err_t err=ESP_OK;
|
|
||||||
if (status_code == HttpStatus_MovedPermanently || status_code == HttpStatus_Found) {
|
|
||||||
ESP_LOGW(TAG, "Handling HTTP redirection. ");
|
|
||||||
err = esp_http_client_set_redirection(http_client);
|
|
||||||
if (err != ESP_OK) {
|
|
||||||
ESP_LOGE(TAG, "URL redirection Failed. %s", esp_err_to_name(err));
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
} else if (status_code == HttpStatus_Unauthorized) {
|
|
||||||
ESP_LOGW(TAG, "Handling Unauthorized. ");
|
|
||||||
esp_http_client_add_auth(http_client);
|
|
||||||
}
|
|
||||||
ESP_LOGD(TAG, "Redirection done, checking if we need to read the data. ");
|
|
||||||
if (process_again(status_code)) {
|
|
||||||
char * local_buff = heap_caps_malloc(ota_config.buffer_size+1, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
|
|
||||||
//char * local_buff = malloc(ota_config.buffer_size+1);
|
|
||||||
if(local_buff==NULL){
|
|
||||||
ESP_LOGE(TAG,"Failed to allocate internal memory buffer for http processing");
|
|
||||||
return ESP_ERR_NO_MEM;
|
|
||||||
}
|
|
||||||
while (1) {
|
|
||||||
ESP_LOGD(TAG, "Reading data chunk. ");
|
|
||||||
int data_read = esp_http_client_read(http_client, local_buff, ota_config.buffer_size);
|
|
||||||
if (data_read < 0) {
|
|
||||||
ESP_LOGE(TAG, "Error: SSL data read error");
|
|
||||||
err= ESP_FAIL;
|
|
||||||
break;
|
|
||||||
} else if (data_read == 0) {
|
|
||||||
ESP_LOGD(TAG, "No more data. ");
|
|
||||||
err= ESP_OK;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FREE_RESET(local_buff);
|
|
||||||
}
|
|
||||||
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
static esp_err_t _http_connect(esp_http_client_handle_t http_client)
|
|
||||||
{
|
|
||||||
esp_err_t err = ESP_FAIL;
|
|
||||||
int status_code, header_ret;
|
|
||||||
do {
|
|
||||||
ESP_LOGD(TAG, "connecting the http client. ");
|
|
||||||
err = esp_http_client_open(http_client, 0);
|
|
||||||
if (err != ESP_OK) {
|
|
||||||
ESP_LOGE(TAG, "Failed to open HTTP connection: %s", esp_err_to_name(err));
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
ESP_LOGD(TAG, "Fetching headers");
|
|
||||||
header_ret = esp_http_client_fetch_headers(http_client);
|
|
||||||
if (header_ret < 0) {
|
|
||||||
// Error found
|
|
||||||
return header_ret;
|
|
||||||
}
|
|
||||||
ESP_LOGD(TAG, "HTTP Header fetch completed, found content length of %d",header_ret);
|
|
||||||
status_code = esp_http_client_get_status_code(http_client);
|
|
||||||
ESP_LOGD(TAG, "HTTP status code was %d",status_code);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
err = _http_handle_response_code(http_client, status_code);
|
|
||||||
if (err != ESP_OK) {
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
} while (process_again(status_code));
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
void ota_task_cleanup(const char * message, ...){
|
void ota_task_cleanup(const char * message, ...){
|
||||||
ota_status.bOTAThreadStarted=false;
|
ota_status->bOTAThreadStarted=false;
|
||||||
|
loc_displayer_progressbar(0);
|
||||||
if(message!=NULL){
|
if(message!=NULL){
|
||||||
|
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, message);
|
va_start(args, message);
|
||||||
triggerStatusJsonRefresh(true,message, args);
|
sendMessaging(MESSAGING_ERROR,message, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
ESP_LOGE(TAG, "%s",ota_status.status_text);
|
|
||||||
}
|
}
|
||||||
FREE_RESET(ota_status.redirected_url);
|
FREE_RESET(ota_status->ota_write_data);
|
||||||
FREE_RESET(ota_status.current_url);
|
FREE_RESET(ota_status->bin_data);
|
||||||
FREE_RESET(ota_write_data);
|
|
||||||
if(ota_http_client!=NULL) {
|
if(ota_http_client!=NULL) {
|
||||||
esp_http_client_cleanup(ota_http_client);
|
esp_http_client_cleanup(ota_http_client);
|
||||||
ota_http_client=NULL;
|
ota_http_client=NULL;
|
||||||
}
|
}
|
||||||
ota_status.bOTAStarted = false;
|
ota_status->bOTAStarted = false;
|
||||||
task_fatal_error();
|
task_fatal_error();
|
||||||
}
|
}
|
||||||
|
esp_err_t ota_buffer_all(){
|
||||||
|
esp_err_t err=ESP_OK;
|
||||||
|
if (ota_status->ota_type == OTA_TYPE_HTTP){
|
||||||
|
IF_DISPLAY(GDS_TextLine(display, 2, GDS_TEXT_LEFT, GDS_TEXT_CLEAR | GDS_TEXT_UPDATE, "Downloading file"));
|
||||||
|
ota_http_client = esp_http_client_init(&http_client_config);
|
||||||
|
if (ota_http_client == NULL) {
|
||||||
|
sendMessaging(MESSAGING_ERROR,"Error: Failed to initialize HTTP connection.");
|
||||||
|
return ESP_FAIL;
|
||||||
|
}
|
||||||
|
_printMemStats();
|
||||||
|
err = esp_http_client_perform(ota_http_client);
|
||||||
|
if (err != ESP_OK) {
|
||||||
|
sendMessaging(MESSAGING_ERROR,"Error: Failed to execute HTTP download. %s",esp_err_to_name(err));
|
||||||
|
return ESP_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ota_status->total_image_len<=0){
|
||||||
|
sendMessaging(MESSAGING_ERROR,"Error: Invalid image length");
|
||||||
|
return ESP_FAIL;
|
||||||
|
}
|
||||||
|
sendMessaging(MESSAGING_INFO,"Download success");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gettimeofday(&ota_status->OTA_start, NULL);
|
||||||
|
}
|
||||||
|
ota_status->remain_image_len=ota_status->total_image_len;
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
int ota_buffer_read(){
|
||||||
|
int data_read=0;
|
||||||
|
if(ota_status->remain_image_len >ota_status->buffer_size){
|
||||||
|
data_read = ota_status->buffer_size;
|
||||||
|
} else {
|
||||||
|
data_read = ota_status->remain_image_len;
|
||||||
|
}
|
||||||
|
memcpy(ota_status->ota_write_data, &ota_status->bin_data[ota_status->actual_image_len], data_read);
|
||||||
|
|
||||||
|
ota_status->actual_image_len += data_read;
|
||||||
|
ota_status->remain_image_len -= data_read;
|
||||||
|
return data_read;
|
||||||
|
}
|
||||||
|
esp_err_t ota_header_check(){
|
||||||
|
esp_app_desc_t new_app_info;
|
||||||
|
esp_app_desc_t running_app_info;
|
||||||
|
|
||||||
|
ota_status->configured = esp_ota_get_boot_partition();
|
||||||
|
ota_status->running = esp_ota_get_running_partition();
|
||||||
|
ota_status->last_invalid_app= esp_ota_get_last_invalid_partition();
|
||||||
|
ota_status->ota_partition = _get_ota_partition(ESP_PARTITION_SUBTYPE_APP_OTA_0);
|
||||||
|
|
||||||
|
ESP_LOGD(TAG, "Running partition [%s] type %d subtype %d (offset 0x%08x)", ota_status->running->label, ota_status->running->type, ota_status->running->subtype, ota_status->running->address);
|
||||||
|
if (ota_status->total_image_len > ota_status->ota_partition->size){
|
||||||
|
ota_task_cleanup("Error: Image size (%d) too large to fit in partition (%d).",ota_status->ota_partition->size,ota_status->total_image_len );
|
||||||
|
return ESP_FAIL;
|
||||||
|
}
|
||||||
|
if(ota_status->ota_partition == NULL){
|
||||||
|
ESP_LOGE(TAG,"Unable to locate OTA application partition. ");
|
||||||
|
ota_task_cleanup("Error: OTA partition not found");
|
||||||
|
return ESP_FAIL;
|
||||||
|
}
|
||||||
|
if (ota_status->configured != ota_status->running) {
|
||||||
|
ESP_LOGW(TAG, "Configured OTA boot partition at offset 0x%08x, but running from offset 0x%08x", ota_status->configured->address, ota_status->running->address);
|
||||||
|
ESP_LOGW(TAG, "(This can happen if either the OTA boot data or preferred boot image become corrupted somehow.)");
|
||||||
|
}
|
||||||
|
ESP_LOGD(TAG, "Next ota update partition is: [%s] subtype %d at offset 0x%x",
|
||||||
|
ota_status->update_partition->label, ota_status->update_partition->subtype, ota_status->update_partition->address);
|
||||||
|
|
||||||
|
if (ota_status->total_image_len >= IMAGE_HEADER_SIZE) {
|
||||||
|
// check current version with downloading
|
||||||
|
memcpy(&new_app_info, &ota_status->bin_data[sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t)], sizeof(esp_app_desc_t));
|
||||||
|
ESP_LOGI(TAG, "New firmware version: %s", new_app_info.version);
|
||||||
|
if (esp_ota_get_partition_description(ota_status->running, &running_app_info) == ESP_OK) {
|
||||||
|
ESP_LOGD(TAG, "Running recovery version: %s", running_app_info.version);
|
||||||
|
}
|
||||||
|
sendMessaging(MESSAGING_INFO,"New version is : %s",new_app_info.version);
|
||||||
|
esp_app_desc_t invalid_app_info;
|
||||||
|
if (esp_ota_get_partition_description(ota_status->last_invalid_app, &invalid_app_info) == ESP_OK) {
|
||||||
|
ESP_LOGD(TAG, "Last invalid firmware version: %s", invalid_app_info.version);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (memcmp(new_app_info.version, running_app_info.version, sizeof(new_app_info.version)) == 0) {
|
||||||
|
ESP_LOGW(TAG, "Current running version is the same as a new.");
|
||||||
|
}
|
||||||
|
return ESP_OK;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
ota_task_cleanup("Error: Binary file too small");
|
||||||
|
}
|
||||||
|
return ESP_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
void ota_task(void *pvParameter)
|
void ota_task(void *pvParameter)
|
||||||
{
|
{
|
||||||
esp_err_t err = ESP_OK;
|
esp_err_t err = ESP_OK;
|
||||||
size_t buffer_size = BUFFSIZE;
|
int data_read = 0;
|
||||||
|
IF_DISPLAY(GDS_TextSetFont(display,2,GDS_GetHeight(display)>32?&Font_droid_sans_fallback_15x17:&Font_droid_sans_fallback_11x13,-2))
|
||||||
|
IF_DISPLAY( GDS_ClearExt(display, true));
|
||||||
|
IF_DISPLAY(GDS_TextLine(display, 1, GDS_TEXT_LEFT, GDS_TEXT_CLEAR | GDS_TEXT_UPDATE, "Firmware update"));
|
||||||
|
IF_DISPLAY(GDS_TextLine(display, 2, GDS_TEXT_LEFT, GDS_TEXT_CLEAR | GDS_TEXT_UPDATE, "Initializing"));
|
||||||
|
loc_displayer_progressbar(0);
|
||||||
ESP_LOGD(TAG, "HTTP ota Thread started");
|
ESP_LOGD(TAG, "HTTP ota Thread started");
|
||||||
const esp_partition_t *configured = esp_ota_get_boot_partition();
|
|
||||||
const esp_partition_t *running = esp_ota_get_running_partition();
|
|
||||||
const esp_partition_t * update_partition = esp_ota_get_next_update_partition(NULL);
|
|
||||||
ESP_LOGI(TAG, "esp_ota_get_next_update_partition returned : partition [%s] subtype %d at offset 0x%x",
|
|
||||||
update_partition->label, update_partition->subtype, update_partition->address);
|
|
||||||
|
|
||||||
if (configured != running) {
|
|
||||||
ESP_LOGW(TAG, "Configured OTA boot partition at offset 0x%08x, but running from offset 0x%08x", configured->address, running->address);
|
|
||||||
ESP_LOGW(TAG, "(This can happen if either the OTA boot data or preferred boot image become corrupted somehow.)");
|
|
||||||
}
|
|
||||||
ESP_LOGI(TAG, "Running partition [%s] type %d subtype %d (offset 0x%08x)", running->label, running->type, running->subtype, running->address);
|
|
||||||
_printMemStats();
|
_printMemStats();
|
||||||
|
|
||||||
|
ota_status->update_partition = esp_ota_get_next_update_partition(NULL);
|
||||||
|
|
||||||
ESP_LOGI(TAG,"Initializing OTA configuration");
|
ESP_LOGD(TAG,"Initializing OTA configuration");
|
||||||
err = init_config(pvParameter);
|
err = init_config(pvParameter);
|
||||||
if(err!=ESP_OK){
|
if(err!=ESP_OK){
|
||||||
ota_task_cleanup("Error: Failed to initialize OTA.");
|
ota_task_cleanup("Error: Failed to initialize OTA.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Locate and erase ota application partition */
|
|
||||||
ESP_LOGW(TAG,"**************** Expecting WATCHDOG errors below during flash erase. This is OK and not to worry about **************** ");
|
|
||||||
triggerStatusJsonRefresh(true,"Erasing OTA partition");
|
|
||||||
esp_partition_t *ota_partition = _get_ota_partition(ESP_PARTITION_SUBTYPE_APP_OTA_0);
|
|
||||||
if(ota_partition == NULL){
|
|
||||||
ESP_LOGE(TAG,"Unable to locate OTA application partition. ");
|
|
||||||
ota_task_cleanup("Error: OTA application partition not found. (%s)",esp_err_to_name(err));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_printMemStats();
|
_printMemStats();
|
||||||
err=_erase_last_boot_app_partition(ota_partition);
|
sendMessaging(MESSAGING_INFO,"Starting OTA...");
|
||||||
|
err=ota_buffer_all();
|
||||||
|
if(err!=ESP_OK){
|
||||||
|
ota_task_cleanup(NULL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ota_header_check()!=ESP_OK){
|
||||||
|
ota_task_cleanup(NULL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Locate and erase ota application partition */
|
||||||
|
sendMessaging(MESSAGING_INFO,"Formatting OTA partition");
|
||||||
|
ESP_LOGW(TAG,"**************** Expecting WATCHDOG errors below during flash erase. This is OK and not to worry about **************** ");
|
||||||
|
IF_DISPLAY(GDS_TextLine(display, 2, GDS_TEXT_LEFT, GDS_TEXT_CLEAR | GDS_TEXT_UPDATE, "Formatting partition"));
|
||||||
|
|
||||||
|
_printMemStats();
|
||||||
|
err=_erase_last_boot_app_partition(ota_status->ota_partition);
|
||||||
if(err!=ESP_OK){
|
if(err!=ESP_OK){
|
||||||
ota_task_cleanup("Error: Unable to erase last APP partition. (%s)",esp_err_to_name(err));
|
ota_task_cleanup("Error: Unable to erase last APP partition. (%s)",esp_err_to_name(err));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
loc_displayer_progressbar(0);
|
||||||
_printMemStats();
|
_printMemStats();
|
||||||
ota_status.bOTAStarted = true;
|
|
||||||
triggerStatusJsonRefresh(true,"Starting OTA...");
|
|
||||||
ota_http_client = esp_http_client_init(&ota_config);
|
|
||||||
if (ota_http_client == NULL) {
|
|
||||||
ota_task_cleanup("Error: Failed to initialize HTTP connection.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_printMemStats();
|
|
||||||
// Open the http connection and follow any redirection
|
|
||||||
err = _http_connect(ota_http_client);
|
|
||||||
if (err != ESP_OK) {
|
|
||||||
ota_task_cleanup("Error: HTTP Start read failed. (%s)",esp_err_to_name(err));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_printMemStats();
|
|
||||||
|
|
||||||
|
// Call OTA Begin with a small partition size - this minimizes the time spent in erasing partition,
|
||||||
|
// which was already done above
|
||||||
esp_ota_handle_t update_handle = 0 ;
|
esp_ota_handle_t update_handle = 0 ;
|
||||||
int binary_file_length = 0;
|
gettimeofday(&ota_status->OTA_start, NULL);
|
||||||
|
err = esp_ota_begin(ota_status->ota_partition, 512, &update_handle);
|
||||||
|
if (err != ESP_OK) {
|
||||||
|
ota_task_cleanup("esp_ota_begin failed (%s)", esp_err_to_name(err));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ESP_LOGD(TAG, "esp_ota_begin succeeded");
|
||||||
|
IF_DISPLAY(GDS_TextLine(display, 2, GDS_TEXT_LEFT, GDS_TEXT_CLEAR | GDS_TEXT_UPDATE, "Writing image..."));
|
||||||
|
while (ota_status->remain_image_len>0) {
|
||||||
|
|
||||||
/*deal with all receive packet*/
|
data_read = ota_buffer_read();
|
||||||
bool image_header_was_checked = false;
|
if (data_read <= 0) {
|
||||||
while (1) {
|
|
||||||
int data_read = esp_http_client_read(ota_http_client, ota_write_data, buffer_size);
|
|
||||||
if (data_read < 0) {
|
|
||||||
ota_task_cleanup("Error: Data read error");
|
ota_task_cleanup("Error: Data read error");
|
||||||
return;
|
return;
|
||||||
} else if (data_read > 0) {
|
} else if (data_read > 0) {
|
||||||
if (image_header_was_checked == false) {
|
err = esp_ota_write( update_handle, (const void *)ota_status->ota_write_data, data_read);
|
||||||
esp_app_desc_t new_app_info;
|
|
||||||
if (data_read > sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t) + sizeof(esp_app_desc_t)) {
|
|
||||||
// check current version with downloading
|
|
||||||
memcpy(&new_app_info, &ota_write_data[sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t)], sizeof(esp_app_desc_t));
|
|
||||||
ESP_LOGI(TAG, "New firmware version: %s", new_app_info.version);
|
|
||||||
|
|
||||||
esp_app_desc_t running_app_info;
|
|
||||||
if (esp_ota_get_partition_description(running, &running_app_info) == ESP_OK) {
|
|
||||||
ESP_LOGI(TAG, "Running recovery version: %s", running_app_info.version);
|
|
||||||
}
|
|
||||||
|
|
||||||
const esp_partition_t* last_invalid_app = esp_ota_get_last_invalid_partition();
|
|
||||||
esp_app_desc_t invalid_app_info;
|
|
||||||
if (esp_ota_get_partition_description(last_invalid_app, &invalid_app_info) == ESP_OK) {
|
|
||||||
ESP_LOGI(TAG, "Last invalid firmware version: %s", invalid_app_info.version);
|
|
||||||
}
|
|
||||||
|
|
||||||
// check current version with last invalid partition
|
|
||||||
// if (last_invalid_app != NULL) {
|
|
||||||
// if (memcmp(invalid_app_info.version, new_app_info.version, sizeof(new_app_info.version)) == 0) {
|
|
||||||
// ESP_LOGW(TAG, "New version is the same as invalid version.");
|
|
||||||
// ESP_LOGW(TAG, "Previously, there was an attempt to launch the firmware with %s version, but it failed.", invalid_app_info.version);
|
|
||||||
// ESP_LOGW(TAG, "The firmware has been rolled back to the previous version.");
|
|
||||||
// ota_task_cleanup("esp_ota_begin failed (%s)", esp_err_to_name(err));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (memcmp(new_app_info.version, running_app_info.version, sizeof(new_app_info.version)) == 0) {
|
|
||||||
ESP_LOGW(TAG, "Current running version is the same as a new.");
|
|
||||||
}
|
|
||||||
|
|
||||||
image_header_was_checked = true;
|
|
||||||
|
|
||||||
// Call OTA Begin with a small partition size - this drives the erase operation which was already done;
|
|
||||||
err = esp_ota_begin(ota_partition, 512, &update_handle);
|
|
||||||
if (err != ESP_OK) {
|
|
||||||
ota_task_cleanup("esp_ota_begin failed (%s)", esp_err_to_name(err));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ESP_LOGD(TAG, "esp_ota_begin succeeded");
|
|
||||||
} else {
|
|
||||||
ota_task_cleanup("Error: Binary file too large for the current partition");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
err = esp_ota_write( update_handle, (const void *)ota_write_data, data_read);
|
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
ota_task_cleanup("Error: OTA Partition write failure. (%s)",esp_err_to_name(err));
|
ota_task_cleanup("Error: OTA Partition write failure. (%s)",esp_err_to_name(err));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
binary_file_length += data_read;
|
ESP_LOGD(TAG, "Written image length %d", ota_status->actual_image_len);
|
||||||
ESP_LOGD(TAG, "Written image length %d", binary_file_length);
|
|
||||||
ota_status.ota_actual_len=binary_file_length;
|
if(ota_get_pct_complete()%5 == 0) ota_status->newpct = ota_get_pct_complete();
|
||||||
if(ota_get_pct_complete()%5 == 0) ota_status.newpct = ota_get_pct_complete();
|
if(ota_status->lastpct!=ota_status->newpct ) {
|
||||||
if(ota_status.lastpct!=ota_status.newpct ) {
|
loc_displayer_progressbar(ota_status->newpct);
|
||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, NULL);
|
||||||
uint32_t elapsed_ms= (tv.tv_sec-ota_status.OTA_start.tv_sec )*1000+(tv.tv_usec-ota_status.OTA_start.tv_usec)/1000;
|
uint32_t elapsed_ms= (tv.tv_sec-ota_status->OTA_start.tv_sec )*1000+(tv.tv_usec-ota_status->OTA_start.tv_usec)/1000;
|
||||||
ESP_LOGI(TAG,"OTA progress : %d/%d (%d pct), %d KB/s", ota_status.ota_actual_len, ota_status.ota_total_len, ota_status.newpct, elapsed_ms>0?ota_status.ota_actual_len*1000/elapsed_ms/1024:0);
|
ESP_LOGI(TAG,"OTA progress : %d/%.0f (%d pct), %d KB/s", ota_status->actual_image_len, ota_status->total_image_len, ota_status->newpct, elapsed_ms>0?ota_status->actual_image_len*1000/elapsed_ms/1024:0);
|
||||||
triggerStatusJsonRefresh(true,"Downloading & writing update.");
|
sendMessaging(MESSAGING_INFO,"Writing binary file %%%3d.",ota_status->newpct);
|
||||||
ota_status.lastpct=ota_status.newpct;
|
ota_status->lastpct=ota_status->newpct;
|
||||||
}
|
}
|
||||||
taskYIELD();
|
taskYIELD();
|
||||||
|
|
||||||
} else if (data_read == 0) {
|
} else if (data_read == 0) {
|
||||||
ESP_LOGI(TAG, "Connection closed");
|
ESP_LOGD(TAG, "End of OTA data stream");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGI(TAG, "Total Write binary data length: %d", binary_file_length);
|
ESP_LOGI(TAG, "Total Write binary data length: %d", ota_status->actual_image_len);
|
||||||
if (ota_status.ota_total_len != binary_file_length) {
|
if (ota_status->total_image_len != ota_status->actual_image_len) {
|
||||||
ota_task_cleanup("Error: Error in receiving complete file");
|
ota_task_cleanup("Error: Error in receiving complete file");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_printMemStats();
|
_printMemStats();
|
||||||
|
loc_displayer_progressbar(100);
|
||||||
err = esp_ota_end(update_handle);
|
err = esp_ota_end(update_handle);
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
ota_task_cleanup("Error: %s",esp_err_to_name(err));
|
ota_task_cleanup("Error: %s",esp_err_to_name(err));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_printMemStats();
|
_printMemStats();
|
||||||
err = esp_ota_set_boot_partition(ota_partition);
|
err = esp_ota_set_boot_partition(ota_status->ota_partition);
|
||||||
if (err == ESP_OK) {
|
if (err == ESP_OK) {
|
||||||
ESP_LOGI(TAG,"OTA Process completed successfully!");
|
ESP_LOGI(TAG,"OTA Process completed successfully!");
|
||||||
triggerStatusJsonRefresh(true,"Success!");
|
sendMessaging(MESSAGING_INFO,"Success!");
|
||||||
|
IF_DISPLAY(GDS_TextLine(display, 2, GDS_TEXT_LEFT, GDS_TEXT_CLEAR | GDS_TEXT_UPDATE, "Success!"));
|
||||||
vTaskDelay(1500/ portTICK_PERIOD_MS); // wait here to give the UI a chance to refresh
|
vTaskDelay(1500/ portTICK_PERIOD_MS); // wait here to give the UI a chance to refresh
|
||||||
|
IF_DISPLAY(GDS_Clear(display,GDS_COLOR_BLACK));
|
||||||
esp_restart();
|
esp_restart();
|
||||||
} else {
|
} else {
|
||||||
ota_task_cleanup("Error: Unable to update boot partition [%s]",esp_err_to_name(err));
|
ota_task_cleanup("Error: Unable to update boot partition [%s]",esp_err_to_name(err));
|
||||||
@@ -540,32 +670,32 @@ void ota_task(void *pvParameter)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
esp_err_t process_recovery_ota(const char * bin_url){
|
esp_err_t process_recovery_ota(const char * bin_url, char * bin_buffer, uint32_t length){
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
uint16_t stack_size, task_priority;
|
uint16_t stack_size, task_priority;
|
||||||
if(ota_status.bOTAThreadStarted){
|
|
||||||
|
if(ota_status && ota_status->bOTAThreadStarted){
|
||||||
ESP_LOGE(TAG,"OTA Already started. ");
|
ESP_LOGE(TAG,"OTA Already started. ");
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
memset(&ota_status, 0x00, sizeof(ota_status));
|
ota_status = heap_caps_malloc(sizeof(ota_status_t) , (MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT));
|
||||||
ota_status.bOTAThreadStarted=true;
|
memset(ota_status, 0x00, sizeof(ota_status_t));
|
||||||
char * urlPtr=strdup(bin_url);
|
ota_status->bOTAThreadStarted=true;
|
||||||
// the first thing we need to do here is to erase the firmware url
|
|
||||||
// to avoid a boot loop
|
if(bin_url){
|
||||||
|
ota_thread_parms.url =strdup(bin_url);
|
||||||
|
ESP_LOGD(TAG, "Starting ota on core %u for : %s", OTA_CORE,ota_thread_parms.url);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ota_thread_parms.bin = bin_buffer;
|
||||||
|
ota_thread_parms.length = length;
|
||||||
|
ESP_LOGD(TAG, "Starting ota on core %u for file upload", OTA_CORE);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1
|
|
||||||
#define OTA_CORE 0
|
|
||||||
#warning "OTA will run on core 0"
|
|
||||||
#else
|
|
||||||
#pragma message "OTA will run on core 1"
|
|
||||||
#define OTA_CORE 1
|
|
||||||
#endif
|
|
||||||
ESP_LOGI(TAG, "Starting ota on core %u for : %s", OTA_CORE,urlPtr);
|
|
||||||
char * num_buffer=config_alloc_get(NVS_TYPE_STR, "ota_stack");
|
char * num_buffer=config_alloc_get(NVS_TYPE_STR, "ota_stack");
|
||||||
if(num_buffer!=NULL) {
|
if(num_buffer!=NULL) {
|
||||||
stack_size= atol(num_buffer);
|
stack_size= atol(num_buffer);
|
||||||
free(num_buffer);
|
FREE_AND_NULL(num_buffer);
|
||||||
num_buffer=NULL;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ESP_LOGW(TAG,"OTA stack size config not found");
|
ESP_LOGW(TAG,"OTA stack size config not found");
|
||||||
@@ -574,41 +704,22 @@ esp_err_t process_recovery_ota(const char * bin_url){
|
|||||||
num_buffer=config_alloc_get(NVS_TYPE_STR, "ota_prio");
|
num_buffer=config_alloc_get(NVS_TYPE_STR, "ota_prio");
|
||||||
if(num_buffer!=NULL) {
|
if(num_buffer!=NULL) {
|
||||||
task_priority= atol(num_buffer);
|
task_priority= atol(num_buffer);
|
||||||
free(num_buffer);
|
FREE_AND_NULL(num_buffer);
|
||||||
num_buffer=NULL;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ESP_LOGW(TAG,"OTA task priority not found");
|
ESP_LOGW(TAG,"OTA task priority not found");
|
||||||
task_priority= OTA_TASK_PRIOTITY;
|
task_priority= OTA_TASK_PRIOTITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGD(TAG,"OTA task stack size %d, priority %d (%d %s ESP_TASK_MAIN_PRIO)",stack_size , task_priority, abs(task_priority-ESP_TASK_MAIN_PRIO), task_priority-ESP_TASK_MAIN_PRIO>0?"above":"below");
|
ESP_LOGD(TAG,"OTA task stack size %d, priority %d (%d %s ESP_TASK_MAIN_PRIO)",stack_size , task_priority, abs(task_priority-ESP_TASK_MAIN_PRIO), task_priority-ESP_TASK_MAIN_PRIO>0?"above":"below");
|
||||||
ret=xTaskCreatePinnedToCore(&ota_task, "ota_task", stack_size , (void *)urlPtr, task_priority, NULL, OTA_CORE);
|
// ret=xTaskCreatePinnedToCore(&ota_task, "ota_task", stack_size , (void *)&ota_thread_parms, task_priority, NULL, OTA_CORE);
|
||||||
//ret=xTaskCreate(&ota_task, "ota_task", 1024*20, (void *)urlPtr, ESP_TASK_MAIN_PRIO+2, NULL);
|
ret=xTaskCreate(&ota_task, "ota_task", stack_size , (void *)&ota_thread_parms, task_priority, NULL);
|
||||||
if (ret != pdPASS) {
|
if (ret != pdPASS) {
|
||||||
ESP_LOGI(TAG, "create thread %s failed", "ota_task");
|
ESP_LOGE(TAG, "create thread %s failed", "ota_task");
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
esp_err_t start_ota(const char * bin_url)
|
|
||||||
{
|
|
||||||
// uint8_t * config_alloc_get_default(NVS_TYPE_BLOB, "certs", server_cert_pem_start , server_cert_pem_end-server_cert_pem_start);
|
|
||||||
#if RECOVERY_APPLICATION
|
|
||||||
return process_recovery_ota(bin_url);
|
|
||||||
#else
|
|
||||||
ESP_LOGW(TAG, "Called to update the firmware from url: %s",bin_url);
|
|
||||||
if(config_set_value(NVS_TYPE_STR, "fwurl", bin_url) != ESP_OK){
|
|
||||||
ESP_LOGE(TAG,"Failed to save the OTA url into nvs cache");
|
|
||||||
return ESP_FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!wait_for_commit()){
|
|
||||||
ESP_LOGW(TAG,"Unable to commit configuration. ");
|
|
||||||
}
|
|
||||||
|
|
||||||
ESP_LOGW(TAG, "Rebooting to recovery to complete the installation");
|
|
||||||
return guided_factory();
|
|
||||||
return ESP_OK;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -9,16 +9,7 @@
|
|||||||
#include "esp_attr.h"
|
#include "esp_attr.h"
|
||||||
#include "esp_image_format.h"
|
#include "esp_image_format.h"
|
||||||
#include "esp_ota_ops.h"
|
#include "esp_ota_ops.h"
|
||||||
|
//
|
||||||
#if RECOVERY_APPLICATION
|
|
||||||
#define CODE_RAM_LOCATION
|
|
||||||
#define RECOVERY_IRAM_FUNCTION IRAM_ATTR
|
|
||||||
#else
|
|
||||||
#define RECOVERY_IRAM_FUNCTION
|
|
||||||
#define CODE_RAM_LOCATION
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ERASE BLOCK needs to be a multiple of sector size. If a different multiple is passed
|
// ERASE BLOCK needs to be a multiple of sector size. If a different multiple is passed
|
||||||
// the OTA process will adjust. Here, we need to strike the balance between speed and
|
// the OTA process will adjust. Here, we need to strike the balance between speed and
|
||||||
@@ -35,8 +26,9 @@
|
|||||||
// tasks
|
// tasks
|
||||||
#define OTA_TASK_PRIOTITY 6
|
#define OTA_TASK_PRIOTITY 6
|
||||||
|
|
||||||
esp_err_t start_ota(const char * bin_url);
|
|
||||||
const char * ota_get_status();
|
const char * ota_get_status();
|
||||||
uint8_t ota_get_pct_complete();
|
uint8_t ota_get_pct_complete();
|
||||||
|
|
||||||
|
esp_err_t start_ota(const char * bin_url, char * bin_buffer, uint32_t length);
|
||||||
|
|
||||||
|
|||||||
0
components/squeezelite/.sc3357753833280144641.c
Normal file
0
components/squeezelite/.sc3357753833280144641.c
Normal file
41
components/squeezelite/CMakeLists.txt
Normal file
41
components/squeezelite/CMakeLists.txt
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
|
||||||
|
|
||||||
|
idf_component_register( SRC_DIRS . external ac101 tas57xx
|
||||||
|
INCLUDE_DIRS . ac101
|
||||||
|
PRIV_REQUIRES
|
||||||
|
codecs
|
||||||
|
newlib
|
||||||
|
esp_common
|
||||||
|
esp-dsp
|
||||||
|
platform_config
|
||||||
|
driver_bt
|
||||||
|
services
|
||||||
|
raop
|
||||||
|
display
|
||||||
|
tools
|
||||||
|
audio
|
||||||
|
EMBED_FILES vu.data
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set_source_files_properties(mad.c
|
||||||
|
PROPERTIES COMPILE_FLAGS
|
||||||
|
-Wno-maybe-uninitialized
|
||||||
|
)
|
||||||
|
set_source_files_properties(pcm.c
|
||||||
|
PROPERTIES COMPILE_FLAGS
|
||||||
|
-Wno-maybe-uninitialized
|
||||||
|
)
|
||||||
|
|
||||||
|
set_source_files_properties(flac.c
|
||||||
|
PROPERTIES COMPILE_FLAGS
|
||||||
|
-Wno-maybe-uninitialized
|
||||||
|
)
|
||||||
|
|
||||||
|
add_definitions(-DLINKALL -DLOOPBACK -DNO_FAAD -DRESAMPLE16 -DEMBEDDED -DTREMOR_ONLY -DBYTES_PER_FRAME=4)
|
||||||
|
add_compile_options (-O3 )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "squeezelite.h"
|
#include "squeezelite.h"
|
||||||
#include "config.h"
|
#include "platform_config.h"
|
||||||
#include "audio_controls.h"
|
#include "audio_controls.h"
|
||||||
|
|
||||||
static log_level loglevel = lINFO;
|
static log_level loglevel = lINFO;
|
||||||
@@ -310,4 +310,4 @@ void sb_controls_init(void) {
|
|||||||
|
|
||||||
chained_notify = server_notify;
|
chained_notify = server_notify;
|
||||||
server_notify = notify;
|
server_notify = notify;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "platform_config.h"
|
||||||
#include "squeezelite.h"
|
#include "squeezelite.h"
|
||||||
#include "bt_app_sink.h"
|
#include "bt_app_sink.h"
|
||||||
#include "raop_sink.h"
|
#include "raop_sink.h"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#ifndef EMBEDDED_H
|
#ifndef EMBEDDED_H
|
||||||
#define EMBEDDED_H
|
#define EMBEDDED_H
|
||||||
|
#include <ctype.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
/* must provide
|
/* must provide
|
||||||
@@ -26,6 +26,9 @@ typedef unsigned long long u64_t;
|
|||||||
#ifndef PTHREAD_STACK_MIN
|
#ifndef PTHREAD_STACK_MIN
|
||||||
#define PTHREAD_STACK_MIN 256
|
#define PTHREAD_STACK_MIN 256
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef _CONST
|
||||||
|
#define _CONST
|
||||||
|
#endif
|
||||||
|
|
||||||
#define STREAM_THREAD_STACK_SIZE 6 * 1024
|
#define STREAM_THREAD_STACK_SIZE 6 * 1024
|
||||||
#define DECODE_THREAD_STACK_SIZE 16 * 1024
|
#define DECODE_THREAD_STACK_SIZE 16 * 1024
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#include "driver/i2c.h"
|
#include "driver/i2c.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "cJSON.h"
|
#include "cJSON.h"
|
||||||
#include "config.h"
|
#include "platform_config.h"
|
||||||
#include "adac.h"
|
#include "adac.h"
|
||||||
|
|
||||||
static const char TAG[] = "DAC external";
|
static const char TAG[] = "DAC external";
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user