init: DLD154Pro 单线圈蓝牙车检器,从 DLD110SV4 复制初始代码和文档

This commit is contained in:
wangfq
2026-07-21 10:38:23 +08:00
commit 5f5f697992
128 changed files with 64619 additions and 0 deletions
+306
View File
@@ -0,0 +1,306 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.2606500741">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.2606500741" moduleId="org.eclipse.cdt.core.settings" name="obj">
<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 artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="${cross_rm} -rf" description="" errorParsers="org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GCCErrorParser" id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.2606500741" name="obj" parent="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release" postannouncebuildStep="" postbuildStep="" preannouncebuildStep="" prebuildStep="">
<folderInfo id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.2606500741" name="/" resourcePath="">
<toolChain id="ilg.gnumcueclipse.managedbuild.cross.riscv.toolchain.elf.release.2606500741" name="RISC-V Cross GCC" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.toolchain.elf.release">
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.rvGcc.1171217701" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.rvGcc" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.rvGcc.8" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.base.1900297968" name="Architecture" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.base" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.arch.rv32i" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.multiply.1509705449" name="Multiply extension (RVM)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.multiply" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.atomic.1590833110" name="Atomic extension (RVA)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.atomic" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.fp.1709872289" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.fp" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.isa.fp.none" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.compressed.1038505275" name="Compressed extension (RVC)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.compressed" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.xw.1505432023" name="Extra Compressed extension (RVXW)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.xw" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.b.1896185078" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.b" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.zmmul.724822239" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.zmmul" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.rvv.435767561" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.isa.rvv" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.isa.rvv." valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.abi.integer.387605487" name="Integer ABI" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.abi.integer" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.abi.integer.ilp32" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.abi.fp.966196099" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.abi.fp" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.abi.fp.none" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.tune.394563202" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.tune" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.tune.default" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.codemodel.105093140" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.codemodel" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.codemodel.any" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.smalldatalimit.1147643442" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.smalldatalimit" useByScannerDiscovery="false" value="8" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.align.322546450" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.align" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.align.default" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.saverestore.367800619" name="Small prologue/epilogue (-msave-restore)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.saverestore" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.other.1526047739" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.target.other" useByScannerDiscovery="true" value="" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.level.514997414" name="Optimization Level" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.level" useByScannerDiscovery="true" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.level.size" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.messagelength.1008570639" name="Message length (-fmessage-length=0)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.messagelength" useByScannerDiscovery="true" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.signedchar.467272439" name="'char' is signed (-fsigned-char)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.signedchar" useByScannerDiscovery="true" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.functionsections.2047756949" name="Function sections (-ffunction-sections)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.functionsections" useByScannerDiscovery="true" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.datasections.207613650" name="Data sections (-fdata-sections)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.datasections" useByScannerDiscovery="true" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.nocommon.358586167" name="No common unitialized (-fno-common)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.nocommon" useByScannerDiscovery="true" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.noinlinefunctions.1298414520" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.noinlinefunctions" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.freestanding.213924425" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.freestanding" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.nobuiltin.2007120903" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.nobuiltin" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.spconstant.938841347" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.spconstant" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.PIC.234574726" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.PIC" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.lto.1002322664" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.lto" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.nomoveloopinvariants.1270575343" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.nomoveloopinvariants" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.highcode.114339272" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.highcode" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.asmsoftlib.896763512" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.asmsoftlib" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.pipe.1835231981" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.pipe" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.caret.2021231049" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.caret" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.ccv.2026012911" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.mrs.ccv" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.other.180560481" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.optimization.other" useByScannerDiscovery="true" value="" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.syntaxonly.1145714735" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.syntaxonly" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.pedantic.1546854128" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.pedantic" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.pedanticerrors.338820707" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.pedanticerrors" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.nowarn.254465728" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.nowarn" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.unused.1961191588" name="Warn on various unused elements (-Wunused)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.unused" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.uninitialized.929829166" name="Warn on uninitialized variables (-Wuninitialized)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.uninitialized" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.allwarn.1168626160" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.allwarn" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.extrawarn.291772487" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.extrawarn" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.missingdeclaration.102344169" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.missingdeclaration" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.conversion.550923640" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.conversion" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.pointerarith.773148082" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.pointerarith" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.padded.1788238782" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.padded" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.shadow.427580978" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.shadow" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.logicalop.1501889551" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.logicalop" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.agreggatereturn.1785504720" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.agreggatereturn" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.floatequal.134298453" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.floatequal" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.toerrors.1117291056" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.toerrors" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.other.1918769559" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.warnings.other" useByScannerDiscovery="true" value="" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.level.1204865254" name="Debug level" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.level" useByScannerDiscovery="true" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.level.default" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.format.867779652" name="Debug format" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.format" useByScannerDiscovery="true" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.format.default" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.prof.2131276390" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.prof" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.gprof.1910159761" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.gprof" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.other.1654431258" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.debugging.other" useByScannerDiscovery="true" value="" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.toolchain.name.1218760634" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.toolchain.name" useByScannerDiscovery="false" value="GNU MCU RISC-V GCC" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.prefix.103341323" name="Prefix" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.prefix" useByScannerDiscovery="false" value="riscv-none-embed-" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.c.487601824" name="C compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.c" useByScannerDiscovery="false" value="gcc" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.cpp.1062130429" name="C++ compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.cpp" useByScannerDiscovery="false" value="g++" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.ar.1194282993" name="Archiver" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.ar" useByScannerDiscovery="false" value="ar" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.objcopy.1529355265" name="Hex/Bin converter" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.objcopy" useByScannerDiscovery="false" value="objcopy" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.objdump.1053750745" name="Listing generator" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.objdump" useByScannerDiscovery="false" value="objdump" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.size.1441326233" name="Size command" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.size" useByScannerDiscovery="false" value="size" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.make.550105535" name="Build command" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.make" useByScannerDiscovery="false" value="make" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.rm.719280496" name="Remove command" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.command.rm" useByScannerDiscovery="false" value="rm" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.toolchain.id.226017994" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.toolchain.id" useByScannerDiscovery="false" value="512258282" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.createflash.1311852988" name="Create flash image" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.createflash" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.createlisting.1983282875" name="Create extended listing" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.createlisting" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.printsize.1000761142" name="Print size" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.addtools.printsize" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnumcueclipse.managedbuild.cross.riscv.targetPlatform.1944008784" isAbstract="false" osList="all" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.targetPlatform"/>
<builder buildPath="${workspace_loc:/DLD154Pro_Peripheral_28K/obj" id="ilg.gnumcueclipse.managedbuild.cross.riscv.builder.1421508906" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" stopOnErr="true" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.builder"/>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler.1244756189" name="GNU RISC-V Cross Assembler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler">
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.usepreprocessor.1692176068" name="Use preprocessor" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.usepreprocessor" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.nostdinc.821897907" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.nostdinc" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.preprocessonly.1205312655" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.preprocessonly" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.defs.181380015" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.defs" useByScannerDiscovery="true" valueType="definedSymbols"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.undefs.1514976831" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.undefs" useByScannerDiscovery="true" valueType="undefDefinedSymbols"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.paths.1034038285" name="Include paths (-I)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.paths" useByScannerDiscovery="true" valueType="includePath"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.systempaths.496720673" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.systempaths" useByScannerDiscovery="true" valueType="includePath"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.files.1898455566" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.files" useByScannerDiscovery="true" valueType="includeFiles"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.otherwarnings.1717778600" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.otherwarnings" useByScannerDiscovery="true" value="" valueType="string"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.flags.1578223870" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.flags" useByScannerDiscovery="false" valueType="stringList"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.asmlisting.1937791148" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.asmlisting" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.savetemps.119863881" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.savetemps" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.verbose.1408057941" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.other.1308239903" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.other" useByScannerDiscovery="false" value="" valueType="string"/>
<inputType id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler.input.126366858" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler.input"/>
</tool>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.1731377187" name="GNU RISC-V Cross C Compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler">
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.nostdinc.1633344562" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.nostdinc" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.preprocessonly.208069239" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.preprocessonly" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.defs.177116515" name="Defined symbols (-D)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
<listOptionValue builtIn="false" value="CH59xBLE_ROM=1"/>
<listOptionValue builtIn="false" value="LIB_FLASH_BASE_ADDRESSS=0x0000C000"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.undef.1820512625" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.undef" useByScannerDiscovery="true" valueType="undefDefinedSymbols"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.paths.1567947810" name="Include paths (-I)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Startup}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/APP/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Profile/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/StdPeriphDriver/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/HAL/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Ld}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/LIB}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/RVMSIS}&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.systempaths.2011720354" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.systempaths" useByScannerDiscovery="true" valueType="includePath"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.files.542153928" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.files" useByScannerDiscovery="true" valueType="includeFiles"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.std.2020844713" name="Language standard" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.std" useByScannerDiscovery="true" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.std.gnu99" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.otheroptimizations.92321033" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.otheroptimizations" useByScannerDiscovery="true" value="" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.warning.missingprototypes.1180998530" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.warning.missingprototypes" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.warning.strictprototypes.684937223" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.warning.strictprototypes" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.warning.badfunctioncast.1090658371" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.warning.badfunctioncast" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.otherwarnings.882361093" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.otherwarnings" useByScannerDiscovery="true" value="" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.asmlisting.1019398219" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.asmlisting" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.savetemps.1858747105" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.savetemps" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.verbose.658438318" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.other.1132663916" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.other" useByScannerDiscovery="true" value="" valueType="string"/>
<inputType id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.input.2036806839" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.input"/>
</tool>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.compiler.1610882921" name="GNU RISC-V Cross C++ Compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.compiler">
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nostdinc.1306818359" name="Do not search system directories (-nostdinc)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nostdinc" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nostdincpp.411115799" name="Do not search system C++ directories (-nostdinc++)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nostdincpp" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.preprocessonly.704235280" name="Preprocess only (-E)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.preprocessonly" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.defs.256688978" name="Defined symbols (-D)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.undef.1769659537" name="Undefined symbols (-U)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.undef" useByScannerDiscovery="true" valueType="undefDefinedSymbols"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.include.paths.1641430352" name="Include paths (-I)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.include.systempaths.1217742259" name="Include system paths (-isystem)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.include.systempaths" useByScannerDiscovery="true" valueType="includePath"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.include.files.1922780842" name="Include files (-include)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.include.files" useByScannerDiscovery="true" valueType="includeFiles"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.std.426208505" name="Language standard" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.std" useByScannerDiscovery="true" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.std.gnucpp11" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.abiversion.1671052931" name="ABI version" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.abiversion" useByScannerDiscovery="true" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.abiversion.0" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.noexceptions.1891612477" name="Do not use exceptions (-fno-exceptions)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.noexceptions" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nortti.76308566" name="Do not use RTTI (-fno-rtti)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nortti" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nousecxaatexit.390229569" name="Do not use _cxa_atexit() (-fno-use-cxa-atexit)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nousecxaatexit" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nothreadsafestatics.1143999424" name="Do not use thread-safe statics (-fno-threadsafe-statics)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.nothreadsafestatics" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.otheroptimizations.1589858535" name="Other optimization flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.otheroptimizations" useByScannerDiscovery="true" value="" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warnabi.1304561076" name="Warn on ABI violations (-Wabi)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warnabi" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.ctordtorprivacy.534922494" name="Warn on class privacy (-Wctor-dtor-privacy)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.ctordtorprivacy" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.noexcept.1102421587" name="Warn on no-except expressions (-Wnoexcept)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.noexcept" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.nonvirtualdtor.249412631" name="Warn on virtual destructors (-Wnon-virtual-dtor)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.nonvirtualdtor" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.strictnullsentinel.1022346732" name="Warn on uncast NULL (-Wstrict-null-sentinel)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.strictnullsentinel" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.signpromo.1510049602" name="Warn on sign promotion (-Wsign-promo)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warning.signpromo" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warneffc.1507924344" name="Warn about Effective C++ violations (-Weffc++)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.warneffc" useByScannerDiscovery="true" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.otherwarnings.521572828" name="Other warning flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.otherwarnings" useByScannerDiscovery="true" value="" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.asmlisting.842958016" name="Generate assembler listing (-Wa,-adhlns=&quot;$@.lst&quot;)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.asmlisting" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.savetemps.715871177" name="Save temporary files (--save-temps Use with caution!)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.savetemps" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.verbose.974774820" name="Verbose (-v)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.other.1293392631" name="Other compiler flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.compiler.other" useByScannerDiscovery="true" value="" valueType="string"/>
<inputType id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.compiler.input.1079228323" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.compiler.input"/>
</tool>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker.1620074387" name="GNU RISC-V Cross C Linker" outputPrefix="" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.scriptfile.1390103472" name="Script files (-T)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.scriptfile" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Ld/Link.ld}&quot;"/>
</option>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nostart.913830613" name="Do not use standard start files (-nostartfiles)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nostart" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nodeflibs.1285997013" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nodeflibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nostdlibs.179047434" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.nostdlibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.gcsections.194760422" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.gcsections" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printgcsections.270824644" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printgcsections" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.strip.1802601885" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.strip" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.libs.813115939" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.libs" useByScannerDiscovery="false" valueType="libs">
<listOptionValue builtIn="false" value="ISP592"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.paths.2057340378" name="Library search path (-L)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.paths" useByScannerDiscovery="false" valueType="libPaths">
<listOptionValue builtIn="false" value="../"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/StdPeriphDriver}&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.flags.1125808200" name="Linker flags (-Xlinker [option])" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.flags" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value="--print-memory-usage"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.otherobjs.16994550" name="Other objects" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.otherobjs" useByScannerDiscovery="false" valueType="userObjs"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.mapfilename.789195953" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.mapfilename" useByScannerDiscovery="false" value="&quot;${BuildArtifactFileBaseName}.map&quot;" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.picolibc.62047318" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.picolibc" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.picolibc.disabled" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.cref.824432654" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.cref" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printmap.751686263" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printmap" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.usenewlibnano.239404511" name="Use newlib-nano (--specs=nano.specs)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.usenewlibnano" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.usenewlibnosys.351964161" name="Do not use syscalls (--specs=nosys.specs)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.usenewlibnosys" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.useprintffloat.695795083" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.useprintffloat" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.usescanffloat.1839373535" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.usescanffloat" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.verbose.1444336626" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printfloat.2044235126" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printfloat" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printf.888161142" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printf" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.iqmath.1390292521" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.iqmath" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.other.1683775650" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.other" useByScannerDiscovery="false" value="" valueType="string"/>
<inputType id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker.input.1859223768" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.linker.1947503520" name="GNU RISC-V Cross C++ Linker" outputPrefix="" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.cpp.linker">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.scriptfile.1751226764" name="Script files (-T)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.scriptfile" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Ld/Link.ld}&quot;"/>
</option>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.nostart.642896175" name="Do not use standard start files (-nostartfiles)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.nostart" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.nodeflibs.282300763" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.nodeflibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.nostdlibs.924960428" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.nostdlibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.gcsections.1689063433" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.gcsections" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.printgcsections.621524254" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.printgcsections" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.strip.679063538" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.strip" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.libs.579700779" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.libs" useByScannerDiscovery="false" valueType="libs">
<listOptionValue builtIn="false" value="ISP592"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.paths.1029177148" name="Library search path (-L)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.paths" useByScannerDiscovery="false" valueType="libPaths">
<listOptionValue builtIn="false" value="../"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/StdPeriphDriver}&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.flags.1251620602" name="Linker flags (-Xlinker [option])" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.flags" useByScannerDiscovery="false" valueType="stringList">
<listOptionValue builtIn="false" value="--print-memory-usage"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.otherobjs.1493906625" name="Other objects" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.otherobjs" useByScannerDiscovery="false" valueType="userObjs"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.mapfilename.1354773182" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.mapfilename" useByScannerDiscovery="false" value="&quot;${BuildArtifactFileBaseName}.map&quot;" valueType="string"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.picolibc.4345436542" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.picolibc" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.picolibc.disabled" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.cref.1007621036" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.cref" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.printmap.2073713641" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.printmap" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.usenewlibnano.1540675679" name="Use newlib-nano (--specs=nano.specs)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.usenewlibnano" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.usenewlibnosys.561457319" name="Do not use syscalls (--specs=nosys.specs)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.usenewlibnosys" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.useprintffloat.1497004994" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.useprintffloat" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.usescanffloat.881728961" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.usescanffloat" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.verbose.922041698" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.printfloat.476377985" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.printfloat" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.printf.626387227" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.printf" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.iqmath.1441123220" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.iqmath" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.other.1748689212" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.cpp.linker.other" useByScannerDiscovery="false" value="" valueType="string"/>
</tool>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.archiver.1292785366" name="GNU RISC-V Cross Archiver" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.archiver">
<outputType id="cdt.managedbuild.tool.gnu.archiver.output.1527226663" superClass="cdt.managedbuild.tool.gnu.archiver.output" outputPrefix="lib"/>
<option id="gnu.both.lib.option.flags.22122911" superClass="gnu.both.lib.option.flags" useByScannerDiscovery="false" value="-r" valueType="string"/>
</tool>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.createflash.1801165667" name="GNU RISC-V Cross Create Flash Image" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.createflash">
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.textsection.1097396305" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.textsection" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.datasection.2034511797" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.datasection" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.choice.1726268709" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.choice" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.choice.ihex" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.createalgorithmfile.2643315497" superClass="ilg.gnuarmeclipse.managedbuild.cross.risv.option.createflash.createalgorithmfile" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.othersection.1890795928" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.othersection" useByScannerDiscovery="false" valueType="stringList"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.other.788974495" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createflash.other" useByScannerDiscovery="false" value="" valueType="string"/>
</tool>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.createlisting.1356766765" name="GNU RISC-V Cross Create Listing" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.createlisting">
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.source.2052761852" name="Display source (--source|-S)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.source" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.allheaders.439659821" name="Display all headers (--all-headers|-x)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.allheaders" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.demangle.67111865" name="Demangle names (--demangle|-C)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.demangle" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.debugging.1623481730" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.debugging" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.disassemble.1859590835" name="Disassemble (--disassemble|-d)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.disassemble" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.fileheaders.160868348" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.fileheaders" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.linenumbers.1549373929" name="Display line numbers (--line-numbers|-l)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.linenumbers" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.reloc.1008747895" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.reloc" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.symbols.577922241" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.symbols" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.wide.1298918921" name="Wide lines (--wide|-w)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.wide" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.other.1560864108" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.createlisting.other" useByScannerDiscovery="false" value="" valueType="string"/>
</tool>
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.printsize.712424314" name="GNU RISC-V Cross Print Size" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.printsize">
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.format.1404031980" name="Size format" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.format" useByScannerDiscovery="false" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.format.berkeley" valueType="enumerated"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.hex.176087647" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.hex" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.totals.380903440" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.totals" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.other.1271150877" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.printsize.other" useByScannerDiscovery="false" value="" valueType="string"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="HAL/Profile|HAL/KEY.c|HAL/LED.c|StdPeriphDriver/CH59x_lcd.c|StdPeriphDriver/CH59x_uart1.c|StdPeriphDriver/CH59x_usbdev.c|StdPeriphDriver/CH59x_usbhostClass.c|StdPeriphDriver/CH59x_usbhostBase.c|StdPeriphDriver/CH59x_pwm.c|StdPeriphDriver/CH59x_spi0.c|StdPeriphDriver/CH59x_timer2.c|StdPeriphDriver/CH59x_timer3.c|StdPeriphDriver/CH59x_uart2.c|StdPeriphDriver/CH59x_uart3.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="ilg.gnumcueclipse.managedbuild.packs"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="999.ilg.gnumcueclipse.managedbuild.cross.riscv.target.elf.275846018" name="Executable file" projectType="ilg.gnumcueclipse.managedbuild.cross.riscv.target.elf"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.debug.767917625;ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.debug.767917625.;ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.1375371130;ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.input.1473381709">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.1008047074;ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.1008047074.;ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.1731377187;ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.input.2036806839">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
</cproject>
@@ -0,0 +1,26 @@
{
"folders": [
{
"path": "."
},
{
"name": "DLD110S_Peripheral_28K",
"path": "e:\\pando\\dg\\prjs\\DLD\\DLD110SB\\BLE\\DLD110S_Peripheral_28K"
}
],
"settings": {
"mrs.workspace.type": "project",
"files.associations": {
"*.c": "c",
"*.h": "cpp",
"*.hxx": "cpp",
"*.hpp": "cpp",
"*.c++": "cpp",
"*.cpp": "cpp",
"*.cxx": "cpp",
"*.cc": "cpp",
"*.hh": "cpp",
"*.h++": "cpp"
}
}
}
@@ -0,0 +1,26 @@
{
"folders": [
{
"path": "."
},
{
"name": "DLD110S_Peripheral_28K",
"path": "e:\\pando\\dg\\prjs\\DLD\\DLD110SB\\BLE\\DLD110S_Peripheral_28K"
}
],
"settings": {
"mrs.workspace.type": "project",
"files.associations": {
"*.c": "c",
"*.h": "cpp",
"*.hxx": "cpp",
"*.hpp": "cpp",
"*.c++": "cpp",
"*.cpp": "cpp",
"*.cxx": "cpp",
"*.cc": "cpp",
"*.hh": "cpp",
"*.h++": "cpp"
}
}
}
@@ -0,0 +1,26 @@
{
"folders": [
{
"path": "."
},
{
"name": "DVM100BPro_Peipheral_28K",
"path": "e:\\pando\\dg\\prjs\\DVM\\DVM100B\\BLE\\DVM100BPro_Peipheral_28K"
}
],
"settings": {
"mrs.workspace.type": "project",
"files.associations": {
"*.c": "c",
"*.h": "cpp",
"*.hxx": "cpp",
"*.hpp": "cpp",
"*.c++": "cpp",
"*.cpp": "cpp",
"*.cxx": "cpp",
"*.cc": "cpp",
"*.hh": "cpp",
"*.h++": "cpp"
}
}
}
@@ -0,0 +1,26 @@
{
"folders": [
{
"path": "."
},
{
"name": "DLD110S_Peripheral_28K",
"path": "e:\\pando\\dg\\prjs\\DLD\\DLD110SB\\BLE\\DLD110S_Peripheral_28K"
}
],
"settings": {
"mrs.workspace.type": "project",
"files.associations": {
"*.c": "c",
"*.h": "cpp",
"*.hxx": "cpp",
"*.hpp": "cpp",
"*.c++": "cpp",
"*.cpp": "cpp",
"*.cxx": "cpp",
"*.cc": "cpp",
"*.hh": "cpp",
"*.h++": "cpp"
}
}
}
@@ -0,0 +1,26 @@
{
"folders": [
{
"path": "."
},
{
"name": "DLD110S_Peripheral_28K",
"path": "e:\\pando\\dg\\prjs\\DLD\\DLD110SB\\BLE\\DLD110S_Peripheral_28K"
}
],
"settings": {
"mrs.workspace.type": "project",
"files.associations": {
"*.c": "c",
"*.h": "cpp",
"*.hxx": "cpp",
"*.hpp": "cpp",
"*.c++": "cpp",
"*.cpp": "cpp",
"*.cxx": "cpp",
"*.cc": "cpp",
"*.hh": "cpp",
"*.h++": "cpp"
}
}
}
@@ -0,0 +1,26 @@
{
"folders": [
{
"path": "."
},
{
"name": "DLD110S_Peripheral_28K",
"path": "e:\\pando\\dg\\prjs\\DLD\\DLD110SB\\BLE\\DLD110S_Peripheral_28K"
}
],
"settings": {
"mrs.workspace.type": "project",
"files.associations": {
"*.c": "c",
"*.h": "cpp",
"*.hxx": "cpp",
"*.hpp": "cpp",
"*.c++": "cpp",
"*.cpp": "cpp",
"*.cxx": "cpp",
"*.cc": "cpp",
"*.hh": "cpp",
"*.h++": "cpp"
}
}
}
@@ -0,0 +1,27 @@
{
"folders": [
{
"path": "."
},
{
"name": "DLD110S_Peripheral_28K",
"path": "E:\\pando\\dg\\prjs\\DLD\\DLD110SB\\BLE\\DLD110S_Peripheral_28K"
}
],
"settings": {
"mrs.workspace.type": "project",
"mrs.init.arg": "",
"files.associations": {
"*.c": "c",
"*.h": "cpp",
"*.hxx": "cpp",
"*.hpp": "cpp",
"*.c++": "cpp",
"*.cpp": "cpp",
"*.cxx": "cpp",
"*.cc": "cpp",
"*.hh": "cpp",
"*.h++": "cpp"
}
}
}
@@ -0,0 +1,26 @@
{
"folders": [
{
"path": "."
},
{
"name": "DLD110S_Peripheral_28K",
"path": "e:\\pando\\dg\\prjs\\DLD\\DLD110SB\\BLE\\DLD110S_Peripheral_28K"
}
],
"settings": {
"mrs.workspace.type": "project",
"files.associations": {
"*.c": "c",
"*.h": "cpp",
"*.hxx": "cpp",
"*.hpp": "cpp",
"*.c++": "cpp",
"*.cpp": "cpp",
"*.cxx": "cpp",
"*.cc": "cpp",
"*.hh": "cpp",
"*.h++": "cpp"
}
}
}
@@ -0,0 +1,26 @@
{
"folders": [
{
"path": "."
},
{
"name": "DLD110S_Peripheral_28K",
"path": "e:\\pando\\dg\\prjs\\DLD\\DLD110SB\\BLE\\DLD110S_Peripheral_28K"
}
],
"settings": {
"mrs.workspace.type": "project",
"files.associations": {
"*.c": "c",
"*.h": "cpp",
"*.hxx": "cpp",
"*.hpp": "cpp",
"*.c++": "cpp",
"*.cpp": "cpp",
"*.cxx": "cpp",
"*.cc": "cpp",
"*.hh": "cpp",
"*.h++": "cpp"
}
}
}
@@ -0,0 +1,27 @@
{
"folders": [
{
"name": ".mrs",
"path": "."
},
{
"name": "DLR008B_28K_Gate",
"path": "../../../../../drd/DLR008B-test/DLR008B/BLE/DLR008B_28K_Gate"
}
],
"settings": {
"mrs.workspace.type": "project",
"files.associations": {
"*.c": "c",
"*.h": "cpp",
"*.hxx": "cpp",
"*.hpp": "cpp",
"*.c++": "cpp",
"*.cpp": "cpp",
"*.cxx": "cpp",
"*.cc": "cpp",
"*.hh": "cpp",
"*.h++": "cpp"
}
}
}
@@ -0,0 +1,26 @@
{
"folders": [
{
"path": "."
},
{
"name": "DLD110S_Peripheral_28K",
"path": "e:\\pando\\dg\\prjs\\DLD\\DLD110SB\\BLE\\DLD110S_Peripheral_28K"
}
],
"settings": {
"mrs.workspace.type": "project",
"files.associations": {
"*.c": "c",
"*.h": "cpp",
"*.hxx": "cpp",
"*.hpp": "cpp",
"*.c++": "cpp",
"*.cpp": "cpp",
"*.cxx": "cpp",
"*.cc": "cpp",
"*.hh": "cpp",
"*.h++": "cpp"
}
}
}
@@ -0,0 +1,27 @@
{
"folders": [
{
"path": "."
},
{
"name": "DLD110S_Peripheral_28K",
"path": "E:\\pando\\dg\\prjs\\DLD\\DLD154Pro\\BLE\\DLD154Pro_Peripheral_28K"
}
],
"settings": {
"mrs.workspace.type": "project",
"mrs.init.arg": "",
"files.associations": {
"*.c": "c",
"*.h": "cpp",
"*.hxx": "cpp",
"*.hpp": "cpp",
"*.c++": "cpp",
"*.cpp": "cpp",
"*.cxx": "cpp",
"*.cc": "cpp",
"*.hh": "cpp",
"*.h++": "cpp"
}
}
}
@@ -0,0 +1,27 @@
{
"folders": [
{
"path": "."
},
{
"name": "DLD110S_Peripheral_28K",
"path": "E:\\pando\\dg\\prjs\\DLD\\DLD110SB\\BLE\\DLD110S_Peripheral_28K"
}
],
"settings": {
"mrs.workspace.type": "project",
"mrs.init.arg": "",
"files.associations": {
"*.c": "c",
"*.h": "cpp",
"*.hxx": "cpp",
"*.hpp": "cpp",
"*.c++": "cpp",
"*.cpp": "cpp",
"*.cxx": "cpp",
"*.cc": "cpp",
"*.hh": "cpp",
"*.h++": "cpp"
}
}
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,67 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "mrs-debugger",
"request": "launch",
"name": "DLD110S_Peripheral_28K",
"cwd": "e:\\pando\\dg\\prjs\\DLD\\DLD110SB\\BLE\\DLD110S_Peripheral_28K",
"openOCDCfg": {
"useLocalOpenOCD": true,
"executable": "d:/MounRiver/MounRiver_Studio2/resources/app/resources/win32/components/WCH/OpenOCD/OpenOCD/bin/openocd.exe",
"configOptions": [
"-f \"d:/MounRiver/MounRiver_Studio2/resources/app/resources/win32/components/WCH/OpenOCD/OpenOCD/bin/wch-riscv.cfg\" -c \"chip_id CH59x\""
],
"gdbport": 3333,
"telnetport": 4444,
"tclport": 6666,
"host": "localhost",
"port": 3333,
"skipDownloadBeforeDebug": false,
"enablePageEraser": false,
"enableNoZeroWaitingAreaFlash": false
},
"gdbCfg": {
"executable": "d:/MounRiver/MounRiver_Studio2/resources/app/resources/win32/components/WCH/Toolchain/RISC-V Embedded GCC/bin/riscv-none-embed-gdb.exe",
"commands": [
"set mem inaccessible-by-default off",
"set architecture riscv:rv32",
"set remotetimeout unlimited"
],
"options": []
},
"startup": {
"initCommands": {
"initReset": true,
"initResetType": "init",
"armSemihosting": false,
"additionalCommands": []
},
"loadedFiles": {
"executableFile": "e:\\pando\\dg\\prjs\\DLD\\DLD110SB\\BLE\\DLD110S_Peripheral_28K\\obj\\DLD110S_Peripheral_28K.elf",
"symbolFile": "e:\\pando\\dg\\prjs\\DLD\\DLD110SB\\BLE\\DLD110S_Peripheral_28K\\obj\\DLD110S_Peripheral_28K.elf",
"executableFileOffset": 0,
"symbolFileOffset": 0
},
"runCommands": {
"runReset": true,
"runResetType": "halt",
"additionalCommands": [],
"setBreakAt": "handle_reset",
"continue": true,
"setProgramCounterAt": 0
},
"debugInRAM": false
},
"svdpath": "",
"output": {
"showDebugGDBTrace": true,
"saveDebugOutputToFile": false,
"showDebugOutputTimestamps": true
},
"isDualCoreDebug": false,
"dualCoreDebugRole": null,
"architecture": "RISC-V"
}
]
}
@@ -0,0 +1,20 @@
{
"details": [
{
"file": "APP/dbn_ble_srv.c",
"encoding": "utf8"
},
{
"file": "APP/peripheral_main.c",
"encoding": "utf8"
},
{
"file": "APP/include/storage.h",
"encoding": "utf8"
},
{
"file": "APP/include/cmcng.h",
"encoding": "utf8"
}
]
}
+55
View File
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<projectDescription>
<name>DLD154Pro_Peripheral_28K</name>
<comment/>
<projects/>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments/>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments/>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<linkedResources>
<link>
<name>HAL</name>
<type>2</type>
<location>PARENT-1-PROJECT_LOC/HAL</location>
</link>
<link>
<name>LIB</name>
<type>2</type>
<location>PARENT-1-PROJECT_LOC/LIB</location>
</link>
<link>
<name>RVMSIS</name>
<type>2</type>
<location>PARENT-2-PROJECT_LOC/SRC/RVMSIS</location>
</link>
<link>
<name>StdPeriphDriver</name>
<type>2</type>
<location>PARENT-2-PROJECT_LOC/SRC/StdPeriphDriver</location>
</link>
</linkedResources>
<filteredResources>
<filter>
<name/>
<type>6</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-*.wvproj</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="ilg.gnumcueclipse.managedbuild.cross.riscv.config.elf.release.1008047074" name="obj">
<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-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="103336483641875289" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
</extension>
</configuration>
</project>
@@ -0,0 +1,73 @@
eclipse.preferences.version=1
org.eclipse.cdt.codan.checkers.errnoreturn=Warning
org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return\\")",implicit\=>false}
org.eclipse.cdt.codan.checkers.errreturnvalue=Error
org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused return value\\")"}
org.eclipse.cdt.codan.checkers.nocommentinside=-Error
org.eclipse.cdt.codan.checkers.nocommentinside.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Nesting comments\\")"}
org.eclipse.cdt.codan.checkers.nolinecomment=-Error
org.eclipse.cdt.codan.checkers.nolinecomment.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Line comments\\")"}
org.eclipse.cdt.codan.checkers.noreturn=Error
org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return value\\")",implicit\=>false}
org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=Error
org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Abstract class cannot be instantiated\\")"}
org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=Error
org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Ambiguous problem\\")"}
org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=Warning
org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment in condition\\")"}
org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=Error
org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment to itself\\")"}
org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=Warning
org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No break at end of case\\")",no_break_comment\=>"no break",last_case_param\=>false,empty_case_param\=>false,enable_fallthrough_quickfix_param\=>false}
org.eclipse.cdt.codan.internal.checkers.CatchByReference=Warning
org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Catching by reference is recommended\\")",unknown\=>false,exceptions\=>()}
org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=Error
org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Circular inheritance\\")"}
org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=Warning
org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class members should be properly initialized\\")",skip\=>true}
org.eclipse.cdt.codan.internal.checkers.DecltypeAutoProblem=Error
org.eclipse.cdt.codan.internal.checkers.DecltypeAutoProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid 'decltype(auto)' specifier\\")"}
org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=Error
org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Field cannot be resolved\\")"}
org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=Error
org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Function cannot be resolved\\")"}
org.eclipse.cdt.codan.internal.checkers.InvalidArguments=Error
org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid arguments\\")"}
org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=Error
org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid template argument\\")"}
org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=Error
org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Label statement not found\\")"}
org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=Error
org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Member declaration not found\\")"}
org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=Error
org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Method cannot be resolved\\")"}
org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info
org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Name convention for function\\")",pattern\=>"^[a-z]",macro\=>true,exceptions\=>()}
org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=Warning
org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class has a virtual method and non-virtual destructor\\")"}
org.eclipse.cdt.codan.internal.checkers.OverloadProblem=Error
org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid overload\\")"}
org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=Error
org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redeclaration\\")"}
org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=Error
org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redefinition\\")"}
org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning
org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Return with parenthesis\\")"}
org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning
org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Format String Vulnerability\\")"}
org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=Warning
org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Statement has no effect\\")",macro\=>true,exceptions\=>()}
org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=Warning
org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suggested parenthesis around expression\\")",paramNot\=>false}
org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=Warning
org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suspicious semicolon\\")",else\=>false,afterelse\=>false}
org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=Error
org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Type cannot be resolved\\")"}
org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=Warning
org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused function declaration\\")",macro\=>true}
org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=Warning
org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused static function\\")",macro\=>true}
org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=Warning
org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused variable declaration in file scope\\")",macro\=>true,exceptions\=>("@(\#)","$Id")}
org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=Error
org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Symbol is not resolved\\")"}
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
formatter_settings_version=1
+32
View File
@@ -0,0 +1,32 @@
Vendor=WCH
Toolchain=RISC-V
Series=CH59X
RTOS=NoneOS
CalibrateSupport=false
CalibrateCommand=
UIConfigSupport=false
UIConfigCommand=
ExternalFlashSupport=false
MCU=CH591R
Link=WCH-Link
PeripheralVersion=1.0
Description=
TempratureScope=
ArtifactType=executable
Mcu Type=CH59x
Address=0x00000000
Target Path=
Exe Path=
Exe Arguments=
CLKSpeed=1
DebugInterfaceMode=0
Erase All=false
Program=false
Verify=false
Reset=false
SDIPrintf=false
Disable Power Output=false
Clear CodeFlash=false
Disable Code-Protect=false
Flash Type=
Algorithm File=
@@ -0,0 +1,855 @@
/*
* dbn_ble_srv.c
*
* Created on: Aug 27, 2024
* Author: Thinkpad
*/
#include "dbn_ble_srv.h"
#include "cmcng.h"
#include "storage.h"
#include "CH59x_common.h"
uint8_t g_flag_notify_temp = 0; //临时通知notify flag, 0 disable, 1 enable
BLE_Notify_Buf g_notify_buftemp = {0,0, ""};
BLE_Notify_Buf g_ble_rcv_buf = {0,0, ""};
BLE_Notify_Buf g_tmp_report_buf = {0,0, ""};
Buf_DBN_BLE g_buf_ble_response = {0,0,0,0,0,0,0,""};
uint8_t tmp_ble_buf[MAX_BLE_TMP_BUF_LEN] = "";
extern uint8_t loop1_FLAG_CUT;
void clear_ble_notify_buf(BLE_Notify_Buf * buf)
{
buf->len = 0;
buf->flag = 0;
memset(buf, 0, MAX_BLE_Notify_Buf_LEN);
}
void clear_buf_dbn_ble(Buf_DBN_BLE * buf)
{
uint8_t i = 0;
buf->flag = 0;
buf->magic = 0;
buf->cmd = 0;
memset(buf->dat, 0, buf->dat_len);
buf->dat_len = 0;
buf->dat_offset = 0;
buf->pkg_amount = 0;
buf->pkg_seq = 0;
}
void clear_buf_dbn_ble_all(Buf_DBN_BLE * buf)
{
uint8_t i = 0;
// if(g_flag_debug)
{
// PRINT("\nclear_buf_dbn_ble_flag:%02X,magic:%02X,pkg_amount:%02X,seq:%02X,cmd:%02X, dat_len:%d,offset:%d\n",
// buf->flag,buf->magic,buf->pkg_amount, buf->pkg_seq,buf->cmd, buf->dat_len,buf->dat_offset);
// for(i = 0; i < buf->dat_len; i++)
// {
// PRINT(" %02X", buf->dat[i]);
// }
// PRINT("\n");
}
buf->flag = 0;
buf->magic = 0;
buf->cmd = 0;
memset(buf->dat, 0, MAX_BLE_BUF_LEN);
buf->dat_len = 0;
buf->dat_offset = 0;
buf->pkg_amount = 0;
buf->pkg_seq = 0;
}
// 0: 包检测异常
//检测包是否完整,Magic Byte, Header Byte, CK Byte, 校验字节(异或校验,以及和校验)
uint8_t check_pkg(uint8_t * pkg, uint8_t len)
{
if(len < 6) //min length of ble pkg is 6
return 0;
uint8_t magic = pkg[0];
uint8_t _len = pkg[2]; //data_len
if(_len + 5 < len)
{
return 0;
}
uint8_t _dxor = 0;
uint8_t _dsum = 0;
uint8_t _cklen = _len + 3; //不计算 校验字节
uint8_t i = 0;
for(i = 1; i < _cklen; i++)
{
_dxor ^= pkg[i];
_dsum += pkg[i];
}
if((_dxor != pkg[_cklen]) || (_dsum != pkg[_cklen+1]))
{
// if(g_flag_debug)
// {
// PRINT("_dxor:0x%02X - 0x%02X, _dsum:0x%02X - 0x%02X\r\n", _dxor, pkg[_cklen], _dsum, pkg[_cklen + 1] );
// }
return 0;
}
return magic;
}
static uint8_t set_dev_info_to_ready(uint8_t *dat_dst)
{
uint8_t i = 0, j = 0;
for(i = 0; i < 6; i++)
{
dat_dst[i] = MACAddr[i];
// PRINT(" %02X",dat_dst[i] );
}
// memcpy(dat_dst, MACAddr, sizeof(MACAddr));
// i += sizeof(MACAddr);
dat_dst[i++] = HARDWARE_VER_MAIN;
dat_dst[i++] = HARDWARE_VER_SUB;
dat_dst[i++] = FIRMWARE_VER_MAIN;
dat_dst[i++] = FIRMWARE_VER_SUB;
// Dev Model
dat_dst[i++] = strlen(PRODUCT_MODEL);
memcpy(&dat_dst[i], PRODUCT_MODEL, strlen(PRODUCT_MODEL));
i += strlen(PRODUCT_MODEL);
// Dev Number
for(j = 0; j < 6; j++, i++)
{
dat_dst[i] = g_dev_number[j];
}
// sub_code
// memcpy(&dat_dst[i], &(g_sub_code_enable.code_set), sizeof(g_sub_code_enable.code_set));
// i += sizeof(g_sub_code_enable.code_set);
dat_dst[i++] = 0;
dat_dst[i++] = 0;
dat_dst[i++] = 0; // g_bus_dus_amount_stored.bus1_amount;
dat_dst[i++] = 0; //g_bus_dus_amount_stored.bus2_amount;
return i;
}
uint8_t set_response_buf(Buf_DBN_BLE *response_dst, uint8_t magic, uint8_t cmd, uint8_t * dat, uint8_t dat_len)
{
uint8_t ret = 0;
uint8_t i = 0;
clear_buf_dbn_ble(response_dst);
response_dst->magic = magic;
response_dst->cmd = cmd;
uint8_t _amount = dat_len / MAX_BLE_DAT_RESPONSE_LEN;
if((dat_len % MAX_BLE_DAT_RESPONSE_LEN) > 0)
{
_amount++;
}
response_dst->pkg_amount = _amount;
response_dst->pkg_seq = 0;
response_dst->dat_len = dat_len;
for(i = 0; i < dat_len; i++)
{
response_dst->dat[i] = dat[i];
}
response_dst->flag = 1;
return ret;
}
uint16_t compute_ckb(uint8_t header_0, uint8_t header_1, uint8_t header_cmd, uint8_t *dat, uint8_t dat_len)
{
uint16_t ret = 0;
uint8_t i = 0;
uint8_t _dxor = header_0 ^ header_1 ^ header_cmd;
uint8_t _dsum = header_0 + header_1 + header_cmd;
for(i = 0; i < dat_len; i++)
{
_dxor ^= dat[i];
_dsum += dat[i];
}
ret = _dxor;
ret = (ret << 8) + (_dsum % 0x100);
return ret;
}
//response_ori must set_response_buf first
uint8_t set_response_to_notify(Buf_DBN_BLE *response_ori, BLE_Notify_Buf * notify_dst)
{
uint8_t ret = 0;
uint8_t i = 0;
uint16_t _ckbl = 0;
if(notify_dst->flag)
{ //dst not idle
return ret;
}
if(response_ori->flag == 0)
{ //ori idle
return ret;
}
if(response_ori->pkg_amount <= 1)
{
//没有分包的情况
notify_dst->buf[0] = response_ori->magic;
if(response_ori->magic == MAGIC_BYTE_DBN_TRANSPARENT)
{
notify_dst->buf[1] = response_ori->pkg_seq;
}
else
{
notify_dst->buf[1] = 0;
}
notify_dst->buf[2] = response_ori->dat_len + 1; // 1 is cmd_byte
notify_dst->buf[3] = response_ori->cmd;
_ckbl = compute_ckb(notify_dst->buf[1], notify_dst->buf[2], notify_dst->buf[3], response_ori->dat, response_ori->dat_len);
for(i = 0; i < response_ori->dat_len; i++)
{
notify_dst->buf[i + 4] = response_ori->dat[i];
}
notify_dst->buf[i + 4] = (uint8_t)(_ckbl >> 8);
i++;
notify_dst->buf[i + 4] = (uint8_t)(_ckbl);
i++;
notify_dst->len = i + 4;
// if(g_flag_debug)
// {
// PRINT("set_response_to_notify_dst__\n");
// for(i = 0; i < notify_dst->len; i++)
// {
// PRINT(" %02X", notify_dst->buf[i]);
// }
// }
notify_dst->flag = 1;
clear_buf_dbn_ble(response_ori);
return 1;
}
else
{
notify_dst->buf[0] = response_ori->magic;
uint8_t _pkg_amount = response_ori->pkg_amount;
uint8_t _pkg_seq = response_ori->pkg_seq;
uint8_t _remain_len = response_ori->dat_len - response_ori->dat_offset;
if(_remain_len > MAX_BLE_DAT_RESPONSE_LEN)
{
_remain_len = MAX_BLE_DAT_RESPONSE_LEN;
}
_pkg_seq += 1;
notify_dst->buf[1] = (_pkg_amount << 4)|(_pkg_seq);
notify_dst->buf[2] = _remain_len + 1; // 1 is cmd_byte
notify_dst->buf[3] = response_ori->cmd;
_ckbl = compute_ckb(notify_dst->buf[1], notify_dst->buf[2], notify_dst->buf[3],
&(response_ori->dat[response_ori->dat_offset]), _remain_len);
for(i = 0; i < _remain_len; i++)
{
notify_dst->buf[i + 4] = response_ori->dat[response_ori->dat_offset + i];
}
notify_dst->buf[i + 4] = (uint8_t)(_ckbl >> 8);
i++;
notify_dst->buf[i + 4] = (uint8_t)(_ckbl);
i++;
response_ori->dat_offset += _remain_len;
response_ori->pkg_seq += 1;
notify_dst->len = i + 4;
// if(g_flag_debug)
// {
// PRINT("\nset_notify_dst,amount:%d,seq:%d,offset:%d\n", response_ori->pkg_amount,response_ori->pkg_seq, response_ori->dat_offset);
// for(i = 0; i < notify_dst->len; i++)
// {
// PRINT(" %02X", notify_dst->buf[i]);
// }
// PRINT("\n");
// }
notify_dst->flag = 1;
if(response_ori->pkg_amount == response_ori->pkg_seq)
{
clear_buf_dbn_ble(response_ori);
}
return 1;
}
}
static uint8_t unpack_packs(uint8_t *pkg, uint8_t len)
{
static uint8_t _offset = 0;
uint8_t _header_0 = pkg[1];
uint8_t _header_0_high = _header_0 >> 4;
uint8_t _header_0_low = _header_0 % 0x10;
uint8_t _len = pkg[2];
uint8_t _cmd = pkg[3];
uint8_t i = 0, j = 0, k = 0;
uint8_t _amount = 0;
if(_header_0_high)
{
if(_header_0_low == 1)
{
g_buf_ble_response.magic = pkg[0];
g_buf_ble_response.pkg_amount = _header_0_high;
g_buf_ble_response.pkg_seq = _header_0_low;
g_buf_ble_response.cmd = _cmd;
memcpy(&g_buf_ble_response.dat, &pkg[4], _len - 1);
_offset = _len - 1;
g_buf_ble_response.dat_len = _len - 1;
}
else
{
if((g_buf_ble_response.pkg_amount != _header_0_high) || (g_buf_ble_response.cmd != _cmd))
{
//printf("\nNot_the_right_sub_pack!\n");
clear_buf_dbn_ble_all(&g_buf_ble_response);
return 0;
}
if(g_buf_ble_response.pkg_seq != (_header_0_low -1))
{
//printf("\nNot_the_right_sub_pack!!\n");
clear_buf_dbn_ble_all(&g_buf_ble_response);
return 0;
}
g_buf_ble_response.pkg_seq = _header_0_low;
g_buf_ble_response.dat_len += (_len - 1); // not include cmd_byte
memcpy(&g_buf_ble_response.dat[_offset], &pkg[4], _len - 1);
_offset += (_len - 1);
}
}
else
{
clear_buf_dbn_ble(&g_buf_ble_response);
g_buf_ble_response.magic = pkg[0];
g_buf_ble_response.pkg_amount = 1;
g_buf_ble_response.pkg_seq = 0;
g_buf_ble_response.cmd = _cmd;
g_buf_ble_response.dat_len = (_len - 1);
memcpy(g_buf_ble_response.dat, &pkg[4], _len - 1);
}
if(_header_0_high == _header_0_low)
{
// received end.
// if(g_flag_debug)
// {
// printf("\nReceive_pack_over:\n");
// for(i = 0; i < g_buf_ble_response.dat_len; i++)
// {
// printf(" %02X", g_buf_ble_response.dat[i]);
// }
// printf("\nEnd\n");
// }
if(g_buf_ble_response.cmd == CMD_DBN_CHECK_PASS)
{
// memset(tmp_ble_buf, 0, MAX_BLE_TMP_BUF_LEN);
// if(g_buf_ble_response.dat_len != 6)
// {
// //response pass failed
// tmp_ble_buf[0] = 0x01;
// set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, 1);
// }
// else
// {
// char _pass = check_ble_safe_pass(g_buf_ble_response.dat);
// if(_pass)
// {
// //response ok
// tmp_ble_buf[0] = 0x0;
// set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, 1);
// }
// else
// {
// //response failed
// tmp_ble_buf[0] = 0x01;
// set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, 1);
// }
// }
} //end if g_buf_ble_response.cmd == CMD_DBN_CHECK_PASS
else if(g_buf_ble_response.cmd == CMD_DBN_MODIFY_PASS)
{
// memset(tmp_ble_buf, 0, MAX_BLE_TMP_BUF_LEN);
// if(g_buf_ble_response.dat_len != 12)
// {
// //response failed
// tmp_ble_buf[0] = 0x01;
// }
// else
// {
// char _pass = check_ble_safe_pass(g_buf_ble_response.dat);
// if(_pass)
// {
// //response ok
// set_ble_safe_pass(&g_buf_ble_response.dat[6]);
// tmp_ble_buf[0] = 0x00;
// }
// else
// {
// //response failed
// tmp_ble_buf[0] = 0x01;
// }
// }
set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, 1);
} //end if g_buf_ble_response.cmd == CMD_DBN_MODIFY_PASS
}
return 0;
}
static void unpack_pkg_set_cjq_param(uint8_t *pkg, uint8_t len)
{
uint8_t i = 4, k = 0;
uint8_t tmp[7] = {0};
k = pkg[i++];
g_loop_cng_unit.sensitvity = k & 0x0F;
g_loop_cng_unit.loopFreq_Level = k >> 4;
g_loop_cng_unit.delay_time = pkg[i++];
k = pkg[i++];
g_loop_cng_unit.output_mode = k & 0x03;
g_loop_cng_unit.loopSafe_Timeout = k >> 3;
g_loop_cng_unit.exist_mode = pkg[i++];
g_loop_cng_unit.direction_mode = pkg[i++];
g_function_mode = (g_loop_cng_unit.direction_mode >> 4) & 0x0F;
g_hold_time = g_loop_cng_unit.exist_mode * 30 * 20;
i = 0;
tmp[i++] = g_loop_cng_unit.sensitvity;
tmp[i++] = g_loop_cng_unit.delay_time;
tmp[i++] = g_loop_cng_unit.output_mode;
tmp[i++] = g_loop_cng_unit.direction_mode; //默认 0
tmp[i++] = g_loop_cng_unit.loopFreq_Level;
tmp[i++] = g_loop_cng_unit.loopSafe_Timeout;
tmp[i++] = g_loop_cng_unit.exist_mode;
write_cfg_to_store(4, tmp, 7);
}
void usart_packet_processing_acs_loop(uint8_t flag)
{
static uint32_t _current_freq = 0;
static uint32_t _last_freq = 0;
clear_ble_notify_buf(&g_tmp_report_buf);
uint8_t i = 0,j;
uint32_t _loop_capvd = g_loop_acs_info.loop_capvd;
g_tmp_report_buf.flag = flag;
g_loop_acs_info.condition = (g_env_activity > 150) ? 15 : (g_env_activity / 10);
if(loop1_FLAG_CUT){
g_loop_acs_info.condition = 15;
}
g_tmp_report_buf.buf[i++] = SENS_LOOP_DYNAMIC;
g_tmp_report_buf.buf[i++] = (g_loop_acs_info.loop_num << 6) | (g_freq_level << 4) | (g_loop_acs_info.condition & 0x0F);
g_tmp_report_buf.buf[i++] = (g_loop_acs_info.relay2_state << 6) | (g_loop_acs_info.relay2_cng << 4) | (g_loop_acs_info.relay1_state << 2) | (g_loop_acs_info.relay1_cng & 0x3);
g_tmp_report_buf.buf[i++] = (loop1_FLAG_CUT << 7) | (g_loop_acs_info.car_state << 4) | (g_loop_acs_info.direction & 0x0F);
g_freq_tmp = (float)(g_sys_freq )/((float)(_loop_capvd)/((float)(loop1_LPCNT))); // ?? ???????
// why + 360? balance value ,补偿,经验值,可以根据示波器比较再进行调整
_current_freq = (uint32_t)(g_freq_tmp) + 360 ;// * 32);
// if(flag)
{
g_loop_acs_info.frequent = _current_freq;
_last_freq = _current_freq;
}
// else
// {
// if(_current_freq > _last_freq)
// {
// if(_current_freq - _last_freq > 30)
// {
// //稳定显示,过滤低数值的变动
// g_loop_acs_info.frequent = _current_freq;
// _last_freq = _current_freq;
// }
// }
// else
// {
// if(_last_freq - _current_freq > 30)
// {
// // 稳定显示,过滤低数值的变动
// g_loop_acs_info.frequent = _current_freq;
// _last_freq = _current_freq;
// }
// }
// }
// g_tmp_report_buf.buf[i++] = (uint8_t)flt_mgr.init_freq;
// g_tmp_report_buf.buf[i++] = (flt_mgr.init_freq >> 8) % 0x100;
// g_tmp_report_buf.buf[i++] = (flt_mgr.init_freq >> 16) % 0x100;
if(g_loop_acs_info.flag_change){
g_loop_acs_info.flag_change = 0;
}
g_tmp_report_buf.buf[i++] = (g_loop_power_up_state == 0) ? 1 : ((uint8_t)g_loop_cut_amount);
g_tmp_report_buf.buf[i++] = (g_loop_power_up_state == 0) ? 0 : ((g_loop_cut_amount >> 8) % 0x100);
g_tmp_report_buf.buf[i++] = (g_loop_power_up_state == 0) ? 0 : ((g_loop_cut_amount >> 16) % 0x100);
g_tmp_report_buf.buf[i++] = (uint8_t)g_loop_acs_info.frequent;
g_tmp_report_buf.buf[i++] = (g_loop_acs_info.frequent >> 8) % 0x100;
g_tmp_report_buf.buf[i++] = (g_loop_acs_info.frequent >> 16) % 0x100;
g_tmp_report_buf.buf[i++] = (uint8_t)g_loop_acs_info.variation;
g_tmp_report_buf.buf[i++] = (g_loop_acs_info.variation >> 8) % 0x100;
g_tmp_report_buf.buf[i++] = (g_loop_acs_info.variation >> 16) % 0x100;
g_tmp_report_buf.len = i;
set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, CMD_SUB_SENS_REPORT, g_tmp_report_buf.buf, g_tmp_report_buf.len);
}
void report_sens_acs(void)
{
uint8_t _ret = 0;
if(g_dbn_ble_state_acs_enable.enable)
{
// 上报线圈动态数据
// switch(g_dbn_ble_state_acs_enable.sens_type)
// {
// //case SENS_LOOP_DYNAMIC:
// default:
// {
// 线圈动态信息
if(g_loop_acs_info.flag_event)
{
// if(g_loop_acs_info.report_counter >= 3)
{
// refresh_loop_acs_info();
g_loop_acs_info.flag_event = 0;
g_loop_acs_info.report_counter = 0;
// report
usart_packet_processing_acs_loop(1);
}
}
if(g_loop_acs_info.report_counter >= 120)
{
// refresh_loop_acs_info();
g_loop_acs_info.report_counter = 0;
// report
usart_packet_processing_acs_loop(0);
// response_bt_dat(usart_packet_processing_acs_loop(0));
}
if(g_dbn_ble_state_acs_enable.timeout_min)
{
if(mstick() - g_dbn_ble_state_acs_enable.counter >= g_dbn_ble_state_acs_enable.timeout_counter)
{
g_dbn_ble_state_acs_enable.flag = 0;
g_dbn_ble_state_acs_enable.enable = 0;
}
}
// } break;
// }
}
}
void manage_dbn_ble_default(uint8_t *pkg, uint8_t len)
{
uint8_t _header_0 = pkg[1];
uint8_t _header_0_high = 0;
uint8_t _header_0_low = _header_0 % 0x10;
uint8_t _len = pkg[2];
uint8_t _cmd = pkg[3];
uint8_t _tmp = 0;
uint8_t i = 0, k = 0;
memset(tmp_ble_buf, 0, MAX_BLE_TMP_BUF_LEN);
switch(_cmd)
{
case CMD_DBN_GET_DEV_INFO:
{
i = set_dev_info_to_ready(tmp_ble_buf);
set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, i);
// printf("\nGet_dev_info\n");
} break;
case CMD_DBN_RESET_DEV:
{
//Restart Dev
SYS_ResetExecute();
} break;
// case CMD_DBN_CHECK_PASS:
// {
// unpack_packs(pkg, len);
// } break;
case CMD_DBN_SET_CJQ_PARAM:
{
// PRINT("\nSet_Cjq_param\n");
unpack_pkg_set_cjq_param(pkg, len);
tmp_ble_buf[0] = 0;
set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, 1);
para_store_init();
} break;
case CMD_DBN_GET_CJQ_PARAM:
{
i = 0;
tmp_ble_buf[i++] = (g_freq_sens + 1) | (g_loop_cng_unit.loopFreq_Level << 4);
tmp_ble_buf[i++] = g_loop_cng_unit.delay_time;
tmp_ble_buf[i++] = g_loop_cng_unit.output_mode | (g_loop_cng_unit.loopSafe_Timeout << 3);
tmp_ble_buf[i++] = g_loop_cng_unit.exist_mode;
tmp_ble_buf[i++] = g_loop_sens_list.total << 4;
tmp_ble_buf[i++] = (g_loop_power_up_state == 0) ? 1 : ((uint8_t)(g_loop_cut_amount));
tmp_ble_buf[i++] = (uint8_t)(g_loop_cut_amount >> 8);
tmp_ble_buf[i++] = g_function_mode;
set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, i);
// PRINT("\nGet_Cjq_param\n");
} break;
// case CMD_DBN_LOOP_SAMPLE_PARAM:{
// // 获取/设置 地感采样参数
//// PRINT("SAMPLE_CNG: %02X\n", pkg[4]);
// if(pkg[4] == 0){
// // get param
// i = 0;
// tmp_ble_buf[i++] = 0x10;
// tmp_ble_buf[i++] = g_loop_balance_planB.sample_cng.flag;
// tmp_ble_buf[i++] = g_loop_balance_planB.sample_cng.max_amplitude;
// tmp_ble_buf[i++] = (g_loop_balance_planB.sample_cng.max_amplitude >> 8) & 0xFF;
// set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, i);
// }
// else {
// // set param
// i = 0;
// k = 4;
// tmp_ble_buf[i++] = 0x11;
// tmp_ble_buf[i++] = pkg[k++];
// tmp_ble_buf[i++] = pkg[k++];
// tmp_ble_buf[i++] = pkg[k++];
//
// g_loop_balance_planB.sample_cng.flag = tmp_ble_buf[1];
// g_loop_balance_planB.sample_cng.max_amplitude = tmp_ble_buf[2] | ((tmp_ble_buf[3] << 8 ) & 0xFF00);
//
// write_cfg_to_store(Addr_Loop_PlanB_Cng_Offset, &tmp_ble_buf[1], sizeof(Loop_Sample_Cng));
//
// set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, i);
//
// //TODO: 不整个设备复位,复位除了蓝牙的部分,即蓝牙正常,其他部分重新初始化
// para_store_init();
// }
//
// } break;
// case CMD_DBN_LOOP_BALANCE_PARAM: {
// // 获取/设置 漂移补偿参数
//// PRINT("Balance_CNG: %02X\n", pkg[4]);
// if(pkg[4] == 0){
// // get param
// i = 0;
// tmp_ble_buf[i++] = 0x10;
// tmp_ble_buf[i++] = g_loop_balance_planB.balance_ori_cng.flag;
// tmp_ble_buf[i++] = g_loop_balance_planB.balance_ori_cng.max_cnt;
// tmp_ble_buf[i++] = (g_loop_balance_planB.balance_ori_cng.max_cnt >> 8) & 0xFF;
//
// set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, i);
// }
// else{
// // set param
// i = 0;
// k = 4;
// tmp_ble_buf[i++] = 0x11;
// tmp_ble_buf[i++] = pkg[k++];
// tmp_ble_buf[i++] = pkg[k++];
// tmp_ble_buf[i++] = pkg[k++];
//
// g_loop_balance_planB.balance_ori_cng.flag = tmp_ble_buf[1];
// g_loop_balance_planB.balance_ori_cng.max_cnt = tmp_ble_buf[2] | ((tmp_ble_buf[3] << 8 ) & 0xFF00);
//
// write_cfg_to_store(Addr_Loop_PlanB_Cng_Offset + sizeof(Loop_Sample_Cng), &tmp_ble_buf[1], sizeof(Loop_Balance_Ori_Cng));
//
// set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, i);
//
// //TODO: 不整个设备复位,复位除了蓝牙的部分,即蓝牙正常,其他部分重新初始化
// para_store_init();
//
// }
//
// } break;
// case CMD_DBN_LOOP_RELEASE_PLANB: {
// // 获取/设置 释放去抖动算法参数
//// PRINT("Release2_CNG: %02X\n", pkg[4]);
// if(pkg[4] == 0){
// // get param
// i = 0;
// tmp_ble_buf[i++] = 0x10;
// tmp_ble_buf[i++] = g_loop_balance_planB.release_ori_planB.flag_weight;
// tmp_ble_buf[i++] = g_loop_balance_planB.release_ori_planB.max_amplitude;
// tmp_ble_buf[i++] = (g_loop_balance_planB.release_ori_planB.max_amplitude >> 8) & 0xFF;
// tmp_ble_buf[i++] = g_loop_balance_planB.release_ori_planB.timeout;
// tmp_ble_buf[i++] = g_loop_balance_planB.release_change_rate.flag_weight;
// tmp_ble_buf[i++] = g_loop_balance_planB.release_change_rate.rate_first;
// tmp_ble_buf[i++] = g_loop_balance_planB.release_change_rate.rate_second;
// tmp_ble_buf[i++] = g_loop_balance_planB.release_change_rate.mode;
//
// set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, i);
// }
// else{
// // set param
// i = 0; k = 0;
// tmp_ble_buf[i++] = 0x11;
// memcpy(&tmp_ble_buf[1], &pkg[4], 8);
// i += 8;
//
// write_cfg_to_store(Addr_Loop_PlanB_Cng_Offset + sizeof(Loop_Sample_Cng) + sizeof(Loop_Balance_Ori_Cng), &tmp_ble_buf[1], 8);
//
// set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, i);
//
// //TODO: 不整个设备复位,复位除了蓝牙的部分,即蓝牙正常,其他部分重新初始化
// para_store_init();
// }
// } break;
case CMD_DBN_LOOP_SENS_LIST: {
// PRINT("SENS_CNG: %02X\n", pkg[4]);
memset(tmp_ble_buf, 0, MAX_BLE_TMP_BUF_LEN);
if(pkg[4] == 0x00){
// get param
i = 0;
tmp_ble_buf[i++] = 0x10;
tmp_ble_buf[i++] = g_loop_sens_list.total;
for(k = 0; k < g_loop_sens_list.total; k++){
tmp_ble_buf[i++] = g_loop_sens_list.sens[k].sens_in;
tmp_ble_buf[i++] = g_loop_sens_list.sens[k].sens_in >> 8;
tmp_ble_buf[i++] = g_loop_sens_list.sens[k].sens_out;
tmp_ble_buf[i++] = g_loop_sens_list.sens[k].sens_out >> 8;
}
set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, i);
}
else {
// set param
i = 0; k = 5;
tmp_ble_buf[i++] = 0x11;
g_loop_sens_list.total = pkg[k];
if(g_loop_sens_list.total > MAX_LOOP_SENS_AMOUNT){
g_loop_sens_list.total = MAX_LOOP_SENS_AMOUNT;
}
k = 1 + g_loop_sens_list.total * 4;
memcpy(&tmp_ble_buf[i], &pkg[5], k);
i += k;
write_cfg_to_store(Addr_Loop_Sens_List_Offset, &tmp_ble_buf[1], (i - 1));
DelayMs(10);
set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, i);
write_cfg_to_store(Addr_Loop_Sens_List_Offset, &tmp_ble_buf[1], (i - 1));
DelayMs(10);
//TODO: 不整个设备复位,复位除了蓝牙的部分,即蓝牙正常,其他部分重新初始化
para_store_init();
}
} break;
case CMD_DBN_SET_CJQ_FACTORY: {
// 出厂初始化
tmp_ble_buf[0] = 0;
set_response_buf(&g_buf_ble_response, MAGIC_BYTE_DBN_DEFAULT, _cmd, tmp_ble_buf, 1);
set_factory_param();
factory_dev();
DelayMs(10);
//TODO: 不整个设备复位,复位除了蓝牙的部分,即蓝牙正常,其他部分重新初始化
para_store_init();
} break;
case CMD_SENS_ACS_ENABLE: {
// 线圈动态
g_dbn_ble_state_acs_enable.enable = pkg[5];
if(g_dbn_ble_state_acs_enable.enable){
g_loop_acs_info.condition = 0;
g_dbn_ble_state_acs_enable.interval = pkg[6] * 0x7F;
g_dbn_ble_state_acs_enable.timeout_min = pkg[7];
if(g_dbn_ble_state_acs_enable.timeout_min){
g_dbn_ble_state_acs_enable.counter = mstick();
g_dbn_ble_state_acs_enable.timeout_counter = g_dbn_ble_state_acs_enable.timeout_min * 60 * 100; // TODO: min --> ms
}
g_dbn_ble_state_acs_enable.flag = 1;
}
else{
g_dbn_ble_state_acs_enable.flag = 0;
}
} break;
default:
{
} break;
}
}
void poll_dbn_ble(void)
{
uint8_t i = 0;
uint8_t magic = 0;
if(g_ble_rcv_buf.flag)
{
// if(g_flag_debug)
// {
// PRINT("profile ChangeCB CHAR1?..:%s, len:%d \n", g_ble_rcv_buf.buf, g_ble_rcv_buf.len);
// for(i = 0; i < g_ble_rcv_buf.len; i++)
// {
// PRINT(" %02X", g_ble_rcv_buf.buf[i]);
// }
// PRINT("\n");
// }
magic = check_pkg(g_ble_rcv_buf.buf, g_ble_rcv_buf.len);
// printf("_magic: %02X\n", magic);
if(magic != 0)
{
// if(magic == MAGIC_BYTE_DBN_DEFAULT)
{
manage_dbn_ble_default(g_ble_rcv_buf.buf, g_ble_rcv_buf.len);
}
}
// memcpy(g_notify_buftemp.buf, g_ble_rcv_buf.buf, g_ble_rcv_buf.len);
// g_notify_buftemp.len = g_ble_rcv_buf.len;
// g_flag_notify_temp = 1;
clear_ble_notify_buf(&g_ble_rcv_buf);
}
if(g_notify_buftemp.flag == 0)
{
report_sens_acs();
g_flag_notify_temp = set_response_to_notify(&g_buf_ble_response, &g_notify_buftemp);
}
}
@@ -0,0 +1,47 @@
/*
* cmcng.h
*
* Created on: Aug 27, 2024
* Author: Thinkpad
* 2026-07-18: ç®—æ³•ç§»æ¤ DLD154V4B, 移除 FltHistoryManager / SecondOrderState /
* StageRangeConfig 等旧算法结构
*/
#ifndef INCLUDE_CMCNG_H_
#define INCLUDE_CMCNG_H_
#include <stdint.h>
#define PRODUCT_MODEL "DLD110S"
#define FIRMWARE_VER "4.30"
#define HARDWARE_VER "4.01"
#define FIRMWARE_VER_MAIN 4
#define FIRMWARE_VER_SUB 30
#define HARDWARE_VER_MAIN 4
#define HARDWARE_VER_SUB 1
/* 功能模å¼ä½? (direction_mode é«?4ä½?, åè®®ä¿ç•™; 新算法ä¸å†æ¶ˆè´?) */
#define FUNCTION_A 0x01 // 二次判断 (已废�)
#define FUNCTION_B 0x02 // 二次判断增强æ¡ä»¶åˆ¤æ–­ (已废å¼?)
#define FUNCTION_C 0x04 //
#define FUNCTION_D 0x08 //
extern uint16_t g_hold_time;
extern char g_flag_debug;
extern uint8_t g_dev_number[6];
extern uint8_t MACAddr[6];
extern uint8_t g_loop_cut_last;
extern uint32_t g_loop_cut_amount;
extern uint8_t g_loop_power_up_state;
extern uint8_t g_function_mode;
/* 新算法状æ€? (DLD154V4B ç§»æ¤) */
extern uint8_t g_loop_stable; // ç¨³å®šæœŸç»“æŸæ ‡å¿? (0=æ”¶æ•›ä¸?, 1=稳定)
extern uint8_t g_env_activity; // 环境活跃åº? (BLE condition å­—æ®µæ¥æº)
uint32_t mstick(void);
#endif /* INCLUDE_CMCNG_H_ */
@@ -0,0 +1,108 @@
/*
* dbn_ble_srv.h
*
* Created on: Aug 27, 2024
* Author: Thinkpad
*/
#ifndef INCLUDE_DBN_BLE_SRV_H_
#define INCLUDE_DBN_BLE_SRV_H_
#include "CONFIG.h"
#include <stdint.h>
/*
* Magic | Header | Data | CheckByte
* | Addr/Sub Len CMD | | Xor Sum
* 1Byte | 1B 1B 1B | xx | 1B 1B
*
* * Len = len(CMD) + len(Data)
*/
#define MAGIC_BYTE_DBN_DEFAULT 0x8F
#define MAGIC_BYTE_DBN_TRANSPARENT 0x7F // 用于 显示屏协议、地感协议、探头协议等
#define CMD_DBN_GET_DEV_INFO 0x10
#define CMD_DBN_CHECK_PASS 0x1C
#define CMD_DBN_MODIFY_PASS 0x1D
#define CMD_DBN_SET_FACTORY 0x1E
#define CMD_DBN_RESET_DEV 0x1F
#define CMD_DBN_SET_NOTIFY 0x20
#define CMD_DBN_SET_NOTIFY_LOOP 0x21
#define CMD_DBN_SET_SUB_CODE 0x22 //使能 子功能
#define CMD_DBN_SET_CJQ_PARAM 0x23 // 设置 车检器参数
#define CMD_DBN_GET_CJQ_PARAM 0x24 // 读取 车检器参数
#define CMD_DBN_DEV_RESET 0x6D
#define CMD_DBN_LOOP_SAMPLE_PARAM 0x87
#define CMD_DBN_LOOP_BALANCE_PARAM 0x88
#define CMD_DBN_LOOP_RELEASE_PLANB 0x89
#define CMD_DBN_LOOP_SENS_LIST 0x8A
#define CMD_DBN_SET_CJQ_FACTORY 0x92
#define CMD_SUB_SENS_REPORT 0xC0 //设备主动上报传感信息
// #define CMD_REQUIRE_DEV_MAC_ADDR 0xC1
// #define CMD_CHANGE_DEV_ADDR_BY_MAC 0xC2
// #define CMD_SET_LED 0xC3
// #define CMD_SET_RELAY 0xC4
#define CMD_SENS_ACS_ENABLE 0xC5 // 设备主动上报 使能
#define MAX_BLE_DAT_RESPONSE_LEN (BLE_BUFF_MAX_LEN - 4) // 14 //返回 的所有字节数不能超过20个字节,除去 magic、header和ckb校验字节,剩下数据的字节数为14
#define MAX_BLE_Notify_Buf_LEN BLE_BUFF_MAX_LEN //24
#define MAX_BLE_BUF_LEN BLE_BUFF_MAX_LEN //128
#define MAX_BLE_TMP_BUF_LEN BLE_BUFF_MAX_LEN
typedef struct _BLE_Notify_Buf_
{
uint8_t flag; //0 idle, 1 buf ready
uint8_t len;
uint8_t buf[MAX_BLE_Notify_Buf_LEN];
}BLE_Notify_Buf;
typedef struct _BUF_DBN_BLE_
{
uint8_t flag;
uint8_t magic;
uint8_t cmd;
uint8_t dat_len ;
uint8_t dat_offset;
uint8_t pkg_amount;
uint8_t pkg_seq;
uint8_t dat[MAX_BLE_BUF_LEN];
} Buf_DBN_BLE;
extern Buf_DBN_BLE g_buf_ble_response;
extern BLE_Notify_Buf g_notify_buftemp;
extern uint8_t g_flag_notify_temp;
extern BLE_Notify_Buf g_ble_rcv_buf;
extern uint16_t loop1_LPCNT;
extern uint8_t g_freq_sens;
extern uint8_t loop1_SensLevel;
extern uint8_t g_freq_level;
extern uint32_t g_sys_freq;
extern float g_freq_tmp;
void clear_ble_notify_buf(BLE_Notify_Buf * buf);
void poll_dbn_ble(void);
void report_sens_acs(void);
void set_factory_param(void);
void factory_dev(void);
void para_store_init(void);
#endif /* INCLUDE_DBN_BLE_SRV_H_ */
@@ -0,0 +1,67 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : peripheral.h
* Author : WCH
* Version : V1.0
* Date : 2018/12/11
* Description :
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#ifndef PERIPHERAL_H
#define PERIPHERAL_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************************
* INCLUDES
*/
#include "dbn_ble_srv.h"
/*********************************************************************
* CONSTANTS
*/
// Peripheral Task Events
#define SBP_START_DEVICE_EVT 0x0001
#define SBP_PERIODIC_EVT 0x0002
#define SBP_READ_RSSI_EVT 0x0004
#define SBP_PARAM_UPDATE_EVT 0x0008
/*********************************************************************
* MACROS
*/
typedef struct
{
uint16_t connHandle; // Connection handle of current connection
uint16_t connInterval;
uint16_t connSlaveLatency;
uint16_t connTimeout;
} peripheralConnItem_t;
/*********************************************************************
* FUNCTIONS
*/
/*
* Task Initialization for the BLE Application
*/
extern void Peripheral_Init(void);
/*
* Task Event Processor for the BLE Application
*/
extern uint16_t Peripheral_ProcessEvent(uint8_t task_id, uint16_t events);
/*********************************************************************
*********************************************************************/
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,187 @@
/*
* storage.h
*
* Created on: Aug 27, 2024
* Author: Thinkpad
*/
#ifndef INCLUDE_STORAGE_H_
#define INCLUDE_STORAGE_H_
#include <stdint.h>
// #define Addr_Loop_PlanB_Cng_Offset 0x10
// #define Addr_Flag_Sample_In 0x10
// #define Addr_Sample_Max_Amplitude 0x11
// #define Addr_Flag_Balance_Ori_In 0x13
// #define Addr_Balance_Ori_In_Max_Cnt 0x14
// #define Addr_Flag_Release_Ori_PlanB 0x16
// #define Addr_Release_Ori_PlanB_TimeOut 0x17
// #define Addr_Release_Ori_PlanB_Weight 0x18
// #define Addr_Release_Ori_Amplitude 0x19
// #define Addr_Flag_Release_Rate 0x1B
// #define Addr_Release_Rate_First 0x1C
// #define Addr_Release_Rate_Second 0x1D
// #define Addr_Release_Rate_Weight 0x1E
// #define Addr_Release_Rate_Mode 0x1F
#define Addr_Loop_Sens_List_Offset 0x20
#define Addr_Sens_Array_In 0x20
#define Addr_Sens_Array_Out 0x30
#define MAX_LOOP_SENS_AMOUNT 3 // 4 // 5
#pragma pack(1)
typedef struct _Loop_Sample_CNG_
{
uint8_t flag;
uint16_t max_amplitude; // 最大幅值
}Loop_Sample_Cng;
typedef struct _Loop_Balance_Ori_CNG_
{
uint8_t flag;
uint16_t max_cnt ; // 最大补偿次数
}Loop_Balance_Ori_Cng; // 漂移补偿
typedef struct _Loop_Release_Ori_PlanB_
{
uint8_t flag_weight;
uint16_t max_amplitude; //最大幅值
uint8_t timeout; // 单位:分钟
}Loop_Release_Ori_PlanB;
typedef struct _Loop_Release_Change_Rate_
{
uint8_t flag_weight;
uint8_t rate_first;
uint8_t rate_second;
uint8_t mode;
}Loop_Release_Change_Rate;
typedef struct _Loop_Balance_PlanB_
{
Loop_Sample_Cng sample_cng;
Loop_Balance_Ori_Cng balance_ori_cng;
Loop_Release_Ori_PlanB release_ori_planB;
Loop_Release_Change_Rate release_change_rate;
}Loop_Balance_PlanB;
extern Loop_Balance_PlanB g_loop_balance_planB;
typedef struct
{
uint8_t sensitvity; // 高四位表示灵敏度的数量,低四位表示当前灵敏度的序号(从0开始)
uint8_t delay_time;
uint8_t output_mode;
uint8_t direction_mode; // 方向判别模式,0 触发模式, 非0 表示方向判别模式
uint8_t loopFreq_Level; // 高低频
uint8_t loopSafe_Timeout; // 线圈安全模式, 0表示关闭,非0表示开启,以10秒为单位
uint8_t exist_mode; // 0 永久存在,非0,表示有限存在的时间,单位为10秒
}Loop_Cng_Unit;
extern Loop_Cng_Unit g_loop_cng_unit;
typedef struct
{
uint16_t sens_in;
uint16_t sens_out;
}Loop_Single_Sens;
typedef struct
{
uint8_t total;
Loop_Single_Sens sens[MAX_LOOP_SENS_AMOUNT];
}Loop_Sens_List;
extern Loop_Sens_List g_loop_sens_list;
typedef struct _DBN_BLE_STATE_
{
uint8_t flag; // if need to report
uint8_t enable; // 是否使能
uint8_t send_flag;
uint8_t obj_amount;
uint8_t cmd;
uint8_t sens_type;
uint8_t dat_len ;
uint8_t dat_offset;
uint8_t pkg_amount;
uint8_t pkg_seq;
uint16_t interval;
uint32_t counter;
uint8_t timeout_min; // minute
uint32_t timeout_counter;
} DBN_BLE_State;
extern DBN_BLE_State g_dbn_ble_state_acs_enable;
typedef enum
{
SENS_NONE = 0,
SENS_SUB_INFO = 1, // 传感器设备信息
SENS_OBJ_DYNAMIC = 2, // 动态目标类型
SENS_SOUTPUT_STATUS = 3, // 当前开关量输出的状态
SENS_DETAIL_CNG = 4, // 详细配置
SENS_LOOP_DYNAMIC = 5, // 线圈动态信息
SENS_OBJ_BackGround = 6, //
SENS_OBJ_INSIDE = 7, //
SENS_LOOP_TREND,
SENS_OBJ_DYNAMIC_SIMPLE,
SENS_OBJ_STATIC_XuJing, //10, 0x0A
SENS_DOBULE_LOOP_ESTIMATE //0x0B, 线圈环境评估
} SUB_SENS_TYPE; // 传感数据类型
typedef struct _LOOP_ACS_INFO
{
uint8_t flag_event;
uint8_t loop_num;
uint8_t freq_level;
uint8_t sensity;
uint8_t relay1_cng;
uint8_t relay1_state;
uint8_t relay2_cng;
uint8_t relay2_state;
uint8_t loop_state;
uint8_t output_mode;
uint8_t dir_mode;
uint8_t delay;
uint8_t car_state;
uint8_t direction;
uint8_t flag_loop_safe;
uint32_t loop_safe_counter;
uint8_t condition;
uint8_t flag_change;
uint32_t frequent;
uint32_t loop_capvd;
int32_t variation;
uint32_t event_counter;
uint32_t report_counter;
} Loop_ACS_Info;
extern Loop_ACS_Info g_loop_acs_info;
#pragma pack()
#define HOLD_TIME 5*1200
#define LC_HOLD_TIME 4*1200 //时间4分钟
#define IN_DELAY 10
#define OUT_DELAY 39
#define PLUSE_DELAY 10
void write_cfg_to_store(uint32_t wAddr, uint8_t * p, uint32_t len);
void read_cfg_from_store(uint32_t addr, uint8_t *p, uint32_t len);
#endif /* INCLUDE_STORAGE_H_ */
@@ -0,0 +1,784 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : peripheral.C
* Author : WCH
* Version : V1.0
* Date : 2018/12/10
* Description : 外设从机多连接应用程序,初始化广播连接参数,然后广播,连接主机后,
* 请求更新连接参数,通过自定义服务传输数据
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
/*********************************************************************
* INCLUDES
*/
#include "CONFIG.h"
#include "devinfoservice.h"
#include "gattprofile.h"
#include "peripheral.h"
/*********************************************************************
* MACROS
*/
extern uint8_t g_flag_bt_state;
/*********************************************************************
* CONSTANTS
*/
// How often to perform periodic event
#define SBP_PERIODIC_EVT_PERIOD 200 //800 //1600
// How often to perform read rssi event
#define SBP_READ_RSSI_EVT_PERIOD 3200
// Parameter update delay
#define SBP_PARAM_UPDATE_DELAY 6400
// What is the advertising interval when device is discoverable (units of 625us, 80=50ms)
#define DEFAULT_ADVERTISING_INTERVAL 80
// Limited discoverable mode advertises for 30.72s, and then stops
// General discoverable mode advertises indefinitely
#define DEFAULT_DISCOVERABLE_MODE GAP_ADTYPE_FLAGS_GENERAL
// Minimum connection interval (units of 1.25ms, 6=7.5ms)
#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 6
// Maximum connection interval (units of 1.25ms, 100=125ms)
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 100
// Slave latency to use parameter update
#define DEFAULT_DESIRED_SLAVE_LATENCY 0
// Supervision timeout value (units of 10ms, 100=1s)
#define DEFAULT_DESIRED_CONN_TIMEOUT 100
// Company Identifier: WCH
#define WCH_COMPANY_ID 0x07D7
/*********************************************************************
* TYPEDEFS
*/
/*********************************************************************
* GLOBAL VARIABLES
*/
/*********************************************************************
* EXTERNAL VARIABLES
*/
/*********************************************************************
* EXTERNAL FUNCTIONS
*/
/*********************************************************************
* LOCAL VARIABLES
*/
static uint8_t Peripheral_TaskID = INVALID_TASK_ID; // Task ID for internal task/event processing
// GAP - SCAN RSP data (max size = 31 bytes)
static uint8_t scanRspData[] = {
// complete name
// 0x12, // length of this data
0x08,
GAP_ADTYPE_LOCAL_NAME_COMPLETE,
// 'S',
// 'i',
// 'm',
// 'p',
// 'l',
// 'e',
// ' ',
// 'P',
// 'e',
// 'r',
// 'i',
// 'p',
// 'h',
// 'e',
// 'r',
// 'a',
// 'l',
'D','L','D','1','1','0','S',
// connection interval range
0x05, // length of this data
GAP_ADTYPE_SLAVE_CONN_INTERVAL_RANGE,
LO_UINT16(DEFAULT_DESIRED_MIN_CONN_INTERVAL), // 100ms
HI_UINT16(DEFAULT_DESIRED_MIN_CONN_INTERVAL),
LO_UINT16(DEFAULT_DESIRED_MAX_CONN_INTERVAL), // 1s
HI_UINT16(DEFAULT_DESIRED_MAX_CONN_INTERVAL),
// Tx power level
0x02, // length of this data
GAP_ADTYPE_POWER_LEVEL,
0 // 0dBm
};
// GAP - Advertisement data (max size = 31 bytes, though this is
// best kept short to conserve power while advertising)
static uint8_t advertData[] = {
// Flags; this sets the device to use limited discoverable
// mode (advertises for 30 seconds at a time) instead of general
// discoverable mode (advertises indefinitely)
0x02, // length of this data
GAP_ADTYPE_FLAGS,
DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,
// service UUID, to notify central devices what services are included
// in this peripheral
0x03, // length of this data
GAP_ADTYPE_16BIT_MORE, // some of the UUID's, but not all
LO_UINT16(SIMPLEPROFILE_SERV_UUID),
HI_UINT16(SIMPLEPROFILE_SERV_UUID)
};
// GAP GATT Attributes
static uint8_t attDeviceName[GAP_DEVICE_NAME_LEN] = "DLD110S";// "Simple Peripheral";
// Connection item list
static peripheralConnItem_t peripheralConnList;
static uint16_t peripheralMTU = ATT_MTU_SIZE;
/*********************************************************************
* LOCAL FUNCTIONS
*/
static void Peripheral_ProcessTMOSMsg(tmos_event_hdr_t *pMsg);
static void peripheralStateNotificationCB(gapRole_States_t newState, gapRoleEvent_t *pEvent);
static void performPeriodicTask(void);
static void simpleProfileChangeCB(uint8_t paramID, uint8_t *pValue, uint16_t len);
static void peripheralParamUpdateCB(uint16_t connHandle, uint16_t connInterval,
uint16_t connSlaveLatency, uint16_t connTimeout);
static void peripheralInitConnItem(peripheralConnItem_t *peripheralConnList);
static void peripheralRssiCB(uint16_t connHandle, int8_t rssi);
static void peripheralChar4Notify(uint8_t *pValue, uint16_t len);
/*********************************************************************
* PROFILE CALLBACKS
*/
// GAP Role Callbacks
static gapRolesCBs_t Peripheral_PeripheralCBs = {
peripheralStateNotificationCB, // Profile State Change Callbacks
peripheralRssiCB, // When a valid RSSI is read from controller (not used by application)
peripheralParamUpdateCB
};
// Broadcast Callbacks
static gapRolesBroadcasterCBs_t Broadcaster_BroadcasterCBs = {
NULL, // Not used in peripheral role
NULL // Receive scan request callback
};
// GAP Bond Manager Callbacks
static gapBondCBs_t Peripheral_BondMgrCBs = {
NULL, // Passcode callback (not used by application)
NULL // Pairing / Bonding state Callback (not used by application)
};
// Simple GATT Profile Callbacks
static simpleProfileCBs_t Peripheral_SimpleProfileCBs = {
simpleProfileChangeCB // Characteristic value change callback
};
/*********************************************************************
* PUBLIC FUNCTIONS
*/
/*********************************************************************
* @fn Peripheral_Init
*
* @brief Initialization function for the Peripheral App Task.
* This is called during initialization and should contain
* any application specific initialization (ie. hardware
* initialization/setup, table initialization, power up
* notificaiton ... ).
*
* @param task_id - the ID assigned by TMOS. This ID should be
* used to send messages and set timers.
*
* @return none
*/
void Peripheral_Init()
{
Peripheral_TaskID = TMOS_ProcessEventRegister(Peripheral_ProcessEvent);
// Setup the GAP Peripheral Role Profile
{
uint8_t initial_advertising_enable = TRUE;
uint16_t desired_min_interval = DEFAULT_DESIRED_MIN_CONN_INTERVAL;
uint16_t desired_max_interval = DEFAULT_DESIRED_MAX_CONN_INTERVAL;
// Set the GAP Role Parameters
GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &initial_advertising_enable);
GAPRole_SetParameter(GAPROLE_SCAN_RSP_DATA, sizeof(scanRspData), scanRspData);
GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(advertData), advertData);
GAPRole_SetParameter(GAPROLE_MIN_CONN_INTERVAL, sizeof(uint16_t), &desired_min_interval);
GAPRole_SetParameter(GAPROLE_MAX_CONN_INTERVAL, sizeof(uint16_t), &desired_max_interval);
}
// Set the GAP Characteristics
GGS_SetParameter(GGS_DEVICE_NAME_ATT, GAP_DEVICE_NAME_LEN, attDeviceName);
{
uint16_t advInt = DEFAULT_ADVERTISING_INTERVAL;
// Set advertising interval
GAP_SetParamValue(TGAP_DISC_ADV_INT_MIN, advInt);
GAP_SetParamValue(TGAP_DISC_ADV_INT_MAX, advInt);
// Enable scan req notify
GAP_SetParamValue(TGAP_ADV_SCAN_REQ_NOTIFY, ENABLE);
}
// Setup the GAP Bond Manager
{
uint32_t passkey = 0; // passkey "000000"
uint8_t pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
uint8_t mitm = TRUE;
uint8_t bonding = TRUE;
uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
GAPBondMgr_SetParameter(GAPBOND_PERI_DEFAULT_PASSCODE, sizeof(uint32_t), &passkey);
GAPBondMgr_SetParameter(GAPBOND_PERI_PAIRING_MODE, sizeof(uint8_t), &pairMode);
GAPBondMgr_SetParameter(GAPBOND_PERI_MITM_PROTECTION, sizeof(uint8_t), &mitm);
GAPBondMgr_SetParameter(GAPBOND_PERI_IO_CAPABILITIES, sizeof(uint8_t), &ioCap);
GAPBondMgr_SetParameter(GAPBOND_PERI_BONDING_ENABLED, sizeof(uint8_t), &bonding);
}
// Initialize GATT attributes
GGS_AddService(GATT_ALL_SERVICES); // GAP
GATTServApp_AddService(GATT_ALL_SERVICES); // GATT attributes
DevInfo_AddService(); // Device Information Service
SimpleProfile_AddService(GATT_ALL_SERVICES); // Simple GATT Profile
// Setup the SimpleProfile Characteristic Values
{
uint8_t charValue1[SIMPLEPROFILE_CHAR1_LEN] = {1};
uint8_t charValue2[SIMPLEPROFILE_CHAR2_LEN] = {2};
uint8_t charValue3[SIMPLEPROFILE_CHAR3_LEN] = {3};
uint8_t charValue4[SIMPLEPROFILE_CHAR4_LEN] = {4};
// uint8_t charValue5[SIMPLEPROFILE_CHAR5_LEN] = {1, 2, 3, 4, 5};
SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR1, SIMPLEPROFILE_CHAR1_LEN, charValue1);
SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR2, SIMPLEPROFILE_CHAR2_LEN, charValue2);
SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR3, SIMPLEPROFILE_CHAR3_LEN, charValue3);
SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR4, SIMPLEPROFILE_CHAR4_LEN, charValue4);
// SimpleProfile_SetParameter(SIMPLEPROFILE_CHAR5, SIMPLEPROFILE_CHAR5_LEN, charValue5);
}
// Init Connection Item
peripheralInitConnItem(&peripheralConnList);
// Register callback with SimpleGATTprofile
SimpleProfile_RegisterAppCBs(&Peripheral_SimpleProfileCBs);
// Register receive scan request callback
GAPRole_BroadcasterSetCB(&Broadcaster_BroadcasterCBs);
// Setup a delayed profile startup
tmos_set_event(Peripheral_TaskID, SBP_START_DEVICE_EVT);
}
/*********************************************************************
* @fn peripheralInitConnItem
*
* @brief Init Connection Item
*
* @param peripheralConnList -
*
* @return NULL
*/
static void peripheralInitConnItem(peripheralConnItem_t *peripheralConnList)
{
peripheralConnList->connHandle = GAP_CONNHANDLE_INIT;
peripheralConnList->connInterval = 0;
peripheralConnList->connSlaveLatency = 0;
peripheralConnList->connTimeout = 0;
}
/*********************************************************************
* @fn Peripheral_ProcessEvent
*
* @brief Peripheral Application Task event processor. This function
* is called to process all events for the task. Events
* include timers, messages and any other user defined events.
*
* @param task_id - The TMOS assigned task ID.
* @param events - events to process. This is a bit map and can
* contain more than one event.
*
* @return events not processed
*/
uint16_t Peripheral_ProcessEvent(uint8_t task_id, uint16_t events)
{
// VOID task_id; // TMOS required parameter that isn't used in this function
if(events & SYS_EVENT_MSG)
{
uint8_t *pMsg;
if((pMsg = tmos_msg_receive(Peripheral_TaskID)) != NULL)
{
Peripheral_ProcessTMOSMsg((tmos_event_hdr_t *)pMsg);
// Release the TMOS message
tmos_msg_deallocate(pMsg);
}
// return unprocessed events
return (events ^ SYS_EVENT_MSG);
}
if(events & SBP_START_DEVICE_EVT)
{
// Start the Device
GAPRole_PeripheralStartDevice(Peripheral_TaskID, &Peripheral_BondMgrCBs, &Peripheral_PeripheralCBs);
return (events ^ SBP_START_DEVICE_EVT);
}
if(events & SBP_PERIODIC_EVT)
{
// Restart timer
if(SBP_PERIODIC_EVT_PERIOD)
{
tmos_start_task(Peripheral_TaskID, SBP_PERIODIC_EVT, SBP_PERIODIC_EVT_PERIOD);
}
// Perform periodic application task
performPeriodicTask();
return (events ^ SBP_PERIODIC_EVT);
}
if(events & SBP_PARAM_UPDATE_EVT)
{
// Send connect param update request
GAPRole_PeripheralConnParamUpdateReq(peripheralConnList.connHandle,
DEFAULT_DESIRED_MIN_CONN_INTERVAL,
DEFAULT_DESIRED_MAX_CONN_INTERVAL,
DEFAULT_DESIRED_SLAVE_LATENCY,
DEFAULT_DESIRED_CONN_TIMEOUT,
Peripheral_TaskID);
return (events ^ SBP_PARAM_UPDATE_EVT);
}
if(events & SBP_READ_RSSI_EVT)
{
GAPRole_ReadRssiCmd(peripheralConnList.connHandle);
tmos_start_task(Peripheral_TaskID, SBP_READ_RSSI_EVT, SBP_READ_RSSI_EVT_PERIOD);
return (events ^ SBP_READ_RSSI_EVT);
}
// Discard unknown events
return 0;
}
/*********************************************************************
* @fn Peripheral_ProcessGAPMsg
*
* @brief Process an incoming task message.
*
* @param pMsg - message to process
*
* @return none
*/
static void Peripheral_ProcessGAPMsg(gapRoleEvent_t *pEvent)
{
switch(pEvent->gap.opcode)
{
case GAP_SCAN_REQUEST_EVENT:
{
// PRINT("Receive scan req from %x %x %x %x %x %x ..\n", pEvent->scanReqEvt.scannerAddr[0],
// pEvent->scanReqEvt.scannerAddr[1], pEvent->scanReqEvt.scannerAddr[2], pEvent->scanReqEvt.scannerAddr[3],
// pEvent->scanReqEvt.scannerAddr[4], pEvent->scanReqEvt.scannerAddr[5]);
break;
}
case GAP_PHY_UPDATE_EVENT:
{
// PRINT("Phy update Rx:%x Tx:%x ..\n", pEvent->linkPhyUpdate.connRxPHYS, pEvent->linkPhyUpdate.connTxPHYS);
break;
}
default:
break;
}
}
/*********************************************************************
* @fn Peripheral_ProcessTMOSMsg
*
* @brief Process an incoming task message.
*
* @param pMsg - message to process
*
* @return none
*/
static void Peripheral_ProcessTMOSMsg(tmos_event_hdr_t *pMsg)
{
switch(pMsg->event)
{
case GAP_MSG_EVENT:
{
Peripheral_ProcessGAPMsg((gapRoleEvent_t *)pMsg);
break;
}
case GATT_MSG_EVENT:
{
gattMsgEvent_t *pMsgEvent;
pMsgEvent = (gattMsgEvent_t *)pMsg;
if(pMsgEvent->method == ATT_MTU_UPDATED_EVENT)
{
peripheralMTU = pMsgEvent->msg.exchangeMTUReq.clientRxMTU;
// PRINT("mtu exchange: %d\n", pMsgEvent->msg.exchangeMTUReq.clientRxMTU);
}
break;
}
default:
break;
}
}
/*********************************************************************
* @fn Peripheral_LinkEstablished
*
* @brief Process link established.
*
* @param pEvent - event to process
*
* @return none
*/
static void Peripheral_LinkEstablished(gapRoleEvent_t *pEvent)
{
gapEstLinkReqEvent_t *event = (gapEstLinkReqEvent_t *)pEvent;
// See if already connected
if(peripheralConnList.connHandle != GAP_CONNHANDLE_INIT)
{
GAPRole_TerminateLink(pEvent->linkCmpl.connectionHandle);
// PRINT("Connection max...\n");
}
else
{
peripheralConnList.connHandle = event->connectionHandle;
peripheralConnList.connInterval = event->connInterval;
peripheralConnList.connSlaveLatency = event->connLatency;
peripheralConnList.connTimeout = event->connTimeout;
peripheralMTU = ATT_MTU_SIZE;
// Set timer for periodic event
tmos_start_task(Peripheral_TaskID, SBP_PERIODIC_EVT, SBP_PERIODIC_EVT_PERIOD);
// Set timer for param update event
tmos_start_task(Peripheral_TaskID, SBP_PARAM_UPDATE_EVT, SBP_PARAM_UPDATE_DELAY);
// Start read rssi
tmos_start_task(Peripheral_TaskID, SBP_READ_RSSI_EVT, SBP_READ_RSSI_EVT_PERIOD);
// PRINT("Conn %x - Int %x \n", event->connectionHandle, event->connInterval);
}
}
/*********************************************************************
* @fn Peripheral_LinkTerminated
*
* @brief Process link terminated.
*
* @param pEvent - event to process
*
* @return none
*/
static void Peripheral_LinkTerminated(gapRoleEvent_t *pEvent)
{
gapTerminateLinkEvent_t *event = (gapTerminateLinkEvent_t *)pEvent;
if(event->connectionHandle == peripheralConnList.connHandle)
{
peripheralConnList.connHandle = GAP_CONNHANDLE_INIT;
peripheralConnList.connInterval = 0;
peripheralConnList.connSlaveLatency = 0;
peripheralConnList.connTimeout = 0;
tmos_stop_task(Peripheral_TaskID, SBP_PERIODIC_EVT);
tmos_stop_task(Peripheral_TaskID, SBP_READ_RSSI_EVT);
// Restart advertising
{
uint8_t advertising_enable = TRUE;
GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &advertising_enable);
}
}
else
{
// PRINT("ERR..\n");
}
}
/*********************************************************************
* @fn peripheralRssiCB
*
* @brief RSSI callback.
*
* @param connHandle - connection handle
* @param rssi - RSSI
*
* @return none
*/
static void peripheralRssiCB(uint16_t connHandle, int8_t rssi)
{
// PRINT("RSSI -%d dB Conn %x \n", -rssi, connHandle);
}
/*********************************************************************
* @fn peripheralParamUpdateCB
*
* @brief Parameter update complete callback
*
* @param connHandle - connect handle
* connInterval - connect interval
* connSlaveLatency - connect slave latency
* connTimeout - connect timeout
*
* @return none
*/
static void peripheralParamUpdateCB(uint16_t connHandle, uint16_t connInterval,
uint16_t connSlaveLatency, uint16_t connTimeout)
{
if(connHandle == peripheralConnList.connHandle)
{
peripheralConnList.connInterval = connInterval;
peripheralConnList.connSlaveLatency = connSlaveLatency;
peripheralConnList.connTimeout = connTimeout;
// PRINT("Update %x - Int %x \n", connHandle, connInterval);
}
else
{
// PRINT("ERR..\n");
}
}
/*********************************************************************
* @fn peripheralStateNotificationCB
*
* @brief Notification from the profile of a state change.
*
* @param newState - new state
*
* @return none
*/
static void peripheralStateNotificationCB(gapRole_States_t newState, gapRoleEvent_t *pEvent)
{
switch(newState & GAPROLE_STATE_ADV_MASK)
{
case GAPROLE_STARTED:
// PRINT("Initialized..\n");
break;
case GAPROLE_ADVERTISING:
if(pEvent->gap.opcode == GAP_LINK_TERMINATED_EVENT)
{
Peripheral_LinkTerminated(pEvent);
g_flag_bt_state = 0;
// PRINT("Disconnected.. Reason:%x\n", pEvent->linkTerminate.reason);
}
// PRINT("Advertising..\n");
break;
case GAPROLE_CONNECTED:
if(pEvent->gap.opcode == GAP_LINK_ESTABLISHED_EVENT)
{
Peripheral_LinkEstablished(pEvent);
}
g_flag_bt_state = 1;
// PRINT("Connected..\n");
break;
case GAPROLE_CONNECTED_ADV:
// PRINT("Connected Advertising..\n");
break;
case GAPROLE_WAITING:
if(pEvent->gap.opcode == GAP_END_DISCOVERABLE_DONE_EVENT)
{
// PRINT("Waiting for advertising..\n");
}
else if(pEvent->gap.opcode == GAP_LINK_TERMINATED_EVENT)
{
Peripheral_LinkTerminated(pEvent);
g_flag_bt_state = 0;
// PRINT("Disconnected.. Reason:%x\n", pEvent->linkTerminate.reason);
}
else if(pEvent->gap.opcode == GAP_LINK_ESTABLISHED_EVENT)
{
if(pEvent->gap.hdr.status != SUCCESS)
{
// PRINT("Waiting for advertising..\n");
}
else
{
// PRINT("Error..\n");
}
}
else
{
// PRINT("Error..%x\n", pEvent->gap.opcode);
}
break;
case GAPROLE_ERROR:
// PRINT("Error..\n");
g_flag_bt_state = 0;
break;
default:
break;
}
}
/*********************************************************************
* @fn performPeriodicTask
*
* @brief Perform a periodic application task. This function gets
* called every five seconds as a result of the SBP_PERIODIC_EVT
* TMOS event. In this example, the value of the third
* characteristic in the SimpleGATTProfile service is retrieved
* from the profile, and then copied into the value of the
* the fourth characteristic.
*
* @param none
*
* @return none
*/
static void performPeriodicTask(void)
{
// uint8_t notiData[SIMPLEPROFILE_CHAR4_LEN] = {0x88};
// peripheralChar4Notify(notiData, SIMPLEPROFILE_CHAR4_LEN);
if(g_flag_notify_temp){
g_flag_notify_temp = 0;
peripheralChar4Notify(g_notify_buftemp.buf, g_notify_buftemp.len);
clear_ble_notify_buf(&g_notify_buftemp);
}
}
/*********************************************************************
* @fn peripheralChar4Notify
*
* @brief Prepare and send simpleProfileChar4 notification
*
* @param pValue - data to notify
* len - length of data
*
* @return none
*/
static void peripheralChar4Notify(uint8_t *pValue, uint16_t len)
{
attHandleValueNoti_t noti;
if(len > (peripheralMTU - 3))
{
// PRINT("Too large noti\n");
return;
}
noti.len = len;
noti.pValue = GATT_bm_alloc(peripheralConnList.connHandle, ATT_HANDLE_VALUE_NOTI, noti.len, NULL, 0);
if(noti.pValue)
{
tmos_memcpy(noti.pValue, pValue, noti.len);
if(simpleProfile_Notify(peripheralConnList.connHandle, &noti) != SUCCESS)
{
GATT_bm_free((gattMsg_t *)&noti, ATT_HANDLE_VALUE_NOTI);
}
}
}
void Jump_OTA(void);
/*********************************************************************
* @fn simpleProfileChangeCB
*
* @brief Callback from SimpleBLEProfile indicating a value change
*
* @param paramID - parameter ID of the value that was changed.
* pValue - pointer to data that was changed
* len - length of data
*
* @return none
*/
static void simpleProfileChangeCB(uint8_t paramID, uint8_t *pValue, uint16_t len)
{
switch(paramID)
{
case SIMPLEPROFILE_CHAR1:
{
// uint8_t newValue[SIMPLEPROFILE_CHAR1_LEN];
// tmos_memcpy(newValue, pValue, len);
// PRINT("profile ChangeCB CHAR1.. \n");
g_ble_rcv_buf.len = len;
tmos_memcpy(g_ble_rcv_buf.buf, pValue, len);
g_ble_rcv_buf.flag = 1;
break;
}
case SIMPLEPROFILE_CHAR3:
{
// uint8_t newValue[SIMPLEPROFILE_CHAR3_LEN];
// tmos_memcpy(newValue, pValue, len);
g_ble_rcv_buf.len = len;
tmos_memcpy(g_ble_rcv_buf.buf, pValue, len);
// PRINT("profile ChangeCB CHAR3..len:%d,dat:%s.\n", len, g_ble_rcv_buf.buf);
if(g_ble_rcv_buf.buf[0] == 0x3F && g_ble_rcv_buf.buf[1] == 0xF3 && g_ble_rcv_buf.buf[2] == 0x23 &&
g_ble_rcv_buf.buf[3] == 'O' && g_ble_rcv_buf.buf[4] == 'T' && g_ble_rcv_buf.buf[5] == 'A'){
// 0x4F, 0x54, 0x41
// PRINT("jump OTA \n");
mDelaymS(5);
Jump_OTA();
}
break;
}
default:
// should not reach here!
break;
}
}
/* OTA 升级标志 */
#define IMAGE_OTA_FLAG 0x03
/* 存放在DataFlash地址,不能占用蓝牙的位置 */
#define OTA_DATAFLASH_ADD 0x00077000 - FLASH_ROM_MAX_SIZE
/* flash的数据临时存储 */
__attribute__((aligned(8))) uint8_t block_buf[16];
/*********************************************************************
* @fn Jump_OTA
*
* @brief 跳转OTA升级
*
* @return none
*/
void Jump_OTA(void)
{
uint16_t i;
uint32_t ver_flag;
/* 读取第一块 */
EEPROM_READ(OTA_DATAFLASH_ADD, (uint32_t *)&block_buf[0], 4);
/* 擦除第一块 */
EEPROM_ERASE(OTA_DATAFLASH_ADD, EEPROM_PAGE_SIZE);
/* 更新Image信息 */
block_buf[0] = IMAGE_OTA_FLAG;
/* 编程DataFlash */
EEPROM_WRITE(OTA_DATAFLASH_ADD, (uint32_t *)&block_buf[0], 4);
/* 软复位 */
SYS_ResetExecute();
}
/*********************************************************************
*********************************************************************/
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,31 @@
/*
* storage.c
*
* Created on: Aug 27, 2024
* Author: Thinkpad
*/
#include "storage.h"
#include "CH59x_common.h"
Loop_Balance_PlanB g_loop_balance_planB;
Loop_Cng_Unit g_loop_cng_unit;
Loop_Sens_List g_loop_sens_list;
void write_cfg_to_store(uint32_t wAddr, uint8_t * p, uint32_t len)
{
EEPROM_WRITE(wAddr, p, len);
}
void read_cfg_from_store(uint32_t addr, uint8_t *p, uint32_t len)
{
EEPROM_READ(addr, p, len);
}
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="com.mounriver.debug.gdbjtag.openocd.launchConfigurationType">
<booleanAttribute key="com.mounriver.debug.gdbjtag.openocd.doStartGdbServer" value="true"/>
<booleanAttribute key="com.mounriver.debug.gdbjtag.openocd.doFirstReset" value="true"/>
<booleanAttribute key="com.mounriver.debug.gdbjtag.openocd.enableSemihosting" value="false"/>
<booleanAttribute key="com.mounriver.debug.gdbjtag.openocd.enableSemihostingNew" value="false"/>
<booleanAttribute key="com.mounriver.debug.gdbjtag.openocd.doDebugInRam" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
<booleanAttribute key="com.mounriver.debug.gdbjtag.openocd.doContinue" value="true"/>
<booleanAttribute key="com.mounriver.debug.gdbjtag.openocd.doSecondReset" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
<booleanAttribute key="com.mounriver.debug.gdbjtag.openocd.doGdbServerAllocateConsole" value="true"/>
<booleanAttribute key="com.mounriver.debug.gdbjtag.openocd.doGdbServerAllocateTelnetConsole" value="false"/>
<booleanAttribute key="com.mounriver.debug.gdbjtag.openocd.doStartGdbCLient" value="true"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
<stringAttribute key="com.mounriver.debug.gdbjtag.openocd.gdbServerExecutable" value="${eclipse_home}toolchain/OpenOCD/bin/${openocd_executable}"/>
<stringAttribute key="com.mounriver.debug.gdbjtag.openocd.gdbServerTclPortNumber" value="6666"/>
<stringAttribute key="com.mounriver.debug.gdbjtag.openocd.gdbServerOther" value="-f &quot;${eclipse_home}toolchain/OpenOCD/bin/wch-riscv.cfg&quot;"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${eclipse_home}toolchain/RISC-V Embedded GCC/bin/riscv-none-embed-gdb.exe"/>
<stringAttribute key="com.mounriver.debug.gdbjtag.openocd.gdbClientOtherOptions" value=""/>
<stringAttribute key="com.mounriver.debug.gdbjtag.openocd.gdbClientOtherCommands" value="set mem inaccessible-by-default off&#xD;&#xA;set architecture riscv:rv32&#xD;&#xA;set remotetimeout unlimited"/>
<stringAttribute key="com.mounriver.debug.gdbjtag.openocd.firstResetType" value="init"/>
<stringAttribute key="com.mounriver.debug.gdbjtag.openocd.otherInitCommands" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
<stringAttribute key="com.mounriver.debug.gdbjtag.openocd.secondResetType" value="halt"/>
<stringAttribute key="com.mounriver.debug.gdbjtag.openocd.otherRunCommands" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="handle_reset"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
<stringAttribute key="com.mounriver.debug.gdbjtag.svdPath"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="obj/DLD110S_Peripheral_28K.elf"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="DLD110S_Peripheral_28K"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="GNU MCU OpenOCD"/>
<stringAttribute key="com.mounriver.debug.gdbjtag.openocd.gdbServerConnectionAddress" value=""/>
<stringAttribute key="com.mounriver.debug.gdbjtag.openocd.gdbServerLog" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?>\r\n&lt;memoryBlockExpressionList context=&quot;Context string&quot;/>\r\n"/>
<intAttribute key="com.mounriver.debug.gdbjtag.openocd.gdbServerGdbPortNumber" value="3333"/>
<intAttribute key="com.mounriver.debug.gdbjtag.openocd.gdbServerTelnetPortNumber" value="4444"/>
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/>
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="DLD110S_Peripheral_28K"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
</launchConfiguration>
@@ -0,0 +1,462 @@
{
"version": "1.0",
"hasAllParsed": true,
"isNormalMRSProject": true,
"basic": {
"chipInfo": {
"vendor": "WCH",
"toolchain": "RISC-V",
"series": "CH59X",
"rtos": "NoneOS",
"mcu": "CH591R",
"description": "",
"tempratureScope": "",
"artifactType": "executable",
"link": "WCH-Link",
"peripheral_version": "1.0",
"calibrateSupport": false,
"calibrateCommand": ""
},
"linkedFolders": [
{
"name": "HAL",
"location": "../HAL"
},
{
"name": "LIB",
"location": "../LIB"
},
{
"name": "RVMSIS",
"location": "../../SRC/RVMSIS"
},
{
"name": "StdPeriphDriver",
"location": "../../SRC/StdPeriphDriver"
}
],
"removedResources": [
{
"parentLogicPath": "",
"type": "file",
"name": "*.wvproj"
}
],
"projectName": "DLD110S_Peripheral_28K",
"architecture": "RISC-V",
"projectType": "c"
},
"buildConfig": {
"configurations": [
{
"buildArtifact": {
"artifact_name": "${ProjName}",
"artifact_extension": "elf",
"output_prefix": "",
"artifact_type": "Executable"
},
"parallelizationNumber": "optimal",
"stop_on_first_build_error": true,
"pre_script": "",
"pre_script_description": "",
"post_script": "",
"post_script_description": "",
"excludeResources": [
"${project}/HAL/Profile",
"${project}/HAL/KEY.c",
"${project}/HAL/LED.c",
"${project}/StdPeriphDriver/CH59x_lcd.c",
"${project}/StdPeriphDriver/CH59x_uart1.c",
"${project}/StdPeriphDriver/CH59x_usbdev.c",
"${project}/StdPeriphDriver/CH59x_usbhostClass.c",
"${project}/StdPeriphDriver/CH59x_usbhostBase.c",
"${project}/StdPeriphDriver/CH59x_pwm.c",
"${project}/StdPeriphDriver/CH59x_spi0.c",
"${project}/StdPeriphDriver/CH59x_timer2.c",
"${project}/StdPeriphDriver/CH59x_timer3.c",
"${project}/StdPeriphDriver/CH59x_uart2.c",
"${project}/StdPeriphDriver/CH59x_uart3.c"
],
"optimization": {
"level": "size",
"message_length": true,
"char_is_signed": true,
"function_sections": true,
"data_sections": true,
"no_common_unitialized": true,
"do_not_inline_functions": false,
"assume_freestanding_environment": false,
"disable_builtin": false,
"single_precision_constants": false,
"position_independent_code": false,
"link_time_optimizer": false,
"disable_loop_invariant_move": false,
"optimize_unused_sections_declared_as_high_code": false,
"code_generation_without_hardware_floating": false,
"use_pipelines": false,
"show_caret_indicating_the_column": false,
"calling_convention_variant": false,
"other_optimization_flags": ""
},
"warnings": {
"check_syntax_only": false,
"pedantic": false,
"pedantic_warnings_as_errors": false,
"inhibit_all_warnings": false,
"warn_on_various_unused_elements": false,
"warn_on_uninitialized_variables": false,
"enable_all_common_warnings": false,
"enable_extra_warnings": false,
"warn_on_undeclared_global_function": false,
"warn_on_implicit_conversions": false,
"warn_if_pointer_arthmetic": false,
"warn_if_padding_is_included": false,
"warn_if_shadowed_variable": false,
"warn_if_suspicious_logical_ops": false,
"warn_if_struct_is_returned": false,
"warn_if_floats_are_compared_as_equal": false,
"generate_errors_instead_of_warnings": false,
"other_warning_flags": ""
},
"debugging": {
"debug_level": "default",
"debug_format": "default",
"generate_prof_information": false,
"generate_gprof_information": false,
"other_debugging_flags": ""
},
"assembler": {
"preprocessor": {
"use_preprocessor": true,
"do_not_search_system_directories": false,
"preprocess_only": false,
"defined_symbols": [],
"undefined_symbols": []
},
"includes": {
"include_paths": [],
"include_system_paths": [],
"include_files": []
},
"other_warning_flags": "",
"miscellaneous": {
"assembler_flags": [],
"generate_assembler_listing": false,
"save_temporary_files": false,
"verbose": false,
"other_assembler_flags": ""
}
},
"ccompiler": {
"preprocessor": {
"do_not_search_system_directories": false,
"preprocess_only": false,
"defined_symbols": [
"CH59xBLE_ROM=1",
"LIB_FLASH_BASE_ADDRESSS=0x0000C000"
],
"undefined_symbols": []
},
"includes": {
"include_paths": [
"${project}/Startup",
"${project}/APP/include",
"${project}/Profile/include",
"${project}/StdPeriphDriver/inc",
"${project}/HAL/include",
"${project}/Ld",
"${project}/LIB",
"${project}/RVMSIS"
],
"include_system_paths": [],
"include_files": []
},
"optimization": {
"language_standard": "gnu99",
"other_optimization_flags": ""
},
"warnings": {
"warn_if_a_global_function_has_no_prototype": false,
"warn_if_a_function_has_no_arg_type": false,
"warn_if_wrong_cast": false,
"other_warning_flags": ""
},
"miscellaneous": {
"generate_assembler_listing": false,
"save_temporary_files": false,
"verbose": false,
"other_compiler_flags": ""
}
},
"cppcompiler": {
"preprocessor": {
"do_not_search_system_directories": false,
"do_not_search_system_cpp_directories": false,
"preprocess_only": false,
"defined_symbols": [],
"undefined_symbols": []
},
"includes": {
"include_paths": [],
"include_system_paths": [],
"include_files": []
},
"optimization": {
"cpp_language_standard": "gnucpp11",
"abi_version": "0",
"do_not_use_exceptions": false,
"do_not_use_rtti": false,
"do_not_use__cxa_atexit": false,
"do_not_use_thread_safe_statics": false,
"other_optimization_flags": ""
},
"warnings": {
"warn_on_abi_violations": false,
"warn_on_class_privacy": false,
"warn_on_no_except_expressions": false,
"warn_on_virtual_destructors": false,
"warn_on_uncast_null": false,
"warn_on_sign_promotion": false,
"warn_about_effictive_cpp_violcations": false,
"other_warning_flags": ""
},
"miscellaneous": {
"generate_assembler_listing": false,
"save_temporary_files": false,
"verbose": false,
"other_compiler_flags": ""
}
},
"clinker": {
"general": {
"scriptFiles": [
"${project}/Ld/Link.ld"
],
"do_not_use_standard_start_files": true,
"do_not_use_default_libraries": false,
"no_startup_or_default_libs": false,
"remove_unused_sections": true,
"print_removed_sections": false,
"omit_all_symbol_information": false
},
"libraries": {
"libraries": [
"ISP592"
],
"library_search_path": [
"../",
"${project}/StdPeriphDriver"
]
},
"miscellaneous": {
"picolibc": "disabled",
"linker_flags": [
"--print-memory-usage"
],
"other_objects": [],
"generate_map": "\"${BuildArtifactFileBaseName}.map\"",
"cross_reference": false,
"print_link_map": false,
"use_newlib_nano": true,
"use_float_with_nano_printf": false,
"use_float_with_nano_scanf": false,
"do_not_use_syscalls": true,
"verbose": false,
"use_wch_printffloat": false,
"use_wch_printf": false,
"use_iqmath": false,
"other_linker_flags": ""
}
},
"cpplinker": {
"general": {
"scriptFiles": [
"${project}/Ld/Link.ld"
],
"do_not_use_standard_start_files": true,
"do_not_use_default_libraries": false,
"no_startup_or_default_libs": false,
"remove_unused_sections": true,
"print_removed_sections": false,
"omit_all_symbol_information": false
},
"libraries": {
"libraries": [
"ISP592"
],
"library_search_path": [
"../",
"${project}/StdPeriphDriver"
]
},
"miscellaneous": {
"picolibc": "disabled",
"linker_flags": [
"--print-memory-usage"
],
"other_objects": [],
"generate_map": "\"${BuildArtifactFileBaseName}.map\"",
"cross_reference": false,
"print_link_map": false,
"use_newlib_nano": true,
"use_float_with_nano_printf": false,
"use_float_with_nano_scanf": false,
"do_not_use_syscalls": true,
"verbose": false,
"use_wch_printffloat": false,
"use_wch_printf": false,
"use_iqmath": false,
"other_linker_flags": ""
}
},
"archiver": {
"archiver_flags": "-r",
"libOutputPrefix": "lib"
},
"createFlash": {
"enabled": true,
"outputFileFormat": "ihex",
"copy_only_section_text": false,
"copy_only_section_data": false,
"copy_only_sections": [],
"other_flags": ""
},
"createList": {
"enabled": true,
"display_source": true,
"display_all_headers": true,
"demangle_names": true,
"display_debug_info": false,
"disassemble": false,
"display_file_headers": false,
"display_line_numbers": true,
"display_relocation_info": false,
"display_symbols": false,
"wide_lines": true,
"other_flags": ""
},
"printSize": {
"enabled": true,
"size_format": "berkeley",
"hex": false,
"show_totals": false,
"other_flags": ""
},
"configVariables": [],
"riscvTargetProcessor": {
"architecture": "rv32i",
"multiply_extension": true,
"atomic_extension": true,
"floating_point": "none",
"compressed_extension": true,
"extra_compressed_extension": false,
"bit_extension": false,
"multiplication_subset_of_the_M_extension": false,
"vector_cryptography_extensions": "",
"integer_ABI": "ilp32",
"floating_point_ABI": "none",
"tuning": "default",
"code_model": "any",
"small_data_limit": 8,
"align": "default",
"save_restore": false,
"other_target_flags": ""
},
"component_toolchain": "${WCH:Toolchain:GCC8}",
"name": "obj"
}
]
},
"flashConfig": {
"mcutype": "CH59x",
"address": "0x00000000",
"target_path": "",
"clkSpeed": "High",
"debug_interface_mode": "1-wire serial",
"erase": false,
"program": false,
"verify": false,
"reset": false,
"sdiPrintf": false,
"disablepowerout": false,
"clearcodeflash": false,
"disablecodeprotect": false,
"exepath": "",
"exearguments": ""
},
"debugConfigurations": {
"openOCDCfg": {
"useLocalOpenOCD": true,
"executable": "${WCH:OpenOCD:default}",
"gdbport": 3333,
"telnetport": 4444,
"tclport": 6666,
"configOptions": [
"-f \"${WCH:OpenOCD:default}/bin/wch-riscv.cfg\""
],
"host": "localhost",
"port": 3333,
"skipDownloadBeforeDebug": false,
"enablePageEraser": false,
"enableNoZeroWaitingAreaFlash": false
},
"gdbCfg": {
"executable": "${WCH:Toolchain:GCC8}",
"options": [],
"commands": [
"set mem inaccessible-by-default off",
"set architecture riscv:rv32",
"set remotetimeout unlimited"
]
},
"startup": {
"initCommands": {
"initReset": true,
"initResetType": "init",
"additionalCommands": [],
"armSemihosting": false,
"armSemihosting_old": false
},
"loadedFiles": {
"loadSymbols": true,
"useProjBinaryForSymbols": true,
"useFileForSymbols": false,
"symbolFile": "",
"symbolFileOffset": "",
"loadImage": true,
"useProjBinaryForImage": true,
"useFileForImage": false,
"executableFile": "",
"executableFileOffset": ""
},
"runCommands": {
"runReset": true,
"runResetType": "halt",
"additionalCommands": [],
"setBreakAt": "handle_reset",
"continue": true,
"setBreak": true,
"setProgramCounter": false,
"setProgramCounterAddress": ""
},
"debugInRAM": false
},
"svdpath": null,
"output": {
"showDebugGDBTrace": true,
"saveDebugOutputToFile": false,
"showDebugOutputTimestamps": true
},
"reserve": {
"PROGRAM_NAME": "obj/DLD110S_Peripheral_28K.elf",
"PROJECT_ATTR": "DLD110S_Peripheral_28K",
"PROJECT_BUILD_CONFIG_AUTO_ATTR": true,
"PROJECT_BUILD_CONFIG_ID_ATTR": "",
"ATTR_BUILD_BEFORE_LAUNCH_ATTR": 2,
"GdbServerAllocateConsole": true,
"GdbServerAllocateTelnetConsole": false,
"StartGdbCLient": true,
"UPDATE_THREADLIST_ON_SUSPEND": false
}
}
}
+187
View File
@@ -0,0 +1,187 @@
ENTRY( _start )
__stack_size = 512;
PROVIDE( _stack_size = __stack_size );
MEMORY
{
FLASH (rx) : ORIGIN = 0x00001000, LENGTH = 28K
RAM (xrw) : ORIGIN = 0x20002000, LENGTH = 18K
}
PROVIDE( __global_pointer$ = 0x20002000 );
SECTIONS
{
.init :
{
_sinit = .;
. = ALIGN(4);
KEEP(*(SORT_NONE(.init)))
KEEP(*(.ImageFlag))
KEEP(*(.ImageFlag.*))
. = ALIGN(4);
_einit = .;
} >FLASH AT>FLASH
/* .vector :
{
*(.vector);
} >FLASH AT>FLASH */
.highcodelalign :
{
. = ALIGN(4);
PROVIDE(_highcode_lma = .);
} >FLASH AT>FLASH
.highcode :
{
. = ALIGN(4);
PROVIDE(_highcode_vma_start = .);
*(.vector);
KEEP(*(SORT_NONE(.vector_handler)))
*(.highcode);
*(.highcode.*);
. = ALIGN(4);
PROVIDE(_highcode_vma_end = .);
} >RAM AT>FLASH
.text :
{
. = ALIGN(4);
KEEP(*(SORT_NONE(.handle_reset)))
*(.text)
*(.text.*)
*(.rodata)
*(.rodata*)
*(.sdata2.*)
*(.glue_7)
*(.glue_7t)
*(.gnu.linkonce.t.*)
. = ALIGN(4);
} >FLASH AT>FLASH
.fini :
{
KEEP(*(SORT_NONE(.fini)))
. = ALIGN(4);
} >FLASH AT>FLASH
PROVIDE( _etext = . );
PROVIDE( _eitcm = . );
.preinit_array :
{
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
} >FLASH AT>FLASH
.init_array :
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
PROVIDE_HIDDEN (__init_array_end = .);
} >FLASH AT>FLASH
.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
PROVIDE_HIDDEN (__fini_array_end = .);
} >FLASH AT>FLASH
.ctors :
{
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin.o(.ctors))
KEEP (*crtbegin?.o(.ctors))
/* We don't want to include the .ctor section from
the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
} >FLASH AT>FLASH
.dtors :
{
KEEP (*crtbegin.o(.dtors))
KEEP (*crtbegin?.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
} >FLASH AT>FLASH
.dalign :
{
. = ORIGIN(RAM) + SIZEOF(.highcode);
} >RAM AT>FLASH
.dlalign :
{
. = ALIGN(4);
PROVIDE(_data_lma = .);
} >FLASH AT>FLASH
.data :
{
. = ALIGN(4);
PROVIDE(_data_vma = .);
*(.gnu.linkonce.r.*)
*(.data .data.*)
*(.gnu.linkonce.d.*)
. = ALIGN(8);
*(.sdata .sdata.*)
*(.gnu.linkonce.s.*)
. = ALIGN(8);
*(.srodata.cst16)
*(.srodata.cst8)
*(.srodata.cst4)
*(.srodata.cst2)
*(.srodata .srodata.*)
. = ALIGN(4);
PROVIDE( _edata = .);
} >RAM AT>FLASH
.bss :
{
. = ALIGN(4);
PROVIDE( _sbss = .);
*(.sbss*)
*(.gnu.linkonce.sb.*)
*(.bss*)
*(.gnu.linkonce.b.*)
*(COMMON*)
. = ALIGN(4);
PROVIDE( _ebss = .);
} >RAM AT>FLASH
PROVIDE( _end = _ebss);
PROVIDE( end = . );
.stack ORIGIN(RAM) + LENGTH(RAM) - __stack_size :
{
PROVIDE( _heap_end = . );
. = ALIGN(4);
PROVIDE(_susrstack = . );
. = . + __stack_size;
PROVIDE( _eusrstack = .);
} >RAM
}
@@ -0,0 +1,589 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : devinfoservice.c
* Author : WCH
* Version : V1.0
* Date : 2018/12/10
* Description : É豸ÐÅÏ¢·þÎñ
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
/*********************************************************************
* INCLUDES
*/
#include "CONFIG.h"
#include "devinfoservice.h"
/*********************************************************************
* MACROS
*/
/*********************************************************************
* CONSTANTS
*/
/*********************************************************************
* TYPEDEFS
*/
/*********************************************************************
* GLOBAL VARIABLES
*/
// Device information service
const uint8_t devInfoServUUID[ATT_BT_UUID_SIZE] = {
LO_UINT16(DEVINFO_SERV_UUID), HI_UINT16(DEVINFO_SERV_UUID)};
// System ID
const uint8_t devInfoSystemIdUUID[ATT_BT_UUID_SIZE] = {
LO_UINT16(SYSTEM_ID_UUID), HI_UINT16(SYSTEM_ID_UUID)};
// Model Number String
const uint8_t devInfoModelNumberUUID[ATT_BT_UUID_SIZE] = {
LO_UINT16(MODEL_NUMBER_UUID), HI_UINT16(MODEL_NUMBER_UUID)};
// Serial Number String
const uint8_t devInfoSerialNumberUUID[ATT_BT_UUID_SIZE] = {
LO_UINT16(SERIAL_NUMBER_UUID), HI_UINT16(SERIAL_NUMBER_UUID)};
// Firmware Revision String
const uint8_t devInfoFirmwareRevUUID[ATT_BT_UUID_SIZE] = {
LO_UINT16(FIRMWARE_REV_UUID), HI_UINT16(FIRMWARE_REV_UUID)};
// Hardware Revision String
const uint8_t devInfoHardwareRevUUID[ATT_BT_UUID_SIZE] = {
LO_UINT16(HARDWARE_REV_UUID), HI_UINT16(HARDWARE_REV_UUID)};
// Software Revision String
const uint8_t devInfoSoftwareRevUUID[ATT_BT_UUID_SIZE] = {
LO_UINT16(SOFTWARE_REV_UUID), HI_UINT16(SOFTWARE_REV_UUID)};
// Manufacturer Name String
const uint8_t devInfoMfrNameUUID[ATT_BT_UUID_SIZE] = {
LO_UINT16(MANUFACTURER_NAME_UUID), HI_UINT16(MANUFACTURER_NAME_UUID)};
// IEEE 11073-20601 Regulatory Certification Data List
const uint8_t devInfo11073CertUUID[ATT_BT_UUID_SIZE] = {
LO_UINT16(IEEE_11073_CERT_DATA_UUID), HI_UINT16(IEEE_11073_CERT_DATA_UUID)};
// PnP ID
const uint8_t devInfoPnpIdUUID[ATT_BT_UUID_SIZE] = {
LO_UINT16(PNP_ID_UUID), HI_UINT16(PNP_ID_UUID)};
/*********************************************************************
* EXTERNAL VARIABLES
*/
/*********************************************************************
* EXTERNAL FUNCTIONS
*/
/*********************************************************************
* LOCAL VARIABLES
*/
/*********************************************************************
* Profile Attributes - variables
*/
// Device Information Service attribute
static const gattAttrType_t devInfoService = {ATT_BT_UUID_SIZE, devInfoServUUID};
// System ID characteristic
static uint8_t devInfoSystemIdProps = GATT_PROP_READ;
static uint8_t devInfoSystemId[DEVINFO_SYSTEM_ID_LEN] = {0, 0, 0, 0, 0, 0, 0, 0};
// Model Number String characteristic
static uint8_t devInfoModelNumberProps = GATT_PROP_READ;
static const uint8_t devInfoModelNumber[] = "Model Number";
// Serial Number String characteristic
static uint8_t devInfoSerialNumberProps = GATT_PROP_READ;
static const uint8_t devInfoSerialNumber[] = "Serial Number";
// Firmware Revision String characteristic
static uint8_t devInfoFirmwareRevProps = GATT_PROP_READ;
static const uint8_t devInfoFirmwareRev[] = "Firmware Revision";
// Hardware Revision String characteristic
static uint8_t devInfoHardwareRevProps = GATT_PROP_READ;
static const uint8_t devInfoHardwareRev[] = "Hardware Revision";
// Software Revision String characteristic
static uint8_t devInfoSoftwareRevProps = GATT_PROP_READ;
static const uint8_t devInfoSoftwareRev[] = "Software Revision";
// Manufacturer Name String characteristic
static uint8_t devInfoMfrNameProps = GATT_PROP_READ;
static const uint8_t devInfoMfrName[] = "Manufacturer Name";
// IEEE 11073-20601 Regulatory Certification Data List characteristic
static uint8_t devInfo11073CertProps = GATT_PROP_READ;
static const uint8_t devInfo11073Cert[] = {
DEVINFO_11073_BODY_EXP, // authoritative body type
0x00, // authoritative body structure type
// authoritative body data follows below:
'e', 'x', 'p', 'e', 'r', 'i', 'm', 'e', 'n', 't', 'a', 'l'};
// System ID characteristic
static uint8_t devInfoPnpIdProps = GATT_PROP_READ;
static uint8_t devInfoPnpId[DEVINFO_PNP_ID_LEN] = {
1, // Vendor ID source (1=Bluetooth SIG)
LO_UINT16(0x07D7), HI_UINT16(0x07D7), // Vendor ID (WCH)
LO_UINT16(0x0000), HI_UINT16(0x0000), // Product ID (vendor-specific)
LO_UINT16(0x0110), HI_UINT16(0x0110) // Product version (JJ.M.N)
};
/*********************************************************************
* Profile Attributes - Table
*/
static gattAttribute_t devInfoAttrTbl[] = {
// Device Information Service
{
{ATT_BT_UUID_SIZE, primaryServiceUUID}, /* type */
GATT_PERMIT_READ, /* permissions */
0, /* handle */
(uint8_t *)&devInfoService /* pValue */
},
// System ID Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&devInfoSystemIdProps},
// System ID Value
{
{ATT_BT_UUID_SIZE, devInfoSystemIdUUID},
GATT_PERMIT_READ,
0,
(uint8_t *)devInfoSystemId},
// Model Number String Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&devInfoModelNumberProps},
// Model Number Value
{
{ATT_BT_UUID_SIZE, devInfoModelNumberUUID},
GATT_PERMIT_READ,
0,
(uint8_t *)devInfoModelNumber},
// Serial Number String Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&devInfoSerialNumberProps},
// Serial Number Value
{
{ATT_BT_UUID_SIZE, devInfoSerialNumberUUID},
GATT_PERMIT_READ,
0,
(uint8_t *)devInfoSerialNumber},
// Firmware Revision String Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&devInfoFirmwareRevProps},
// Firmware Revision Value
{
{ATT_BT_UUID_SIZE, devInfoFirmwareRevUUID},
GATT_PERMIT_READ,
0,
(uint8_t *)devInfoFirmwareRev},
// Hardware Revision String Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&devInfoHardwareRevProps},
// Hardware Revision Value
{
{ATT_BT_UUID_SIZE, devInfoHardwareRevUUID},
GATT_PERMIT_READ,
0,
(uint8_t *)devInfoHardwareRev},
// Software Revision String Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&devInfoSoftwareRevProps},
// Software Revision Value
{
{ATT_BT_UUID_SIZE, devInfoSoftwareRevUUID},
GATT_PERMIT_READ,
0,
(uint8_t *)devInfoSoftwareRev},
// Manufacturer Name String Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&devInfoMfrNameProps},
// Manufacturer Name Value
{
{ATT_BT_UUID_SIZE, devInfoMfrNameUUID},
GATT_PERMIT_READ,
0,
(uint8_t *)devInfoMfrName},
// IEEE 11073-20601 Regulatory Certification Data List Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&devInfo11073CertProps},
// IEEE 11073-20601 Regulatory Certification Data List Value
{
{ATT_BT_UUID_SIZE, devInfo11073CertUUID},
GATT_PERMIT_READ,
0,
(uint8_t *)devInfo11073Cert},
// PnP ID Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&devInfoPnpIdProps},
// PnP ID Value
{
{ATT_BT_UUID_SIZE, devInfoPnpIdUUID},
GATT_PERMIT_READ,
0,
(uint8_t *)devInfoPnpId}
};
/*********************************************************************
* LOCAL FUNCTIONS
*/
static bStatus_t devInfo_ReadAttrCB(uint16_t connHandle, gattAttribute_t *pAttr,
uint8_t *pValue, uint16_t *pLen, uint16_t offset, uint16_t maxLen, uint8_t method);
/*********************************************************************
* PROFILE CALLBACKS
*/
// Device Info Service Callbacks
gattServiceCBs_t devInfoCBs = {
devInfo_ReadAttrCB, // Read callback function pointer
NULL, // Write callback function pointer
NULL // Authorization callback function pointer
};
/*********************************************************************
* NETWORK LAYER CALLBACKS
*/
/*********************************************************************
* PUBLIC FUNCTIONS
*/
/*********************************************************************
* @fn DevInfo_AddService
*
* @brief Initializes the Device Information service by registering
* GATT attributes with the GATT server.
*
* @return Success or Failure
*/
bStatus_t DevInfo_AddService(void)
{
// Register GATT attribute list and CBs with GATT Server App
return GATTServApp_RegisterService(devInfoAttrTbl,
GATT_NUM_ATTRS(devInfoAttrTbl),
GATT_MAX_ENCRYPT_KEY_SIZE,
&devInfoCBs);
}
/*********************************************************************
* @fn DevInfo_SetParameter
*
* @brief Set a Device Information parameter.
*
* @param param - Profile parameter ID
* @param len - length of data to write
* @param value - pointer to data to write. This is dependent on
* the parameter ID and WILL be cast to the appropriate
* data type (example: data type of uint16_t will be cast to
* uint16_t pointer).
*
* @return bStatus_t
*/
bStatus_t DevInfo_SetParameter(uint8_t param, uint8_t len, void *value)
{
bStatus_t ret = SUCCESS;
switch(param)
{
case DEVINFO_SYSTEM_ID:
tmos_memcpy(devInfoSystemId, value, len);
break;
default:
ret = INVALIDPARAMETER;
break;
}
return (ret);
}
/*********************************************************************
* @fn DevInfo_GetParameter
*
* @brief Get a Device Information parameter.
*
* @param param - Profile parameter ID
* @param value - pointer to data to get. This is dependent on
* the parameter ID and WILL be cast to the appropriate
* data type (example: data type of uint16_t will be cast to
* uint16_t pointer).
*
* @return bStatus_t
*/
bStatus_t DevInfo_GetParameter(uint8_t param, void *value)
{
bStatus_t ret = SUCCESS;
switch(param)
{
case DEVINFO_SYSTEM_ID:
tmos_memcpy(value, devInfoSystemId, sizeof(devInfoSystemId));
break;
case DEVINFO_MODEL_NUMBER:
tmos_memcpy(value, devInfoModelNumber, sizeof(devInfoModelNumber));
break;
case DEVINFO_SERIAL_NUMBER:
tmos_memcpy(value, devInfoSerialNumber, sizeof(devInfoSerialNumber));
break;
case DEVINFO_FIRMWARE_REV:
tmos_memcpy(value, devInfoFirmwareRev, sizeof(devInfoFirmwareRev));
break;
case DEVINFO_HARDWARE_REV:
tmos_memcpy(value, devInfoHardwareRev, sizeof(devInfoHardwareRev));
break;
case DEVINFO_SOFTWARE_REV:
tmos_memcpy(value, devInfoSoftwareRev, sizeof(devInfoSoftwareRev));
break;
case DEVINFO_MANUFACTURER_NAME:
tmos_memcpy(value, devInfoMfrName, sizeof(devInfoMfrName));
break;
case DEVINFO_11073_CERT_DATA:
tmos_memcpy(value, devInfo11073Cert, sizeof(devInfo11073Cert));
break;
case DEVINFO_PNP_ID:
tmos_memcpy(value, devInfoPnpId, sizeof(devInfoPnpId));
break;
default:
ret = INVALIDPARAMETER;
break;
}
return (ret);
}
/*********************************************************************
* @fn devInfo_ReadAttrCB
*
* @brief Read an attribute.
*
* @param connHandle - connection message was received on
* @param pAttr - pointer to attribute
* @param pValue - pointer to data to be read
* @param pLen - length of data to be read
* @param offset - offset of the first octet to be read
* @param maxLen - maximum length of data to be read
*
* @return Success or Failure
*/
static bStatus_t devInfo_ReadAttrCB(uint16_t connHandle, gattAttribute_t *pAttr,
uint8_t *pValue, uint16_t *pLen, uint16_t offset, uint16_t maxLen, uint8_t method)
{
bStatus_t status = SUCCESS;
uint16_t uuid = BUILD_UINT16(pAttr->type.uuid[0], pAttr->type.uuid[1]);
switch(uuid)
{
case SYSTEM_ID_UUID:
// verify offset
if(offset >= sizeof(devInfoSystemId))
{
status = ATT_ERR_INVALID_OFFSET;
}
else
{
// determine read length
*pLen = MIN(maxLen, (sizeof(devInfoSystemId) - offset));
// copy data
tmos_memcpy(pValue, &devInfoSystemId[offset], *pLen);
}
break;
case MODEL_NUMBER_UUID:
// verify offset
if(offset >= (sizeof(devInfoModelNumber) - 1))
{
status = ATT_ERR_INVALID_OFFSET;
}
else
{
// determine read length (exclude null terminating character)
*pLen = MIN(maxLen, ((sizeof(devInfoModelNumber) - 1) - offset));
// copy data
tmos_memcpy(pValue, &devInfoModelNumber[offset], *pLen);
}
break;
case SERIAL_NUMBER_UUID:
// verify offset
if(offset >= (sizeof(devInfoSerialNumber) - 1))
{
status = ATT_ERR_INVALID_OFFSET;
}
else
{
// determine read length (exclude null terminating character)
*pLen = MIN(maxLen, ((sizeof(devInfoSerialNumber) - 1) - offset));
// copy data
tmos_memcpy(pValue, &devInfoSerialNumber[offset], *pLen);
}
break;
case FIRMWARE_REV_UUID:
// verify offset
if(offset >= (sizeof(devInfoFirmwareRev) - 1))
{
status = ATT_ERR_INVALID_OFFSET;
}
else
{
// determine read length (exclude null terminating character)
*pLen = MIN(maxLen, ((sizeof(devInfoFirmwareRev) - 1) - offset));
// copy data
tmos_memcpy(pValue, &devInfoFirmwareRev[offset], *pLen);
}
break;
case HARDWARE_REV_UUID:
// verify offset
if(offset >= (sizeof(devInfoHardwareRev) - 1))
{
status = ATT_ERR_INVALID_OFFSET;
}
else
{
// determine read length (exclude null terminating character)
*pLen = MIN(maxLen, ((sizeof(devInfoHardwareRev) - 1) - offset));
// copy data
tmos_memcpy(pValue, &devInfoHardwareRev[offset], *pLen);
}
break;
case SOFTWARE_REV_UUID:
// verify offset
if(offset >= (sizeof(devInfoSoftwareRev) - 1))
{
status = ATT_ERR_INVALID_OFFSET;
}
else
{
// determine read length (exclude null terminating character)
*pLen = MIN(maxLen, ((sizeof(devInfoSoftwareRev) - 1) - offset));
// copy data
tmos_memcpy(pValue, &devInfoSoftwareRev[offset], *pLen);
}
break;
case MANUFACTURER_NAME_UUID:
// verify offset
if(offset >= (sizeof(devInfoMfrName) - 1))
{
status = ATT_ERR_INVALID_OFFSET;
}
else
{
// determine read length (exclude null terminating character)
*pLen = MIN(maxLen, ((sizeof(devInfoMfrName) - 1) - offset));
// copy data
tmos_memcpy(pValue, &devInfoMfrName[offset], *pLen);
}
break;
case IEEE_11073_CERT_DATA_UUID:
// verify offset
if(offset >= sizeof(devInfo11073Cert))
{
status = ATT_ERR_INVALID_OFFSET;
}
else
{
// determine read length
*pLen = MIN(maxLen, (sizeof(devInfo11073Cert) - offset));
// copy data
tmos_memcpy(pValue, &devInfo11073Cert[offset], *pLen);
}
break;
case PNP_ID_UUID:
// verify offset
if(offset >= sizeof(devInfoPnpId))
{
status = ATT_ERR_INVALID_OFFSET;
}
else
{
// determine read length
*pLen = MIN(maxLen, (sizeof(devInfoPnpId) - offset));
// copy data
tmos_memcpy(pValue, &devInfoPnpId[offset], *pLen);
}
break;
default:
*pLen = 0;
status = ATT_ERR_ATTR_NOT_FOUND;
break;
}
return (status);
}
/*********************************************************************
*********************************************************************/
@@ -0,0 +1,730 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : gattprofile.C
* Author : WCH
* Version : V1.0
* Date : 2018/12/10
* Description : 自定义包含五种不同属性的服务,包含可读、可写、通知、可读可写、安全可读
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
/*********************************************************************
* INCLUDES
*/
#include "CONFIG.h"
#include "gattprofile.h"
/*********************************************************************
* MACROS
*/
/*********************************************************************
* CONSTANTS
*/
// Position of simpleProfilechar4 value in attribute array
#define SIMPLEPROFILE_CHAR4_VALUE_POS 11
/*********************************************************************
* TYPEDEFS
*/
/*********************************************************************
* GLOBAL VARIABLES
*/
// Simple GATT Profile Service UUID: 0xFFF0
const uint8_t simpleProfileServUUID[ATT_BT_UUID_SIZE] = {
LO_UINT16(SIMPLEPROFILE_SERV_UUID), HI_UINT16(SIMPLEPROFILE_SERV_UUID)};
// Characteristic 1 UUID: 0xFFF1
const uint8_t simpleProfilechar1UUID[ATT_BT_UUID_SIZE] = {
LO_UINT16(SIMPLEPROFILE_CHAR1_UUID), HI_UINT16(SIMPLEPROFILE_CHAR1_UUID)};
// Characteristic 2 UUID: 0xFFF2
const uint8_t simpleProfilechar2UUID[ATT_BT_UUID_SIZE] = {
LO_UINT16(SIMPLEPROFILE_CHAR2_UUID), HI_UINT16(SIMPLEPROFILE_CHAR2_UUID)};
// Characteristic 3 UUID: 0xFFF3
const uint8_t simpleProfilechar3UUID[ATT_BT_UUID_SIZE] = {
LO_UINT16(SIMPLEPROFILE_CHAR3_UUID), HI_UINT16(SIMPLEPROFILE_CHAR3_UUID)};
// Characteristic 4 UUID: 0xFFF4
const uint8_t simpleProfilechar4UUID[ATT_BT_UUID_SIZE] = {
LO_UINT16(SIMPLEPROFILE_CHAR4_UUID), HI_UINT16(SIMPLEPROFILE_CHAR4_UUID)};
// Characteristic 5 UUID: 0xFFF5
const uint8_t simpleProfilechar5UUID[ATT_BT_UUID_SIZE] = {
LO_UINT16(SIMPLEPROFILE_CHAR5_UUID), HI_UINT16(SIMPLEPROFILE_CHAR5_UUID)};
/*********************************************************************
* EXTERNAL VARIABLES
*/
/*********************************************************************
* EXTERNAL FUNCTIONS
*/
/*********************************************************************
* LOCAL VARIABLES
*/
static simpleProfileCBs_t *simpleProfile_AppCBs = NULL;
/*********************************************************************
* Profile Attributes - variables
*/
// Simple Profile Service attribute
static const gattAttrType_t simpleProfileService = {ATT_BT_UUID_SIZE, simpleProfileServUUID};
// Simple Profile Characteristic 1 Properties
static uint8_t simpleProfileChar1Props = GATT_PROP_READ | GATT_PROP_WRITE;
// Characteristic 1 Value
static uint8_t simpleProfileChar1[SIMPLEPROFILE_CHAR1_LEN] = {0};
// Simple Profile Characteristic 1 User Description
static uint8_t simpleProfileChar1UserDesp[] = "Characteristic 1\0";
// Simple Profile Characteristic 2 Properties
static uint8_t simpleProfileChar2Props = GATT_PROP_READ;
// Characteristic 2 Value
static uint8_t simpleProfileChar2[SIMPLEPROFILE_CHAR2_LEN] = {0};
// Simple Profile Characteristic 2 User Description
static uint8_t simpleProfileChar2UserDesp[] = "Characteristic 2\0";
// Simple Profile Characteristic 3 Properties
static uint8_t simpleProfileChar3Props = GATT_PROP_WRITE;
// Characteristic 3 Value
static uint8_t simpleProfileChar3[SIMPLEPROFILE_CHAR3_LEN] = {0};
// Simple Profile Characteristic 3 User Description
static uint8_t simpleProfileChar3UserDesp[] = "Characteristic 3\0";
// Simple Profile Characteristic 4 Properties
static uint8_t simpleProfileChar4Props = GATT_PROP_NOTIFY;
// Characteristic 4 Value
static uint8_t simpleProfileChar4[SIMPLEPROFILE_CHAR4_LEN] = {0};
// Simple Profile Characteristic 4 Configuration Each client has its own
// instantiation of the Client Characteristic Configuration. Reads of the
// Client Characteristic Configuration only shows the configuration for
// that client and writes only affect the configuration of that client.
static gattCharCfg_t simpleProfileChar4Config[PERIPHERAL_MAX_CONNECTION];
// Simple Profile Characteristic 4 User Description
static uint8_t simpleProfileChar4UserDesp[] = "Characteristic 4\0";
// Simple Profile Characteristic 5 Properties
static uint8_t simpleProfileChar5Props = GATT_PROP_READ;
// Characteristic 5 Value
static uint8_t simpleProfileChar5[SIMPLEPROFILE_CHAR5_LEN] = {0};
// Simple Profile Characteristic 5 User Description
static uint8_t simpleProfileChar5UserDesp[] = "Characteristic 5\0";
/*********************************************************************
* Profile Attributes - Table
*/
static gattAttribute_t simpleProfileAttrTbl[] = {
// Simple Profile Service
{
{ATT_BT_UUID_SIZE, primaryServiceUUID}, /* type */
GATT_PERMIT_READ, /* permissions */
0, /* handle */
(uint8_t *)&simpleProfileService /* pValue */
},
// Characteristic 1 Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&simpleProfileChar1Props},
// Characteristic Value 1
{
{ATT_BT_UUID_SIZE, simpleProfilechar1UUID},
GATT_PERMIT_READ | GATT_PERMIT_WRITE,
0,
simpleProfileChar1},
// Characteristic 1 User Description
{
{ATT_BT_UUID_SIZE, charUserDescUUID},
GATT_PERMIT_READ,
0,
simpleProfileChar1UserDesp},
// Characteristic 2 Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&simpleProfileChar2Props},
// Characteristic Value 2
{
{ATT_BT_UUID_SIZE, simpleProfilechar2UUID},
GATT_PERMIT_READ,
0,
simpleProfileChar2},
// Characteristic 2 User Description
{
{ATT_BT_UUID_SIZE, charUserDescUUID},
GATT_PERMIT_READ,
0,
simpleProfileChar2UserDesp},
// Characteristic 3 Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&simpleProfileChar3Props},
// Characteristic Value 3
{
{ATT_BT_UUID_SIZE, simpleProfilechar3UUID},
GATT_PERMIT_WRITE,
0,
simpleProfileChar3},
// Characteristic 3 User Description
{
{ATT_BT_UUID_SIZE, charUserDescUUID},
GATT_PERMIT_READ,
0,
simpleProfileChar3UserDesp},
// Characteristic 4 Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&simpleProfileChar4Props},
// Characteristic Value 4
{
{ATT_BT_UUID_SIZE, simpleProfilechar4UUID},
0,
0,
simpleProfileChar4},
// Characteristic 4 configuration
{
{ATT_BT_UUID_SIZE, clientCharCfgUUID},
GATT_PERMIT_READ | GATT_PERMIT_WRITE,
0,
(uint8_t *)simpleProfileChar4Config},
// Characteristic 4 User Description
{
{ATT_BT_UUID_SIZE, charUserDescUUID},
GATT_PERMIT_READ,
0,
simpleProfileChar4UserDesp},
// Characteristic 5 Declaration
{
{ATT_BT_UUID_SIZE, characterUUID},
GATT_PERMIT_READ,
0,
&simpleProfileChar5Props},
// Characteristic Value 5
{
{ATT_BT_UUID_SIZE, simpleProfilechar5UUID},
GATT_PERMIT_AUTHEN_READ,
0,
simpleProfileChar5},
// Characteristic 5 User Description
{
{ATT_BT_UUID_SIZE, charUserDescUUID},
GATT_PERMIT_READ,
0,
simpleProfileChar5UserDesp},
};
/*********************************************************************
* LOCAL FUNCTIONS
*/
static bStatus_t simpleProfile_ReadAttrCB(uint16_t connHandle, gattAttribute_t *pAttr,
uint8_t *pValue, uint16_t *pLen, uint16_t offset, uint16_t maxLen, uint8_t method);
static bStatus_t simpleProfile_WriteAttrCB(uint16_t connHandle, gattAttribute_t *pAttr,
uint8_t *pValue, uint16_t len, uint16_t offset, uint8_t method);
static void simpleProfile_HandleConnStatusCB(uint16_t connHandle, uint8_t changeType);
/*********************************************************************
* PROFILE CALLBACKS
*/
// Simple Profile Service Callbacks
gattServiceCBs_t simpleProfileCBs = {
simpleProfile_ReadAttrCB, // Read callback function pointer
simpleProfile_WriteAttrCB, // Write callback function pointer
NULL // Authorization callback function pointer
};
/*********************************************************************
* PUBLIC FUNCTIONS
*/
/*********************************************************************
* @fn SimpleProfile_AddService
*
* @brief Initializes the Simple Profile service by registering
* GATT attributes with the GATT server.
*
* @param services - services to add. This is a bit map and can
* contain more than one service.
*
* @return Success or Failure
*/
bStatus_t SimpleProfile_AddService(uint32_t services)
{
uint8_t status = SUCCESS;
// Initialize Client Characteristic Configuration attributes
GATTServApp_InitCharCfg(INVALID_CONNHANDLE, simpleProfileChar4Config);
// Register with Link DB to receive link status change callback
linkDB_Register(simpleProfile_HandleConnStatusCB);
if(services & SIMPLEPROFILE_SERVICE)
{
// Register GATT attribute list and CBs with GATT Server App
status = GATTServApp_RegisterService(simpleProfileAttrTbl,
GATT_NUM_ATTRS(simpleProfileAttrTbl),
GATT_MAX_ENCRYPT_KEY_SIZE,
&simpleProfileCBs);
}
return (status);
}
/*********************************************************************
* @fn SimpleProfile_RegisterAppCBs
*
* @brief Registers the application callback function. Only call
* this function once.
*
* @param callbacks - pointer to application callbacks.
*
* @return SUCCESS or bleAlreadyInRequestedMode
*/
bStatus_t SimpleProfile_RegisterAppCBs(simpleProfileCBs_t *appCallbacks)
{
if(appCallbacks)
{
simpleProfile_AppCBs = appCallbacks;
return (SUCCESS);
}
else
{
return (bleAlreadyInRequestedMode);
}
}
/*********************************************************************
* @fn SimpleProfile_SetParameter
*
* @brief Set a Simple Profile parameter.
*
* @param param - Profile parameter ID
* @param len - length of data to right
* @param value - pointer to data to write. This is dependent on
* the parameter ID and WILL be cast to the appropriate
* data type (example: data type of uint16_t will be cast to
* uint16_t pointer).
*
* @return bStatus_t
*/
bStatus_t SimpleProfile_SetParameter(uint8_t param, uint8_t len, void *value)
{
bStatus_t ret = SUCCESS;
switch(param)
{
case SIMPLEPROFILE_CHAR1:
if(len == SIMPLEPROFILE_CHAR1_LEN)
{
tmos_memcpy(simpleProfileChar1, value, SIMPLEPROFILE_CHAR1_LEN);
}
else
{
ret = bleInvalidRange;
}
break;
case SIMPLEPROFILE_CHAR2:
if(len == SIMPLEPROFILE_CHAR2_LEN)
{
tmos_memcpy(simpleProfileChar2, value, SIMPLEPROFILE_CHAR2_LEN);
}
else
{
ret = bleInvalidRange;
}
break;
case SIMPLEPROFILE_CHAR3:
if(len == SIMPLEPROFILE_CHAR3_LEN)
{
tmos_memcpy(simpleProfileChar3, value, SIMPLEPROFILE_CHAR3_LEN);
}
else
{
ret = bleInvalidRange;
}
break;
case SIMPLEPROFILE_CHAR4:
if(len == SIMPLEPROFILE_CHAR4_LEN)
{
tmos_memcpy(simpleProfileChar4, value, SIMPLEPROFILE_CHAR4_LEN);
}
else
{
ret = bleInvalidRange;
}
break;
case SIMPLEPROFILE_CHAR5:
if(len == SIMPLEPROFILE_CHAR5_LEN)
{
tmos_memcpy(simpleProfileChar5, value, SIMPLEPROFILE_CHAR5_LEN);
}
else
{
ret = bleInvalidRange;
}
break;
default:
ret = INVALIDPARAMETER;
break;
}
return (ret);
}
/*********************************************************************
* @fn SimpleProfile_GetParameter
*
* @brief Get a Simple Profile parameter.
*
* @param param - Profile parameter ID
* @param value - pointer to data to put. This is dependent on
* the parameter ID and WILL be cast to the appropriate
* data type (example: data type of uint16_t will be cast to
* uint16_t pointer).
*
* @return bStatus_t
*/
bStatus_t SimpleProfile_GetParameter(uint8_t param, void *value)
{
bStatus_t ret = SUCCESS;
switch(param)
{
case SIMPLEPROFILE_CHAR1:
tmos_memcpy(value, simpleProfileChar1, SIMPLEPROFILE_CHAR1_LEN);
break;
case SIMPLEPROFILE_CHAR2:
tmos_memcpy(value, simpleProfileChar2, SIMPLEPROFILE_CHAR2_LEN);
break;
case SIMPLEPROFILE_CHAR3:
tmos_memcpy(value, simpleProfileChar3, SIMPLEPROFILE_CHAR3_LEN);
break;
case SIMPLEPROFILE_CHAR4:
tmos_memcpy(value, simpleProfileChar4, SIMPLEPROFILE_CHAR4_LEN);
break;
case SIMPLEPROFILE_CHAR5:
tmos_memcpy(value, simpleProfileChar5, SIMPLEPROFILE_CHAR5_LEN);
break;
default:
ret = INVALIDPARAMETER;
break;
}
return (ret);
}
/*********************************************************************
* @fn simpleProfile_Notify
*
* @brief Send a notification containing a heart rate
* measurement.
*
* @param connHandle - connection handle
* @param pNoti - pointer to notification structure
*
* @return Success or Failure
*/
bStatus_t simpleProfile_Notify(uint16_t connHandle, attHandleValueNoti_t *pNoti)
{
uint16_t value = GATTServApp_ReadCharCfg(connHandle, simpleProfileChar4Config);
// If notifications enabled
if(value & GATT_CLIENT_CFG_NOTIFY)
{
// Set the handle
pNoti->handle = simpleProfileAttrTbl[SIMPLEPROFILE_CHAR4_VALUE_POS].handle;
// Send the notification
return GATT_Notification(connHandle, pNoti, FALSE);
}
return bleIncorrectMode;
}
/*********************************************************************
* @fn simpleProfile_ReadAttrCB
*
* @brief Read an attribute.
*
* @param connHandle - connection message was received on
* @param pAttr - pointer to attribute
* @param pValue - pointer to data to be read
* @param pLen - length of data to be read
* @param offset - offset of the first octet to be read
* @param maxLen - maximum length of data to be read
*
* @return Success or Failure
*/
static bStatus_t simpleProfile_ReadAttrCB(uint16_t connHandle, gattAttribute_t *pAttr,
uint8_t *pValue, uint16_t *pLen, uint16_t offset, uint16_t maxLen, uint8_t method)
{
bStatus_t status = SUCCESS;
// Make sure it's not a blob operation (no attributes in the profile are long)
if(offset > 0)
{
return (ATT_ERR_ATTR_NOT_LONG);
}
if(pAttr->type.len == ATT_BT_UUID_SIZE)
{
// 16-bit UUID
uint16_t uuid = BUILD_UINT16(pAttr->type.uuid[0], pAttr->type.uuid[1]);
switch(uuid)
{
// No need for "GATT_SERVICE_UUID" or "GATT_CLIENT_CHAR_CFG_UUID" cases;
// gattserverapp handles those reads
// characteristics 1 and 2 have read permissions
// characteritisc 3 does not have read permissions; therefore it is not
// included here
// characteristic 4 does not have read permissions, but because it
// can be sent as a notification, it is included here
case SIMPLEPROFILE_CHAR1_UUID:
if(maxLen > SIMPLEPROFILE_CHAR1_LEN)
{
*pLen = SIMPLEPROFILE_CHAR1_LEN;
}
else
{
*pLen = maxLen;
}
tmos_memcpy(pValue, pAttr->pValue, *pLen);
break;
case SIMPLEPROFILE_CHAR2_UUID:
if(maxLen > SIMPLEPROFILE_CHAR2_LEN)
{
*pLen = SIMPLEPROFILE_CHAR2_LEN;
}
else
{
*pLen = maxLen;
}
tmos_memcpy(pValue, pAttr->pValue, *pLen);
break;
case SIMPLEPROFILE_CHAR4_UUID:
if(maxLen > SIMPLEPROFILE_CHAR4_LEN)
{
*pLen = SIMPLEPROFILE_CHAR4_LEN;
}
else
{
*pLen = maxLen;
}
tmos_memcpy(pValue, pAttr->pValue, *pLen);
break;
case SIMPLEPROFILE_CHAR5_UUID:
if(maxLen > SIMPLEPROFILE_CHAR5_LEN)
{
*pLen = SIMPLEPROFILE_CHAR5_LEN;
}
else
{
*pLen = maxLen;
}
tmos_memcpy(pValue, pAttr->pValue, *pLen);
break;
default:
// Should never get here! (characteristics 3 and 4 do not have read permissions)
*pLen = 0;
status = ATT_ERR_ATTR_NOT_FOUND;
break;
}
}
else
{
// 128-bit UUID
*pLen = 0;
status = ATT_ERR_INVALID_HANDLE;
}
return (status);
}
/*********************************************************************
* @fn simpleProfile_WriteAttrCB
*
* @brief Validate attribute data prior to a write operation
*
* @param connHandle - connection message was received on
* @param pAttr - pointer to attribute
* @param pValue - pointer to data to be written
* @param len - length of data
* @param offset - offset of the first octet to be written
*
* @return Success or Failure
*/
static bStatus_t simpleProfile_WriteAttrCB(uint16_t connHandle, gattAttribute_t *pAttr,
uint8_t *pValue, uint16_t len, uint16_t offset, uint8_t method)
{
bStatus_t status = SUCCESS;
uint8_t notifyApp = 0xFF;
// If attribute permissions require authorization to write, return error
if(gattPermitAuthorWrite(pAttr->permissions))
{
// Insufficient authorization
return (ATT_ERR_INSUFFICIENT_AUTHOR);
}
if(pAttr->type.len == ATT_BT_UUID_SIZE)
{
// 16-bit UUID
uint16_t uuid = BUILD_UINT16(pAttr->type.uuid[0], pAttr->type.uuid[1]);
switch(uuid)
{
case SIMPLEPROFILE_CHAR1_UUID:
//Validate the value
// Make sure it's not a blob oper
if(offset == 0)
{
if(len > SIMPLEPROFILE_CHAR1_LEN)
{
status = ATT_ERR_INVALID_VALUE_SIZE;
}
}
else
{
status = ATT_ERR_ATTR_NOT_LONG;
}
//Write the value
if(status == SUCCESS)
{
tmos_memcpy(pAttr->pValue, pValue, SIMPLEPROFILE_CHAR1_LEN);
notifyApp = SIMPLEPROFILE_CHAR1;
}
break;
case SIMPLEPROFILE_CHAR3_UUID:
//Validate the value
// Make sure it's not a blob oper
if(offset == 0)
{
if(len > SIMPLEPROFILE_CHAR3_LEN)
{
status = ATT_ERR_INVALID_VALUE_SIZE;
}
}
else
{
status = ATT_ERR_ATTR_NOT_LONG;
}
//Write the value
if(status == SUCCESS)
{
tmos_memcpy(pAttr->pValue, pValue, SIMPLEPROFILE_CHAR3_LEN);
notifyApp = SIMPLEPROFILE_CHAR3;
}
break;
case GATT_CLIENT_CHAR_CFG_UUID:
status = GATTServApp_ProcessCCCWriteReq(connHandle, pAttr, pValue, len,
offset, GATT_CLIENT_CFG_NOTIFY);
break;
default:
// Should never get here! (characteristics 2 and 4 do not have write permissions)
status = ATT_ERR_ATTR_NOT_FOUND;
break;
}
}
else
{
// 128-bit UUID
status = ATT_ERR_INVALID_HANDLE;
}
// If a charactersitic value changed then callback function to notify application of change
if((notifyApp != 0xFF) && simpleProfile_AppCBs && simpleProfile_AppCBs->pfnSimpleProfileChange)
{
simpleProfile_AppCBs->pfnSimpleProfileChange(notifyApp, pValue, len);
}
return (status);
}
/*********************************************************************
* @fn simpleProfile_HandleConnStatusCB
*
* @brief Simple Profile link status change handler function.
*
* @param connHandle - connection handle
* @param changeType - type of change
*
* @return none
*/
static void simpleProfile_HandleConnStatusCB(uint16_t connHandle, uint8_t changeType)
{
// Make sure this is not loopback connection
if(connHandle != LOOPBACK_CONNHANDLE)
{
// Reset Client Char Config if connection has dropped
if((changeType == LINKDB_STATUS_UPDATE_REMOVED) ||
((changeType == LINKDB_STATUS_UPDATE_STATEFLAGS) &&
(!linkDB_Up(connHandle))))
{
GATTServApp_InitCharCfg(connHandle, simpleProfileChar4Config);
}
}
}
/*********************************************************************
*********************************************************************/
@@ -0,0 +1,109 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : devinfoservice.h
* Author : WCH
* Version : V1.0
* Date : 2018/12/11
* Description :
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#ifndef DEVINFOSERVICE_H
#define DEVINFOSERVICE_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************************
* INCLUDES
*/
/*********************************************************************
* CONSTANTS
*/
// Device Information Service Parameters
#define DEVINFO_SYSTEM_ID 0
#define DEVINFO_MODEL_NUMBER 1
#define DEVINFO_SERIAL_NUMBER 2
#define DEVINFO_FIRMWARE_REV 3
#define DEVINFO_HARDWARE_REV 4
#define DEVINFO_SOFTWARE_REV 5
#define DEVINFO_MANUFACTURER_NAME 6
#define DEVINFO_11073_CERT_DATA 7
#define DEVINFO_PNP_ID 8
// IEEE 11073 authoritative body values
#define DEVINFO_11073_BODY_EMPTY 0
#define DEVINFO_11073_BODY_IEEE 1
#define DEVINFO_11073_BODY_CONTINUA 2
#define DEVINFO_11073_BODY_EXP 254
// System ID length
#define DEVINFO_SYSTEM_ID_LEN 8
// PnP ID length
#define DEVINFO_PNP_ID_LEN 7
/*********************************************************************
* TYPEDEFS
*/
/*********************************************************************
* MACROS
*/
/*********************************************************************
* Profile Callbacks
*/
/*********************************************************************
* API FUNCTIONS
*/
/*
* DevInfo_AddService- Initializes the Device Information service by registering
* GATT attributes with the GATT server.
*
*/
extern bStatus_t DevInfo_AddService(void);
/*********************************************************************
* @fn DevInfo_SetParameter
*
* @brief Set a Device Information parameter.
*
* @param param - Profile parameter ID
* @param len - length of data to right
* @param value - pointer to data to write. This is dependent on
* the parameter ID and WILL be cast to the appropriate
* data type (example: data type of uint16_t will be cast to
* uint16_t pointer).
*
* @return bStatus_t
*/
bStatus_t DevInfo_SetParameter(uint8_t param, uint8_t len, void *value);
/*
* DevInfo_GetParameter - Get a Device Information parameter.
*
* param - Profile parameter ID
* value - pointer to data to write. This is dependent on
* the parameter ID and WILL be cast to the appropriate
* data type (example: data type of uint16_t will be cast to
* uint16_t pointer).
*/
extern bStatus_t DevInfo_GetParameter(uint8_t param, void *value);
/*********************************************************************
*********************************************************************/
#ifdef __cplusplus
}
#endif
#endif /* DEVINFOSERVICE_H */
@@ -0,0 +1,135 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : gattprofile.h
* Author : WCH
* Version : V1.0
* Date : 2018/12/11
* Description :
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
#ifndef GATTPROFILE_H
#define GATTPROFILE_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************************
* INCLUDES
*/
/*********************************************************************
* CONSTANTS
*/
// Profile Parameters
#define SIMPLEPROFILE_CHAR1 0 // RW uint8_t - Profile Characteristic 1 value
#define SIMPLEPROFILE_CHAR2 1 // RW uint8_t - Profile Characteristic 2 value
#define SIMPLEPROFILE_CHAR3 2 // RW uint8_t - Profile Characteristic 3 value
#define SIMPLEPROFILE_CHAR4 3 // RW uint8_t - Profile Characteristic 4 value
#define SIMPLEPROFILE_CHAR5 4 // RW uint8_t - Profile Characteristic 4 value
// Simple Profile Service UUID
#define SIMPLEPROFILE_SERV_UUID 0xFFE0
// Key Pressed UUID
#define SIMPLEPROFILE_CHAR1_UUID 0xFFE1
#define SIMPLEPROFILE_CHAR2_UUID 0xFFE2
#define SIMPLEPROFILE_CHAR3_UUID 0xFFE3
#define SIMPLEPROFILE_CHAR4_UUID 0xFFE4
#define SIMPLEPROFILE_CHAR5_UUID 0xFFE5
// Simple Keys Profile Services bit fields
#define SIMPLEPROFILE_SERVICE 0x00000001
// Length of characteristic in bytes ( Default MTU is 23 )
#define SIMPLEPROFILE_CHAR1_LEN 64
#define SIMPLEPROFILE_CHAR2_LEN 1
#define SIMPLEPROFILE_CHAR3_LEN 8 //1
#define SIMPLEPROFILE_CHAR4_LEN 32//20
#define SIMPLEPROFILE_CHAR5_LEN 5
/*********************************************************************
* TYPEDEFS
*/
/*********************************************************************
* MACROS
*/
/*********************************************************************
* Profile Callbacks
*/
// Callback when a characteristic value has changed
typedef void (*simpleProfileChange_t)(uint8_t paramID, uint8_t *pValue, uint16_t len);
typedef struct
{
simpleProfileChange_t pfnSimpleProfileChange; // Called when characteristic value changes
} simpleProfileCBs_t;
/*********************************************************************
* API FUNCTIONS
*/
/*
* SimpleProfile_AddService- Initializes the Simple GATT Profile service by registering
* GATT attributes with the GATT server.
*
* @param services - services to add. This is a bit map and can
* contain more than one service.
*/
extern bStatus_t SimpleProfile_AddService(uint32_t services);
/*
* SimpleProfile_RegisterAppCBs - Registers the application callback function.
* Only call this function once.
*
* appCallbacks - pointer to application callbacks.
*/
extern bStatus_t SimpleProfile_RegisterAppCBs(simpleProfileCBs_t *appCallbacks);
/*
* SimpleProfile_SetParameter - Set a Simple GATT Profile parameter.
*
* param - Profile parameter ID
* len - length of data to right
* value - pointer to data to write. This is dependent on
* the parameter ID and WILL be cast to the appropriate
* data type (example: data type of uint16_t will be cast to
* uint16_t pointer).
*/
extern bStatus_t SimpleProfile_SetParameter(uint8_t param, uint8_t len, void *value);
/*
* SimpleProfile_GetParameter - Get a Simple GATT Profile parameter.
*
* param - Profile parameter ID
* value - pointer to data to write. This is dependent on
* the parameter ID and WILL be cast to the appropriate
* data type (example: data type of uint16_t will be cast to
* uint16_t pointer).
*/
extern bStatus_t SimpleProfile_GetParameter(uint8_t param, void *value);
/*
* simpleProfile_Notify - Send notification.
*
* connHandle - connect handle
* pNoti - pointer to structure to notify.
*/
extern bStatus_t simpleProfile_Notify(uint16_t connHandle, attHandleValueNoti_t *pNoti);
/*********************************************************************
*********************************************************************/
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,187 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : startup_CH59x.s
* Author : WCH
* Version : V1.0.0
* Date : 2021/02/25
* Description :
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
.section .init,"ax",@progbits
.global _start
.align 1
_start:
j handle_reset
.section .vector,"ax",@progbits
.align 1
_vector_base:
.option norvc;
.word 0
.word 0
.word NMI_Handler /* NMI Handler */
.word HardFault_Handler /* Hard Fault Handler */
.word 0xF5F9BDA9
.word Ecall_M_Mode_Handler /* 5 */
.word 0
.word 0
.word Ecall_U_Mode_Handler /* 8 */
.word Break_Point_Handler /* 9 */
.word 0
.word 0
.word SysTick_Handler /* SysTick Handler */
.word 0
.word SW_Handler /* SW Handler */
.word 0
/* External Interrupts */
.word TMR0_IRQHandler /* 0: TMR0 */
.word GPIOA_IRQHandler /* GPIOA */
.word GPIOB_IRQHandler /* GPIOB */
.word SPI0_IRQHandler /* SPI0 */
.word BB_IRQHandler /* BLEB */
.word LLE_IRQHandler /* BLEL */
.word USB_IRQHandler /* USB */
.word 0
.word TMR1_IRQHandler /* TMR1 */
.word TMR2_IRQHandler /* TMR2 */
.word UART0_IRQHandler /* UART0 */
.word UART1_IRQHandler /* UART1 */
.word RTC_IRQHandler /* RTC */
.word ADC_IRQHandler /* ADC */
.word I2C_IRQHandler /* I2C */
.word PWMX_IRQHandler /* PWMX */
.word TMR3_IRQHandler /* TMR3 */
.word UART2_IRQHandler /* UART2 */
.word UART3_IRQHandler /* UART3 */
.word WDOG_BAT_IRQHandler /* WDOG_BAT */
.option rvc;
.section .vector_handler, "ax", @progbits
.weak NMI_Handler
.weak HardFault_Handler
.weak Ecall_M_Mode_Handler
.weak Ecall_U_Mode_Handler
.weak Break_Point_Handler
.weak SysTick_Handler
.weak SW_Handler
.weak TMR0_IRQHandler
.weak GPIOA_IRQHandler
.weak GPIOB_IRQHandler
.weak SPI0_IRQHandler
.weak BB_IRQHandler
.weak LLE_IRQHandler
.weak USB_IRQHandler
.weak TMR1_IRQHandler
.weak TMR2_IRQHandler
.weak UART0_IRQHandler
.weak UART1_IRQHandler
.weak RTC_IRQHandler
.weak ADC_IRQHandler
.weak I2C_IRQHandler
.weak PWMX_IRQHandler
.weak TMR3_IRQHandler
.weak UART2_IRQHandler
.weak UART3_IRQHandler
.weak WDOG_BAT_IRQHandler
NMI_Handler:
HardFault_Handler:
Ecall_M_Mode_Handler:
Ecall_U_Mode_Handler:
Break_Point_Handler:
SysTick_Handler:
SW_Handler:
TMR0_IRQHandler:
GPIOA_IRQHandler:
GPIOB_IRQHandler:
SPI0_IRQHandler:
BB_IRQHandler:
LLE_IRQHandler:
USB_IRQHandler:
TMR1_IRQHandler:
TMR2_IRQHandler:
UART0_IRQHandler:
UART1_IRQHandler:
RTC_IRQHandler:
ADC_IRQHandler:
I2C_IRQHandler:
PWMX_IRQHandler:
TMR3_IRQHandler:
UART2_IRQHandler:
UART3_IRQHandler:
WDOG_BAT_IRQHandler:
1:
j 1b
.section .handle_reset,"ax",@progbits
.weak handle_reset
.align 1
handle_reset:
.option push
.option norelax
la gp, __global_pointer$
.option pop
1:
la sp, _eusrstack
/* Load highcode code section from flash to RAM */
2:
la a0, _highcode_lma
la a1, _highcode_vma_start
la a2, _highcode_vma_end
bgeu a1, a2, 2f
1:
lw t0, (a0)
sw t0, (a1)
addi a0, a0, 4
addi a1, a1, 4
bltu a1, a2, 1b
/* Load data section from flash to RAM */
2:
la a0, _data_lma
la a1, _data_vma
la a2, _edata
bgeu a1, a2, 2f
1:
lw t0, (a0)
sw t0, (a1)
addi a0, a0, 4
addi a1, a1, 4
bltu a1, a2, 1b
2:
/* clear bss section */
la a0, _sbss
la a1, _ebss
bgeu a0, a1, 2f
1:
sw zero, (a0)
addi a0, a0, 4
bltu a0, a1, 1b
2:
/* 流水线控制位 & 动态预测控制位 */
li t0, 0x1f
csrw 0xbc0, t0
/* 打开嵌套中断、硬件压栈功能 */
li t0, 0x3
csrw 0x804, t0
li t0, 0x1888
csrw mstatus, t0
la t0, _vector_base
/* 配置向量表模式为绝对地址模式 */
ori t0, t0, 3
csrw mtvec, t0
la t0, main
csrw mepc, t0
j 0xC000
mret