mirror of
https://github.com/yoboujon/dumber.git
synced 2025-06-08 13:50:49 +02:00
Gros jardinage
This commit is contained in:
parent
aae905f551
commit
f8f7ab84ef
30 changed files with 1693 additions and 643 deletions
|
@ -110,17 +110,6 @@
|
||||||
<outputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype.1151842665" name="Resource Custom Build Step Output Type"/>
|
<outputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype.1151842665" name="Resource Custom Build Step Output Type"/>
|
||||||
</tool>
|
</tool>
|
||||||
</fileInfo>
|
</fileInfo>
|
||||||
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.301016929" name="moteurs.c" rcbsApplicability="disable" resourcePath="Application/moteurs.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1474341646.1614918774">
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1474341646.1614918774" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1474341646">
|
|
||||||
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1820635767" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
|
||||||
</tool>
|
|
||||||
<tool customBuildStep="true" id="org.eclipse.cdt.managedbuilder.ui.rcbs.436390343" name="Resource Custom Build Step">
|
|
||||||
<inputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.inputtype.1413464112" name="Resource Custom Build Step Input Type">
|
|
||||||
<additionalInput kind="additionalinputdependency"/>
|
|
||||||
</inputType>
|
|
||||||
<outputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype.859128992" name="Resource Custom Build Step Output Type"/>
|
|
||||||
</tool>
|
|
||||||
</fileInfo>
|
|
||||||
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.1827743340" name="application.c" rcbsApplicability="disable" resourcePath="Application/application.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1474341646.2011451410">
|
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.1827743340" name="application.c" rcbsApplicability="disable" resourcePath="Application/application.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1474341646.2011451410">
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1474341646.2011451410" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1474341646">
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1474341646.2011451410" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1474341646">
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1397894115" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o0" valueType="enumerated"/>
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1397894115" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o0" valueType="enumerated"/>
|
||||||
|
@ -134,7 +123,7 @@
|
||||||
</tool>
|
</tool>
|
||||||
</fileInfo>
|
</fileInfo>
|
||||||
<sourceEntries>
|
<sourceEntries>
|
||||||
<entry excluding="XBEE" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Application"/>
|
<entry excluding="Xbee-API|XBEE" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Application"/>
|
||||||
<entry excluding="XBEE" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
|
<entry excluding="XBEE" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Middlewares"/>
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Middlewares"/>
|
||||||
|
@ -220,6 +209,192 @@
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||||
</cconfiguration>
|
</cconfiguration>
|
||||||
|
<cconfiguration id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516">
|
||||||
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516" moduleId="org.eclipse.cdt.core.settings" name="Tests">
|
||||||
|
<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.debug" cleanCommand="rm -rf" description="Basic dynamic tests" 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="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516" name="Tests" parent="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug">
|
||||||
|
<folderInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516." name="/" resourcePath="">
|
||||||
|
<toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug.1725642963" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.871689179" name="MCU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" useByScannerDiscovery="true" value="STM32L010C6Tx" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.182926785" name="CPU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" useByScannerDiscovery="false" value="0" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.906309827" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.461660153" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.491617643" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.5 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32L010C6Tx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Middlewares/Third_Party/FreeRTOS/Source/include | ../Drivers/CMSIS/Include | ../Core/Inc | ../Drivers/STM32L0xx_HAL_Driver/Inc | ../Drivers/CMSIS/Device/ST/STM32L0xx/Include | ../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy | ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 | ../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM0 || || || USE_HAL_DRIVER | STM32L010x6 || || Drivers | Core/Startup | Middlewares | Core || || || ${workspace_loc:/${ProjName}/STM32L010C6TX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || " valueType="string"/>
|
||||||
|
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.434803197" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
|
||||||
|
<builder buildPath="${workspace_loc:/Dumber3}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.608409653" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1730188417" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.1715086132" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g3" valueType="enumerated"/>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.1752071024" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||||
|
</option>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.374319773" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.213526881" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g3" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.190523459" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o2" valueType="enumerated"/>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.101854329" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||||
|
<listOptionValue builtIn="false" value="TESTS"/>
|
||||||
|
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
||||||
|
<listOptionValue builtIn="false" value="STM32L071xx"/>
|
||||||
|
</option>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.1529934591" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
|
<listOptionValue builtIn="false" value="../Application"/>
|
||||||
|
<listOptionValue builtIn="false" value="../TestsPlans/UnitTests"/>
|
||||||
|
<listOptionValue builtIn="false" value="../TestsPlans"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Core/Inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Drivers/STM32L0xx_HAL_Driver/Inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Drivers/STM32L0xx_HAL_Driver/Inc/Legacy"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32L0xx/Include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Middlewares/Third_Party/FreeRTOS/Source/include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM0"/>
|
||||||
|
</option>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.265277817" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.1174036490" name="MCU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.153193431" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g3" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.863977908" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.357678379" name="MCU GCC Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script.459112783" name="Linker Script (-T)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script" useByScannerDiscovery="false" value="${workspace_loc:/${ProjName}/STM32L071CBTX_FLASH.ld}" valueType="string"/>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input.1366958991" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input">
|
||||||
|
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||||
|
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||||
|
</inputType>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.853583137" name="MCU G++ Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.83208283" name="MCU GCC Archiver" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.1934785920" name="MCU Size" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.890514722" name="MCU Output Converter list file" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.1008220180" name="MCU Output Converter Hex" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.1050410195" name="MCU Output Converter Binary" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.17802640" name="MCU Output Converter Verilog" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.1026641387" name="MCU Output Converter Motorola S-rec" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.1426714819" name="MCU Output Converter Motorola S-rec with symbols" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec"/>
|
||||||
|
</toolChain>
|
||||||
|
</folderInfo>
|
||||||
|
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516.1048778148" name="tests.c" rcbsApplicability="disable" resourcePath="TestsPlans/tests.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985.969637317">
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985.969637317" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.329749788" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o0" valueType="enumerated"/>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.2047994536" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
||||||
|
</tool>
|
||||||
|
</fileInfo>
|
||||||
|
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516.Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_uart_ex.c" name="stm32l0xx_hal_uart_ex.c" rcbsApplicability="disable" resourcePath="Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_uart_ex.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1805933764">
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1805933764" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1984394619" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o0" valueType="enumerated"/>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1279424512" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
||||||
|
</tool>
|
||||||
|
<tool customBuildStep="true" id="org.eclipse.cdt.managedbuilder.ui.rcbs.1659546583.1148842895" name="Resource Custom Build Step">
|
||||||
|
<inputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.inputtype.1432031452.1251248982" name="Resource Custom Build Step Input Type">
|
||||||
|
<additionalInput kind="additionalinputdependency" paths=""/>
|
||||||
|
</inputType>
|
||||||
|
<outputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype.415746645.864178606" name="Resource Custom Build Step Output Type"/>
|
||||||
|
</tool>
|
||||||
|
</fileInfo>
|
||||||
|
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516.Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_uart.c" name="stm32l0xx_hal_uart.c" rcbsApplicability="disable" resourcePath="Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_uart.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.158010177">
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.158010177" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1823221561" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o0" valueType="enumerated"/>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.297929989" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
||||||
|
</tool>
|
||||||
|
<tool customBuildStep="true" id="org.eclipse.cdt.managedbuilder.ui.rcbs.465455954.40256557" name="Resource Custom Build Step">
|
||||||
|
<inputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.inputtype.1630632169.1194181786" name="Resource Custom Build Step Input Type">
|
||||||
|
<additionalInput kind="additionalinputdependency" paths=""/>
|
||||||
|
</inputType>
|
||||||
|
<outputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype.15440907.287822728" name="Resource Custom Build Step Output Type"/>
|
||||||
|
</tool>
|
||||||
|
</fileInfo>
|
||||||
|
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516.Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_dma.c" name="stm32l0xx_hal_dma.c" rcbsApplicability="disable" resourcePath="Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_dma.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.613168748">
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.613168748" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1230640165" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o0" valueType="enumerated"/>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.860741978" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
||||||
|
</tool>
|
||||||
|
<tool customBuildStep="true" id="org.eclipse.cdt.managedbuilder.ui.rcbs.737656347.764022843" name="Resource Custom Build Step">
|
||||||
|
<inputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.inputtype.689637588.705671540" name="Resource Custom Build Step Input Type">
|
||||||
|
<additionalInput kind="additionalinputdependency" paths=""/>
|
||||||
|
</inputType>
|
||||||
|
<outputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype.1151842665.1610208999" name="Resource Custom Build Step Output Type"/>
|
||||||
|
</tool>
|
||||||
|
</fileInfo>
|
||||||
|
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516.Application/application.c" name="application.c" rcbsApplicability="disable" resourcePath="Application/application.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.983087978">
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.983087978" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.606614377" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o0" valueType="enumerated"/>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1996673393" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
||||||
|
</tool>
|
||||||
|
<tool customBuildStep="true" id="org.eclipse.cdt.managedbuilder.ui.rcbs.389963892.995306756" name="Resource Custom Build Step">
|
||||||
|
<inputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.inputtype.115340338.624270908" name="Resource Custom Build Step Input Type">
|
||||||
|
<additionalInput kind="additionalinputdependency" paths=""/>
|
||||||
|
</inputType>
|
||||||
|
<outputType id="org.eclipse.cdt.managedbuilder.ui.rcbs.outputtype.1700687045.61103792" name="Resource Custom Build Step Output Type"/>
|
||||||
|
</tool>
|
||||||
|
</fileInfo>
|
||||||
|
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516.662138057" name="leds.c" rcbsApplicability="disable" resourcePath="Application/leds.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985.1311312183">
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985.1311312183" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1291578589" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o0" valueType="enumerated"/>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.941552495" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
||||||
|
</tool>
|
||||||
|
</fileInfo>
|
||||||
|
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516.2090116280" name="xbee.c" rcbsApplicability="disable" resourcePath="Application/xbee.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985.704358328">
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985.704358328" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1774324656" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o0" valueType="enumerated"/>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.429048284" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
||||||
|
</tool>
|
||||||
|
</fileInfo>
|
||||||
|
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516.53808517" name="batterie.c" rcbsApplicability="disable" resourcePath="Application/batterie.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985.1171631638">
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985.1171631638" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.2016549754" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o0" valueType="enumerated"/>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.457387693" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
||||||
|
</tool>
|
||||||
|
</fileInfo>
|
||||||
|
<folderInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516.Application/Xbee-API" name="/" resourcePath="Application/Xbee-API">
|
||||||
|
<toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug.2021164284" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug" unusedChildren="">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.1680641606.1951407663.127771378" name="MCU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.1680641606"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.1194953091.1850201363.1767387635" name="CPU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.1194953091"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.1508870668.89435523.1071775695" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.1508870668"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.475855176.1730312852.1578861356" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.475855176"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.802392362.1707463427.1227765991" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.802392362"/>
|
||||||
|
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.929326971" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.991631339" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1730188417">
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.1058223080" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1561136854" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1017015985">
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.24352825" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.127663848" name="MCU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.1174036490"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.972213236" name="MCU GCC Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.357678379"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.1667657819" name="MCU G++ Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.853583137"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.1680647921" name="MCU GCC Archiver" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.83208283"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.1977939241" name="MCU Size" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.1934785920"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.618977275" name="MCU Output Converter list file" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.890514722"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.996506390" name="MCU Output Converter Hex" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.1008220180"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.1078850052" name="MCU Output Converter Binary" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.1050410195"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.1075520082" name="MCU Output Converter Verilog" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.17802640"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.139031285" name="MCU Output Converter Motorola S-rec" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.1026641387"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.338302336" name="MCU Output Converter Motorola S-rec with symbols" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.1426714819"/>
|
||||||
|
</toolChain>
|
||||||
|
</folderInfo>
|
||||||
|
<sourceEntries>
|
||||||
|
<entry excluding="Xbee-API|XBEE" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Application"/>
|
||||||
|
<entry excluding="XBEE" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Middlewares"/>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="TestsPlans"/>
|
||||||
|
</sourceEntries>
|
||||||
|
</configuration>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||||
|
</cconfiguration>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.pathentry"/>
|
<storageModule moduleId="org.eclipse.cdt.core.pathentry"/>
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
|
@ -243,5 +418,8 @@
|
||||||
<configuration configurationName="Release">
|
<configuration configurationName="Release">
|
||||||
<resource resourceType="PROJECT" workspacePath="/Dumber3"/>
|
<resource resourceType="PROJECT" workspacePath="/Dumber3"/>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<configuration configurationName="Tests">
|
||||||
|
<resource resourceType="PROJECT" workspacePath="/Dumber3"/>
|
||||||
|
</configuration>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
</cproject>
|
</cproject>
|
File diff suppressed because one or more lines are too long
|
@ -5,7 +5,7 @@
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
<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.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="1490091031643224932" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="55004790486127528" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
</provider>
|
</provider>
|
||||||
|
@ -17,7 +17,18 @@
|
||||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
||||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="1490091031643224932" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="55004790486127528" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||||
|
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||||
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
|
</provider>
|
||||||
|
</extension>
|
||||||
|
</configuration>
|
||||||
|
<configuration id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1504381080.727722516" name="Tests">
|
||||||
|
<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="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="55004790486127528" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
</provider>
|
</provider>
|
||||||
|
|
440
software/dumber3/Application/Xbee-API/xbee.c
Normal file
440
software/dumber3/Application/Xbee-API/xbee.c
Normal file
|
@ -0,0 +1,440 @@
|
||||||
|
/*
|
||||||
|
* xbee.c
|
||||||
|
*
|
||||||
|
* Created on: Sep 12, 2022
|
||||||
|
* Author: dimercur
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "xbee.h"
|
||||||
|
#include "semphr.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "stm32l0xx_ll_usart.h"
|
||||||
|
|
||||||
|
extern UART_HandleTypeDef hlpuart1;
|
||||||
|
extern DMA_HandleTypeDef hdma_lpuart1_tx;
|
||||||
|
extern DMA_HandleTypeDef hdma_lpuart1_rx;
|
||||||
|
|
||||||
|
/***** API2 escaped char *****/
|
||||||
|
#define XBEE_API_ESCAPE_CHAR 0x7D
|
||||||
|
#define XBEE_API_START_OF_FRAME 0x7E
|
||||||
|
#define XBEE_API_XON 0x11
|
||||||
|
#define XBEE_API_XOFF 0x13
|
||||||
|
|
||||||
|
/***** RX part *****/
|
||||||
|
|
||||||
|
/* Stuff for Xbee RX task */
|
||||||
|
StaticTask_t xTaskXbeeRX;
|
||||||
|
StackType_t xStackXbeeRX[ STACK_SIZE ];
|
||||||
|
TaskHandle_t xHandleXbeeRX = NULL;
|
||||||
|
|
||||||
|
uint8_t txBuffer[XBEE_RX_BUFFER_MAX_LENGTH]={0};
|
||||||
|
uint16_t txIndex;
|
||||||
|
uint16_t txDataToSend;
|
||||||
|
|
||||||
|
void XBEE_RxThread(void* params);
|
||||||
|
|
||||||
|
SemaphoreHandle_t xHandleSemaphoreRX = NULL;
|
||||||
|
StaticSemaphore_t xSemaphoreRx;
|
||||||
|
|
||||||
|
uint8_t rxBuffer[XBEE_RX_BUFFER_MAX_LENGTH]={0};
|
||||||
|
//uint8_t rxWaitForACK =0;
|
||||||
|
uint8_t rxPhase;
|
||||||
|
uint16_t rxFrameLength;
|
||||||
|
uint16_t rxDataToReceive;
|
||||||
|
uint16_t rxIndex;
|
||||||
|
|
||||||
|
#define XBEE_RX_PHASE_SOF 0
|
||||||
|
#define XBEE_RX_PHASE_HEADER 1
|
||||||
|
#define XBEE_RX_PHASE_BODY 2
|
||||||
|
|
||||||
|
/****** TX part ******/
|
||||||
|
SemaphoreHandle_t xHandleSemaphoreTX = NULL;
|
||||||
|
SemaphoreHandle_t xHandleSemaphoreTX_ACK = NULL;
|
||||||
|
StaticSemaphore_t xSemaphoreTX;
|
||||||
|
StaticSemaphore_t xSemaphoreTX_ACK;
|
||||||
|
|
||||||
|
void XBEE_Init(void) {
|
||||||
|
xHandleSemaphoreTX = xSemaphoreCreateBinaryStatic( &xSemaphoreTX );
|
||||||
|
xHandleSemaphoreTX_ACK = xSemaphoreCreateBinaryStatic( &xSemaphoreTX_ACK );
|
||||||
|
xSemaphoreGive(xHandleSemaphoreTX);
|
||||||
|
//xSemaphoreTake(xHandleSemaphoreTX_ACK);
|
||||||
|
|
||||||
|
xHandleSemaphoreRX = xSemaphoreCreateBinaryStatic( &xSemaphoreRx );
|
||||||
|
|
||||||
|
/* Create the task without using any dynamic memory allocation. */
|
||||||
|
xHandleXbeeRX = xTaskCreateStatic(
|
||||||
|
XBEE_RxThread, /* Function that implements the task. */
|
||||||
|
"XBEE Rx", /* Text name for the task. */
|
||||||
|
STACK_SIZE, /* Number of indexes in the xStack array. */
|
||||||
|
NULL, /* Parameter passed into the task. */
|
||||||
|
PriorityMoteurs,/* Priority at which the task is created. */
|
||||||
|
xStackXbeeRX, /* Array to use as the task's stack. */
|
||||||
|
&xTaskXbeeRX); /* Variable to hold the task's data structure. */
|
||||||
|
vTaskResume(xHandleXbeeRX);
|
||||||
|
|
||||||
|
/* Enable Xbee */
|
||||||
|
HAL_GPIO_WritePin(XBEE_RESET_GPIO_Port, XBEE_RESET_Pin, GPIO_PIN_SET);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**** Support functions ****/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compute length of encoded data using escape char
|
||||||
|
*
|
||||||
|
* \param data pointer on raw data
|
||||||
|
* \param length length of raw data
|
||||||
|
* \return length of data when encoded
|
||||||
|
*/
|
||||||
|
int XBEE_GetDataLength(char* data, int length) {
|
||||||
|
int encodedLength=0;
|
||||||
|
|
||||||
|
for (int i=0; i< length; i++) {
|
||||||
|
if ((*data == (char)XBEE_API_ESCAPE_CHAR) || (*data == (char)XBEE_API_START_OF_FRAME) ||
|
||||||
|
(*data == (char)XBEE_API_XOFF) ||(*data == (char)XBEE_API_XON)) {
|
||||||
|
encodedLength++; /* Add 1 byte for escape char */
|
||||||
|
}
|
||||||
|
|
||||||
|
encodedLength++; /* Add current char in length calculation */
|
||||||
|
data++; /* move to next byte in raw buffer */
|
||||||
|
}
|
||||||
|
|
||||||
|
return encodedLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert raw data into escaped data. Create a new buffer that is returned
|
||||||
|
*
|
||||||
|
* \param data pointer on raw data
|
||||||
|
* \param length length of raw data
|
||||||
|
* \param encodedLength length of encoded data
|
||||||
|
* \return new buffer allocated with escaped char
|
||||||
|
*/
|
||||||
|
char* XBEE_EncodeWithEscapeChar(char* data, int length, int *encodedLength) {
|
||||||
|
char* encodedData;
|
||||||
|
|
||||||
|
*encodedLength=XBEE_GetDataLength(data, length);
|
||||||
|
encodedData = (char*)malloc(*encodedLength);
|
||||||
|
|
||||||
|
for (char* p=encodedData; p< (encodedData + *encodedLength); p++) {
|
||||||
|
if ((*data == (char)XBEE_API_ESCAPE_CHAR) || (*data == (char)XBEE_API_START_OF_FRAME) ||
|
||||||
|
(*data == (char)XBEE_API_XOFF) ||(*data == (char)XBEE_API_XON)) {
|
||||||
|
*p = (char) XBEE_API_ESCAPE_CHAR;
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
|
||||||
|
*p = *data;
|
||||||
|
data++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return encodedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a raw buffer and convert it into a transmission frame
|
||||||
|
*
|
||||||
|
* \param data pointer on raw data
|
||||||
|
* \param length length of raw data
|
||||||
|
* \param destination address of the destination
|
||||||
|
* \param frameLength length of frame
|
||||||
|
* \return new frame (allocated) containing escaped data
|
||||||
|
*/
|
||||||
|
void XBEE_EncodeTransmissionFrame(char* data, int length, uint16_t destination, char* frame, int* frameLength) {
|
||||||
|
uint8_t checksum=0;
|
||||||
|
uint16_t localLength=0;
|
||||||
|
char* p;
|
||||||
|
|
||||||
|
localLength = length+9;
|
||||||
|
|
||||||
|
frame[0] = (char)XBEE_FRAME_SOF_CHAR;
|
||||||
|
frame[1] = (char)((uint16_t)(localLength-4)>>8);
|
||||||
|
frame[2] = (char)((uint16_t)(localLength-4));
|
||||||
|
frame[3] = (char)XBEE_TX_16BIT_REQUEST_TYPE;
|
||||||
|
frame[4] = 0x1;
|
||||||
|
|
||||||
|
frame[5] = (char)((uint16_t)(destination)>>8);
|
||||||
|
frame[6] = (char)((uint16_t)(destination));
|
||||||
|
|
||||||
|
frame[7] = 0x0;
|
||||||
|
|
||||||
|
for (p = &frame[8]; p< (data + length); p++) {
|
||||||
|
if ((*data == (char)XBEE_API_ESCAPE_CHAR) || (*data == (char)XBEE_API_START_OF_FRAME) ||
|
||||||
|
(*data == (char)XBEE_API_XOFF) ||(*data == (char)XBEE_API_XON)) {
|
||||||
|
*p = (char) XBEE_API_ESCAPE_CHAR;
|
||||||
|
p++;
|
||||||
|
*p = *data^0x20;
|
||||||
|
} else
|
||||||
|
*p = *data;
|
||||||
|
|
||||||
|
data++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* calcul du checksum */
|
||||||
|
for (int i=3; i<(localLength-1); i++) {
|
||||||
|
checksum += (uint8_t)frame[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
*p = 0xFF-checksum;
|
||||||
|
*frameLength = localLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get frame length
|
||||||
|
*
|
||||||
|
* \param frame pointer on frame header
|
||||||
|
* \return length of incoming frame
|
||||||
|
*/
|
||||||
|
uint16_t XBEE_GetFrameLength(uint8_t *frame) {
|
||||||
|
return (((uint16_t)frame[1])<<8) + (uint16_t)frame[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a complete frame, check if frame is correct and extract raw data
|
||||||
|
*
|
||||||
|
* \param raw_frame pointer on complete frame
|
||||||
|
* \param incomingFrame pointer to processed frame, with escape char removed
|
||||||
|
* \return status of decoding: XBEE_OK if decoding is successful, XBEE_INVALID_FRAME otherwise
|
||||||
|
*/
|
||||||
|
XBEE_Status XBEE_DecodeFrame(char* rawFrame, XBEE_INCOMING_FRAME** incomingFrame) {
|
||||||
|
uint8_t frame_type = (uint8_t)rawFrame[3];
|
||||||
|
uint16_t rawFrameLength;
|
||||||
|
uint8_t checksum;
|
||||||
|
XBEE_Status status = XBEE_OK;
|
||||||
|
int allocatedSize;
|
||||||
|
int dataSize;
|
||||||
|
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (rawFrame[0] == '~') {
|
||||||
|
rawFrameLength = (((uint16_t)rawFrame[1])<<8) + (uint16_t)rawFrame[2];
|
||||||
|
|
||||||
|
/* verification du checksum */
|
||||||
|
checksum =0;
|
||||||
|
for (i=3; i<3+rawFrameLength+1; i++) {
|
||||||
|
checksum += (uint8_t)rawFrame[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (checksum != 0xFF)
|
||||||
|
return XBEE_INVALID_FRAME;
|
||||||
|
|
||||||
|
switch (frame_type) {
|
||||||
|
case XBEE_RX_16BIT_PACKET_TYPE:
|
||||||
|
dataSize = rawFrameLength-5; // there is 5 bytes of "other" data than truly data bytes in a frame
|
||||||
|
allocatedSize = sizeof(XBEE_INCOMING_FRAME)+dataSize;
|
||||||
|
|
||||||
|
*incomingFrame = (XBEE_INCOMING_FRAME*) malloc(allocatedSize); /* Allocate a generic frame struct */
|
||||||
|
(*incomingFrame)->type = frame_type;
|
||||||
|
|
||||||
|
/* Get source address */
|
||||||
|
(*incomingFrame)->source_addr = (((uint16_t)rawFrame[4])<<8) + (uint16_t)rawFrame[5];
|
||||||
|
//XBEE_DecodeWithoutEscapeChar(&rawFrame[8], rawFrameLength-5, (*incomingFrame)->data, &incomingDataLength); // Data = Frame length -5
|
||||||
|
(*incomingFrame)->length = (uint8_t)(dataSize);
|
||||||
|
(*incomingFrame)->ack = 0;
|
||||||
|
|
||||||
|
for (i=0; i<dataSize; i++)
|
||||||
|
(*incomingFrame)->data[i] = rawFrame[i+8];
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case XBEE_MODEM_STATUS_TYPE:
|
||||||
|
allocatedSize = sizeof(XBEE_INCOMING_FRAME); // no data
|
||||||
|
*incomingFrame = (XBEE_INCOMING_FRAME*) malloc(allocatedSize); /* Allocate a generic frame struct */
|
||||||
|
|
||||||
|
(*incomingFrame)->type = frame_type;
|
||||||
|
|
||||||
|
(*incomingFrame)->modem_status = rawFrame[4];
|
||||||
|
(*incomingFrame)->data[0]=0x0;
|
||||||
|
(*incomingFrame)->length = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case XBEE_TX_STATUS_TYPE:
|
||||||
|
allocatedSize = sizeof(XBEE_INCOMING_FRAME); // no data
|
||||||
|
*incomingFrame = (XBEE_INCOMING_FRAME*) malloc(allocatedSize); /* Allocate a generic frame struct */
|
||||||
|
|
||||||
|
(*incomingFrame)->ack = rawFrame[5];
|
||||||
|
(*incomingFrame)->data[0]=0x0;
|
||||||
|
(*incomingFrame)->length = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case XBEE_EXTENDED_TX_STATUS_TYPE:
|
||||||
|
allocatedSize = sizeof(XBEE_INCOMING_FRAME); // no data
|
||||||
|
*incomingFrame = (XBEE_INCOMING_FRAME*) malloc(allocatedSize); /* Allocate a generic frame struct */
|
||||||
|
|
||||||
|
(*incomingFrame)->ack = rawFrame[8];
|
||||||
|
(*incomingFrame)->data[0]=0x0;
|
||||||
|
(*incomingFrame)->length = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
*incomingFrame=NULL;
|
||||||
|
return XBEE_INVALID_FRAME;
|
||||||
|
};
|
||||||
|
} else status = XBEE_INVALID_FRAME;
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**** TX Part *****/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send data. Create a transmission frame, add escape char to data and send it over UART
|
||||||
|
*
|
||||||
|
* \param data raw data to send
|
||||||
|
* \param length length of data to send
|
||||||
|
* \return status of decoding: XBEE_OK if decoding is successful,
|
||||||
|
* XBEE_TX_ERROR in case of sending error,
|
||||||
|
* XBEE_TX_TIMEOUT in case semaphore takes too long
|
||||||
|
*/
|
||||||
|
int XBEE_SendData(uint16_t address, char* data, int length) {
|
||||||
|
BaseType_t state;
|
||||||
|
int status = XBEE_OK;
|
||||||
|
|
||||||
|
// Prevents successive calls to overlap
|
||||||
|
state = xSemaphoreTake(xHandleSemaphoreTX, pdMS_TO_TICKS(XBEE_TX_SEMAPHORE_WAIT)); // wait max 500 ms (to avoid interlocking)
|
||||||
|
|
||||||
|
if (state != pdFALSE) { /* test semaphore take answer
|
||||||
|
if answer is false, it means timeout appends
|
||||||
|
We should probably reset something in "else" branch */
|
||||||
|
|
||||||
|
XBEE_EncodeTransmissionFrame(data, length, address, (char*) txBuffer, (int*)&txDataToSend);
|
||||||
|
|
||||||
|
LL_USART_TransmitData8(hlpuart1.Instance, txBuffer[0]);
|
||||||
|
txIndex =1;
|
||||||
|
LL_USART_EnableIT_TXE(hlpuart1.Instance); // enable TX Interrupt
|
||||||
|
} else status= XBEE_TX_TIMEOUT;
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
void XBEE_TX_IRQHandler(void) {
|
||||||
|
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
|
LL_USART_TransmitData8(hlpuart1.Instance, txBuffer[txIndex]);
|
||||||
|
txIndex++;
|
||||||
|
if (txIndex == txDataToSend) {
|
||||||
|
LL_USART_DisableIT_TXE(hlpuart1.Instance);
|
||||||
|
xSemaphoreGiveFromISR( xHandleSemaphoreTX, &xHigherPriorityTaskWoken );
|
||||||
|
}
|
||||||
|
|
||||||
|
if (xHigherPriorityTaskWoken) {
|
||||||
|
/* If xHigherPriorityTaskWoken is now set to pdTRUE then a context switch
|
||||||
|
should be performed to ensure the interrupt returns directly to the highest
|
||||||
|
priority task. The macro used for this purpose is dependent on the port in
|
||||||
|
use and may be called portEND_SWITCHING_ISR(). */
|
||||||
|
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** Rx Part *****/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reception thread. Wait for incoming frame, process it and send message to application
|
||||||
|
*
|
||||||
|
* \param params not used
|
||||||
|
*/
|
||||||
|
void XBEE_RxThread(void* params) {
|
||||||
|
XBEE_INCOMING_FRAME *incomingFrame;
|
||||||
|
|
||||||
|
rxPhase= XBEE_RX_PHASE_SOF;
|
||||||
|
rxFrameLength=0;
|
||||||
|
rxDataToReceive=1;
|
||||||
|
rxIndex=0;
|
||||||
|
|
||||||
|
while (HAL_UART_Receive_IT(&hlpuart1, rxBuffer, 1)!= HAL_OK); // try starting reception of frame
|
||||||
|
LL_USART_Disable(hlpuart1.Instance);
|
||||||
|
LL_USART_DisableOverrunDetect(hlpuart1.Instance);
|
||||||
|
LL_USART_Enable(hlpuart1.Instance);
|
||||||
|
|
||||||
|
// endless task
|
||||||
|
while (1) {
|
||||||
|
if (xSemaphoreTake(xHandleSemaphoreRX, portMAX_DELAY)==pdTRUE) { // wait forever
|
||||||
|
|
||||||
|
/* Process frame */
|
||||||
|
if (XBEE_DecodeFrame((char*) rxBuffer, &incomingFrame)==XBEE_OK) { // frame is valid
|
||||||
|
if (incomingFrame != 0x0) // frame is valid
|
||||||
|
MESSAGE_SendMailbox(APPLICATION_Mailbox, MSG_ID_XBEE_CMD, (QueueHandle_t)0x0, (void*)incomingFrame);
|
||||||
|
// if (rxBuffer[3]== XBEE_RX_16BIT_PACKET_TYPE) {
|
||||||
|
// MESSAGE_SendMailbox(APPLICATION_Mailbox, MSG_ID_XBEE_CMD, (QueueHandle_t)0x0, (void*)0x0);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<XBEE_RX_BUFFER_MAX_LENGTH; i++)
|
||||||
|
rxBuffer[i]=0xFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void XBEE_RX_IRQHandler(void) {
|
||||||
|
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
uint8_t data;
|
||||||
|
|
||||||
|
data = LL_USART_ReceiveData8(hlpuart1.Instance); // lecture de l'octet reçu
|
||||||
|
|
||||||
|
switch (rxPhase) {
|
||||||
|
case XBEE_RX_PHASE_SOF:
|
||||||
|
if (data == XBEE_FRAME_SOF_CHAR) {
|
||||||
|
rxBuffer[0] = data;
|
||||||
|
rxPhase = XBEE_RX_PHASE_HEADER;
|
||||||
|
rxIndex = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case XBEE_RX_PHASE_HEADER:
|
||||||
|
rxBuffer[rxIndex] = data;
|
||||||
|
rxIndex ++;
|
||||||
|
|
||||||
|
if (rxIndex==3) {
|
||||||
|
// header reçu, calcul de la longueur de la frame
|
||||||
|
rxFrameLength = (((uint16_t)rxBuffer[1]) << 8) + (uint16_t)rxBuffer[2];
|
||||||
|
rxDataToReceive = rxFrameLength +1; // +1 for checksum
|
||||||
|
rxPhase = XBEE_RX_PHASE_BODY;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case XBEE_RX_PHASE_BODY:
|
||||||
|
rxBuffer[rxIndex] = data;
|
||||||
|
if (rxBuffer[rxIndex-1] == XBEE_API_ESCAPE_CHAR)
|
||||||
|
rxBuffer[rxIndex-1] = rxBuffer[rxIndex] ^ 0x20;
|
||||||
|
else {
|
||||||
|
rxIndex++;
|
||||||
|
rxDataToReceive--;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!rxDataToReceive) {
|
||||||
|
rxIndex=0;
|
||||||
|
rxPhase = XBEE_RX_PHASE_SOF;
|
||||||
|
xSemaphoreGiveFromISR( xHandleSemaphoreRX, &xHigherPriorityTaskWoken ); /* send event to receive task to process received task */
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
while(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (xHigherPriorityTaskWoken) {
|
||||||
|
/* If xHigherPriorityTaskWoken is now set to pdTRUE then a context switch
|
||||||
|
should be performed to ensure the interrupt returns directly to the highest
|
||||||
|
priority task. The macro used for this purpose is dependent on the port in
|
||||||
|
use and may be called portEND_SWITCHING_ISR(). */
|
||||||
|
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DMA IRQ handler for reception. Receive a complete frame send send event to sending frame in case of acknowledge frame or to receive task otherwise
|
||||||
|
*
|
||||||
|
* \param UartHandle not used
|
||||||
|
*/
|
||||||
|
void LPUART1_IRQHandler(void) {
|
||||||
|
|
||||||
|
if (LL_USART_IsActiveFlag_RXNE(hlpuart1.Instance)) {
|
||||||
|
XBEE_RX_IRQHandler();
|
||||||
|
} else if (LL_USART_IsActiveFlag_TXE(hlpuart1.Instance)) {
|
||||||
|
XBEE_TX_IRQHandler();
|
||||||
|
} else {
|
||||||
|
if (LL_USART_IsActiveFlag_TC(hlpuart1.Instance))
|
||||||
|
LL_USART_DisableIT_TC(hlpuart1.Instance);
|
||||||
|
else if (LL_USART_IsActiveFlag_IDLE(hlpuart1.Instance))
|
||||||
|
LL_USART_ClearFlag_IDLE(hlpuart1.Instance);
|
||||||
|
else if (LL_USART_IsActiveFlag_ORE(hlpuart1.Instance)) {
|
||||||
|
LL_USART_ClearFlag_ORE(hlpuart1.Instance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
67
software/dumber3/Application/Xbee-API/xbee.h
Normal file
67
software/dumber3/Application/Xbee-API/xbee.h
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
/*
|
||||||
|
* xbee.h
|
||||||
|
*
|
||||||
|
* Created on: Sep 12, 2022
|
||||||
|
* Author: dimercur
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INC_XBEE_H_
|
||||||
|
#define INC_XBEE_H_
|
||||||
|
|
||||||
|
#include "application.h"
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
XBEE_OK=0,
|
||||||
|
XBEE_CONFIG_ERROR=-1,
|
||||||
|
XBEE_TX_ACK_ERROR=-2,
|
||||||
|
XBEE_RX_TIMEOUT=-3,
|
||||||
|
XBEE_RX_ERROR=-4,
|
||||||
|
XBEE_TX_ERROR=-5,
|
||||||
|
XBEE_INVALID_FRAME=-6,
|
||||||
|
XBEE_TX_TIMEOUT=-7,
|
||||||
|
} XBEE_Status;
|
||||||
|
|
||||||
|
#define XBEE_RX_PACKET_TYPE 0x90
|
||||||
|
#define XBEE_RX_EXPLICIT_TYPE 0x91
|
||||||
|
#define XBEE_TX_STATUS_TYPE 0x89
|
||||||
|
#define XBEE_AT_CMD_RESPONSE_TYPE 0x88
|
||||||
|
#define XBEE_MODEM_STATUS_TYPE 0x8A
|
||||||
|
#define XBEE_EXTENDED_TX_STATUS_TYPE 0x8B
|
||||||
|
#define XBEE_LOCAL_AT_CMD_TYPE 0x08
|
||||||
|
#define XBEE_TX_REQUEST_TYPE 0x10
|
||||||
|
#define XBEE_TX_EXPLICIT_TYPE 0x11
|
||||||
|
#define XBEE_TX_16BIT_REQUEST_TYPE 0x01
|
||||||
|
#define XBEE_RX_16BIT_PACKET_TYPE 0x81
|
||||||
|
|
||||||
|
#define XBEE_AT_STATUS_SUCCESS 0
|
||||||
|
#define XBEE_AT_STATUS_ERROR 1
|
||||||
|
#define XBEE_AT_STATUS_INVALID_COMMAND 2
|
||||||
|
#define XBEE_AT_STATUS_INVALID_PARAMETER 3
|
||||||
|
|
||||||
|
#define XBEE_TX_STATUS_SUCCESS 0x00
|
||||||
|
#define XBEE_TX_STATUS_NO_ACK 0x01
|
||||||
|
#define XBEE_TX_STATUS_CCA_FAILURE 0x02
|
||||||
|
#define XBEE_TX_STATUS_NETWORK_NO_ACK 0x21
|
||||||
|
|
||||||
|
#define XBEE_MODEM_STATUS_HW_RST 0x00
|
||||||
|
#define XBEE_MODEM_STATUS_JOINED 0x02
|
||||||
|
|
||||||
|
#define XBEE_RX_OPTIONS_ACKNOWLEDGED 0x01
|
||||||
|
#define XBEE_RX_OPTIONS_BRODCASTED 0x02
|
||||||
|
#define XBEE_RX_OPTIONS_PAN_BROADCASTED 0x04
|
||||||
|
|
||||||
|
#define XBEE_FRAME_SOF_CHAR 0x7E // '~'
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint8_t type;
|
||||||
|
uint16_t source_addr;
|
||||||
|
uint8_t length;
|
||||||
|
char ack;
|
||||||
|
char modem_status;
|
||||||
|
char data[];
|
||||||
|
} XBEE_INCOMING_FRAME;
|
||||||
|
|
||||||
|
void XBEE_Init(void);
|
||||||
|
int XBEE_SendData(uint16_t address, char* data, int length);
|
||||||
|
|
||||||
|
#endif /* INC_XBEE_H_ */
|
|
@ -94,7 +94,7 @@ void APPLICATION_Init(void) {
|
||||||
"APPLICATION Main", /* Text name for the task. */
|
"APPLICATION Main", /* Text name for the task. */
|
||||||
STACK_SIZE, /* Number of indexes in the xStack array. */
|
STACK_SIZE, /* Number of indexes in the xStack array. */
|
||||||
NULL, /* Parameter passed into the task. */
|
NULL, /* Parameter passed into the task. */
|
||||||
PriorityApplicationMain,/* Priority at which the task is created. */
|
PriorityApplicationHandler,/* Priority at which the task is created. */
|
||||||
xStackApplicationMain, /* Array to use as the task's stack. */
|
xStackApplicationMain, /* Array to use as the task's stack. */
|
||||||
&xTaskApplicationMain); /* Variable to hold the task's data structure. */
|
&xTaskApplicationMain); /* Variable to hold the task's data structure. */
|
||||||
vTaskResume(xHandleApplicationMain);
|
vTaskResume(xHandleApplicationMain);
|
||||||
|
@ -108,14 +108,11 @@ void APPLICATION_Init(void) {
|
||||||
vTimerTimeoutCallback,
|
vTimerTimeoutCallback,
|
||||||
&xBufferTimerTimeout);
|
&xBufferTimerTimeout);
|
||||||
xTimerStart(xHandleTimerTimeout,0 );
|
xTimerStart(xHandleTimerTimeout,0 );
|
||||||
|
|
||||||
APPLICATION_TransitionToNewState(stateStartup);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void APPLICATION_MainThread(void* params) {
|
void APPLICATION_MainThread(void* params) {
|
||||||
MESSAGE_Typedef msg;
|
MESSAGE_Typedef msg;
|
||||||
XBEE_INCOMING_FRAME *xbeeFrame;
|
char* receivedCMD;
|
||||||
|
|
||||||
CMD_Generic* decodedCmd;
|
CMD_Generic* decodedCmd;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
@ -123,17 +120,13 @@ void APPLICATION_MainThread(void* params) {
|
||||||
|
|
||||||
switch (msg.id) {
|
switch (msg.id) {
|
||||||
case MSG_ID_XBEE_CMD:
|
case MSG_ID_XBEE_CMD:
|
||||||
xbeeFrame = (XBEE_INCOMING_FRAME*)msg.data;
|
receivedCMD = (char*)msg.data;
|
||||||
|
|
||||||
if (xbeeFrame != NULL) {
|
if (receivedCMD != NULL) {
|
||||||
systemInfos.senderAddress = xbeeFrame->source_addr;
|
decodedCmd = cmdDecode(receivedCMD,strlen(receivedCMD));
|
||||||
|
|
||||||
switch (xbeeFrame->type) {
|
|
||||||
case XBEE_RX_16BIT_PACKET_TYPE:
|
|
||||||
decodedCmd = cmdDecode(xbeeFrame->data,xbeeFrame->length);
|
|
||||||
|
|
||||||
if (decodedCmd==CMD_DECODE_UNKNOWN)
|
if (decodedCmd==CMD_DECODE_UNKNOWN)
|
||||||
cmdSendAnswer(systemInfos.senderAddress, ANS_UNKNOWN);
|
cmdSendAnswer(ANS_UNKNOWN);
|
||||||
else {
|
else {
|
||||||
systemInfos.cmd = decodedCmd->type;
|
systemInfos.cmd = decodedCmd->type;
|
||||||
systemTimeout.inactivityCnt = 0;
|
systemTimeout.inactivityCnt = 0;
|
||||||
|
@ -145,19 +138,19 @@ void APPLICATION_MainThread(void* params) {
|
||||||
case CMD_TEST:
|
case CMD_TEST:
|
||||||
case CMD_DEBUG:
|
case CMD_DEBUG:
|
||||||
case CMD_POWER_OFF:
|
case CMD_POWER_OFF:
|
||||||
cmdSendAnswer(systemInfos.senderAddress, ANS_OK);
|
cmdSendAnswer(ANS_OK);
|
||||||
break;
|
break;
|
||||||
case CMD_GET_BATTERY:
|
case CMD_GET_BATTERY:
|
||||||
cmdSendBatteryLevel(systemInfos.senderAddress, systemInfos.batteryVoltage);
|
cmdSendBatteryLevel(systemInfos.batteryVoltage);
|
||||||
break;
|
break;
|
||||||
case CMD_GET_VERSION:
|
case CMD_GET_VERSION:
|
||||||
cmdSendVersion(SYSTEM_VERSION);
|
cmdSendVersion();
|
||||||
break;
|
break;
|
||||||
case CMD_GET_BUSY_STATE:
|
case CMD_GET_BUSY_STATE:
|
||||||
if (systemInfos.state == stateInMouvement)
|
if (systemInfos.state == stateInMouvement)
|
||||||
cmdSendBusyState(systemInfos.senderAddress, 0x1);
|
cmdSendBusyState(0x1);
|
||||||
else
|
else
|
||||||
cmdSendBusyState(systemInfos.senderAddress, 0x0);
|
cmdSendBusyState(0x0);
|
||||||
break;
|
break;
|
||||||
case CMD_MOVE:
|
case CMD_MOVE:
|
||||||
systemInfos.distance = ((CMD_Move*)decodedCmd)->distance;
|
systemInfos.distance = ((CMD_Move*)decodedCmd)->distance;
|
||||||
|
@ -175,41 +168,25 @@ void APPLICATION_MainThread(void* params) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XBEE_TX_STATUS_TYPE:
|
|
||||||
if (xbeeFrame->ack == 0) {
|
|
||||||
if (systemInfos.rfProblem !=0)
|
|
||||||
systemInfos.rfProblem--;
|
|
||||||
} else {
|
|
||||||
if (systemInfos.rfProblem !=255)
|
|
||||||
systemInfos.rfProblem++;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(xbeeFrame);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSG_ID_BAT_NIVEAU:
|
case MSG_ID_BAT_CHARGE_OFF:
|
||||||
case MSG_ID_BAT_CHARGE:
|
case MSG_ID_BAT_CHARGE_COMPLETE:
|
||||||
systemInfos.batteryVoltage = *((uint16_t*)msg.data);
|
systemInfos.batteryVoltage = *((uint16_t*)msg.data);
|
||||||
systemInfos.batteryUpdate = 1;
|
systemInfos.batteryUpdate = 1;
|
||||||
|
|
||||||
if (msg.id == MSG_ID_BAT_CHARGE)
|
if (msg.id == MSG_ID_BAT_CHARGE_COMPLETE)
|
||||||
systemInfos.inCharge =1;
|
systemInfos.inCharge =1;
|
||||||
else
|
else
|
||||||
systemInfos.inCharge =0;
|
systemInfos.inCharge =0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSG_ID_BAT_CHARGEUR_ON:
|
case MSG_ID_BAT_CHARGE_ON:
|
||||||
case MSG_ID_BAT_CHARGEUR_OFF:
|
|
||||||
if (msg.id == MSG_ID_BAT_CHARGEUR_ON)
|
|
||||||
systemInfos.inCharge =1;
|
systemInfos.inCharge =1;
|
||||||
else
|
|
||||||
systemInfos.inCharge =0;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSG_ID_MOTEURS_STOP:
|
case MSG_ID_MOTEURS_STOP:
|
||||||
|
@ -255,16 +232,16 @@ void APPLICATION_StateMachine() {
|
||||||
(systemInfos.state == stateRun) ||
|
(systemInfos.state == stateRun) ||
|
||||||
(systemInfos.state == stateInMouvement)) {
|
(systemInfos.state == stateInMouvement)) {
|
||||||
/* command RESET is only applicable in those 3 states, otherwise it is rejected */
|
/* command RESET is only applicable in those 3 states, otherwise it is rejected */
|
||||||
cmdSendAnswer(systemInfos.senderAddress, ANS_OK);
|
cmdSendAnswer(ANS_OK);
|
||||||
APPLICATION_TransitionToNewState(stateIdle);
|
APPLICATION_TransitionToNewState(stateIdle);
|
||||||
} else
|
} else
|
||||||
cmdSendAnswer(systemInfos.senderAddress, ANS_ERR);
|
cmdSendAnswer(ANS_ERR);
|
||||||
break;
|
break;
|
||||||
case CMD_START_WITH_WATCHDOG:
|
case CMD_START_WITH_WATCHDOG:
|
||||||
case CMD_START_WITHOUT_WATCHDOG:
|
case CMD_START_WITHOUT_WATCHDOG:
|
||||||
if (systemInfos.state == stateIdle) {
|
if (systemInfos.state == stateIdle) {
|
||||||
/* only state where START cmd is accepted */
|
/* only state where START cmd is accepted */
|
||||||
cmdSendAnswer(systemInfos.senderAddress, ANS_OK);
|
cmdSendAnswer(ANS_OK);
|
||||||
|
|
||||||
APPLICATION_TransitionToNewState(stateRun);
|
APPLICATION_TransitionToNewState(stateRun);
|
||||||
|
|
||||||
|
@ -274,15 +251,15 @@ void APPLICATION_StateMachine() {
|
||||||
systemTimeout.watchdogMissedCnt=0;
|
systemTimeout.watchdogMissedCnt=0;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
cmdSendAnswer(systemInfos.senderAddress, ANS_ERR);
|
cmdSendAnswer(ANS_ERR);
|
||||||
break;
|
break;
|
||||||
case CMD_RESET_WATCHDOG:
|
case CMD_RESET_WATCHDOG:
|
||||||
if ((systemInfos.state == stateRun) || (systemInfos.state == stateInMouvement)) {
|
if ((systemInfos.state == stateRun) || (systemInfos.state == stateInMouvement)) {
|
||||||
if ((systemTimeout.watchdogEnabled ==0 ) ||
|
if ((systemTimeout.watchdogEnabled ==0 ) ||
|
||||||
((systemTimeout.watchdogCnt>=APPLICATION_WATCHDOG_MIN) && (systemTimeout.watchdogCnt<=APPLICATION_WATCHDOG_MAX)))
|
((systemTimeout.watchdogCnt>=APPLICATION_WATCHDOG_MIN) && (systemTimeout.watchdogCnt<=APPLICATION_WATCHDOG_MAX)))
|
||||||
cmdSendAnswer(systemInfos.senderAddress, ANS_OK);
|
cmdSendAnswer(ANS_OK);
|
||||||
else
|
else
|
||||||
cmdSendAnswer(systemInfos.senderAddress, ANS_ERR);
|
cmdSendAnswer(ANS_ERR);
|
||||||
|
|
||||||
systemTimeout.watchdogCnt =0;
|
systemTimeout.watchdogCnt =0;
|
||||||
}
|
}
|
||||||
|
@ -294,17 +271,17 @@ void APPLICATION_StateMachine() {
|
||||||
if (((systemInfos.cmd == CMD_MOVE) && (systemInfos.distance !=0)) ||
|
if (((systemInfos.cmd == CMD_MOVE) && (systemInfos.distance !=0)) ||
|
||||||
((systemInfos.cmd == CMD_TURN) && (systemInfos.turns !=0))) {
|
((systemInfos.cmd == CMD_TURN) && (systemInfos.turns !=0))) {
|
||||||
systemInfos.endOfMouvement = 0;
|
systemInfos.endOfMouvement = 0;
|
||||||
cmdSendAnswer(systemInfos.senderAddress, ANS_OK);
|
cmdSendAnswer(ANS_OK);
|
||||||
APPLICATION_TransitionToNewState(stateInMouvement);
|
APPLICATION_TransitionToNewState(stateInMouvement);
|
||||||
} // if TURN and MOVE are sent without parameter, do nothing: we are still in run state
|
} // if TURN and MOVE are sent without parameter, do nothing: we are still in run state
|
||||||
} else if (systemInfos.state == stateInMouvement) { // in this state, MOVE and TURN cmds are accepted only if they come with no parameter
|
} else if (systemInfos.state == stateInMouvement) { // in this state, MOVE and TURN cmds are accepted only if they come with no parameter
|
||||||
if (((systemInfos.cmd == CMD_MOVE) && (systemInfos.distance ==0)) ||
|
if (((systemInfos.cmd == CMD_MOVE) && (systemInfos.distance ==0)) ||
|
||||||
((systemInfos.cmd == CMD_TURN) && (systemInfos.turns ==0))) {
|
((systemInfos.cmd == CMD_TURN) && (systemInfos.turns ==0))) {
|
||||||
systemInfos.endOfMouvement = 1;
|
systemInfos.endOfMouvement = 1;
|
||||||
cmdSendAnswer(systemInfos.senderAddress, ANS_OK);
|
cmdSendAnswer(ANS_OK);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
cmdSendAnswer(systemInfos.senderAddress, ANS_ERR);
|
cmdSendAnswer(ANS_ERR);
|
||||||
break;
|
break;
|
||||||
default: // commands no common for every states
|
default: // commands no common for every states
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -6,6 +6,16 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "batterie.h"
|
#include "batterie.h"
|
||||||
|
#include "stm32l0xx.h"
|
||||||
|
#include "stm32l0xx_ll_gpio.h"
|
||||||
|
#include "timers.h"
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
CHARGEUR_NOT_PLUGGED,
|
||||||
|
CHARGEUR_IN_CHARGE,
|
||||||
|
CHARGEUR_CHARGE_COMPLETE,
|
||||||
|
CHARGEUR_ERROR
|
||||||
|
} BATTERIE_StatusChargerTypedef;
|
||||||
|
|
||||||
extern ADC_HandleTypeDef hadc;
|
extern ADC_HandleTypeDef hadc;
|
||||||
uint8_t conversion_complete;
|
uint8_t conversion_complete;
|
||||||
|
@ -21,6 +31,17 @@ TaskHandle_t xHandleBatterie = NULL;
|
||||||
TaskHandle_t task_handler;
|
TaskHandle_t task_handler;
|
||||||
TaskHandle_t charger_thread_handler;
|
TaskHandle_t charger_thread_handler;
|
||||||
|
|
||||||
|
/* TimerButton sert à attendre ~ 3secondes avant de prendre en compte les IT bouton
|
||||||
|
* En effet, au demarrage, le bouton est appuyé pour lancer le systeme. ceci genere alors une IT bouton,
|
||||||
|
* ammenant à envoyer le message MSG_ID_BUTTON_PRESSED, demandant l'arret du systeme
|
||||||
|
*
|
||||||
|
* De ce fait, avec cette tempo, on s'assure de ne pas prendre en compte les IT dans les 3 premieres secondes.
|
||||||
|
*/
|
||||||
|
StaticTimer_t xBufferTimerButton;
|
||||||
|
TimerHandle_t xHandleTimerButton = NULL;
|
||||||
|
void vTimerButtonCallback( TimerHandle_t xTimer );
|
||||||
|
uint8_t BUTTON_Inactivity=1; //start with button on/off inactive
|
||||||
|
|
||||||
void BATTERIE_VoltageThread(void* params);
|
void BATTERIE_VoltageThread(void* params);
|
||||||
|
|
||||||
void BATTERIE_Init(void) {
|
void BATTERIE_Init(void) {
|
||||||
|
@ -33,12 +54,44 @@ void BATTERIE_Init(void) {
|
||||||
"BATTERIE Voltage", /* Text name for the task. */
|
"BATTERIE Voltage", /* Text name for the task. */
|
||||||
STACK_SIZE, /* Number of indexes in the xStack array. */
|
STACK_SIZE, /* Number of indexes in the xStack array. */
|
||||||
NULL, /* Parameter passed into the task. */
|
NULL, /* Parameter passed into the task. */
|
||||||
PriorityLeds,/* Priority at which the task is created. */
|
PriorityBatterieHandler,/* Priority at which the task is created. */
|
||||||
xStackBatterie, /* Array to use as the task's stack. */
|
xStackBatterie, /* Array to use as the task's stack. */
|
||||||
&xTaskBatterie); /* Variable to hold the task's data structure. */
|
&xTaskBatterie); /* Variable to hold the task's data structure. */
|
||||||
|
|
||||||
|
/* Create a periodic task without using any dynamic memory allocation. */
|
||||||
|
xHandleTimerButton = xTimerCreateStatic(
|
||||||
|
"Inactivity Button Timer",
|
||||||
|
pdMS_TO_TICKS(BUTTON_INACTIVITY_PERIODE),
|
||||||
|
pdTRUE,
|
||||||
|
( void * ) 0,
|
||||||
|
vTimerButtonCallback,
|
||||||
|
&xBufferTimerButton);
|
||||||
|
|
||||||
|
xTimerStart(xHandleTimerButton,0 );
|
||||||
vTaskResume(xHandleBatterie);
|
vTaskResume(xHandleBatterie);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Lit les pins GPIO
|
||||||
|
*/
|
||||||
|
BATTERIE_StatusChargerTypedef BATTERIE_LireStatusChargeur(void) {
|
||||||
|
uint32_t st2 = LL_GPIO_ReadInputPort(CHARGER_ST2_GPIO_Port) & CHARGER_ST2_Pin;
|
||||||
|
uint32_t st1 = LL_GPIO_ReadInputPort(CHARGER_ST1_GPIO_Port) & CHARGER_ST1_Pin;
|
||||||
|
|
||||||
|
BATTERIE_StatusChargerTypedef status;
|
||||||
|
|
||||||
|
if (st1 && st2)
|
||||||
|
status = CHARGEUR_NOT_PLUGGED;
|
||||||
|
else if (st1 && !st2)
|
||||||
|
status = CHARGEUR_CHARGE_COMPLETE;
|
||||||
|
else if (!st1 && st2)
|
||||||
|
status = CHARGEUR_IN_CHARGE;
|
||||||
|
else /* !st1 && !st2 */
|
||||||
|
status = CHARGEUR_ERROR;
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
int BATTERIE_LireTension(uint16_t *val) {
|
int BATTERIE_LireTension(uint16_t *val) {
|
||||||
uint32_t ulNotificationValue;
|
uint32_t ulNotificationValue;
|
||||||
conversion_complete = 0;
|
conversion_complete = 0;
|
||||||
|
@ -66,6 +119,8 @@ int BATTERIE_LireTension(uint16_t *val) {
|
||||||
|
|
||||||
void BATTERIE_VoltageThread(void* params) {
|
void BATTERIE_VoltageThread(void* params) {
|
||||||
static uint16_t tension;
|
static uint16_t tension;
|
||||||
|
BATTERIE_StatusChargerTypedef currentStatus;
|
||||||
|
|
||||||
TickType_t xLastWakeTime;
|
TickType_t xLastWakeTime;
|
||||||
|
|
||||||
// Initialise the xLastWakeTime variable with the current time.
|
// Initialise the xLastWakeTime variable with the current time.
|
||||||
|
@ -73,10 +128,16 @@ void BATTERIE_VoltageThread(void* params) {
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (BATTERIE_LireTension(&tension) ==0) {
|
if (BATTERIE_LireTension(&tension) ==0) {
|
||||||
if (HAL_GPIO_ReadPin(GPIOB, USB_SENSE_Pin)==GPIO_PIN_SET) // le chargeur est branché
|
|
||||||
MESSAGE_SendMailbox(APPLICATION_Mailbox, MSG_ID_BAT_CHARGE, (QueueHandle_t)0x0, (void*)&tension);
|
currentStatus = BATTERIE_LireStatusChargeur();
|
||||||
|
if (currentStatus == CHARGEUR_ERROR)
|
||||||
|
MESSAGE_SendMailbox(APPLICATION_Mailbox, MSG_ID_BAT_CHARGE_ERR, (QueueHandle_t)0x0, (void*)NULL);
|
||||||
|
else if (currentStatus == CHARGEUR_IN_CHARGE)
|
||||||
|
MESSAGE_SendMailbox(APPLICATION_Mailbox, MSG_ID_BAT_CHARGE_ON, (QueueHandle_t)0x0, (void*)&tension);
|
||||||
|
else if (currentStatus == CHARGEUR_CHARGE_COMPLETE)
|
||||||
|
MESSAGE_SendMailbox(APPLICATION_Mailbox, MSG_ID_BAT_CHARGE_COMPLETE, (QueueHandle_t)0x0, (void*)&tension);
|
||||||
else
|
else
|
||||||
MESSAGE_SendMailbox(APPLICATION_Mailbox, MSG_ID_BAT_NIVEAU, (QueueHandle_t)0x0, (void*)&tension);
|
MESSAGE_SendMailbox(APPLICATION_Mailbox, MSG_ID_BAT_CHARGE_OFF, (QueueHandle_t)0x0, (void*)&tension);
|
||||||
} else {
|
} else {
|
||||||
MESSAGE_SendMailbox(APPLICATION_Mailbox, MSG_ID_BAT_ADC_ERR, (QueueHandle_t)0x0, (void*)0x0);
|
MESSAGE_SendMailbox(APPLICATION_Mailbox, MSG_ID_BAT_ADC_ERR, (QueueHandle_t)0x0, (void*)0x0);
|
||||||
}
|
}
|
||||||
|
@ -106,22 +167,32 @@ void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void vTimerButtonCallback( TimerHandle_t xTimer ) {
|
||||||
|
BUTTON_Inactivity=0;
|
||||||
|
|
||||||
|
xTimerStop(xHandleTimerButton,0 );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function handles EXTI line0 interrupt.
|
* @brief This function handles EXTI line0 interrupt.
|
||||||
*/
|
*/
|
||||||
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
|
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
|
||||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
if (GPIO_Pin == USB_SENSE_Pin) { // Le chargeur vient d'etre branché ou debranché
|
// if (GPIO_Pin == USB_SENSE_Pin) { // Le chargeur vient d'etre branché ou debranché
|
||||||
if (HAL_GPIO_ReadPin(GPIOB, GPIO_Pin)==GPIO_PIN_SET) // le chargeur est branché
|
// if (HAL_GPIO_ReadPin(USB_SENSE_GPIO_Port, GPIO_Pin)==GPIO_PIN_SET) // le chargeur est branché
|
||||||
MESSAGE_SendMailboxFromISR(APPLICATION_Mailbox, MSG_ID_BAT_CHARGEUR_ON, (QueueHandle_t)0x0, 0x0, &xHigherPriorityTaskWoken);
|
// MESSAGE_SendMailboxFromISR(APPLICATION_Mailbox, MSG_ID_BAT_CHARGE_ON, (QueueHandle_t)0x0, 0x0, &xHigherPriorityTaskWoken);
|
||||||
else
|
// else
|
||||||
MESSAGE_SendMailboxFromISR(APPLICATION_Mailbox, MSG_ID_BAT_CHARGEUR_OFF, (QueueHandle_t)0x0, 0x0, &xHigherPriorityTaskWoken);
|
// MESSAGE_SendMailboxFromISR(APPLICATION_Mailbox, MSG_ID_BAT_CHARGE_OFF, (QueueHandle_t)0x0, 0x0, &xHigherPriorityTaskWoken);
|
||||||
}
|
// }
|
||||||
else if (GPIO_Pin == BUTTON_SENSE_Pin) { // on vient d'appuyer sur le bouton on/off
|
// else
|
||||||
if (HAL_GPIO_ReadPin(GPIOB, GPIO_Pin)==GPIO_PIN_SET) // le chargeur est branché
|
|
||||||
|
if (GPIO_Pin == BUTTON_SENSE_Pin) { // on vient d'appuyer sur le bouton on/off
|
||||||
|
if (!BUTTON_Inactivity) {
|
||||||
|
if (HAL_GPIO_ReadPin(BUTTON_SENSE_GPIO_Port, GPIO_Pin)==GPIO_PIN_RESET) // GPIOB.3 = 0 => le bouton est appuyé
|
||||||
MESSAGE_SendMailboxFromISR(APPLICATION_Mailbox, MSG_ID_BUTTON_PRESSED, (QueueHandle_t)0x0, 0x0, &xHigherPriorityTaskWoken);
|
MESSAGE_SendMailboxFromISR(APPLICATION_Mailbox, MSG_ID_BUTTON_PRESSED, (QueueHandle_t)0x0, 0x0, &xHigherPriorityTaskWoken);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (xHigherPriorityTaskWoken) {
|
if (xHigherPriorityTaskWoken) {
|
||||||
/* If xHigherPriorityTaskWoken is now set to pdTRUE then a context switch
|
/* If xHigherPriorityTaskWoken is now set to pdTRUE then a context switch
|
||||||
|
|
|
@ -7,40 +7,204 @@
|
||||||
|
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
/* Definition des commandes */
|
/* Definition des commandes */
|
||||||
|
|
||||||
|
#define PingCMD 'p'
|
||||||
|
#define ResetCMD 'r'
|
||||||
|
#define SetMotorCMD 'm'
|
||||||
|
#define StartWWatchDogCMD 'W'
|
||||||
|
#define ResetWatchdogCMD 'w'
|
||||||
|
#define GetBatteryVoltageCMD 'v'
|
||||||
|
#define GetVersionCMD 'V'
|
||||||
|
#define StartWithoutWatchCMD 'u'
|
||||||
|
#define MoveCMD 'M'
|
||||||
|
#define TurnCMD 'T'
|
||||||
|
#define BusyStateCMD 'b'
|
||||||
|
#define TestCMD 't'
|
||||||
|
#define DebugCMD 'a'
|
||||||
|
#define PowerOffCMD 'z'
|
||||||
|
|
||||||
|
#define OK_ANS "O\r"
|
||||||
|
#define ERR_ANS "E\r"
|
||||||
|
#define UNKNOW_ANS "C\r"
|
||||||
|
#define BAT_OK "2\r"
|
||||||
|
#define BAT_LOW "1\r"
|
||||||
|
#define BAT_EMPTY "0\r"
|
||||||
|
|
||||||
|
char* cmdAddChecksum(const char* str);
|
||||||
|
char cmdVerifyChecksum(char* str);
|
||||||
|
|
||||||
|
/** @addtogroup Checksum
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @brief Inclut le checksum à sendString
|
||||||
|
*
|
||||||
|
* Parcours str pour y calculer le checksum ( xor sur chaque caractére)
|
||||||
|
* et inclut le resultat en fin de chaine.
|
||||||
|
*
|
||||||
|
* @param string sans checksum
|
||||||
|
* @retval string avec checksum
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
char* cmdAddChecksum(const char* str) {
|
||||||
|
uint16_t j;
|
||||||
|
unsigned char checksum=0;
|
||||||
|
char *outstr = (char*) malloc(strlen(str)+2); // +1 for checksum to add, +1 for zero ending
|
||||||
|
|
||||||
|
for (j = 0; str[j] != '\r'; j++) {
|
||||||
|
outstr[j] = str[j];
|
||||||
|
checksum ^= str[j];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (checksum == '\r')
|
||||||
|
checksum++;
|
||||||
|
outstr[j] = checksum;
|
||||||
|
outstr[j + 1] = '\r';
|
||||||
|
outstr[j + 2] = 0;
|
||||||
|
|
||||||
|
return outstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Verifie le checksum de la variable global recepitString
|
||||||
|
*
|
||||||
|
* Vérifie le dernier carctére de str sensé être le checksum.
|
||||||
|
* Si celui-ci est bon, ll retournera 0 et supprimera le checksum de str
|
||||||
|
* sinon il retournera 1 sans faire de modification.
|
||||||
|
* @param None
|
||||||
|
* @retval 0 ou 1
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
char cmdVerifyChecksum(char* str) {
|
||||||
|
uint16_t j;
|
||||||
|
uint16_t length;
|
||||||
|
unsigned char checksum=0;
|
||||||
|
|
||||||
|
length = strlen(str);
|
||||||
|
for (j = 0; j < length - 2; j++) {
|
||||||
|
checksum ^= str[j];
|
||||||
|
}
|
||||||
|
if (checksum == '\r')
|
||||||
|
checksum++;
|
||||||
|
|
||||||
|
if (str[j] == checksum) {
|
||||||
|
str[length - 2] = 13;
|
||||||
|
str[length - 1] = 0;
|
||||||
|
str[length] = 0;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
} else
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
//CMD_Generic* cmdDecode(char* cmd, uint8_t length) {
|
||||||
|
// CMD_Generic* decodedCmd;
|
||||||
|
// char cmd_type = cmd[0];
|
||||||
|
//
|
||||||
|
// switch (cmd_type)
|
||||||
|
// {
|
||||||
|
// case CMD_MOVE:
|
||||||
|
// decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Move));
|
||||||
|
// decodedCmd->type = CMD_MOVE;
|
||||||
|
// ((CMD_Move*)decodedCmd)->distance = ((int16_t)cmd[1]<<8) + (int16_t)cmd[2];
|
||||||
|
// break;
|
||||||
|
//
|
||||||
|
// case CMD_TURN:
|
||||||
|
// decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Turn));
|
||||||
|
// decodedCmd->type = CMD_TURN;
|
||||||
|
// ((CMD_Turn*)decodedCmd)->turns = ((int16_t)cmd[1]<<8) + (int16_t)cmd[2];
|
||||||
|
// break;
|
||||||
|
//
|
||||||
|
// case CMD_PING:
|
||||||
|
// case CMD_RESET:
|
||||||
|
// case CMD_START_WITHOUT_WATCHDOG:
|
||||||
|
// case CMD_START_WITH_WATCHDOG:
|
||||||
|
// case CMD_RESET_WATCHDOG:
|
||||||
|
// case CMD_GET_BATTERY:
|
||||||
|
// case CMD_GET_BUSY_STATE:
|
||||||
|
// case CMD_GET_VERSION:
|
||||||
|
// case CMD_TEST:
|
||||||
|
// case CMD_DEBUG:
|
||||||
|
// case CMD_POWER_OFF:
|
||||||
|
// decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Generic));
|
||||||
|
// decodedCmd->type = cmd_type;
|
||||||
|
// break;
|
||||||
|
//
|
||||||
|
// default:
|
||||||
|
// decodedCmd = CMD_DECODE_UNKNOWN;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// return decodedCmd;
|
||||||
|
//}
|
||||||
|
|
||||||
CMD_Generic* cmdDecode(char* cmd, uint8_t length) {
|
CMD_Generic* cmdDecode(char* cmd, uint8_t length) {
|
||||||
CMD_Generic* decodedCmd;
|
CMD_Generic* decodedCmd;
|
||||||
char cmd_type = cmd[0];
|
char cmd_type = cmd[0];
|
||||||
|
|
||||||
switch (cmd_type)
|
switch (cmd_type)
|
||||||
{
|
{
|
||||||
case CMD_MOVE:
|
case MoveCMD:
|
||||||
decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Move));
|
decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Move));
|
||||||
decodedCmd->type = CMD_MOVE;
|
decodedCmd->type = CMD_MOVE;
|
||||||
((CMD_Move*)decodedCmd)->distance = ((int16_t)cmd[1]<<8) + (int16_t)cmd[2];
|
((CMD_Move*)decodedCmd)->distance = ((int16_t)cmd[1]<<8) + (int16_t)cmd[2];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CMD_TURN:
|
case TurnCMD:
|
||||||
decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Turn));
|
decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Turn));
|
||||||
decodedCmd->type = CMD_TURN;
|
decodedCmd->type = CMD_TURN;
|
||||||
((CMD_Turn*)decodedCmd)->turns = ((int16_t)cmd[1]<<8) + (int16_t)cmd[2];
|
((CMD_Turn*)decodedCmd)->turns = ((int16_t)cmd[1]<<8) + (int16_t)cmd[2];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CMD_PING:
|
case PingCMD:
|
||||||
case CMD_RESET:
|
|
||||||
case CMD_START_WITHOUT_WATCHDOG:
|
|
||||||
case CMD_START_WITH_WATCHDOG:
|
|
||||||
case CMD_RESET_WATCHDOG:
|
|
||||||
case CMD_GET_BATTERY:
|
|
||||||
case CMD_GET_BUSY_STATE:
|
|
||||||
case CMD_GET_VERSION:
|
|
||||||
case CMD_TEST:
|
|
||||||
case CMD_DEBUG:
|
|
||||||
case CMD_POWER_OFF:
|
|
||||||
decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Generic));
|
decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Generic));
|
||||||
decodedCmd->type = cmd_type;
|
decodedCmd->type = CMD_PING;
|
||||||
|
break;
|
||||||
|
case ResetCMD:
|
||||||
|
decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Generic));
|
||||||
|
decodedCmd->type = CMD_RESET;
|
||||||
|
break;
|
||||||
|
case StartWWatchDogCMD:
|
||||||
|
decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Generic));
|
||||||
|
decodedCmd->type = CMD_START_WITH_WATCHDOG;
|
||||||
|
break;
|
||||||
|
case StartWithoutWatchCMD:
|
||||||
|
decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Generic));
|
||||||
|
decodedCmd->type = CMD_START_WITHOUT_WATCHDOG;
|
||||||
|
break;
|
||||||
|
case ResetWatchdogCMD:
|
||||||
|
decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Generic));
|
||||||
|
decodedCmd->type = CMD_RESET_WATCHDOG;
|
||||||
|
break;
|
||||||
|
case GetBatteryVoltageCMD:
|
||||||
|
decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Generic));
|
||||||
|
decodedCmd->type = CMD_GET_BATTERY;
|
||||||
|
break;
|
||||||
|
case GetVersionCMD:
|
||||||
|
decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Generic));
|
||||||
|
decodedCmd->type = CMD_GET_VERSION;
|
||||||
|
break;
|
||||||
|
case BusyStateCMD:
|
||||||
|
decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Generic));
|
||||||
|
decodedCmd->type = CMD_GET_BUSY_STATE;
|
||||||
|
break;
|
||||||
|
case TestCMD:
|
||||||
|
decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Generic));
|
||||||
|
decodedCmd->type = CMD_TEST;
|
||||||
|
break;
|
||||||
|
case DebugCMD:
|
||||||
|
decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Generic));
|
||||||
|
decodedCmd->type = CMD_DEBUG;
|
||||||
|
break;
|
||||||
|
case PowerOffCMD:
|
||||||
|
decodedCmd = (CMD_Generic*)malloc(sizeof(CMD_Generic));
|
||||||
|
decodedCmd->type = CMD_POWER_OFF;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -50,42 +214,82 @@ CMD_Generic* cmdDecode(char* cmd, uint8_t length) {
|
||||||
return decodedCmd;
|
return decodedCmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmdSendAnswer(uint16_t address, uint8_t ans) {
|
void cmdSendAnswer(uint8_t ans) {
|
||||||
ANS_Generic answer;
|
char* answer;
|
||||||
|
|
||||||
answer.ans = ans;
|
switch (ans) {
|
||||||
XBEE_SendData(address, (char*)&answer, sizeof (answer));
|
case ANS_OK:
|
||||||
|
answer = cmdAddChecksum(OK_ANS);
|
||||||
|
break;
|
||||||
|
case ANS_ERR:
|
||||||
|
answer = cmdAddChecksum(ERR_ANS);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
answer = cmdAddChecksum(UNKNOW_ANS);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmdSendBatteryLevel(uint16_t address, char level) {
|
MESSAGE_SendMailbox(XBEE_Mailbox, MSG_ID_XBEE_ANS, APPLICATION_Mailbox, (char*) answer);
|
||||||
ANS_Battery answer;
|
}
|
||||||
|
|
||||||
|
void cmdSendString(char *str) {
|
||||||
|
char* answer;
|
||||||
|
int strlength = strlen(str);
|
||||||
|
char localstr[strlength+2];
|
||||||
|
|
||||||
|
strncpy(localstr, str, strlength+2);
|
||||||
|
if (localstr[strlength-1]!='\r') { // \r n'est pas present
|
||||||
|
localstr[strlength]='\r';
|
||||||
|
localstr[strlength+1]=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
answer = cmdAddChecksum(localstr);
|
||||||
|
MESSAGE_SendMailbox(XBEE_Mailbox, MSG_ID_XBEE_ANS, APPLICATION_Mailbox, (char*) answer);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cmdSendBatteryLevel(char level) {
|
||||||
|
char* answer;
|
||||||
char localLevel=level;
|
char localLevel=level;
|
||||||
|
|
||||||
if (localLevel<0) localLevel=0;
|
if (localLevel<0) localLevel=0;
|
||||||
else if (localLevel>2) localLevel=2;
|
else if (localLevel>2) localLevel=2;
|
||||||
|
|
||||||
answer.ans = ANS_OK;
|
switch (localLevel) {
|
||||||
answer.bat_level = localLevel;
|
case 2:
|
||||||
|
answer = cmdAddChecksum("2\r");
|
||||||
XBEE_SendData(address, (char*)&answer, sizeof (answer));
|
break;
|
||||||
|
case 1:
|
||||||
|
answer = cmdAddChecksum("1\r");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
answer = cmdAddChecksum("0\r");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmdSendVersion(uint16_t address) {
|
MESSAGE_SendMailbox(XBEE_Mailbox, MSG_ID_XBEE_ANS, APPLICATION_Mailbox, (char*) answer);
|
||||||
ANS_Version answer;
|
|
||||||
|
|
||||||
answer.ans = ANS_OK;
|
|
||||||
answer.version=SYSTEM_VERSION;
|
|
||||||
|
|
||||||
XBEE_SendData(address, (char*)&answer, sizeof (answer));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmdSendBusyState(uint16_t address, uint8_t state) {
|
void cmdSendVersion(void) {
|
||||||
ANS_Busy_State answer;
|
int versionlength = strlen(SYSTEM_VERSION_STR);
|
||||||
|
char versionstr[versionlength+2];
|
||||||
|
char* answer;
|
||||||
|
|
||||||
answer.ans = ANS_OK;
|
strncpy(versionstr,SYSTEM_VERSION_STR,versionlength+2);
|
||||||
answer.state = state;
|
versionstr[versionlength] = '\r';
|
||||||
|
versionstr[versionlength+1]=0; // zero ending string
|
||||||
|
|
||||||
if (answer.state >1) answer.state=0;
|
answer = cmdAddChecksum(versionstr);
|
||||||
|
|
||||||
XBEE_SendData(address, (char*)&answer, sizeof (answer));
|
MESSAGE_SendMailbox(XBEE_Mailbox, MSG_ID_XBEE_ANS, APPLICATION_Mailbox, (char*) answer);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cmdSendBusyState(uint8_t state) {
|
||||||
|
char* answer;
|
||||||
|
|
||||||
|
if (state)
|
||||||
|
answer = cmdAddChecksum("1\r");
|
||||||
|
else
|
||||||
|
answer = cmdAddChecksum("0\r");
|
||||||
|
|
||||||
|
MESSAGE_SendMailbox(XBEE_Mailbox, MSG_ID_XBEE_ANS, APPLICATION_Mailbox, (char*) answer);
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,9 +81,10 @@ typedef struct __attribute__((packed)) {
|
||||||
#define CMD_DECODE_UNKNOWN ((CMD_Generic*)UINT32_MAX)
|
#define CMD_DECODE_UNKNOWN ((CMD_Generic*)UINT32_MAX)
|
||||||
|
|
||||||
CMD_Generic* cmdDecode(char* cmd, uint8_t length);
|
CMD_Generic* cmdDecode(char* cmd, uint8_t length);
|
||||||
void cmdSendAnswer(uint16_t address, uint8_t ans);
|
void cmdSendAnswer(uint8_t ans);
|
||||||
void cmdSendBatteryLevel(uint16_t address, char level);
|
void cmdSendString(char* str);
|
||||||
void cmdSendVersion(uint16_t address);
|
void cmdSendBatteryLevel(char level);
|
||||||
void cmdSendBusyState(uint16_t address, uint8_t state);
|
void cmdSendVersion(void);
|
||||||
|
void cmdSendBusyState(uint8_t state);
|
||||||
|
|
||||||
#endif /* INC_CMD_H_ */
|
#endif /* INC_CMD_H_ */
|
||||||
|
|
|
@ -16,20 +16,32 @@
|
||||||
#define PriorityMoteursAsservissement (configMAX_PRIORITIES -1)
|
#define PriorityMoteursAsservissement (configMAX_PRIORITIES -1)
|
||||||
#define PriorityXbeeRX (configMAX_PRIORITIES -2)
|
#define PriorityXbeeRX (configMAX_PRIORITIES -2)
|
||||||
#define PriorityXbeeTX (configMAX_PRIORITIES -3)
|
#define PriorityXbeeTX (configMAX_PRIORITIES -3)
|
||||||
#define PriorityMoteurs (configMAX_PRIORITIES -4)
|
#define PriorityMoteursHandler (configMAX_PRIORITIES -4)
|
||||||
#define PriorityBatterie (configMAX_PRIORITIES -5)
|
#define PriorityBatterieHandler (configMAX_PRIORITIES -5)
|
||||||
#define PriorityApplicationMain (configMAX_PRIORITIES -6)
|
#define PriorityApplicationHandler (configMAX_PRIORITIES -6)
|
||||||
#define PrioritySequenceurTimeout (configMAX_PRIORITIES -7)
|
#define PrioritySequenceurTimeout (configMAX_PRIORITIES -7)
|
||||||
#define PriorityLeds (configMAX_PRIORITIES -8)
|
#define PriorityLedsAction (configMAX_PRIORITIES -8)
|
||||||
|
#define PriorityLedsHandler (configMAX_PRIORITIES -9)
|
||||||
|
|
||||||
|
#define PriorityTestsHandler (configMAX_PRIORITIES -10)
|
||||||
|
|
||||||
/* Périodes des taches périodiques (en ms) */
|
/* Périodes des taches périodiques (en ms) */
|
||||||
#define MOTEURS_PERIODE_ASSERVISSEMENT (2)
|
#define MOTEURS_PERIODE_ASSERVISSEMENT (2)
|
||||||
#define APPLICATION_PERIODE (100)
|
#define APPLICATION_PERIODE (100)
|
||||||
#define BATTERIE_PERIODE_SCRUTATION (1000)
|
#define BATTERIE_PERIODE_SCRUTATION (1000)
|
||||||
#define LEDS_PERIODE (100)
|
#define LEDS_PERIODE (100)
|
||||||
|
#define BUTTON_INACTIVITY_PERIODE (1500)
|
||||||
|
|
||||||
|
#define TESTS_PERIODE (5000)
|
||||||
|
|
||||||
#define XBEE_TX_SEMAPHORE_WAIT 500
|
#define XBEE_TX_SEMAPHORE_WAIT 500
|
||||||
|
#ifdef TESTS
|
||||||
|
#define XBEE_RX_BUFFER_MAX_LENGTH 100
|
||||||
|
#define XBEE_TX_BUFFER_MAX_LENGTH 100
|
||||||
|
#else
|
||||||
#define XBEE_RX_BUFFER_MAX_LENGTH 50
|
#define XBEE_RX_BUFFER_MAX_LENGTH 50
|
||||||
|
#define XBEE_TX_BUFFER_MAX_LENGTH 50
|
||||||
|
#endif /* TESTS */
|
||||||
|
|
||||||
#define BATTERY_EMPTY_LEVEL 128
|
#define BATTERY_EMPTY_LEVEL 128
|
||||||
#define BATTERY_LOW_LEVEL 140
|
#define BATTERY_LOW_LEVEL 140
|
||||||
|
@ -37,7 +49,12 @@
|
||||||
/*
|
/*
|
||||||
* Revoir les délais : c'est en 100 ms, pas ms
|
* Revoir les délais : c'est en 100 ms, pas ms
|
||||||
*/
|
*/
|
||||||
|
#ifdef TESTS
|
||||||
|
#define APPLICATION_INACTIVITY_TIMEOUT (0xFFFFFFFF) // Max U32, infinite timeout
|
||||||
|
#else
|
||||||
#define APPLICATION_INACTIVITY_TIMEOUT (2*60*1000) // 2 minutes, expressed in ms
|
#define APPLICATION_INACTIVITY_TIMEOUT (2*60*1000) // 2 minutes, expressed in ms
|
||||||
|
#endif /* TESTS */
|
||||||
|
|
||||||
#define APPLICATION_WATCHDOG_MIN (900) // minimum time to wait before resetting watchdog, expressed in ms
|
#define APPLICATION_WATCHDOG_MIN (900) // minimum time to wait before resetting watchdog, expressed in ms
|
||||||
#define APPLICATION_WATCHDOG_MAX (1100) // maximum time to wait before resetting watchdog, expressed in ms
|
#define APPLICATION_WATCHDOG_MAX (1100) // maximum time to wait before resetting watchdog, expressed in ms
|
||||||
#define APPLICATION_WATCHDOG_MISSED_MAX (3) // Maximum missed timeout reset before entering watchdog disabled state
|
#define APPLICATION_WATCHDOG_MISSED_MAX (3) // Maximum missed timeout reset before entering watchdog disabled state
|
||||||
|
|
|
@ -108,17 +108,26 @@ uint16_t LEDS_Patterns [LED_MAX_PATTERNS][4]= {
|
||||||
LEDS_State LEDS_Animation;
|
LEDS_State LEDS_Animation;
|
||||||
LEDS_State LEDS_AnimationAncien;
|
LEDS_State LEDS_AnimationAncien;
|
||||||
|
|
||||||
StaticTask_t xTaskLeds;
|
StaticTask_t xTaskLedsHandler;
|
||||||
|
|
||||||
/* Buffer that the task being created will use as its stack. Note this is
|
/* Buffer that the task being created will use as its stack. Note this is
|
||||||
an array of StackType_t variables. The size of StackType_t is dependent on
|
an array of StackType_t variables. The size of StackType_t is dependent on
|
||||||
the RTOS port. */
|
the RTOS port. */
|
||||||
StackType_t xStackLeds[ STACK_SIZE ];
|
StackType_t xStackLedsHandler[ STACK_SIZE ];
|
||||||
TaskHandle_t xHandleLeds = NULL;
|
TaskHandle_t xHandleLedsHandler = NULL;
|
||||||
|
|
||||||
void LEDS_AnimationThread(void* params);
|
StaticTask_t xTaskLedsAction;
|
||||||
|
|
||||||
|
/* Buffer that the task being created will use as its stack. Note this is
|
||||||
|
an array of StackType_t variables. The size of StackType_t is dependent on
|
||||||
|
the RTOS port. */
|
||||||
|
StackType_t xStackLedsAction[ STACK_SIZE ];
|
||||||
|
TaskHandle_t xHandleLedsAction = NULL;
|
||||||
|
|
||||||
|
void LEDS_ActionThread(void* params);
|
||||||
void LEDS_ShowPattern(uint8_t pattern);
|
void LEDS_ShowPattern(uint8_t pattern);
|
||||||
void LEDS_Tests(void* params);
|
void LEDS_Tests(void* params);
|
||||||
|
void LEDS_HandlerThread(void* params);
|
||||||
|
|
||||||
void LEDS_Init(void) {
|
void LEDS_Init(void) {
|
||||||
LEDS_Eteint_Tout();
|
LEDS_Eteint_Tout();
|
||||||
|
@ -129,15 +138,16 @@ void LEDS_Init(void) {
|
||||||
/* Mailbox is created in messages.c */
|
/* Mailbox is created in messages.c */
|
||||||
|
|
||||||
/* Create the task without using any dynamic memory allocation. */
|
/* Create the task without using any dynamic memory allocation. */
|
||||||
xHandleLeds = xTaskCreateStatic(
|
xHandleLedsHandler = xTaskCreateStatic(
|
||||||
LEDS_AnimationThread, /* Function that implements the task. */
|
LEDS_HandlerThread, /* Function that implements the task. */
|
||||||
"LEDS Animation", /* Text name for the task. */
|
"LEDS Handler", /* Text name for the task. */
|
||||||
STACK_SIZE, /* Number of indexes in the xStack array. */
|
STACK_SIZE, /* Number of indexes in the xStack array. */
|
||||||
NULL, /* Parameter passed into the task. */
|
NULL, /* Parameter passed into the task. */
|
||||||
PriorityLeds,/* Priority at which the task is created. */
|
PriorityLedsHandler,/* Priority at which the task is created. */
|
||||||
xStackLeds, /* Array to use as the task's stack. */
|
xStackLedsHandler, /* Array to use as the task's stack. */
|
||||||
&xTaskLeds); /* Variable to hold the task's data structure. */
|
&xTaskLedsHandler); /* Variable to hold the task's data structure. */
|
||||||
vTaskResume(xHandleLeds);
|
|
||||||
|
vTaskResume(xHandleLedsHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LEDS_ShowPattern(uint8_t pattern) {
|
void LEDS_ShowPattern(uint8_t pattern) {
|
||||||
|
@ -166,20 +176,12 @@ void LEDS_Tests(void* params) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LEDS_AnimationThread(void* params) {
|
void LEDS_HandlerThread(void* params) {
|
||||||
MESSAGE_Typedef msg;
|
MESSAGE_Typedef msg;
|
||||||
uint8_t cnt=0;
|
|
||||||
TickType_t xLastWakeTime;
|
|
||||||
|
|
||||||
// Initialise the xLastWakeTime variable with the current time.
|
|
||||||
xLastWakeTime = xTaskGetTickCount();
|
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
// Wait for the next cycle.
|
|
||||||
vTaskDelayUntil( &xLastWakeTime, pdMS_TO_TICKS(LEDS_PERIODE));
|
|
||||||
|
|
||||||
msg = MESSAGE_ReadMailboxNoDelay(LEDS_Mailbox);
|
msg = MESSAGE_ReadMailbox(LEDS_Mailbox);
|
||||||
cnt++;
|
|
||||||
|
|
||||||
if (msg.id == MSG_ID_LED_ETAT) { // Si c'est bien un message de changement d'etat LEDS
|
if (msg.id == MSG_ID_LED_ETAT) { // Si c'est bien un message de changement d'etat LEDS
|
||||||
LEDS_Animation = *((LEDS_State*)msg.data);
|
LEDS_Animation = *((LEDS_State*)msg.data);
|
||||||
|
@ -188,10 +190,35 @@ void LEDS_AnimationThread(void* params) {
|
||||||
// dans ce cas, on eteint les leds pour repartir sur une base saine
|
// dans ce cas, on eteint les leds pour repartir sur une base saine
|
||||||
LEDS_AnimationAncien = LEDS_Animation;
|
LEDS_AnimationAncien = LEDS_Animation;
|
||||||
|
|
||||||
|
/* If action task is running, destroy it first */
|
||||||
|
if (xHandleLedsAction!= NULL) vTaskDelete(xHandleLedsAction);
|
||||||
|
|
||||||
|
/* Create the task without using any dynamic memory allocation. */
|
||||||
|
xHandleLedsAction = xTaskCreateStatic(
|
||||||
|
LEDS_ActionThread, /* Function that implements the task. */
|
||||||
|
"LEDS Action", /* Text name for the task. */
|
||||||
|
STACK_SIZE, /* Number of indexes in the xStack array. */
|
||||||
|
NULL, /* Parameter passed into the task. */
|
||||||
|
PriorityLedsAction,/* Priority at which the task is created. */
|
||||||
|
xStackLedsAction, /* Array to use as the task's stack. */
|
||||||
|
&xTaskLedsAction); /* Variable to hold the task's data structure. */
|
||||||
|
|
||||||
|
vTaskResume(xHandleLedsAction);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LEDS_ActionThread(void* params) {
|
||||||
|
uint8_t cnt=0;
|
||||||
|
TickType_t xLastWakeTime;
|
||||||
|
|
||||||
|
// Initialise the xLastWakeTime variable with the current time.
|
||||||
|
xLastWakeTime = xTaskGetTickCount();
|
||||||
|
|
||||||
LEDS_Eteint_Tout();
|
LEDS_Eteint_Tout();
|
||||||
cnt=0;
|
|
||||||
}
|
while (1) {
|
||||||
}
|
|
||||||
|
|
||||||
switch (LEDS_Animation) {
|
switch (LEDS_Animation) {
|
||||||
case leds_off:
|
case leds_off:
|
||||||
|
@ -342,5 +369,11 @@ void LEDS_AnimationThread(void* params) {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wait for the next cycle.
|
||||||
|
vTaskDelayUntil( &xLastWakeTime, pdMS_TO_TICKS(LEDS_PERIODE));
|
||||||
|
|
||||||
|
cnt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,13 +13,13 @@
|
||||||
QueueHandle_t LEDS_Mailbox;
|
QueueHandle_t LEDS_Mailbox;
|
||||||
QueueHandle_t MOTEURS_Mailbox;
|
QueueHandle_t MOTEURS_Mailbox;
|
||||||
QueueHandle_t APPLICATION_Mailbox;
|
QueueHandle_t APPLICATION_Mailbox;
|
||||||
QueueHandle_t BATTERIE_Mailbox;
|
|
||||||
QueueHandle_t XBEE_Mailbox;
|
QueueHandle_t XBEE_Mailbox;
|
||||||
|
|
||||||
void MESSAGE_Init(void) {
|
void MESSAGE_Init(void) {
|
||||||
LEDS_Mailbox = xQueueCreate(QUEUE_SIZE, sizeof(MESSAGE_Typedef));
|
LEDS_Mailbox = xQueueCreate(QUEUE_SIZE, sizeof(MESSAGE_Typedef));
|
||||||
MOTEURS_Mailbox = xQueueCreate(QUEUE_SIZE, sizeof(MESSAGE_Typedef));
|
MOTEURS_Mailbox = xQueueCreate(QUEUE_SIZE, sizeof(MESSAGE_Typedef));
|
||||||
APPLICATION_Mailbox = xQueueCreate(QUEUE_SIZE, sizeof(MESSAGE_Typedef));
|
APPLICATION_Mailbox = xQueueCreate(QUEUE_SIZE, sizeof(MESSAGE_Typedef));
|
||||||
|
XBEE_Mailbox = xQueueCreate(QUEUE_SIZE, sizeof(MESSAGE_Typedef));
|
||||||
}
|
}
|
||||||
|
|
||||||
MESSAGE_Typedef MESSAGE_ReadMailbox(QueueHandle_t mbx) {
|
MESSAGE_Typedef MESSAGE_ReadMailbox(QueueHandle_t mbx) {
|
||||||
|
|
|
@ -20,17 +20,17 @@ typedef struct {
|
||||||
extern QueueHandle_t LEDS_Mailbox;
|
extern QueueHandle_t LEDS_Mailbox;
|
||||||
extern QueueHandle_t MOTEURS_Mailbox;
|
extern QueueHandle_t MOTEURS_Mailbox;
|
||||||
extern QueueHandle_t APPLICATION_Mailbox;
|
extern QueueHandle_t APPLICATION_Mailbox;
|
||||||
|
extern QueueHandle_t XBEE_Mailbox;
|
||||||
|
|
||||||
#define MSG_ID_NO_MESSAGE 0x00
|
#define MSG_ID_NO_MESSAGE 0x00
|
||||||
|
|
||||||
#define MSG_ID_LED_ETAT 0x10
|
#define MSG_ID_LED_ETAT 0x10
|
||||||
|
|
||||||
#define MSG_ID_BAT_NIVEAU 0x20
|
#define MSG_ID_BAT_CHARGE_COMPLETE 0x20
|
||||||
#define MSG_ID_BAT_CHARGE 0x21
|
#define MSG_ID_BAT_CHARGE_ON 0x21
|
||||||
#define MSG_ID_BAT_CHARGEUR_ON 0x22
|
#define MSG_ID_BAT_CHARGE_OFF 0x22
|
||||||
#define MSG_ID_BAT_CHARGEUR_OFF 0x23
|
#define MSG_ID_BAT_CHARGE_ERR 0x23
|
||||||
#define MSG_ID_BAT_CHARGEUR_ERR 0x24
|
#define MSG_ID_BAT_ADC_ERR 0x24
|
||||||
#define MSG_ID_BAT_ADC_ERR 0x25
|
|
||||||
|
|
||||||
#define MSG_ID_BUTTON_PRESSED 0x30
|
#define MSG_ID_BUTTON_PRESSED 0x30
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ extern QueueHandle_t APPLICATION_Mailbox;
|
||||||
#define MSG_ID_MOTEURS_TURN 0x42
|
#define MSG_ID_MOTEURS_TURN 0x42
|
||||||
|
|
||||||
#define MSG_ID_XBEE_CMD 0x50
|
#define MSG_ID_XBEE_CMD 0x50
|
||||||
|
#define MSG_ID_XBEE_ANS 0x51
|
||||||
|
|
||||||
void MESSAGE_Init(void);
|
void MESSAGE_Init(void);
|
||||||
MESSAGE_Typedef MESSAGE_ReadMailbox(QueueHandle_t mbx);
|
MESSAGE_Typedef MESSAGE_ReadMailbox(QueueHandle_t mbx);
|
||||||
|
|
|
@ -83,7 +83,7 @@ void MOTEURS_Init(void) {
|
||||||
"MOTEURS Principale", /* Text name for the task. */
|
"MOTEURS Principale", /* Text name for the task. */
|
||||||
STACK_SIZE, /* Number of indexes in the xStack array. */
|
STACK_SIZE, /* Number of indexes in the xStack array. */
|
||||||
NULL, /* Parameter passed into the task. */
|
NULL, /* Parameter passed into the task. */
|
||||||
PriorityMoteurs,/* Priority at which the task is created. */
|
PriorityMoteursHandler,/* Priority at which the task is created. */
|
||||||
xStackMoteurs, /* Array to use as the task's stack. */
|
xStackMoteurs, /* Array to use as the task's stack. */
|
||||||
&xTaskMoteurs); /* Variable to hold the task's data structure. */
|
&xTaskMoteurs); /* Variable to hold the task's data structure. */
|
||||||
vTaskResume(xHandleMoteurs);
|
vTaskResume(xHandleMoteurs);
|
||||||
|
|
|
@ -22,26 +22,37 @@ extern DMA_HandleTypeDef hdma_lpuart1_rx;
|
||||||
#define XBEE_API_XON 0x11
|
#define XBEE_API_XON 0x11
|
||||||
#define XBEE_API_XOFF 0x13
|
#define XBEE_API_XOFF 0x13
|
||||||
|
|
||||||
|
#define XBEE_ENDING_CHAR '\r'
|
||||||
|
|
||||||
|
/***** TX part *****/
|
||||||
|
void XBEE_TxHandlerThread(void* params);
|
||||||
|
int XBEE_SendData(char* data);
|
||||||
|
|
||||||
|
/* Stuff for Xbee TX task */
|
||||||
|
StaticTask_t xTaskXbeeTXHandler;
|
||||||
|
StackType_t xStackXbeeTXHandler[ STACK_SIZE ];
|
||||||
|
TaskHandle_t xHandleXbeeTXHandler = NULL;
|
||||||
|
|
||||||
|
uint8_t txBuffer[XBEE_TX_BUFFER_MAX_LENGTH]={0};
|
||||||
|
uint16_t txIndex;
|
||||||
|
uint16_t txRemainingData;
|
||||||
|
uint16_t txDataToSend;
|
||||||
|
|
||||||
/***** RX part *****/
|
/***** RX part *****/
|
||||||
|
void XBEE_RxThread(void* params);
|
||||||
|
|
||||||
|
SemaphoreHandle_t xHandleSemaphoreRX = NULL;
|
||||||
|
StaticSemaphore_t xSemaphoreRx;
|
||||||
|
|
||||||
/* Stuff for Xbee RX task */
|
/* Stuff for Xbee RX task */
|
||||||
StaticTask_t xTaskXbeeRX;
|
StaticTask_t xTaskXbeeRX;
|
||||||
StackType_t xStackXbeeRX[ STACK_SIZE ];
|
StackType_t xStackXbeeRX[ STACK_SIZE ];
|
||||||
TaskHandle_t xHandleXbeeRX = NULL;
|
TaskHandle_t xHandleXbeeRX = NULL;
|
||||||
|
|
||||||
uint8_t txBuffer[XBEE_RX_BUFFER_MAX_LENGTH]={0};
|
|
||||||
uint16_t txIndex;
|
|
||||||
uint16_t txDataToSend;
|
|
||||||
|
|
||||||
void XBEE_RxThread(void* params);
|
|
||||||
|
|
||||||
SemaphoreHandle_t xHandleSemaphoreRX = NULL;
|
|
||||||
StaticSemaphore_t xSemaphoreRx;
|
|
||||||
|
|
||||||
uint8_t rxBuffer[XBEE_RX_BUFFER_MAX_LENGTH]={0};
|
uint8_t rxBuffer[XBEE_RX_BUFFER_MAX_LENGTH]={0};
|
||||||
//uint8_t rxWaitForACK =0;
|
//uint8_t rxWaitForACK =0;
|
||||||
uint8_t rxPhase;
|
uint8_t rxPhase;
|
||||||
uint16_t rxFrameLength;
|
uint16_t rxCmdLength;
|
||||||
uint16_t rxDataToReceive;
|
uint16_t rxDataToReceive;
|
||||||
uint16_t rxIndex;
|
uint16_t rxIndex;
|
||||||
|
|
||||||
|
@ -51,13 +62,13 @@ uint16_t rxIndex;
|
||||||
|
|
||||||
/****** TX part ******/
|
/****** TX part ******/
|
||||||
SemaphoreHandle_t xHandleSemaphoreTX = NULL;
|
SemaphoreHandle_t xHandleSemaphoreTX = NULL;
|
||||||
SemaphoreHandle_t xHandleSemaphoreTX_ACK = NULL;
|
//SemaphoreHandle_t xHandleSemaphoreTX_ACK = NULL;
|
||||||
StaticSemaphore_t xSemaphoreTX;
|
StaticSemaphore_t xSemaphoreTX;
|
||||||
StaticSemaphore_t xSemaphoreTX_ACK;
|
//StaticSemaphore_t xSemaphoreTX_ACK;
|
||||||
|
|
||||||
void XBEE_Init(void) {
|
void XBEE_Init(void) {
|
||||||
xHandleSemaphoreTX = xSemaphoreCreateBinaryStatic( &xSemaphoreTX );
|
xHandleSemaphoreTX = xSemaphoreCreateBinaryStatic( &xSemaphoreTX );
|
||||||
xHandleSemaphoreTX_ACK = xSemaphoreCreateBinaryStatic( &xSemaphoreTX_ACK );
|
//xHandleSemaphoreTX_ACK = xSemaphoreCreateBinaryStatic( &xSemaphoreTX_ACK );
|
||||||
xSemaphoreGive(xHandleSemaphoreTX);
|
xSemaphoreGive(xHandleSemaphoreTX);
|
||||||
//xSemaphoreTake(xHandleSemaphoreTX_ACK);
|
//xSemaphoreTake(xHandleSemaphoreTX_ACK);
|
||||||
|
|
||||||
|
@ -69,224 +80,53 @@ void XBEE_Init(void) {
|
||||||
"XBEE Rx", /* Text name for the task. */
|
"XBEE Rx", /* Text name for the task. */
|
||||||
STACK_SIZE, /* Number of indexes in the xStack array. */
|
STACK_SIZE, /* Number of indexes in the xStack array. */
|
||||||
NULL, /* Parameter passed into the task. */
|
NULL, /* Parameter passed into the task. */
|
||||||
PriorityMoteurs,/* Priority at which the task is created. */
|
PriorityXbeeRX,/* Priority at which the task is created. */
|
||||||
xStackXbeeRX, /* Array to use as the task's stack. */
|
xStackXbeeRX, /* Array to use as the task's stack. */
|
||||||
&xTaskXbeeRX); /* Variable to hold the task's data structure. */
|
&xTaskXbeeRX); /* Variable to hold the task's data structure. */
|
||||||
vTaskResume(xHandleXbeeRX);
|
vTaskResume(xHandleXbeeRX);
|
||||||
|
|
||||||
|
/* Create the task without using any dynamic memory allocation. */
|
||||||
|
xHandleXbeeTXHandler = xTaskCreateStatic(
|
||||||
|
XBEE_TxHandlerThread, /* Function that implements the task. */
|
||||||
|
"XBEE Tx", /* Text name for the task. */
|
||||||
|
STACK_SIZE, /* Number of indexes in the xStack array. */
|
||||||
|
NULL, /* Parameter passed into the task. */
|
||||||
|
PriorityXbeeTX,/* Priority at which the task is created. */
|
||||||
|
xStackXbeeTXHandler, /* Array to use as the task's stack. */
|
||||||
|
&xTaskXbeeTXHandler); /* Variable to hold the task's data structure. */
|
||||||
|
vTaskResume(xHandleXbeeTXHandler);
|
||||||
|
|
||||||
/* Enable Xbee */
|
/* Enable Xbee */
|
||||||
HAL_GPIO_WritePin(XBEE_RESET_GPIO_Port, XBEE_RESET_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(XBEE_RESET_GPIO_Port, XBEE_RESET_Pin, GPIO_PIN_SET);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**** Support functions ****/
|
/**** Support functions ****/
|
||||||
|
|
||||||
/**
|
|
||||||
* Compute length of encoded data using escape char
|
|
||||||
*
|
|
||||||
* \param data pointer on raw data
|
|
||||||
* \param length length of raw data
|
|
||||||
* \return length of data when encoded
|
|
||||||
*/
|
|
||||||
int XBEE_GetDataLength(char* data, int length) {
|
|
||||||
int encodedLength=0;
|
|
||||||
|
|
||||||
for (int i=0; i< length; i++) {
|
|
||||||
if ((*data == (char)XBEE_API_ESCAPE_CHAR) || (*data == (char)XBEE_API_START_OF_FRAME) ||
|
|
||||||
(*data == (char)XBEE_API_XOFF) ||(*data == (char)XBEE_API_XON)) {
|
|
||||||
encodedLength++; /* Add 1 byte for escape char */
|
|
||||||
}
|
|
||||||
|
|
||||||
encodedLength++; /* Add current char in length calculation */
|
|
||||||
data++; /* move to next byte in raw buffer */
|
|
||||||
}
|
|
||||||
|
|
||||||
return encodedLength;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert raw data into escaped data. Create a new buffer that is returned
|
|
||||||
*
|
|
||||||
* \param data pointer on raw data
|
|
||||||
* \param length length of raw data
|
|
||||||
* \param encodedLength length of encoded data
|
|
||||||
* \return new buffer allocated with escaped char
|
|
||||||
*/
|
|
||||||
char* XBEE_EncodeWithEscapeChar(char* data, int length, int *encodedLength) {
|
|
||||||
char* encodedData;
|
|
||||||
|
|
||||||
*encodedLength=XBEE_GetDataLength(data, length);
|
|
||||||
encodedData = (char*)malloc(*encodedLength);
|
|
||||||
|
|
||||||
for (char* p=encodedData; p< (encodedData + *encodedLength); p++) {
|
|
||||||
if ((*data == (char)XBEE_API_ESCAPE_CHAR) || (*data == (char)XBEE_API_START_OF_FRAME) ||
|
|
||||||
(*data == (char)XBEE_API_XOFF) ||(*data == (char)XBEE_API_XON)) {
|
|
||||||
*p = (char) XBEE_API_ESCAPE_CHAR;
|
|
||||||
p++;
|
|
||||||
}
|
|
||||||
|
|
||||||
*p = *data;
|
|
||||||
data++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return encodedData;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a raw buffer and convert it into a transmission frame
|
|
||||||
*
|
|
||||||
* \param data pointer on raw data
|
|
||||||
* \param length length of raw data
|
|
||||||
* \param destination address of the destination
|
|
||||||
* \param frameLength length of frame
|
|
||||||
* \return new frame (allocated) containing escaped data
|
|
||||||
*/
|
|
||||||
void XBEE_EncodeTransmissionFrame(char* data, int length, uint16_t destination, char* frame, int* frameLength) {
|
|
||||||
uint8_t checksum=0;
|
|
||||||
uint16_t localLength=0;
|
|
||||||
char* p;
|
|
||||||
|
|
||||||
localLength = length+9;
|
|
||||||
|
|
||||||
frame[0] = (char)XBEE_FRAME_SOF_CHAR;
|
|
||||||
frame[1] = (char)((uint16_t)(localLength-4)>>8);
|
|
||||||
frame[2] = (char)((uint16_t)(localLength-4));
|
|
||||||
frame[3] = (char)XBEE_TX_16BIT_REQUEST_TYPE;
|
|
||||||
frame[4] = 0x1;
|
|
||||||
|
|
||||||
frame[5] = (char)((uint16_t)(destination)>>8);
|
|
||||||
frame[6] = (char)((uint16_t)(destination));
|
|
||||||
|
|
||||||
frame[7] = 0x0;
|
|
||||||
|
|
||||||
for (p = &frame[8]; p< (data + length); p++) {
|
|
||||||
if ((*data == (char)XBEE_API_ESCAPE_CHAR) || (*data == (char)XBEE_API_START_OF_FRAME) ||
|
|
||||||
(*data == (char)XBEE_API_XOFF) ||(*data == (char)XBEE_API_XON)) {
|
|
||||||
*p = (char) XBEE_API_ESCAPE_CHAR;
|
|
||||||
p++;
|
|
||||||
*p = *data^0x20;
|
|
||||||
} else
|
|
||||||
*p = *data;
|
|
||||||
|
|
||||||
data++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* calcul du checksum */
|
|
||||||
for (int i=3; i<(localLength-1); i++) {
|
|
||||||
checksum += (uint8_t)frame[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
*p = 0xFF-checksum;
|
|
||||||
*frameLength = localLength;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get frame length
|
|
||||||
*
|
|
||||||
* \param frame pointer on frame header
|
|
||||||
* \return length of incoming frame
|
|
||||||
*/
|
|
||||||
uint16_t XBEE_GetFrameLength(uint8_t *frame) {
|
|
||||||
return (((uint16_t)frame[1])<<8) + (uint16_t)frame[2];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a complete frame, check if frame is correct and extract raw data
|
|
||||||
*
|
|
||||||
* \param raw_frame pointer on complete frame
|
|
||||||
* \param incomingFrame pointer to processed frame, with escape char removed
|
|
||||||
* \return status of decoding: XBEE_OK if decoding is successful, XBEE_INVALID_FRAME otherwise
|
|
||||||
*/
|
|
||||||
XBEE_Status XBEE_DecodeFrame(char* rawFrame, XBEE_INCOMING_FRAME** incomingFrame) {
|
|
||||||
uint8_t frame_type = (uint8_t)rawFrame[3];
|
|
||||||
uint16_t rawFrameLength;
|
|
||||||
uint8_t checksum;
|
|
||||||
XBEE_Status status = XBEE_OK;
|
|
||||||
int allocatedSize;
|
|
||||||
int dataSize;
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (rawFrame[0] == '~') {
|
|
||||||
rawFrameLength = (((uint16_t)rawFrame[1])<<8) + (uint16_t)rawFrame[2];
|
|
||||||
|
|
||||||
/* verification du checksum */
|
|
||||||
checksum =0;
|
|
||||||
for (i=3; i<3+rawFrameLength+1; i++) {
|
|
||||||
checksum += (uint8_t)rawFrame[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (checksum != 0xFF)
|
|
||||||
return XBEE_INVALID_FRAME;
|
|
||||||
|
|
||||||
switch (frame_type) {
|
|
||||||
case XBEE_RX_16BIT_PACKET_TYPE:
|
|
||||||
dataSize = rawFrameLength-5; // there is 5 bytes of "other" data than truly data bytes in a frame
|
|
||||||
allocatedSize = sizeof(XBEE_INCOMING_FRAME)+dataSize;
|
|
||||||
|
|
||||||
*incomingFrame = (XBEE_INCOMING_FRAME*) malloc(allocatedSize); /* Allocate a generic frame struct */
|
|
||||||
(*incomingFrame)->type = frame_type;
|
|
||||||
|
|
||||||
/* Get source address */
|
|
||||||
(*incomingFrame)->source_addr = (((uint16_t)rawFrame[4])<<8) + (uint16_t)rawFrame[5];
|
|
||||||
//XBEE_DecodeWithoutEscapeChar(&rawFrame[8], rawFrameLength-5, (*incomingFrame)->data, &incomingDataLength); // Data = Frame length -5
|
|
||||||
(*incomingFrame)->length = (uint8_t)(dataSize);
|
|
||||||
(*incomingFrame)->ack = 0;
|
|
||||||
|
|
||||||
for (i=0; i<dataSize; i++)
|
|
||||||
(*incomingFrame)->data[i] = rawFrame[i+8];
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case XBEE_MODEM_STATUS_TYPE:
|
|
||||||
allocatedSize = sizeof(XBEE_INCOMING_FRAME); // no data
|
|
||||||
*incomingFrame = (XBEE_INCOMING_FRAME*) malloc(allocatedSize); /* Allocate a generic frame struct */
|
|
||||||
|
|
||||||
(*incomingFrame)->type = frame_type;
|
|
||||||
|
|
||||||
(*incomingFrame)->modem_status = rawFrame[4];
|
|
||||||
(*incomingFrame)->data[0]=0x0;
|
|
||||||
(*incomingFrame)->length = 0;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case XBEE_TX_STATUS_TYPE:
|
|
||||||
allocatedSize = sizeof(XBEE_INCOMING_FRAME); // no data
|
|
||||||
*incomingFrame = (XBEE_INCOMING_FRAME*) malloc(allocatedSize); /* Allocate a generic frame struct */
|
|
||||||
|
|
||||||
(*incomingFrame)->ack = rawFrame[5];
|
|
||||||
(*incomingFrame)->data[0]=0x0;
|
|
||||||
(*incomingFrame)->length = 0;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case XBEE_EXTENDED_TX_STATUS_TYPE:
|
|
||||||
allocatedSize = sizeof(XBEE_INCOMING_FRAME); // no data
|
|
||||||
*incomingFrame = (XBEE_INCOMING_FRAME*) malloc(allocatedSize); /* Allocate a generic frame struct */
|
|
||||||
|
|
||||||
(*incomingFrame)->ack = rawFrame[8];
|
|
||||||
(*incomingFrame)->data[0]=0x0;
|
|
||||||
(*incomingFrame)->length = 0;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
*incomingFrame=NULL;
|
|
||||||
return XBEE_INVALID_FRAME;
|
|
||||||
};
|
|
||||||
} else status = XBEE_INVALID_FRAME;
|
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**** TX Part *****/
|
/**** TX Part *****/
|
||||||
|
|
||||||
|
void XBEE_TxHandlerThread(void* params) {
|
||||||
|
MESSAGE_Typedef msg;
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
msg = MESSAGE_ReadMailbox(XBEE_Mailbox);
|
||||||
|
|
||||||
|
if (msg.id == MSG_ID_XBEE_ANS) {
|
||||||
|
XBEE_SendData((char*)msg.data); // block function during send
|
||||||
|
|
||||||
|
free(msg.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send data. Create a transmission frame, add escape char to data and send it over UART
|
* Send data. Create a transmission frame, add escape char to data and send it over UART
|
||||||
*
|
*
|
||||||
* \param data raw data to send
|
* \param data raw data to send
|
||||||
* \param length length of data to send
|
|
||||||
* \return status of decoding: XBEE_OK if decoding is successful,
|
* \return status of decoding: XBEE_OK if decoding is successful,
|
||||||
* XBEE_TX_ERROR in case of sending error,
|
* XBEE_TX_ERROR in case of sending error,
|
||||||
* XBEE_TX_TIMEOUT in case semaphore takes too long
|
* XBEE_TX_TIMEOUT in case semaphore takes too long
|
||||||
*/
|
*/
|
||||||
int XBEE_SendData(uint16_t address, char* data, int length) {
|
int XBEE_SendData(char* data) {
|
||||||
BaseType_t state;
|
BaseType_t state;
|
||||||
int status = XBEE_OK;
|
int status = XBEE_OK;
|
||||||
|
|
||||||
|
@ -297,11 +137,17 @@ int XBEE_SendData(uint16_t address, char* data, int length) {
|
||||||
if answer is false, it means timeout appends
|
if answer is false, it means timeout appends
|
||||||
We should probably reset something in "else" branch */
|
We should probably reset something in "else" branch */
|
||||||
|
|
||||||
XBEE_EncodeTransmissionFrame(data, length, address, (char*) txBuffer, (int*)&txDataToSend);
|
strncpy((char*)txBuffer,data,XBEE_TX_BUFFER_MAX_LENGTH-1);
|
||||||
|
txBuffer[XBEE_TX_BUFFER_MAX_LENGTH-1]=0;
|
||||||
|
txRemainingData = strlen((char*)txBuffer);
|
||||||
|
|
||||||
|
if (txRemainingData!=0) {
|
||||||
|
txIndex =1;
|
||||||
|
txRemainingData=txRemainingData-1;
|
||||||
|
|
||||||
LL_USART_TransmitData8(hlpuart1.Instance, txBuffer[0]);
|
LL_USART_TransmitData8(hlpuart1.Instance, txBuffer[0]);
|
||||||
txIndex =1;
|
|
||||||
LL_USART_EnableIT_TXE(hlpuart1.Instance); // enable TX Interrupt
|
LL_USART_EnableIT_TXE(hlpuart1.Instance); // enable TX Interrupt
|
||||||
|
}
|
||||||
} else status= XBEE_TX_TIMEOUT;
|
} else status= XBEE_TX_TIMEOUT;
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
@ -310,11 +156,13 @@ int XBEE_SendData(uint16_t address, char* data, int length) {
|
||||||
void XBEE_TX_IRQHandler(void) {
|
void XBEE_TX_IRQHandler(void) {
|
||||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
LL_USART_TransmitData8(hlpuart1.Instance, txBuffer[txIndex]);
|
if (txRemainingData==0) { // No more data, disable TXE bit
|
||||||
txIndex++;
|
|
||||||
if (txIndex == txDataToSend) {
|
|
||||||
LL_USART_DisableIT_TXE(hlpuart1.Instance);
|
LL_USART_DisableIT_TXE(hlpuart1.Instance);
|
||||||
xSemaphoreGiveFromISR( xHandleSemaphoreTX, &xHigherPriorityTaskWoken );
|
xSemaphoreGiveFromISR( xHandleSemaphoreTX, &xHigherPriorityTaskWoken );
|
||||||
|
} else {
|
||||||
|
LL_USART_TransmitData8(hlpuart1.Instance, txBuffer[txIndex]);
|
||||||
|
txIndex++;
|
||||||
|
txRemainingData--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xHigherPriorityTaskWoken) {
|
if (xHigherPriorityTaskWoken) {
|
||||||
|
@ -334,11 +182,9 @@ void XBEE_TX_IRQHandler(void) {
|
||||||
* \param params not used
|
* \param params not used
|
||||||
*/
|
*/
|
||||||
void XBEE_RxThread(void* params) {
|
void XBEE_RxThread(void* params) {
|
||||||
XBEE_INCOMING_FRAME *incomingFrame;
|
//XBEE_INCOMING_FRAME *incomingFrame;
|
||||||
|
char* incomingData;
|
||||||
rxPhase= XBEE_RX_PHASE_SOF;
|
rxCmdLength=0;
|
||||||
rxFrameLength=0;
|
|
||||||
rxDataToReceive=1;
|
|
||||||
rxIndex=0;
|
rxIndex=0;
|
||||||
|
|
||||||
while (HAL_UART_Receive_IT(&hlpuart1, rxBuffer, 1)!= HAL_OK); // try starting reception of frame
|
while (HAL_UART_Receive_IT(&hlpuart1, rxBuffer, 1)!= HAL_OK); // try starting reception of frame
|
||||||
|
@ -350,16 +196,13 @@ void XBEE_RxThread(void* params) {
|
||||||
while (1) {
|
while (1) {
|
||||||
if (xSemaphoreTake(xHandleSemaphoreRX, portMAX_DELAY)==pdTRUE) { // wait forever
|
if (xSemaphoreTake(xHandleSemaphoreRX, portMAX_DELAY)==pdTRUE) { // wait forever
|
||||||
|
|
||||||
/* Process frame */
|
incomingData = (char*)malloc(rxCmdLength+1); // +1 for ending zero !
|
||||||
if (XBEE_DecodeFrame((char*) rxBuffer, &incomingFrame)==XBEE_OK) { // frame is valid
|
strncpy (incomingData, (char*)rxBuffer, XBEE_RX_BUFFER_MAX_LENGTH);
|
||||||
if (incomingFrame != 0x0) // frame is valid
|
|
||||||
MESSAGE_SendMailbox(APPLICATION_Mailbox, MSG_ID_XBEE_CMD, (QueueHandle_t)0x0, (void*)incomingFrame);
|
|
||||||
// if (rxBuffer[3]== XBEE_RX_16BIT_PACKET_TYPE) {
|
|
||||||
// MESSAGE_SendMailbox(APPLICATION_Mailbox, MSG_ID_XBEE_CMD, (QueueHandle_t)0x0, (void*)0x0);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i=0; i<XBEE_RX_BUFFER_MAX_LENGTH; i++)
|
rxCmdLength=0; // reset counters for next command
|
||||||
rxBuffer[i]=0xFF;
|
rxIndex=0;
|
||||||
|
|
||||||
|
MESSAGE_SendMailbox(APPLICATION_Mailbox, MSG_ID_XBEE_CMD, (QueueHandle_t)0x0, (void*)incomingData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -370,43 +213,19 @@ void XBEE_RX_IRQHandler(void) {
|
||||||
|
|
||||||
data = LL_USART_ReceiveData8(hlpuart1.Instance); // lecture de l'octet reçu
|
data = LL_USART_ReceiveData8(hlpuart1.Instance); // lecture de l'octet reçu
|
||||||
|
|
||||||
switch (rxPhase) {
|
if (data != XBEE_ENDING_CHAR) { // end of command not received
|
||||||
case XBEE_RX_PHASE_SOF:
|
|
||||||
if (data == XBEE_FRAME_SOF_CHAR) {
|
|
||||||
rxBuffer[0] = data;
|
|
||||||
rxPhase = XBEE_RX_PHASE_HEADER;
|
|
||||||
rxIndex = 1;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case XBEE_RX_PHASE_HEADER:
|
|
||||||
rxBuffer[rxIndex] = data;
|
rxBuffer[rxIndex] = data;
|
||||||
rxIndex++;
|
rxIndex++;
|
||||||
|
if (rxIndex>=XBEE_RX_BUFFER_MAX_LENGTH)
|
||||||
if (rxIndex==3) {
|
|
||||||
// header reçu, calcul de la longueur de la frame
|
|
||||||
rxFrameLength = (((uint16_t)rxBuffer[1]) << 8) + (uint16_t)rxBuffer[2];
|
|
||||||
rxDataToReceive = rxFrameLength +1; // +1 for checksum
|
|
||||||
rxPhase = XBEE_RX_PHASE_BODY;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case XBEE_RX_PHASE_BODY:
|
|
||||||
rxBuffer[rxIndex] = data;
|
|
||||||
if (rxBuffer[rxIndex-1] == XBEE_API_ESCAPE_CHAR)
|
|
||||||
rxBuffer[rxIndex-1] = rxBuffer[rxIndex] ^ 0x20;
|
|
||||||
else {
|
|
||||||
rxIndex++;
|
|
||||||
rxDataToReceive--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!rxDataToReceive) {
|
|
||||||
rxIndex=0;
|
rxIndex=0;
|
||||||
rxPhase = XBEE_RX_PHASE_SOF;
|
|
||||||
|
rxCmdLength++;
|
||||||
|
if (rxCmdLength>=XBEE_RX_BUFFER_MAX_LENGTH)
|
||||||
|
rxCmdLength=0;
|
||||||
|
} else { // end of command received
|
||||||
|
rxBuffer[rxIndex] = 0; // ending zero for C string
|
||||||
xSemaphoreGiveFromISR( xHandleSemaphoreRX, &xHigherPriorityTaskWoken ); /* send event to receive task to process received task */
|
xSemaphoreGiveFromISR( xHandleSemaphoreRX, &xHigherPriorityTaskWoken ); /* send event to receive task to process received task */
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
default:
|
|
||||||
while(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (xHigherPriorityTaskWoken) {
|
if (xHigherPriorityTaskWoken) {
|
||||||
/* If xHigherPriorityTaskWoken is now set to pdTRUE then a context switch
|
/* If xHigherPriorityTaskWoken is now set to pdTRUE then a context switch
|
||||||
|
@ -426,15 +245,20 @@ void LPUART1_IRQHandler(void) {
|
||||||
|
|
||||||
if (LL_USART_IsActiveFlag_RXNE(hlpuart1.Instance)) {
|
if (LL_USART_IsActiveFlag_RXNE(hlpuart1.Instance)) {
|
||||||
XBEE_RX_IRQHandler();
|
XBEE_RX_IRQHandler();
|
||||||
} else if (LL_USART_IsActiveFlag_TXE(hlpuart1.Instance)) {
|
} else if ((LL_USART_IsEnabledIT_TXE(hlpuart1.Instance)) && (LL_USART_IsActiveFlag_TXE(hlpuart1.Instance))) {
|
||||||
XBEE_TX_IRQHandler();
|
XBEE_TX_IRQHandler();
|
||||||
} else {
|
} else {
|
||||||
if (LL_USART_IsActiveFlag_TC(hlpuart1.Instance))
|
if ((LL_USART_IsEnabledIT_TC(hlpuart1.Instance)) && (LL_USART_IsActiveFlag_TC(hlpuart1.Instance)))
|
||||||
LL_USART_DisableIT_TC(hlpuart1.Instance);
|
LL_USART_DisableIT_TC(hlpuart1.Instance);
|
||||||
else if (LL_USART_IsActiveFlag_IDLE(hlpuart1.Instance))
|
else if ((LL_USART_IsEnabledIT_IDLE(hlpuart1.Instance)) && (LL_USART_IsActiveFlag_IDLE(hlpuart1.Instance)))
|
||||||
LL_USART_ClearFlag_IDLE(hlpuart1.Instance);
|
LL_USART_ClearFlag_IDLE(hlpuart1.Instance);
|
||||||
else if (LL_USART_IsActiveFlag_ORE(hlpuart1.Instance)) {
|
else {
|
||||||
LL_USART_ClearFlag_ORE(hlpuart1.Instance);
|
LL_USART_ClearFlag_ORE(hlpuart1.Instance);
|
||||||
|
LL_USART_ClearFlag_FE(hlpuart1.Instance);
|
||||||
|
LL_USART_ClearFlag_PE(hlpuart1.Instance);
|
||||||
|
LL_USART_ClearFlag_NE(hlpuart1.Instance);
|
||||||
|
LL_USART_DisableIT_ERROR(hlpuart1.Instance);
|
||||||
|
LL_USART_DisableIT_PE(hlpuart1.Instance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,5 @@ typedef struct {
|
||||||
} XBEE_INCOMING_FRAME;
|
} XBEE_INCOMING_FRAME;
|
||||||
|
|
||||||
void XBEE_Init(void);
|
void XBEE_Init(void);
|
||||||
int XBEE_SendData(uint16_t address, char* data, int length);
|
|
||||||
|
|
||||||
#endif /* INC_XBEE_H_ */
|
#endif /* INC_XBEE_H_ */
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
|
|
||||||
/* Software timer definitions. */
|
/* Software timer definitions. */
|
||||||
#define configUSE_TIMERS 1
|
#define configUSE_TIMERS 1
|
||||||
#define configTIMER_TASK_PRIORITY ( 2 )
|
#define configTIMER_TASK_PRIORITY ( 3 )
|
||||||
#define configTIMER_QUEUE_LENGTH 10
|
#define configTIMER_QUEUE_LENGTH 10
|
||||||
#define configTIMER_TASK_STACK_DEPTH 256
|
#define configTIMER_TASK_STACK_DEPTH 256
|
||||||
|
|
||||||
|
|
|
@ -67,8 +67,6 @@ void Error_Handler(void);
|
||||||
#define ENC_PHA_GAUCHE_GPIO_Port GPIOA
|
#define ENC_PHA_GAUCHE_GPIO_Port GPIOA
|
||||||
#define ENC_PHA_DROIT_Pin GPIO_PIN_2
|
#define ENC_PHA_DROIT_Pin GPIO_PIN_2
|
||||||
#define ENC_PHA_DROIT_GPIO_Port GPIOA
|
#define ENC_PHA_DROIT_GPIO_Port GPIOA
|
||||||
#define ENC_PHB_DROIT_Pin GPIO_PIN_4
|
|
||||||
#define ENC_PHB_DROIT_GPIO_Port GPIOA
|
|
||||||
#define ENC_PHB_GAUCHE_Pin GPIO_PIN_5
|
#define ENC_PHB_GAUCHE_Pin GPIO_PIN_5
|
||||||
#define ENC_PHB_GAUCHE_GPIO_Port GPIOA
|
#define ENC_PHB_GAUCHE_GPIO_Port GPIOA
|
||||||
#define PWM_B_GAUCHE_Pin GPIO_PIN_6
|
#define PWM_B_GAUCHE_Pin GPIO_PIN_6
|
||||||
|
|
|
@ -51,7 +51,6 @@ void NMI_Handler(void);
|
||||||
void HardFault_Handler(void);
|
void HardFault_Handler(void);
|
||||||
void EXTI2_3_IRQHandler(void);
|
void EXTI2_3_IRQHandler(void);
|
||||||
void EXTI4_15_IRQHandler(void);
|
void EXTI4_15_IRQHandler(void);
|
||||||
void DMA1_Channel2_3_IRQHandler(void);
|
|
||||||
void ADC1_COMP_IRQHandler(void);
|
void ADC1_COMP_IRQHandler(void);
|
||||||
void TIM2_IRQHandler(void);
|
void TIM2_IRQHandler(void);
|
||||||
void TIM6_IRQHandler(void);
|
void TIM6_IRQHandler(void);
|
||||||
|
|
|
@ -57,6 +57,7 @@
|
||||||
__weak void PreSleepProcessing(uint32_t *ulExpectedIdleTime)
|
__weak void PreSleepProcessing(uint32_t *ulExpectedIdleTime)
|
||||||
{
|
{
|
||||||
/* place for user code */
|
/* place for user code */
|
||||||
|
*ulExpectedIdleTime=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__weak void PostSleepProcessing(uint32_t *ulExpectedIdleTime)
|
__weak void PostSleepProcessing(uint32_t *ulExpectedIdleTime)
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
/* Private includes ----------------------------------------------------------*/
|
/* Private includes ----------------------------------------------------------*/
|
||||||
/* USER CODE BEGIN Includes */
|
/* USER CODE BEGIN Includes */
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
|
#include "tests.h"
|
||||||
|
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
@ -45,12 +46,10 @@
|
||||||
ADC_HandleTypeDef hadc;
|
ADC_HandleTypeDef hadc;
|
||||||
|
|
||||||
UART_HandleTypeDef hlpuart1;
|
UART_HandleTypeDef hlpuart1;
|
||||||
DMA_HandleTypeDef hdma_lpuart1_tx;
|
|
||||||
|
|
||||||
TIM_HandleTypeDef htim2;
|
TIM_HandleTypeDef htim2;
|
||||||
TIM_HandleTypeDef htim3;
|
TIM_HandleTypeDef htim3;
|
||||||
TIM_HandleTypeDef htim21;
|
TIM_HandleTypeDef htim21;
|
||||||
TIM_HandleTypeDef htim22;
|
|
||||||
|
|
||||||
/* Definitions for defaultTask */
|
/* Definitions for defaultTask */
|
||||||
osThreadId_t defaultTaskHandle;
|
osThreadId_t defaultTaskHandle;
|
||||||
|
@ -66,13 +65,11 @@ const osThreadAttr_t defaultTask_attributes = {
|
||||||
/* Private function prototypes -----------------------------------------------*/
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
void SystemClock_Config(void);
|
void SystemClock_Config(void);
|
||||||
static void MX_GPIO_Init(void);
|
static void MX_GPIO_Init(void);
|
||||||
static void MX_DMA_Init(void);
|
|
||||||
static void MX_LPUART1_UART_Init(void);
|
static void MX_LPUART1_UART_Init(void);
|
||||||
static void MX_TIM2_Init(void);
|
static void MX_TIM2_Init(void);
|
||||||
static void MX_TIM3_Init(void);
|
static void MX_TIM3_Init(void);
|
||||||
static void MX_TIM21_Init(void);
|
static void MX_TIM21_Init(void);
|
||||||
static void MX_ADC_Init(void);
|
static void MX_ADC_Init(void);
|
||||||
static void MX_TIM22_Init(void);
|
|
||||||
void StartDefaultTask(void *argument);
|
void StartDefaultTask(void *argument);
|
||||||
|
|
||||||
/* USER CODE BEGIN PFP */
|
/* USER CODE BEGIN PFP */
|
||||||
|
@ -112,15 +109,17 @@ int main(void)
|
||||||
|
|
||||||
/* Initialize all configured peripherals */
|
/* Initialize all configured peripherals */
|
||||||
MX_GPIO_Init();
|
MX_GPIO_Init();
|
||||||
MX_DMA_Init();
|
|
||||||
MX_LPUART1_UART_Init();
|
MX_LPUART1_UART_Init();
|
||||||
MX_TIM2_Init();
|
MX_TIM2_Init();
|
||||||
MX_TIM3_Init();
|
MX_TIM3_Init();
|
||||||
MX_TIM21_Init();
|
MX_TIM21_Init();
|
||||||
MX_ADC_Init();
|
MX_ADC_Init();
|
||||||
MX_TIM22_Init();
|
|
||||||
/* USER CODE BEGIN 2 */
|
/* USER CODE BEGIN 2 */
|
||||||
|
#ifdef TESTS
|
||||||
|
TESTS_Init();
|
||||||
|
#else
|
||||||
APPLICATION_Init();
|
APPLICATION_Init();
|
||||||
|
#endif /* TESTS */
|
||||||
/* USER CODE END 2 */
|
/* USER CODE END 2 */
|
||||||
|
|
||||||
/* Init scheduler */
|
/* Init scheduler */
|
||||||
|
@ -292,7 +291,7 @@ static void MX_LPUART1_UART_Init(void)
|
||||||
|
|
||||||
/* USER CODE END LPUART1_Init 1 */
|
/* USER CODE END LPUART1_Init 1 */
|
||||||
hlpuart1.Instance = LPUART1;
|
hlpuart1.Instance = LPUART1;
|
||||||
hlpuart1.Init.BaudRate = 115200;
|
hlpuart1.Init.BaudRate = 9600;
|
||||||
hlpuart1.Init.WordLength = UART_WORDLENGTH_8B;
|
hlpuart1.Init.WordLength = UART_WORDLENGTH_8B;
|
||||||
hlpuart1.Init.StopBits = UART_STOPBITS_1;
|
hlpuart1.Init.StopBits = UART_STOPBITS_1;
|
||||||
hlpuart1.Init.Parity = UART_PARITY_NONE;
|
hlpuart1.Init.Parity = UART_PARITY_NONE;
|
||||||
|
@ -354,7 +353,7 @@ static void MX_TIM2_Init(void)
|
||||||
sSlaveConfig.InputTrigger = TIM_TS_TI1FP1;
|
sSlaveConfig.InputTrigger = TIM_TS_TI1FP1;
|
||||||
sSlaveConfig.TriggerPolarity = TIM_INPUTCHANNELPOLARITY_RISING;
|
sSlaveConfig.TriggerPolarity = TIM_INPUTCHANNELPOLARITY_RISING;
|
||||||
sSlaveConfig.TriggerPrescaler = TIM_ICPSC_DIV1;
|
sSlaveConfig.TriggerPrescaler = TIM_ICPSC_DIV1;
|
||||||
sSlaveConfig.TriggerFilter = 0;
|
sSlaveConfig.TriggerFilter = 3;
|
||||||
if (HAL_TIM_SlaveConfigSynchro(&htim2, &sSlaveConfig) != HAL_OK)
|
if (HAL_TIM_SlaveConfigSynchro(&htim2, &sSlaveConfig) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
|
@ -362,14 +361,13 @@ static void MX_TIM2_Init(void)
|
||||||
sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING;
|
sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING;
|
||||||
sConfigIC.ICSelection = TIM_ICSELECTION_DIRECTTI;
|
sConfigIC.ICSelection = TIM_ICSELECTION_DIRECTTI;
|
||||||
sConfigIC.ICPrescaler = TIM_ICPSC_DIV1;
|
sConfigIC.ICPrescaler = TIM_ICPSC_DIV1;
|
||||||
sConfigIC.ICFilter = TIM_CCMR1_IC1F_3;
|
sConfigIC.ICFilter = 3;
|
||||||
if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_1) != HAL_OK)
|
if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_1) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
}
|
}
|
||||||
sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_FALLING;
|
sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_FALLING;
|
||||||
sConfigIC.ICSelection = TIM_ICSELECTION_INDIRECTTI;
|
sConfigIC.ICSelection = TIM_ICSELECTION_INDIRECTTI;
|
||||||
sConfigIC.ICFilter = TIM_CCMR1_IC2F_3;
|
|
||||||
if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_2) != HAL_OK)
|
if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_2) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
|
@ -504,7 +502,7 @@ static void MX_TIM21_Init(void)
|
||||||
sSlaveConfig.InputTrigger = TIM_TS_TI1FP1;
|
sSlaveConfig.InputTrigger = TIM_TS_TI1FP1;
|
||||||
sSlaveConfig.TriggerPolarity = TIM_INPUTCHANNELPOLARITY_RISING;
|
sSlaveConfig.TriggerPolarity = TIM_INPUTCHANNELPOLARITY_RISING;
|
||||||
sSlaveConfig.TriggerPrescaler = TIM_ICPSC_DIV1;
|
sSlaveConfig.TriggerPrescaler = TIM_ICPSC_DIV1;
|
||||||
sSlaveConfig.TriggerFilter = 0;
|
sSlaveConfig.TriggerFilter = 3;
|
||||||
if (HAL_TIM_SlaveConfigSynchro(&htim21, &sSlaveConfig) != HAL_OK)
|
if (HAL_TIM_SlaveConfigSynchro(&htim21, &sSlaveConfig) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
|
@ -512,14 +510,13 @@ static void MX_TIM21_Init(void)
|
||||||
sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING;
|
sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING;
|
||||||
sConfigIC.ICSelection = TIM_ICSELECTION_DIRECTTI;
|
sConfigIC.ICSelection = TIM_ICSELECTION_DIRECTTI;
|
||||||
sConfigIC.ICPrescaler = TIM_ICPSC_DIV1;
|
sConfigIC.ICPrescaler = TIM_ICPSC_DIV1;
|
||||||
sConfigIC.ICFilter = TIM_CCMR1_IC1F_3;
|
sConfigIC.ICFilter = 3;
|
||||||
if (HAL_TIM_IC_ConfigChannel(&htim21, &sConfigIC, TIM_CHANNEL_1) != HAL_OK)
|
if (HAL_TIM_IC_ConfigChannel(&htim21, &sConfigIC, TIM_CHANNEL_1) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
}
|
}
|
||||||
sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_FALLING;
|
sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_FALLING;
|
||||||
sConfigIC.ICSelection = TIM_ICSELECTION_INDIRECTTI;
|
sConfigIC.ICSelection = TIM_ICSELECTION_INDIRECTTI;
|
||||||
sConfigIC.ICFilter = TIM_CCMR1_IC2F_3;
|
|
||||||
if (HAL_TIM_IC_ConfigChannel(&htim21, &sConfigIC, TIM_CHANNEL_2) != HAL_OK)
|
if (HAL_TIM_IC_ConfigChannel(&htim21, &sConfigIC, TIM_CHANNEL_2) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
|
@ -536,70 +533,6 @@ static void MX_TIM21_Init(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief TIM22 Initialization Function
|
|
||||||
* @param None
|
|
||||||
* @retval None
|
|
||||||
*/
|
|
||||||
static void MX_TIM22_Init(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
/* USER CODE BEGIN TIM22_Init 0 */
|
|
||||||
|
|
||||||
/* USER CODE END TIM22_Init 0 */
|
|
||||||
|
|
||||||
TIM_ClockConfigTypeDef sClockSourceConfig = {0};
|
|
||||||
TIM_MasterConfigTypeDef sMasterConfig = {0};
|
|
||||||
|
|
||||||
/* USER CODE BEGIN TIM22_Init 1 */
|
|
||||||
|
|
||||||
/* USER CODE END TIM22_Init 1 */
|
|
||||||
htim22.Instance = TIM22;
|
|
||||||
htim22.Init.Prescaler = 0;
|
|
||||||
htim22.Init.CounterMode = TIM_COUNTERMODE_UP;
|
|
||||||
htim22.Init.Period = 65535;
|
|
||||||
htim22.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
|
||||||
htim22.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
|
||||||
if (HAL_TIM_Base_Init(&htim22) != HAL_OK)
|
|
||||||
{
|
|
||||||
Error_Handler();
|
|
||||||
}
|
|
||||||
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_ETRMODE2;
|
|
||||||
sClockSourceConfig.ClockPolarity = TIM_CLOCKPOLARITY_NONINVERTED;
|
|
||||||
sClockSourceConfig.ClockPrescaler = TIM_CLOCKPRESCALER_DIV1;
|
|
||||||
sClockSourceConfig.ClockFilter = 0;
|
|
||||||
if (HAL_TIM_ConfigClockSource(&htim22, &sClockSourceConfig) != HAL_OK)
|
|
||||||
{
|
|
||||||
Error_Handler();
|
|
||||||
}
|
|
||||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
|
||||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
|
||||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim22, &sMasterConfig) != HAL_OK)
|
|
||||||
{
|
|
||||||
Error_Handler();
|
|
||||||
}
|
|
||||||
/* USER CODE BEGIN TIM22_Init 2 */
|
|
||||||
|
|
||||||
/* USER CODE END TIM22_Init 2 */
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable DMA controller clock
|
|
||||||
*/
|
|
||||||
static void MX_DMA_Init(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
/* DMA controller clock enable */
|
|
||||||
__HAL_RCC_DMA1_CLK_ENABLE();
|
|
||||||
|
|
||||||
/* DMA interrupt init */
|
|
||||||
/* DMA1_Channel2_3_IRQn interrupt configuration */
|
|
||||||
HAL_NVIC_SetPriority(DMA1_Channel2_3_IRQn, 3, 0);
|
|
||||||
HAL_NVIC_EnableIRQ(DMA1_Channel2_3_IRQn);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief GPIO Initialization Function
|
* @brief GPIO Initialization Function
|
||||||
* @param None
|
* @param None
|
||||||
|
@ -608,6 +541,8 @@ static void MX_DMA_Init(void)
|
||||||
static void MX_GPIO_Init(void)
|
static void MX_GPIO_Init(void)
|
||||||
{
|
{
|
||||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||||
|
/* USER CODE BEGIN MX_GPIO_Init_1 */
|
||||||
|
/* USER CODE END MX_GPIO_Init_1 */
|
||||||
|
|
||||||
/* GPIO Ports Clock Enable */
|
/* GPIO Ports Clock Enable */
|
||||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||||
|
@ -653,11 +588,11 @@ static void MX_GPIO_Init(void)
|
||||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
HAL_GPIO_Init(BUTTON_SENSE_GPIO_Port, &GPIO_InitStruct);
|
HAL_GPIO_Init(BUTTON_SENSE_GPIO_Port, &GPIO_InitStruct);
|
||||||
|
|
||||||
/*Configure GPIO pin : USB_SENSE_Pin */
|
// /*Configure GPIO pin : USB_SENSE_Pin */
|
||||||
GPIO_InitStruct.Pin = USB_SENSE_Pin;
|
// GPIO_InitStruct.Pin = USB_SENSE_Pin;
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;
|
// GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;
|
||||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
// GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
HAL_GPIO_Init(USB_SENSE_GPIO_Port, &GPIO_InitStruct);
|
// HAL_GPIO_Init(USB_SENSE_GPIO_Port, &GPIO_InitStruct);
|
||||||
|
|
||||||
/*Configure GPIO pins : CHARGER_ST2_Pin CHARGER_ST1_Pin */
|
/*Configure GPIO pins : CHARGER_ST2_Pin CHARGER_ST1_Pin */
|
||||||
GPIO_InitStruct.Pin = CHARGER_ST2_Pin|CHARGER_ST1_Pin;
|
GPIO_InitStruct.Pin = CHARGER_ST2_Pin|CHARGER_ST1_Pin;
|
||||||
|
@ -676,9 +611,11 @@ static void MX_GPIO_Init(void)
|
||||||
HAL_NVIC_SetPriority(EXTI2_3_IRQn, 3, 0);
|
HAL_NVIC_SetPriority(EXTI2_3_IRQn, 3, 0);
|
||||||
HAL_NVIC_EnableIRQ(EXTI2_3_IRQn);
|
HAL_NVIC_EnableIRQ(EXTI2_3_IRQn);
|
||||||
|
|
||||||
HAL_NVIC_SetPriority(EXTI4_15_IRQn, 3, 0);
|
// HAL_NVIC_SetPriority(EXTI4_15_IRQn, 3, 0);
|
||||||
HAL_NVIC_EnableIRQ(EXTI4_15_IRQn);
|
// HAL_NVIC_EnableIRQ(EXTI4_15_IRQn);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN MX_GPIO_Init_2 */
|
||||||
|
/* USER CODE END MX_GPIO_Init_2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* USER CODE BEGIN 4 */
|
/* USER CODE BEGIN 4 */
|
||||||
|
|
|
@ -21,10 +21,10 @@
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
/* USER CODE BEGIN Includes */
|
/* USER CODE BEGIN Includes */
|
||||||
|
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
extern DMA_HandleTypeDef hdma_lpuart1_tx;
|
|
||||||
|
|
||||||
/* Private typedef -----------------------------------------------------------*/
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
/* USER CODE BEGIN TD */
|
/* USER CODE BEGIN TD */
|
||||||
|
@ -177,29 +177,11 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
|
||||||
GPIO_InitStruct.Alternate = GPIO_AF4_LPUART1;
|
GPIO_InitStruct.Alternate = GPIO_AF4_LPUART1;
|
||||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||||
|
|
||||||
/* LPUART1 DMA Init */
|
|
||||||
/* LPUART1_TX Init */
|
|
||||||
hdma_lpuart1_tx.Instance = DMA1_Channel2;
|
|
||||||
hdma_lpuart1_tx.Init.Request = DMA_REQUEST_5;
|
|
||||||
hdma_lpuart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
|
|
||||||
hdma_lpuart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;
|
|
||||||
hdma_lpuart1_tx.Init.MemInc = DMA_MINC_ENABLE;
|
|
||||||
hdma_lpuart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
|
|
||||||
hdma_lpuart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
|
|
||||||
hdma_lpuart1_tx.Init.Mode = DMA_NORMAL;
|
|
||||||
hdma_lpuart1_tx.Init.Priority = DMA_PRIORITY_HIGH;
|
|
||||||
if (HAL_DMA_Init(&hdma_lpuart1_tx) != HAL_OK)
|
|
||||||
{
|
|
||||||
Error_Handler();
|
|
||||||
}
|
|
||||||
|
|
||||||
__HAL_LINKDMA(huart,hdmatx,hdma_lpuart1_tx);
|
|
||||||
|
|
||||||
/* LPUART1 interrupt Init */
|
/* LPUART1 interrupt Init */
|
||||||
HAL_NVIC_SetPriority(LPUART1_IRQn, 3, 0);
|
HAL_NVIC_SetPriority(LPUART1_IRQn, 2, 0);
|
||||||
HAL_NVIC_EnableIRQ(LPUART1_IRQn);
|
HAL_NVIC_EnableIRQ(LPUART1_IRQn);
|
||||||
/* USER CODE BEGIN LPUART1_MspInit 1 */
|
/* USER CODE BEGIN LPUART1_MspInit 1 */
|
||||||
HAL_NVIC_SetPriority(LPUART1_IRQn, 2, 0);
|
//HAL_NVIC_SetPriority(LPUART1_IRQn, 3, 0);
|
||||||
/* USER CODE END LPUART1_MspInit 1 */
|
/* USER CODE END LPUART1_MspInit 1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,9 +209,6 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
|
||||||
*/
|
*/
|
||||||
HAL_GPIO_DeInit(GPIOB, USART_TX_Pin|USART_RX_Pin);
|
HAL_GPIO_DeInit(GPIOB, USART_TX_Pin|USART_RX_Pin);
|
||||||
|
|
||||||
/* LPUART1 DMA DeInit */
|
|
||||||
HAL_DMA_DeInit(huart->hdmatx);
|
|
||||||
|
|
||||||
/* LPUART1 interrupt DeInit */
|
/* LPUART1 interrupt DeInit */
|
||||||
HAL_NVIC_DisableIRQ(LPUART1_IRQn);
|
HAL_NVIC_DisableIRQ(LPUART1_IRQn);
|
||||||
/* USER CODE BEGIN LPUART1_MspDeInit 1 */
|
/* USER CODE BEGIN LPUART1_MspDeInit 1 */
|
||||||
|
@ -311,29 +290,6 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
|
||||||
|
|
||||||
/* USER CODE END TIM21_MspInit 1 */
|
/* USER CODE END TIM21_MspInit 1 */
|
||||||
}
|
}
|
||||||
else if(htim_base->Instance==TIM22)
|
|
||||||
{
|
|
||||||
/* USER CODE BEGIN TIM22_MspInit 0 */
|
|
||||||
|
|
||||||
/* USER CODE END TIM22_MspInit 0 */
|
|
||||||
/* Peripheral clock enable */
|
|
||||||
__HAL_RCC_TIM22_CLK_ENABLE();
|
|
||||||
|
|
||||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
|
||||||
/**TIM22 GPIO Configuration
|
|
||||||
PA4 ------> TIM22_ETR
|
|
||||||
*/
|
|
||||||
GPIO_InitStruct.Pin = ENC_PHB_DROIT_Pin;
|
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
|
||||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
|
||||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
|
||||||
GPIO_InitStruct.Alternate = GPIO_AF5_TIM22;
|
|
||||||
HAL_GPIO_Init(ENC_PHB_DROIT_GPIO_Port, &GPIO_InitStruct);
|
|
||||||
|
|
||||||
/* USER CODE BEGIN TIM22_MspInit 1 */
|
|
||||||
|
|
||||||
/* USER CODE END TIM22_MspInit 1 */
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -431,23 +387,6 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
|
||||||
|
|
||||||
/* USER CODE END TIM21_MspDeInit 1 */
|
/* USER CODE END TIM21_MspDeInit 1 */
|
||||||
}
|
}
|
||||||
else if(htim_base->Instance==TIM22)
|
|
||||||
{
|
|
||||||
/* USER CODE BEGIN TIM22_MspDeInit 0 */
|
|
||||||
|
|
||||||
/* USER CODE END TIM22_MspDeInit 0 */
|
|
||||||
/* Peripheral clock disable */
|
|
||||||
__HAL_RCC_TIM22_CLK_DISABLE();
|
|
||||||
|
|
||||||
/**TIM22 GPIO Configuration
|
|
||||||
PA4 ------> TIM22_ETR
|
|
||||||
*/
|
|
||||||
HAL_GPIO_DeInit(ENC_PHB_DROIT_GPIO_Port, ENC_PHB_DROIT_Pin);
|
|
||||||
|
|
||||||
/* USER CODE BEGIN TIM22_MspDeInit 1 */
|
|
||||||
|
|
||||||
/* USER CODE END TIM22_MspDeInit 1 */
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,7 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
|
||||||
htim6.Instance = TIM6;
|
htim6.Instance = TIM6;
|
||||||
|
|
||||||
/* Initialize TIMx peripheral as follow:
|
/* Initialize TIMx peripheral as follow:
|
||||||
|
|
||||||
+ Period = [(TIM6CLK/1000) - 1]. to have a (1/1000) s time base.
|
+ Period = [(TIM6CLK/1000) - 1]. to have a (1/1000) s time base.
|
||||||
+ Prescaler = (uwTimclock/1000000 - 1) to have a 1MHz counter clock.
|
+ Prescaler = (uwTimclock/1000000 - 1) to have a 1MHz counter clock.
|
||||||
+ ClockDivision = 0
|
+ ClockDivision = 0
|
||||||
|
|
|
@ -57,7 +57,6 @@
|
||||||
|
|
||||||
/* External variables --------------------------------------------------------*/
|
/* External variables --------------------------------------------------------*/
|
||||||
extern ADC_HandleTypeDef hadc;
|
extern ADC_HandleTypeDef hadc;
|
||||||
extern DMA_HandleTypeDef hdma_lpuart1_tx;
|
|
||||||
extern UART_HandleTypeDef hlpuart1;
|
extern UART_HandleTypeDef hlpuart1;
|
||||||
extern TIM_HandleTypeDef htim2;
|
extern TIM_HandleTypeDef htim2;
|
||||||
extern TIM_HandleTypeDef htim21;
|
extern TIM_HandleTypeDef htim21;
|
||||||
|
@ -135,20 +134,6 @@ void EXTI4_15_IRQHandler(void)
|
||||||
/* USER CODE END EXTI4_15_IRQn 1 */
|
/* USER CODE END EXTI4_15_IRQn 1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief This function handles DMA1 channel 2 and channel 3 interrupts.
|
|
||||||
*/
|
|
||||||
//void DMA1_Channel2_3_IRQHandler(void)
|
|
||||||
//{
|
|
||||||
// /* USER CODE BEGIN DMA1_Channel2_3_IRQn 0 */
|
|
||||||
//
|
|
||||||
// /* USER CODE END DMA1_Channel2_3_IRQn 0 */
|
|
||||||
// HAL_DMA_IRQHandler(&hdma_lpuart1_tx);
|
|
||||||
// /* USER CODE BEGIN DMA1_Channel2_3_IRQn 1 */
|
|
||||||
//
|
|
||||||
// /* USER CODE END DMA1_Channel2_3_IRQn 1 */
|
|
||||||
//}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function handles ADC, COMP1 and COMP2 interrupts (COMP interrupts through EXTI lines 21 and 22).
|
* @brief This function handles ADC, COMP1 and COMP2 interrupts (COMP interrupts through EXTI lines 21 and 22).
|
||||||
*/
|
*/
|
||||||
|
@ -211,11 +196,11 @@ void TIM21_IRQHandler(void)
|
||||||
//void LPUART1_IRQHandler(void)
|
//void LPUART1_IRQHandler(void)
|
||||||
//{
|
//{
|
||||||
// /* USER CODE BEGIN LPUART1_IRQn 0 */
|
// /* USER CODE BEGIN LPUART1_IRQn 0 */
|
||||||
//
|
////
|
||||||
// /* USER CODE END LPUART1_IRQn 0 */
|
// /* USER CODE END LPUART1_IRQn 0 */
|
||||||
// HAL_UART_IRQHandler(&hlpuart1);
|
// HAL_UART_IRQHandler(&hlpuart1);
|
||||||
// /* USER CODE BEGIN LPUART1_IRQn 1 */
|
// /* USER CODE BEGIN LPUART1_IRQn 1 */
|
||||||
//
|
////
|
||||||
// /* USER CODE END LPUART1_IRQn 1 */
|
// /* USER CODE END LPUART1_IRQn 1 */
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
79
software/dumber3/Dumber3 Tests.launch
Normal file
79
software/dumber3/Dumber3 Tests.launch
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<launchConfiguration type="com.st.stm32cube.ide.mcu.debug.launch.launchConfigurationType">
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.access_port_id" value="0"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.cubeprog_external_loaders" value="[]"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.enable_live_expr" value="true"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.enable_swv" value="false"/>
|
||||||
|
<intAttribute key="com.st.stm32cube.ide.mcu.debug.launch.formatVersion" value="2"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.ip_address_local" value="localhost"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.enabled" value="false"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.value" value=""/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.loadList" value="{"fItems":[{"fIsFromMainTab":true,"fPath":"Tests/Dumber3.elf","fProjectName":"Dumber3","fPerformBuild":true,"fDownload":true,"fLoadSymbols":true}]}"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.override_start_address_mode" value="default"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.remoteCommand" value="target remote"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startServer" value="true"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.exception.divby0" value="true"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.exception.unaligned" value="false"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.haltonexception" value="true"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swd_mode" value="true"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_port" value="61235"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_trace_hclk" value="16000000"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.useRemoteTarget" value="true"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.vector_table" value=""/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.verify_flash_download" value="true"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.cti_allow_halt" value="false"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.cti_signal_halt" value="false"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_logging" value="false"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_max_halt_delay" value="false"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_shared_stlink" value="false"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.frequency" value="0"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.halt_all_on_reset" value="false"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.log_file" value="/home/dimercur/Travail/git/dumber/software/dumber3/Debug/st-link_gdbserver_log.txt"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.low_power_debug" value="enable"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.max_halt_delay" value="2"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.reset_strategy" value="connect_under_reset"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_check_serial_number" value="true"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value="49FF67064970535516370687"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="none"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="true"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{"fVersion":1,"fItems":[{"fDisplayName":"Reset","fIsSuppressible":false,"fResetAttribute":"Software system reset","fResetStrategies":[{"fDisplayName":"Software system reset","fLaunchAttribute":"system_reset","fGdbCommands":["monitor reset\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Hardware reset","fLaunchAttribute":"hardware_reset","fGdbCommands":["monitor reset hardware\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Core reset","fLaunchAttribute":"core_reset","fGdbCommands":["monitor reset core\n"],"fCmdOptions":["-g"]},{"fDisplayName":"None","fLaunchAttribute":"no_reset","fGdbCommands":[],"fCmdOptions":["-g"]}],"fGdbCommandGroup":{"name":"Additional commands","commands":[]},"fStartApplication":true}]}"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="true"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="freertos"/>
|
||||||
|
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriverAuto" value="false"/>
|
||||||
|
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriverPort" value="ARM_CM0"/>
|
||||||
|
<intAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyPort" value="60000"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDeviceId" value="com.st.stm32cube.ide.mcu.debug.stlink"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
|
||||||
|
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="61234"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
|
||||||
|
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Tests/Dumber3.elf"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="Dumber3"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||||
|
<listEntry value="/Dumber3"/>
|
||||||
|
</listAttribute>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||||
|
<listEntry value="4"/>
|
||||||
|
</listAttribute>
|
||||||
|
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><memoryBlockExpressionList context="reserved-for-future-use"/>"/>
|
||||||
|
<stringAttribute key="process_factory_id" value="com.st.stm32cube.ide.mcu.debug.launch.HardwareDebugProcessFactory"/>
|
||||||
|
<stringAttribute key="saved_expressions<seperator>Unknown" value="rxBuffer"/>
|
||||||
|
</launchConfiguration>
|
|
@ -10,17 +10,18 @@ FREERTOS.INCLUDE_xEventGroupSetBitFromISR=1
|
||||||
FREERTOS.INCLUDE_xTaskAbortDelay=1
|
FREERTOS.INCLUDE_xTaskAbortDelay=1
|
||||||
FREERTOS.INCLUDE_xTaskGetCurrentTaskHandle=1
|
FREERTOS.INCLUDE_xTaskGetCurrentTaskHandle=1
|
||||||
FREERTOS.INCLUDE_xTaskGetHandle=1
|
FREERTOS.INCLUDE_xTaskGetHandle=1
|
||||||
FREERTOS.IPParameters=Tasks01,configTICK_RATE_HZ,configUSE_TICKLESS_IDLE,INCLUDE_xTaskGetHandle,INCLUDE_xTaskAbortDelay,INCLUDE_xEventGroupSetBitFromISR,INCLUDE_pcTaskGetTaskName,INCLUDE_xTaskGetCurrentTaskHandle,configTOTAL_HEAP_SIZE,configUSE_NEWLIB_REENTRANT,configMAX_TASK_NAME_LEN
|
FREERTOS.IPParameters=Tasks01,configTICK_RATE_HZ,configUSE_TICKLESS_IDLE,INCLUDE_xTaskGetHandle,INCLUDE_xTaskAbortDelay,INCLUDE_xEventGroupSetBitFromISR,INCLUDE_pcTaskGetTaskName,INCLUDE_xTaskGetCurrentTaskHandle,configTOTAL_HEAP_SIZE,configUSE_NEWLIB_REENTRANT,configMAX_TASK_NAME_LEN,configTIMER_TASK_PRIORITY
|
||||||
FREERTOS.Tasks01=defaultTask,24,128,StartDefaultTask,Default,NULL,Dynamic,NULL,NULL
|
FREERTOS.Tasks01=defaultTask,24,128,StartDefaultTask,Default,NULL,Dynamic,NULL,NULL
|
||||||
FREERTOS.configMAX_TASK_NAME_LEN=25
|
FREERTOS.configMAX_TASK_NAME_LEN=25
|
||||||
FREERTOS.configTICK_RATE_HZ=1000
|
FREERTOS.configTICK_RATE_HZ=1000
|
||||||
|
FREERTOS.configTIMER_TASK_PRIORITY=3
|
||||||
FREERTOS.configTOTAL_HEAP_SIZE=1024
|
FREERTOS.configTOTAL_HEAP_SIZE=1024
|
||||||
FREERTOS.configUSE_NEWLIB_REENTRANT=1
|
FREERTOS.configUSE_NEWLIB_REENTRANT=1
|
||||||
FREERTOS.configUSE_TICKLESS_IDLE=1
|
FREERTOS.configUSE_TICKLESS_IDLE=1
|
||||||
File.Version=6
|
File.Version=6
|
||||||
GPIO.groupedBy=Group By Peripherals
|
GPIO.groupedBy=Group By Peripherals
|
||||||
KeepUserPlacement=false
|
KeepUserPlacement=false
|
||||||
LPUART1.BaudRate=115200
|
LPUART1.BaudRate=9600
|
||||||
LPUART1.DMADisableonRxErrorParam=UART_ADVFEATURE_DMA_DISABLEONRXERROR
|
LPUART1.DMADisableonRxErrorParam=UART_ADVFEATURE_DMA_DISABLEONRXERROR
|
||||||
LPUART1.IPParameters=BaudRate,WordLength,DMADisableonRxErrorParam
|
LPUART1.IPParameters=BaudRate,WordLength,DMADisableonRxErrorParam
|
||||||
LPUART1.WordLength=UART_WORDLENGTH_8B
|
LPUART1.WordLength=UART_WORDLENGTH_8B
|
||||||
|
@ -75,14 +76,14 @@ Mcu.PinsNb=33
|
||||||
Mcu.ThirdPartyNb=0
|
Mcu.ThirdPartyNb=0
|
||||||
Mcu.UserConstants=
|
Mcu.UserConstants=
|
||||||
Mcu.UserName=STM32L071CBTx
|
Mcu.UserName=STM32L071CBTx
|
||||||
MxCube.Version=6.7.0
|
MxCube.Version=6.9.2
|
||||||
MxDb.Version=DB.6.0.70
|
MxDb.Version=DB.6.0.92
|
||||||
NVIC.ADC1_COMP_IRQn=true\:3\:0\:false\:false\:true\:true\:true\:true\:true
|
NVIC.ADC1_COMP_IRQn=true\:3\:0\:false\:false\:true\:true\:true\:true\:true
|
||||||
NVIC.EXTI2_3_IRQn=true\:3\:0\:false\:false\:true\:true\:true\:true\:true
|
NVIC.EXTI2_3_IRQn=true\:3\:0\:false\:false\:true\:true\:true\:true\:true
|
||||||
NVIC.EXTI4_15_IRQn=true\:3\:0\:false\:false\:true\:true\:true\:true\:true
|
NVIC.EXTI4_15_IRQn=true\:3\:0\:false\:false\:true\:true\:true\:true\:true
|
||||||
NVIC.ForceEnableDMAVector=true
|
NVIC.ForceEnableDMAVector=true
|
||||||
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
|
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
|
||||||
NVIC.LPUART1_IRQn=true\:3\:0\:false\:false\:true\:true\:true\:true\:true
|
NVIC.LPUART1_IRQn=true\:3\:0\:true\:false\:true\:true\:true\:true\:true
|
||||||
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
|
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
|
||||||
NVIC.PendSV_IRQn=true\:3\:0\:false\:false\:false\:true\:false\:false\:false
|
NVIC.PendSV_IRQn=true\:3\:0\:false\:false\:false\:true\:false\:false\:false
|
||||||
NVIC.SVC_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false\:true
|
NVIC.SVC_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false\:true
|
||||||
|
@ -92,7 +93,7 @@ NVIC.SavedSystickIrqHandlerGenerated=true
|
||||||
NVIC.SysTick_IRQn=true\:3\:0\:false\:false\:false\:true\:false\:true\:false
|
NVIC.SysTick_IRQn=true\:3\:0\:false\:false\:false\:true\:false\:true\:false
|
||||||
NVIC.TIM21_IRQn=true\:1\:0\:true\:false\:true\:false\:true\:true\:true
|
NVIC.TIM21_IRQn=true\:1\:0\:true\:false\:true\:false\:true\:true\:true
|
||||||
NVIC.TIM2_IRQn=true\:1\:0\:true\:false\:true\:false\:true\:true\:true
|
NVIC.TIM2_IRQn=true\:1\:0\:true\:false\:true\:false\:true\:true\:true
|
||||||
NVIC.TIM6_IRQn=true\:3\:0\:false\:false\:true\:false\:false\:true\:true
|
NVIC.TIM6_IRQn=true\:3\:0\:true\:false\:true\:false\:false\:true\:true
|
||||||
NVIC.TimeBase=TIM6_IRQn
|
NVIC.TimeBase=TIM6_IRQn
|
||||||
NVIC.TimeBaseIP=TIM6
|
NVIC.TimeBaseIP=TIM6
|
||||||
PA0.GPIOParameters=GPIO_Label
|
PA0.GPIOParameters=GPIO_Label
|
||||||
|
@ -242,10 +243,13 @@ ProjectManager.PreviousToolchain=
|
||||||
ProjectManager.ProjectBuild=false
|
ProjectManager.ProjectBuild=false
|
||||||
ProjectManager.ProjectFileName=Dumber3.ioc
|
ProjectManager.ProjectFileName=Dumber3.ioc
|
||||||
ProjectManager.ProjectName=Dumber3
|
ProjectManager.ProjectName=Dumber3
|
||||||
|
ProjectManager.ProjectStructure=
|
||||||
ProjectManager.RegisterCallBack=
|
ProjectManager.RegisterCallBack=
|
||||||
ProjectManager.StackSize=0x200
|
ProjectManager.StackSize=0x200
|
||||||
ProjectManager.TargetToolchain=STM32CubeIDE
|
ProjectManager.TargetToolchain=STM32CubeIDE
|
||||||
ProjectManager.ToolChainLocation=
|
ProjectManager.ToolChainLocation=
|
||||||
|
ProjectManager.UAScriptAfterPath=
|
||||||
|
ProjectManager.UAScriptBeforePath=
|
||||||
ProjectManager.UnderRoot=true
|
ProjectManager.UnderRoot=true
|
||||||
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_LPUART1_UART_Init-LPUART1-false-HAL-true,4-MX_TIM2_Init-TIM2-false-HAL-true,5-MX_TIM3_Init-TIM3-false-HAL-true,6-MX_TIM21_Init-TIM21-false-HAL-true,7-MX_ADC_Init-ADC-false-HAL-true
|
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_LPUART1_UART_Init-LPUART1-false-HAL-true,4-MX_TIM2_Init-TIM2-false-HAL-true,5-MX_TIM3_Init-TIM3-false-HAL-true,6-MX_TIM21_Init-TIM21-false-HAL-true,7-MX_ADC_Init-ADC-false-HAL-true
|
||||||
RCC.ADCFreq_Value=4000000
|
RCC.ADCFreq_Value=4000000
|
||||||
|
@ -324,4 +328,5 @@ VP_TIM2_VS_ClockSourceINT.Signal=TIM2_VS_ClockSourceINT
|
||||||
VP_TIM3_VS_ClockSourceINT.Mode=Internal
|
VP_TIM3_VS_ClockSourceINT.Mode=Internal
|
||||||
VP_TIM3_VS_ClockSourceINT.Signal=TIM3_VS_ClockSourceINT
|
VP_TIM3_VS_ClockSourceINT.Signal=TIM3_VS_ClockSourceINT
|
||||||
board=custom
|
board=custom
|
||||||
|
rtos.0.ip=FREERTOS
|
||||||
isbadioc=false
|
isbadioc=false
|
||||||
|
|
256
software/dumber3/TestsPlans/tests.c
Normal file
256
software/dumber3/TestsPlans/tests.c
Normal file
|
@ -0,0 +1,256 @@
|
||||||
|
/*
|
||||||
|
* tests.c
|
||||||
|
*
|
||||||
|
* Created on: 28 sept. 2023
|
||||||
|
* Author: dimercur
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "tests.h"
|
||||||
|
#include "application.h"
|
||||||
|
#include "timers.h"
|
||||||
|
#include "string.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "moteurs.h"
|
||||||
|
#include "leds.h"
|
||||||
|
#include "xbee.h"
|
||||||
|
#include "batterie.h"
|
||||||
|
#include "messages.h"
|
||||||
|
|
||||||
|
StaticTask_t xTaskBasicTests;
|
||||||
|
|
||||||
|
/* Buffer that the task being created will use as its stack. Note this is
|
||||||
|
an array of StackType_t variables. The size of StackType_t is dependent on
|
||||||
|
the RTOS port. */
|
||||||
|
StackType_t xStackBasicTests[ STACK_SIZE ];
|
||||||
|
TaskHandle_t xHandleBasicTests = NULL;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
LED_Tests=1,
|
||||||
|
XBEE_Tests,
|
||||||
|
COMMANDS_Tests,
|
||||||
|
BATTERY_Tests,
|
||||||
|
MOTEURS_Tests,
|
||||||
|
MISC_Tests
|
||||||
|
} TESTS_Type;
|
||||||
|
|
||||||
|
TESTS_Type TESTS_Nbr=COMMANDS_Tests; // Number indicating which test is being run
|
||||||
|
|
||||||
|
void TESTS_BasicTests(void* params);
|
||||||
|
|
||||||
|
void TESTS_Init(void) {
|
||||||
|
/* Init Application */
|
||||||
|
|
||||||
|
/* Init des messages box */
|
||||||
|
MESSAGE_Init();
|
||||||
|
|
||||||
|
/* Init de l'afficheur */
|
||||||
|
LEDS_Init();
|
||||||
|
|
||||||
|
/* Init de la partie RF / reception des messages */
|
||||||
|
XBEE_Init();
|
||||||
|
BATTERIE_Init();
|
||||||
|
MOTEURS_Init();
|
||||||
|
|
||||||
|
/* Tests starts here */
|
||||||
|
xHandleBasicTests = xTaskCreateStatic(
|
||||||
|
TESTS_BasicTests, /* Function that implements the task. */
|
||||||
|
"TESTS Basic", /* Text name for the task. */
|
||||||
|
STACK_SIZE, /* Number of indexes in the xStack array. */
|
||||||
|
NULL, /* Parameter passed into the task. */
|
||||||
|
PriorityTestsHandler,/* Priority at which the task is created. */
|
||||||
|
xStackBasicTests, /* Array to use as the task's stack. */
|
||||||
|
&xTaskBasicTests); /* Variable to hold the task's data structure. */
|
||||||
|
|
||||||
|
vTaskResume(xHandleBasicTests);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TESTS_BasicTests(void* params) {
|
||||||
|
static LEDS_State ledsStates = leds_off;
|
||||||
|
MESSAGE_Typedef msg;
|
||||||
|
CMD_Generic* cmd;
|
||||||
|
|
||||||
|
char* ans;
|
||||||
|
|
||||||
|
ledsStates = leds_run;
|
||||||
|
MESSAGE_SendMailbox(LEDS_Mailbox, MSG_ID_LED_ETAT, APPLICATION_Mailbox, (void*)&ledsStates); // show program is running
|
||||||
|
|
||||||
|
switch (TESTS_Nbr) {
|
||||||
|
case LED_Tests: //Leds tests
|
||||||
|
|
||||||
|
while (ledsStates<=leds_state_unknown) {
|
||||||
|
ledsStates++;
|
||||||
|
|
||||||
|
MESSAGE_SendMailbox(LEDS_Mailbox, MSG_ID_LED_ETAT, APPLICATION_Mailbox, (void*)&ledsStates);
|
||||||
|
vTaskDelay(pdMS_TO_TICKS(TESTS_PERIODE)); // wait 10s
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case XBEE_Tests: // Xbee tests
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
int length;
|
||||||
|
|
||||||
|
msg = MESSAGE_ReadMailbox(APPLICATION_Mailbox); // Wait for a message from Xbee
|
||||||
|
|
||||||
|
if (msg.id == MSG_ID_XBEE_CMD) {
|
||||||
|
length = strlen((char*)msg.data) + strlen("Data received: ") +2;
|
||||||
|
ans = (char*)malloc(length);
|
||||||
|
ans[0] = 0; // empty string
|
||||||
|
|
||||||
|
strncat(ans, "Data received: ", length);
|
||||||
|
strncat(ans, (char *)msg.data, length);
|
||||||
|
ans[length-2] = '\r';
|
||||||
|
ans[length-1] = 0;
|
||||||
|
|
||||||
|
MESSAGE_SendMailbox(XBEE_Mailbox, MSG_ID_XBEE_ANS, APPLICATION_Mailbox, (void*)ans);
|
||||||
|
|
||||||
|
free(msg.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case COMMANDS_Tests:
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
int length;
|
||||||
|
char* str;
|
||||||
|
|
||||||
|
msg = MESSAGE_ReadMailbox(APPLICATION_Mailbox); // Wait for a message from Xbee
|
||||||
|
|
||||||
|
if (msg.id == MSG_ID_XBEE_CMD) {
|
||||||
|
length = strlen((char*)msg.data) + strlen("Data received: ") +2;
|
||||||
|
ans = (char*)malloc(length);
|
||||||
|
ans[0] = 0; // empty string
|
||||||
|
|
||||||
|
strncat(ans, "Data received: ", length);
|
||||||
|
strncat(ans, (char *)msg.data, length);
|
||||||
|
ans[length-2] = '\r';
|
||||||
|
ans[length-1] = 0;
|
||||||
|
|
||||||
|
MESSAGE_SendMailbox(XBEE_Mailbox, MSG_ID_XBEE_ANS, APPLICATION_Mailbox, (void*)ans);
|
||||||
|
|
||||||
|
cmd = cmdDecode((char*)msg.data, strlen((char*)msg.data));
|
||||||
|
free(msg.data);
|
||||||
|
str = (char*)malloc(100);
|
||||||
|
str[0] = 0; // empty string
|
||||||
|
|
||||||
|
switch (cmd->type) {
|
||||||
|
case CMD_PING:
|
||||||
|
snprintf(str, 99, "PING received\r");
|
||||||
|
cmdSendAnswer(ANS_OK);
|
||||||
|
break;
|
||||||
|
case CMD_RESET:
|
||||||
|
snprintf(str, 99, "RESET received\r");
|
||||||
|
cmdSendAnswer(ANS_OK);
|
||||||
|
break;
|
||||||
|
case CMD_START_WITH_WATCHDOG:
|
||||||
|
snprintf(str, 99, "START with Watchdog received\r");
|
||||||
|
cmdSendAnswer(ANS_OK);
|
||||||
|
break;
|
||||||
|
case CMD_RESET_WATCHDOG:
|
||||||
|
snprintf(str, 99, "RESET Watchdog received\r");
|
||||||
|
cmdSendAnswer(ANS_OK);
|
||||||
|
break;
|
||||||
|
case CMD_GET_BATTERY:
|
||||||
|
snprintf(str, 99, "GET_BATTERY received\r");
|
||||||
|
cmdSendBatteryLevel(ANS_BAT_OK);
|
||||||
|
break;
|
||||||
|
case CMD_GET_VERSION:
|
||||||
|
snprintf(str, 99, "GET_VERSION received\r");
|
||||||
|
cmdSendVersion();
|
||||||
|
break;
|
||||||
|
case CMD_START_WITHOUT_WATCHDOG:
|
||||||
|
snprintf(str, 99, "START without Watchdog received\r");
|
||||||
|
cmdSendAnswer(ANS_OK);
|
||||||
|
break;
|
||||||
|
case CMD_MOVE:
|
||||||
|
snprintf(str, 99, "MOVE received\r");
|
||||||
|
cmdSendAnswer(ANS_OK);
|
||||||
|
break;
|
||||||
|
case CMD_TURN:
|
||||||
|
snprintf(str, 99, "TURN received\r");
|
||||||
|
cmdSendAnswer(ANS_OK);
|
||||||
|
break;
|
||||||
|
case CMD_GET_BUSY_STATE:
|
||||||
|
snprintf(str, 99, "GET_BUSY_STATE received\r");
|
||||||
|
cmdSendBusyState(ANS_STATE_BUSY);
|
||||||
|
break;
|
||||||
|
case CMD_TEST:
|
||||||
|
snprintf(str, 99, "TEST received\r");
|
||||||
|
cmdSendAnswer(ANS_OK);
|
||||||
|
break;
|
||||||
|
case CMD_DEBUG:
|
||||||
|
snprintf(str, 99, "DEBUG received\r");
|
||||||
|
cmdSendAnswer(ANS_OK);
|
||||||
|
break;
|
||||||
|
case CMD_POWER_OFF:
|
||||||
|
snprintf(str, 99, "POWER_OFF received\r");
|
||||||
|
cmdSendAnswer(ANS_OK);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
snprintf(str, 99, "Unknown command\r");
|
||||||
|
cmdSendAnswer(ANS_UNKNOWN);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
MESSAGE_SendMailbox(XBEE_Mailbox, MSG_ID_XBEE_ANS, APPLICATION_Mailbox, (void*)str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case BATTERY_Tests:
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
char* str;
|
||||||
|
|
||||||
|
msg = MESSAGE_ReadMailbox(APPLICATION_Mailbox); // Wait for a message from Xbee
|
||||||
|
str = (char*)malloc(100); /* allocate a buffer of 100 bytes */
|
||||||
|
str[0]=0;
|
||||||
|
|
||||||
|
switch (msg.id) {
|
||||||
|
case MSG_ID_BAT_ADC_ERR:
|
||||||
|
snprintf(str, 99, "ADC error received\r");
|
||||||
|
break;
|
||||||
|
case MSG_ID_BAT_CHARGE_COMPLETE:
|
||||||
|
snprintf(str, 99, "Charge complete (plug in) [Level = %u]\r", *((uint16_t*)msg.data));
|
||||||
|
break;
|
||||||
|
case MSG_ID_BAT_CHARGE_ON:
|
||||||
|
snprintf(str, 99, "Charging (plug in) [Level = %u]\r", *((uint16_t*)msg.data));
|
||||||
|
break;
|
||||||
|
case MSG_ID_BAT_CHARGE_OFF:
|
||||||
|
snprintf(str, 99, "Not in charge (plug removed) [Level = %u]\r", *((uint16_t*)msg.data));
|
||||||
|
break;
|
||||||
|
case MSG_ID_BAT_CHARGE_ERR:
|
||||||
|
snprintf(str, 99, "Charge error (plug in)\r");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
free(str); // buffer alloué non utilisé
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
MESSAGE_SendMailbox(XBEE_Mailbox, MSG_ID_XBEE_ANS, APPLICATION_Mailbox, (void*)str);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case MOTEURS_Tests:
|
||||||
|
|
||||||
|
break;
|
||||||
|
case MISC_Tests: // test du bouton on/off
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
char* str;
|
||||||
|
|
||||||
|
msg = MESSAGE_ReadMailbox(APPLICATION_Mailbox); // Wait for a message from button
|
||||||
|
|
||||||
|
if (msg.id == MSG_ID_BUTTON_PRESSED) {
|
||||||
|
str = (char*)malloc(100); /* allocate a buffer of 100 bytes */
|
||||||
|
str[0]=0;
|
||||||
|
|
||||||
|
snprintf(str, 99, "Bouton on/off appuyé\r");
|
||||||
|
MESSAGE_SendMailbox(XBEE_Mailbox, MSG_ID_XBEE_ANS, APPLICATION_Mailbox, (void*)str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
13
software/dumber3/TestsPlans/tests.h
Normal file
13
software/dumber3/TestsPlans/tests.h
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
/*
|
||||||
|
* tests.h
|
||||||
|
*
|
||||||
|
* Created on: 28 sept. 2023
|
||||||
|
* Author: dimercur
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef TESTS_H_
|
||||||
|
#define TESTS_H_
|
||||||
|
|
||||||
|
void TESTS_Init(void);
|
||||||
|
|
||||||
|
#endif /* TESTS_H_ */
|
15
software/dumber3/commands.xml
Normal file
15
software/dumber3/commands.xml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<loop>false</loop>
|
||||||
|
<repeat_times>1</repeat_times>
|
||||||
|
<repeat_period>500</repeat_period>
|
||||||
|
<packets_list>
|
||||||
|
<packet name="Ping">
|
||||||
|
<payload>70700D</payload>
|
||||||
|
</packet>
|
||||||
|
<packet name="Reset">
|
||||||
|
<payload>72720D</payload>
|
||||||
|
</packet>
|
||||||
|
</packets_list>
|
||||||
|
</data>
|
|
@ -27,8 +27,8 @@
|
||||||
<cpucore>Arm Cortex-M0+</cpucore>
|
<cpucore>Arm Cortex-M0+</cpucore>
|
||||||
<fpu>None</fpu>
|
<fpu>None</fpu>
|
||||||
<memories>
|
<memories>
|
||||||
<memory access="xrw" name="RAM" size="20" start="0x20000000" />
|
<memory access="xrw" name="RAM" size="20480" start="0x20000000" />
|
||||||
<memory access="rx" name="FLASH" size="128" start="0x8000000" />
|
<memory access="rx" name="FLASH" size="131072" start="0x8000000" />
|
||||||
</memories>
|
</memories>
|
||||||
<startup>/home/dimercur/STM32Cube/Repository/STM32Cube_FW_L0_V1.12.2/Drivers/CMSIS/Device\ST\STM32L0xx\Source\Templates\gcc\startup_stm32l071xx.s</startup>
|
<startup>/home/dimercur/STM32Cube/Repository/STM32Cube_FW_L0_V1.12.2/Drivers/CMSIS/Device\ST\STM32L0xx\Source\Templates\gcc\startup_stm32l071xx.s</startup>
|
||||||
<LinkSettings>
|
<LinkSettings>
|
||||||
|
@ -63,7 +63,6 @@
|
||||||
<Adefines />
|
<Adefines />
|
||||||
<Cdefines>
|
<Cdefines>
|
||||||
<define>USE_FULL_LL_DRIVER</define>
|
<define>USE_FULL_LL_DRIVER</define>
|
||||||
<define>MBEDTLS_CONFIG_FILE="mbedtls_config.h"</define>
|
|
||||||
<define>USE_FULL_ASSERT=1U</define>
|
<define>USE_FULL_ASSERT=1U</define>
|
||||||
</Cdefines>
|
</Cdefines>
|
||||||
<Ldefines />
|
<Ldefines />
|
||||||
|
|
Loading…
Add table
Reference in a new issue