Added USART, shiftregister and command line parser code
This commit is contained in:
parent
744aaef6a5
commit
c6caaafde7
112
.cproject
112
.cproject
|
@ -15,64 +15,64 @@
|
||||||
<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" cleanCommand="rm -rf" description="" id="com.atollic.truestudio.exe.debug.1518366166" name="Debug" parent="com.atollic.truestudio.exe.debug" postbuildStep="arm-atollic-eabi-objcopy.exe -O ihex "${BuildArtifactFileBaseName}.elf" "${BuildArtifactFileBaseName}.hex"" prebuildStep="">
|
<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" cleanCommand="rm -rf" description="" id="com.atollic.truestudio.exe.debug.1518366166" name="Debug" parent="com.atollic.truestudio.exe.debug" postbuildStep="arm-atollic-eabi-objcopy.exe -O ihex "${BuildArtifactFileBaseName}.elf" "${BuildArtifactFileBaseName}.hex"" prebuildStep="">
|
||||||
<folderInfo id="com.atollic.truestudio.exe.debug.1518366166.2031504340" name="/" resourcePath="">
|
<folderInfo id="com.atollic.truestudio.exe.debug.1518366166.2031504340" name="/" resourcePath="">
|
||||||
<toolChain id="com.atollic.truestudio.exe.debug.toolchain.683225115" name="Atollic ARM Tools" superClass="com.atollic.truestudio.exe.debug.toolchain">
|
<toolChain id="com.atollic.truestudio.exe.debug.toolchain.683225115" name="Atollic ARM Tools" superClass="com.atollic.truestudio.exe.debug.toolchain">
|
||||||
<option id="com.atollic.truestudio.general.runtimelib.1557952293" superClass="com.atollic.truestudio.general.runtimelib" value="com.atollic.truestudio.ld.general.clib.small" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.general.runtimelib.1557952293" name="Runtime Library" superClass="com.atollic.truestudio.general.runtimelib" useByScannerDiscovery="false" value="com.atollic.truestudio.ld.general.clib.standard" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.toolchain_options.mcu.1546266502" superClass="com.atollic.truestudio.toolchain_options.mcu" value="STM32F030RC" valueType="string"/>
|
<option id="com.atollic.truestudio.toolchain_options.mcu.1546266502" name="Microcontroller" superClass="com.atollic.truestudio.toolchain_options.mcu" useByScannerDiscovery="false" value="STM32F030RC" valueType="string"/>
|
||||||
<option id="com.atollic.truestudio.toolchain_options.vendor.3396250" superClass="com.atollic.truestudio.toolchain_options.vendor" value="STMicroelectronics" valueType="string"/>
|
<option id="com.atollic.truestudio.toolchain_options.vendor.3396250" name="Vendor name" superClass="com.atollic.truestudio.toolchain_options.vendor" useByScannerDiscovery="false" value="STMicroelectronics" valueType="string"/>
|
||||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.atollic.truestudio.exe.debug.toolchain.platform.2054752829" isAbstract="false" name="Debug platform" superClass="com.atollic.truestudio.exe.debug.toolchain.platform"/>
|
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.atollic.truestudio.exe.debug.toolchain.platform.2054752829" isAbstract="false" name="Debug platform" superClass="com.atollic.truestudio.exe.debug.toolchain.platform"/>
|
||||||
<builder buildPath="${workspace_loc:/EPROMEmu}/Debug" id="com.atollic.truestudio.mbs.builder1.1222194476" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="com.atollic.truestudio.mbs.builder1">
|
<builder buildPath="${workspace_loc:/EPROMEmu}/Debug" customBuilderProperties="toolChainpathType=1|toolChainpathString=C:\\Program Files (x86)\\Atollic\\TrueSTUDIO for STM32 9.3.0\\ARMTools\\bin|" id="com.atollic.truestudio.mbs.builder1.1222194476" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="com.atollic.truestudio.mbs.builder1">
|
||||||
<outputEntries>
|
<outputEntries>
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Debug"/>
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Debug"/>
|
||||||
</outputEntries>
|
</outputEntries>
|
||||||
</builder>
|
</builder>
|
||||||
<tool command="arm-atollic-eabi-gcc -c" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX} ${OUTPUT} ${INPUTS}" id="com.atollic.truestudio.exe.debug.toolchain.as.1545899283" name="Assembler" superClass="com.atollic.truestudio.exe.debug.toolchain.as">
|
<tool command="arm-atollic-eabi-gcc -c" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX} ${OUTPUT} ${INPUTS}" id="com.atollic.truestudio.exe.debug.toolchain.as.1545899283" name="Assembler" superClass="com.atollic.truestudio.exe.debug.toolchain.as">
|
||||||
<option id="com.atollic.truestudio.common_options.target.endianess.1608144567" name="Endianess" superClass="com.atollic.truestudio.common_options.target.endianess" value="com.atollic.truestudio.common_options.target.endianess.little" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.endianess.1608144567" name="Endianess" superClass="com.atollic.truestudio.common_options.target.endianess" useByScannerDiscovery="false" value="com.atollic.truestudio.common_options.target.endianess.little" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.mcpu.286463162" name="Microcontroller" superClass="com.atollic.truestudio.common_options.target.mcpu" value="STM32F030RC" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.mcpu.286463162" name="Microcontroller" superClass="com.atollic.truestudio.common_options.target.mcpu" useByScannerDiscovery="false" value="STM32F030RC" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.instr_set.2033833414" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.instr_set.2033833414" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" useByScannerDiscovery="false" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.as.general.incpath.770237934" name="Include path" superClass="com.atollic.truestudio.as.general.incpath"/>
|
<option id="com.atollic.truestudio.as.general.incpath.770237934" name="Include path" superClass="com.atollic.truestudio.as.general.incpath" useByScannerDiscovery="false"/>
|
||||||
<option id="com.atollic.truestudio.gcc.symbols.defined.1670122205" name="Defined symbols" superClass="com.atollic.truestudio.gcc.symbols.defined"/>
|
<option id="com.atollic.truestudio.gcc.symbols.defined.1670122205" name="Defined symbols" superClass="com.atollic.truestudio.gcc.symbols.defined" useByScannerDiscovery="false"/>
|
||||||
<option id="com.atollic.truestudio.as.general.otherflags.51384659" superClass="com.atollic.truestudio.as.general.otherflags" value="" valueType="string"/>
|
<option id="com.atollic.truestudio.as.general.otherflags.51384659" name="Other options" superClass="com.atollic.truestudio.as.general.otherflags" useByScannerDiscovery="false" value="" valueType="string"/>
|
||||||
<option id="com.atollic.truestudio.as.general.warnings.1324541152" superClass="com.atollic.truestudio.as.general.warnings" value="true" valueType="boolean"/>
|
<option id="com.atollic.truestudio.as.general.warnings.1324541152" name="Suppress warnings " superClass="com.atollic.truestudio.as.general.warnings" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.fpu.829683864" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu" value="com.atollic.truestudio.common_options.target.fpu.soft" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.fpu.829683864" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu" useByScannerDiscovery="false" value="com.atollic.truestudio.common_options.target.fpu.soft" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.fpucore.1297069055" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" value="com.atollic.truestudio.common_options.target.fpucore.None" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.fpucore.1297069055" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" useByScannerDiscovery="false" value="com.atollic.truestudio.common_options.target.fpucore.None" valueType="enumerated"/>
|
||||||
<inputType id="com.atollic.truestudio.as.input.374932590" name="Input" superClass="com.atollic.truestudio.as.input"/>
|
<inputType id="com.atollic.truestudio.as.input.374932590" name="Input" superClass="com.atollic.truestudio.as.input"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool command="arm-atollic-eabi-gcc -c " commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX} ${OUTPUT} ${INPUTS}" id="com.atollic.truestudio.exe.debug.toolchain.gcc.1836874447" name="C Compiler" superClass="com.atollic.truestudio.exe.debug.toolchain.gcc">
|
<tool command="arm-atollic-eabi-gcc -c " commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX} ${OUTPUT} ${INPUTS}" id="com.atollic.truestudio.exe.debug.toolchain.gcc.1836874447" name="C Compiler" superClass="com.atollic.truestudio.exe.debug.toolchain.gcc">
|
||||||
<option id="com.atollic.truestudio.gcc.directories.select.330946435" name="Include path" superClass="com.atollic.truestudio.gcc.directories.select" valueType="includePath">
|
<option id="com.atollic.truestudio.gcc.directories.select.330946435" name="Include path" superClass="com.atollic.truestudio.gcc.directories.select" useByScannerDiscovery="false" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value="../Inc"/>
|
<listOptionValue builtIn="false" value="../Inc"/>
|
||||||
<listOptionValue builtIn="false" value="../Drivers/STM32F0xx_HAL_Driver/Inc"/>
|
<listOptionValue builtIn="false" value="../Drivers/STM32F0xx_HAL_Driver/Inc"/>
|
||||||
<listOptionValue builtIn="false" value="../Drivers/STM32F0xx_HAL_Driver/Inc/Legacy"/>
|
<listOptionValue builtIn="false" value="../Drivers/STM32F0xx_HAL_Driver/Inc/Legacy"/>
|
||||||
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F0xx/Include"/>
|
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F0xx/Include"/>
|
||||||
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
|
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
|
||||||
</option>
|
</option>
|
||||||
<option id="com.atollic.truestudio.gcc.symbols.defined.1670122205" name="Defined symbols" superClass="com.atollic.truestudio.gcc.symbols.defined" valueType="definedSymbols">
|
<option id="com.atollic.truestudio.gcc.symbols.defined.1670122205" name="Defined symbols" superClass="com.atollic.truestudio.gcc.symbols.defined" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
<listOptionValue builtIn="false" value="__weak=__attribute__((weak))"/>
|
<listOptionValue builtIn="false" value="__weak=__attribute__((weak))"/>
|
||||||
<listOptionValue builtIn="false" value="__packed=__attribute__((__packed__))"/>
|
<listOptionValue builtIn="false" value="__packed=__attribute__((__packed__))"/>
|
||||||
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
||||||
<listOptionValue builtIn="false" value="STM32F030xC"/>
|
<listOptionValue builtIn="false" value="STM32F030xC"/>
|
||||||
</option>
|
</option>
|
||||||
<option id="com.atollic.truestudio.common_options.target.endianess.1854274048" name="Endianess" superClass="com.atollic.truestudio.common_options.target.endianess" value="com.atollic.truestudio.common_options.target.endianess.little" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.endianess.1854274048" name="Endianess" superClass="com.atollic.truestudio.common_options.target.endianess" useByScannerDiscovery="false" value="com.atollic.truestudio.common_options.target.endianess.little" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.mcpu.191909026" name="Microcontroller" superClass="com.atollic.truestudio.common_options.target.mcpu" value="STM32F030RC" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.mcpu.191909026" name="Microcontroller" superClass="com.atollic.truestudio.common_options.target.mcpu" useByScannerDiscovery="false" value="STM32F030RC" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.instr_set.1503159865" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.instr_set.1503159865" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" useByScannerDiscovery="false" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.gcc.optimization.prep_garbage.586275206" name="Prepare dead code removal" superClass="com.atollic.truestudio.gcc.optimization.prep_garbage" value="true" valueType="boolean"/>
|
<option id="com.atollic.truestudio.gcc.optimization.prep_garbage.586275206" name="Prepare dead code removal " superClass="com.atollic.truestudio.gcc.optimization.prep_garbage" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||||
<option id="com.atollic.truestudio.gcc.optimization.prep_data.1044766448" name="Prepare dead data removal" superClass="com.atollic.truestudio.gcc.optimization.prep_data" value="true" valueType="boolean"/>
|
<option id="com.atollic.truestudio.gcc.optimization.prep_data.1044766448" name="Prepare dead data removal" superClass="com.atollic.truestudio.gcc.optimization.prep_data" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||||
<option id="com.atollic.truestudio.gcc.misc.otherflags.895097519" name="Other options" superClass="com.atollic.truestudio.gcc.misc.otherflags" value="" valueType="string"/>
|
<option id="com.atollic.truestudio.gcc.misc.otherflags.895097519" name="Other options" superClass="com.atollic.truestudio.gcc.misc.otherflags" useByScannerDiscovery="false" value="" valueType="string"/>
|
||||||
<option id="com.atollic.truestudio.exe.debug.toolchain.gcc.optimization.level.1763412676" name="Optimization Level" superClass="com.atollic.truestudio.exe.debug.toolchain.gcc.optimization.level" value="com.atollic.truestudio.gcc.optimization.level.0s" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.exe.debug.toolchain.gcc.optimization.level.1763412676" name="Optimization Level" superClass="com.atollic.truestudio.exe.debug.toolchain.gcc.optimization.level" useByScannerDiscovery="false" value="com.atollic.truestudio.gcc.optimization.level.0g" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.fpu.829683864" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu" value="com.atollic.truestudio.common_options.target.fpu.soft" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.fpu.829683864" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu" useByScannerDiscovery="false" value="com.atollic.truestudio.common_options.target.fpu.soft" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.fpucore.1297069055" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" value="com.atollic.truestudio.common_options.target.fpucore.None" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.fpucore.1297069055" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" useByScannerDiscovery="false" value="com.atollic.truestudio.common_options.target.fpucore.None" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.interwork.1173495076" name="Mix ARM/Thumb" superClass="com.atollic.truestudio.common_options.target.interwork"/>
|
<option id="com.atollic.truestudio.common_options.target.interwork.1173495076" name="Mix ARM/Thumb" superClass="com.atollic.truestudio.common_options.target.interwork" useByScannerDiscovery="false"/>
|
||||||
<inputType id="com.atollic.truestudio.gcc.input.850396938" superClass="com.atollic.truestudio.gcc.input"/>
|
<inputType id="com.atollic.truestudio.gcc.input.850396938" superClass="com.atollic.truestudio.gcc.input"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="com.atollic.truestudio.exe.debug.toolchain.ld.1444973427" name="C Linker" superClass="com.atollic.truestudio.exe.debug.toolchain.ld">
|
<tool id="com.atollic.truestudio.exe.debug.toolchain.ld.1444973427" name="C Linker" superClass="com.atollic.truestudio.exe.debug.toolchain.ld">
|
||||||
<option id="com.atollic.truestudio.common_options.target.endianess.662778612" name="Endianess" superClass="com.atollic.truestudio.common_options.target.endianess" value="com.atollic.truestudio.common_options.target.endianess.little" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.endianess.662778612" name="Endianess" superClass="com.atollic.truestudio.common_options.target.endianess" useByScannerDiscovery="false" value="com.atollic.truestudio.common_options.target.endianess.little" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.mcpu.35700531" name="Microcontroller" superClass="com.atollic.truestudio.common_options.target.mcpu" value="STM32F030RC" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.mcpu.35700531" name="Microcontroller" superClass="com.atollic.truestudio.common_options.target.mcpu" useByScannerDiscovery="false" value="STM32F030RC" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.instr_set.566688004" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.instr_set.566688004" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" useByScannerDiscovery="false" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.ld.general.scriptfile.1350476438" name="Linker script" superClass="com.atollic.truestudio.ld.general.scriptfile" value="../STM32F030RC_FLASH.ld" valueType="string"/>
|
<option id="com.atollic.truestudio.ld.general.scriptfile.1350476438" name="Linker script" superClass="com.atollic.truestudio.ld.general.scriptfile" useByScannerDiscovery="false" value="../STM32F030RC_FLASH.ld" valueType="string"/>
|
||||||
<option id="com.atollic.truestudio.ld.optimization.do_garbage.1816004776" name="Dead code removal" superClass="com.atollic.truestudio.ld.optimization.do_garbage" value="true" valueType="boolean"/>
|
<option id="com.atollic.truestudio.ld.optimization.do_garbage.1816004776" name="Dead code removal " superClass="com.atollic.truestudio.ld.optimization.do_garbage" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||||
<option id="com.atollic.truestudio.ld.libraries.list.848669414" superClass="com.atollic.truestudio.ld.libraries.list"/>
|
<option id="com.atollic.truestudio.ld.libraries.list.848669414" name="Libraries" superClass="com.atollic.truestudio.ld.libraries.list" useByScannerDiscovery="false"/>
|
||||||
<option id="com.atollic.truestudio.ld.libraries.searchpath.1273009461" superClass="com.atollic.truestudio.ld.libraries.searchpath"/>
|
<option id="com.atollic.truestudio.ld.libraries.searchpath.1273009461" name="Library search path" superClass="com.atollic.truestudio.ld.libraries.searchpath" useByScannerDiscovery="false"/>
|
||||||
<option id="com.atollic.truestudio.ld.misc.linkerflags.1948405714" superClass="com.atollic.truestudio.ld.misc.linkerflags" value="" valueType="string"/>
|
<option id="com.atollic.truestudio.ld.misc.linkerflags.1948405714" name="Other options" superClass="com.atollic.truestudio.ld.misc.linkerflags" useByScannerDiscovery="false" value="" valueType="string"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.fpu.829683864" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu" value="com.atollic.truestudio.common_options.target.fpu.soft" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.fpu.829683864" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu" useByScannerDiscovery="false" value="com.atollic.truestudio.common_options.target.fpu.soft" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.fpucore.1297069055" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" value="com.atollic.truestudio.common_options.target.fpucore.None" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.fpucore.1297069055" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" useByScannerDiscovery="false" value="com.atollic.truestudio.common_options.target.fpucore.None" valueType="enumerated"/>
|
||||||
<inputType id="com.atollic.truestudio.ld.input.1372975870" name="Input" superClass="com.atollic.truestudio.ld.input">
|
<inputType id="com.atollic.truestudio.ld.input.1372975870" name="Input" superClass="com.atollic.truestudio.ld.input">
|
||||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||||
|
@ -107,9 +107,9 @@
|
||||||
<option id="com.atollic.truestudio.common_options.target.instr_set.1600237525" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.instr_set.1600237525" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.ldcc.general.scriptfile.561304432" name="Linker script" superClass="com.atollic.truestudio.ldcc.general.scriptfile" value="../STM32F030RC_FLASH.ld" valueType="string"/>
|
<option id="com.atollic.truestudio.ldcc.general.scriptfile.561304432" name="Linker script" superClass="com.atollic.truestudio.ldcc.general.scriptfile" value="../STM32F030RC_FLASH.ld" valueType="string"/>
|
||||||
<option id="com.atollic.truestudio.ldcc.optimization.do_garbage.956844137" name="Dead code removal" superClass="com.atollic.truestudio.ldcc.optimization.do_garbage" value="true" valueType="boolean"/>
|
<option id="com.atollic.truestudio.ldcc.optimization.do_garbage.956844137" name="Dead code removal" superClass="com.atollic.truestudio.ldcc.optimization.do_garbage" value="true" valueType="boolean"/>
|
||||||
<option id="com.atollic.truestudio.ldcc.libraries.list.848669414" superClass="com.atollic.truestudio.ldcc.libraries.list"/>
|
<option id="com.atollic.truestudio.ldcc.libraries.list.848669414" name="Libraries" superClass="com.atollic.truestudio.ldcc.libraries.list"/>
|
||||||
<option id="com.atollic.truestudio.ldcc.libraries.searchpath.1273009461" superClass="com.atollic.truestudio.ldcc.libraries.searchpath"/>
|
<option id="com.atollic.truestudio.ldcc.libraries.searchpath.1273009461" name="Library search path" superClass="com.atollic.truestudio.ldcc.libraries.searchpath"/>
|
||||||
<option id="com.atollic.truestudio.ldcc.misc.linkerflags.1948405714" superClass="com.atollic.truestudio.ldcc.misc.linkerflags" value="" valueType="string"/>
|
<option id="com.atollic.truestudio.ldcc.misc.linkerflags.1948405714" name="Other options" superClass="com.atollic.truestudio.ldcc.misc.linkerflags" value="" valueType="string"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.fpu.829683864" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu" value="com.atollic.truestudio.common_options.target.fpu.soft" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.fpu.829683864" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu" value="com.atollic.truestudio.common_options.target.fpu.soft" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.fpucore.1297069055" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" value="com.atollic.truestudio.common_options.target.fpucore.None" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.fpucore.1297069055" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" value="com.atollic.truestudio.common_options.target.fpucore.None" valueType="enumerated"/>
|
||||||
</tool>
|
</tool>
|
||||||
|
@ -147,9 +147,9 @@
|
||||||
<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" cleanCommand="rm -rf" description="" id="com.atollic.truestudio.configuration.release.1518366166" name="Release" parent="com.atollic.truestudio.configuration.release" postbuildStep="arm-atollic-eabi-objcopy.exe -O ihex "${BuildArtifactFileBaseName}.elf" "${BuildArtifactFileBaseName}.hex"" prebuildStep="">
|
<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" cleanCommand="rm -rf" description="" id="com.atollic.truestudio.configuration.release.1518366166" name="Release" parent="com.atollic.truestudio.configuration.release" postbuildStep="arm-atollic-eabi-objcopy.exe -O ihex "${BuildArtifactFileBaseName}.elf" "${BuildArtifactFileBaseName}.hex"" prebuildStep="">
|
||||||
<folderInfo id="com.atollic.truestudio.configuration.release.1518366166.2031504340" name="/" resourcePath="">
|
<folderInfo id="com.atollic.truestudio.configuration.release.1518366166.2031504340" name="/" resourcePath="">
|
||||||
<toolChain id="com.atollic.truestudio.exe.release.toolchain.683225115" name="Atollic ARM Tools" superClass="com.atollic.truestudio.exe.release.toolchain">
|
<toolChain id="com.atollic.truestudio.exe.release.toolchain.683225115" name="Atollic ARM Tools" superClass="com.atollic.truestudio.exe.release.toolchain">
|
||||||
<option id="com.atollic.truestudio.general.runtimelib.1816224464" superClass="com.atollic.truestudio.general.runtimelib" value="com.atollic.truestudio.ld.general.clib.small" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.general.runtimelib.1816224464" name="Runtime Library" superClass="com.atollic.truestudio.general.runtimelib" value="com.atollic.truestudio.ld.general.clib.small" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.toolchain_options.mcu.1158682477" superClass="com.atollic.truestudio.toolchain_options.mcu" value="STM32F030RC" valueType="string"/>
|
<option id="com.atollic.truestudio.toolchain_options.mcu.1158682477" name="Microcontroller" superClass="com.atollic.truestudio.toolchain_options.mcu" value="STM32F030RC" valueType="string"/>
|
||||||
<option id="com.atollic.truestudio.toolchain_options.vendor.409123398" superClass="com.atollic.truestudio.toolchain_options.vendor" value="STMicroelectronics" valueType="string"/>
|
<option id="com.atollic.truestudio.toolchain_options.vendor.409123398" name="Vendor name" superClass="com.atollic.truestudio.toolchain_options.vendor" value="STMicroelectronics" valueType="string"/>
|
||||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.atollic.truestudio.exe.release.toolchain.platform.2054752829" isAbstract="false" name="Release platform" superClass="com.atollic.truestudio.exe.release.toolchain.platform"/>
|
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.atollic.truestudio.exe.release.toolchain.platform.2054752829" isAbstract="false" name="Release platform" superClass="com.atollic.truestudio.exe.release.toolchain.platform"/>
|
||||||
<builder buildPath="${workspace_loc:/EPROMEmu}/Release" id="com.atollic.truestudio.mbs.builder1.1222194476" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="com.atollic.truestudio.mbs.builder1">
|
<builder buildPath="${workspace_loc:/EPROMEmu}/Release" id="com.atollic.truestudio.mbs.builder1.1222194476" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="com.atollic.truestudio.mbs.builder1">
|
||||||
<outputEntries>
|
<outputEntries>
|
||||||
|
@ -162,8 +162,8 @@
|
||||||
<option id="com.atollic.truestudio.common_options.target.instr_set.2033833414" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.instr_set.2033833414" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.as.general.incpath.770237934" name="Include path" superClass="com.atollic.truestudio.as.general.incpath"/>
|
<option id="com.atollic.truestudio.as.general.incpath.770237934" name="Include path" superClass="com.atollic.truestudio.as.general.incpath"/>
|
||||||
<option id="com.atollic.truestudio.gcc.symbols.defined.1670122205" name="Defined symbols" superClass="com.atollic.truestudio.gcc.symbols.defined"/>
|
<option id="com.atollic.truestudio.gcc.symbols.defined.1670122205" name="Defined symbols" superClass="com.atollic.truestudio.gcc.symbols.defined"/>
|
||||||
<option id="com.atollic.truestudio.as.general.otherflags.51384659" superClass="com.atollic.truestudio.as.general.otherflags" value="" valueType="string"/>
|
<option id="com.atollic.truestudio.as.general.otherflags.51384659" name="Other options" superClass="com.atollic.truestudio.as.general.otherflags" value="" valueType="string"/>
|
||||||
<option id="com.atollic.truestudio.as.general.warnings.1324541152" superClass="com.atollic.truestudio.as.general.warnings" value="true" valueType="boolean"/>
|
<option id="com.atollic.truestudio.as.general.warnings.1324541152" name="Suppress warnings " superClass="com.atollic.truestudio.as.general.warnings" value="true" valueType="boolean"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.fpu.829683864" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu" value="com.atollic.truestudio.common_options.target.fpu.soft" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.fpu.829683864" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu" value="com.atollic.truestudio.common_options.target.fpu.soft" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.fpucore.1297069055" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" value="com.atollic.truestudio.common_options.target.fpucore.None" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.fpucore.1297069055" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" value="com.atollic.truestudio.common_options.target.fpucore.None" valueType="enumerated"/>
|
||||||
<inputType id="com.atollic.truestudio.as.input.374932590" name="Input" superClass="com.atollic.truestudio.as.input"/>
|
<inputType id="com.atollic.truestudio.as.input.374932590" name="Input" superClass="com.atollic.truestudio.as.input"/>
|
||||||
|
@ -185,7 +185,7 @@
|
||||||
<option id="com.atollic.truestudio.common_options.target.endianess.1854274048" name="Endianess" superClass="com.atollic.truestudio.common_options.target.endianess" value="com.atollic.truestudio.common_options.target.endianess.little" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.endianess.1854274048" name="Endianess" superClass="com.atollic.truestudio.common_options.target.endianess" value="com.atollic.truestudio.common_options.target.endianess.little" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.mcpu.191909026" name="Microcontroller" superClass="com.atollic.truestudio.common_options.target.mcpu" value="STM32F030RC" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.mcpu.191909026" name="Microcontroller" superClass="com.atollic.truestudio.common_options.target.mcpu" value="STM32F030RC" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.instr_set.1503159865" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.instr_set.1503159865" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.gcc.optimization.prep_garbage.586275206" name="Prepare dead code removal" superClass="com.atollic.truestudio.gcc.optimization.prep_garbage" value="true" valueType="boolean"/>
|
<option id="com.atollic.truestudio.gcc.optimization.prep_garbage.586275206" name="Prepare dead code removal " superClass="com.atollic.truestudio.gcc.optimization.prep_garbage" value="true" valueType="boolean"/>
|
||||||
<option id="com.atollic.truestudio.gcc.optimization.prep_data.1044766448" name="Prepare dead data removal" superClass="com.atollic.truestudio.gcc.optimization.prep_data" value="true" valueType="boolean"/>
|
<option id="com.atollic.truestudio.gcc.optimization.prep_data.1044766448" name="Prepare dead data removal" superClass="com.atollic.truestudio.gcc.optimization.prep_data" value="true" valueType="boolean"/>
|
||||||
<option id="com.atollic.truestudio.gcc.misc.otherflags.895097519" name="Other options" superClass="com.atollic.truestudio.gcc.misc.otherflags" value="" valueType="string"/>
|
<option id="com.atollic.truestudio.gcc.misc.otherflags.895097519" name="Other options" superClass="com.atollic.truestudio.gcc.misc.otherflags" value="" valueType="string"/>
|
||||||
<option id="com.atollic.truestudio.exe.release.toolchain.gcc.optimization.level.1763412676" name="Optimization Level" superClass="com.atollic.truestudio.exe.release.toolchain.gcc.optimization.level" value="com.atollic.truestudio.gcc.optimization.level.0s" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.exe.release.toolchain.gcc.optimization.level.1763412676" name="Optimization Level" superClass="com.atollic.truestudio.exe.release.toolchain.gcc.optimization.level" value="com.atollic.truestudio.gcc.optimization.level.0s" valueType="enumerated"/>
|
||||||
|
@ -199,10 +199,10 @@
|
||||||
<option id="com.atollic.truestudio.common_options.target.mcpu.35700531" name="Microcontroller" superClass="com.atollic.truestudio.common_options.target.mcpu" value="STM32F030RC" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.mcpu.35700531" name="Microcontroller" superClass="com.atollic.truestudio.common_options.target.mcpu" value="STM32F030RC" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.instr_set.566688004" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.instr_set.566688004" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.ld.general.scriptfile.1350476438" name="Linker script" superClass="com.atollic.truestudio.ld.general.scriptfile" value="../STM32F030RC_FLASH.ld" valueType="string"/>
|
<option id="com.atollic.truestudio.ld.general.scriptfile.1350476438" name="Linker script" superClass="com.atollic.truestudio.ld.general.scriptfile" value="../STM32F030RC_FLASH.ld" valueType="string"/>
|
||||||
<option id="com.atollic.truestudio.ld.optimization.do_garbage.1816004776" name="Dead code removal" superClass="com.atollic.truestudio.ld.optimization.do_garbage" value="true" valueType="boolean"/>
|
<option id="com.atollic.truestudio.ld.optimization.do_garbage.1816004776" name="Dead code removal " superClass="com.atollic.truestudio.ld.optimization.do_garbage" value="true" valueType="boolean"/>
|
||||||
<option id="com.atollic.truestudio.ld.libraries.list.848669414" superClass="com.atollic.truestudio.ld.libraries.list"/>
|
<option id="com.atollic.truestudio.ld.libraries.list.848669414" name="Libraries" superClass="com.atollic.truestudio.ld.libraries.list"/>
|
||||||
<option id="com.atollic.truestudio.ld.libraries.searchpath.1273009461" superClass="com.atollic.truestudio.ld.libraries.searchpath"/>
|
<option id="com.atollic.truestudio.ld.libraries.searchpath.1273009461" name="Library search path" superClass="com.atollic.truestudio.ld.libraries.searchpath"/>
|
||||||
<option id="com.atollic.truestudio.ld.misc.linkerflags.1948405714" superClass="com.atollic.truestudio.ld.misc.linkerflags" value="" valueType="string"/>
|
<option id="com.atollic.truestudio.ld.misc.linkerflags.1948405714" name="Other options" superClass="com.atollic.truestudio.ld.misc.linkerflags" value="" valueType="string"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.fpu.829683864" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu" value="com.atollic.truestudio.common_options.target.fpu.soft" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.fpu.829683864" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu" value="com.atollic.truestudio.common_options.target.fpu.soft" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.fpucore.1297069055" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" value="com.atollic.truestudio.common_options.target.fpucore.None" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.fpucore.1297069055" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" value="com.atollic.truestudio.common_options.target.fpucore.None" valueType="enumerated"/>
|
||||||
<inputType id="com.atollic.truestudio.ld.input.1372975870" name="Input" superClass="com.atollic.truestudio.ld.input">
|
<inputType id="com.atollic.truestudio.ld.input.1372975870" name="Input" superClass="com.atollic.truestudio.ld.input">
|
||||||
|
@ -239,9 +239,9 @@
|
||||||
<option id="com.atollic.truestudio.common_options.target.instr_set.1600237525" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.instr_set.1600237525" name="Instruction set" superClass="com.atollic.truestudio.common_options.target.instr_set" value="com.atollic.truestudio.common_options.target.instr_set.thumb2" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.ldcc.general.scriptfile.561304432" name="Linker script" superClass="com.atollic.truestudio.ldcc.general.scriptfile" value="../STM32F030RC_FLASH.ld" valueType="string"/>
|
<option id="com.atollic.truestudio.ldcc.general.scriptfile.561304432" name="Linker script" superClass="com.atollic.truestudio.ldcc.general.scriptfile" value="../STM32F030RC_FLASH.ld" valueType="string"/>
|
||||||
<option id="com.atollic.truestudio.ldcc.optimization.do_garbage.956844137" name="Dead code removal" superClass="com.atollic.truestudio.ldcc.optimization.do_garbage" value="true" valueType="boolean"/>
|
<option id="com.atollic.truestudio.ldcc.optimization.do_garbage.956844137" name="Dead code removal" superClass="com.atollic.truestudio.ldcc.optimization.do_garbage" value="true" valueType="boolean"/>
|
||||||
<option id="com.atollic.truestudio.ldcc.libraries.list.848669414" superClass="com.atollic.truestudio.ldcc.libraries.list"/>
|
<option id="com.atollic.truestudio.ldcc.libraries.list.848669414" name="Libraries" superClass="com.atollic.truestudio.ldcc.libraries.list"/>
|
||||||
<option id="com.atollic.truestudio.ldcc.libraries.searchpath.1273009461" superClass="com.atollic.truestudio.ldcc.libraries.searchpath"/>
|
<option id="com.atollic.truestudio.ldcc.libraries.searchpath.1273009461" name="Library search path" superClass="com.atollic.truestudio.ldcc.libraries.searchpath"/>
|
||||||
<option id="com.atollic.truestudio.ldcc.misc.linkerflags.1948405714" superClass="com.atollic.truestudio.ldcc.misc.linkerflags" value="" valueType="string"/>
|
<option id="com.atollic.truestudio.ldcc.misc.linkerflags.1948405714" name="Other options" superClass="com.atollic.truestudio.ldcc.misc.linkerflags" value="" valueType="string"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.fpu.829683864" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu" value="com.atollic.truestudio.common_options.target.fpu.soft" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.fpu.829683864" name="Floating point" superClass="com.atollic.truestudio.common_options.target.fpu" value="com.atollic.truestudio.common_options.target.fpu.soft" valueType="enumerated"/>
|
||||||
<option id="com.atollic.truestudio.common_options.target.fpucore.1297069055" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" value="com.atollic.truestudio.common_options.target.fpucore.None" valueType="enumerated"/>
|
<option id="com.atollic.truestudio.common_options.target.fpucore.1297069055" name="FPU" superClass="com.atollic.truestudio.common_options.target.fpucore" value="com.atollic.truestudio.common_options.target.fpucore.None" valueType="enumerated"/>
|
||||||
</tool>
|
</tool>
|
||||||
|
@ -269,7 +269,14 @@
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
<project id="EPROMEmu.com.atollic.truestudio.exe.1549124020" name="Executable" projectType="com.atollic.truestudio.exe"/>
|
<project id="EPROMEmu.com.atollic.truestudio.exe.1549124020" name="Executable" projectType="com.atollic.truestudio.exe"/>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="refreshScope"/>
|
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||||
|
<configuration configurationName="Debug">
|
||||||
|
<resource resourceType="PROJECT" workspacePath="/EPROMEmu"/>
|
||||||
|
</configuration>
|
||||||
|
<configuration configurationName="Release">
|
||||||
|
<resource resourceType="PROJECT" workspacePath="/EPROMEmu"/>
|
||||||
|
</configuration>
|
||||||
|
</storageModule>
|
||||||
<storageModule moduleId="scannerConfiguration">
|
<storageModule moduleId="scannerConfiguration">
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
|
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
|
||||||
|
@ -310,4 +317,5 @@
|
||||||
</scannerConfigBuildInfo>
|
</scannerConfigBuildInfo>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||||
</cproject>
|
</cproject>
|
||||||
|
|
|
@ -1,46 +1,56 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<launchConfiguration type="com.atollic.hardwaredebug.launch.launchConfigurationType">
|
<launchConfiguration type="com.atollic.hardwaredebug.launch.launchConfigurationType">
|
||||||
<stringAttribute key="com.atollic.hardwaredebug.jlink_common.cpu_core" value="Cortex-M" />
|
<stringAttribute key="com.atollic.hardwaredebug.jlink_common.cpu_core" value="Cortex-M"/>
|
||||||
<stringAttribute key="com.atollic.hardwaredebug.jlink_common.device" value="STM32F030RC" />
|
<stringAttribute key="com.atollic.hardwaredebug.jlink_common.device" value="STM32F030RC"/>
|
||||||
<stringAttribute key="com.atollic.hardwaredebug.jlink_common.endian" value="little" />
|
<stringAttribute key="com.atollic.hardwaredebug.jlink_common.endian" value="little"/>
|
||||||
<stringAttribute key="com.atollic.hardwaredebug.jlink_common.init_speed" value="4000" />
|
<stringAttribute key="com.atollic.hardwaredebug.jlink_common.init_speed" value="4000"/>
|
||||||
<booleanAttribute key="com.atollic.hardwaredebug.jlink_common.scan_chain_auto" value="true" />
|
<booleanAttribute key="com.atollic.hardwaredebug.jlink_common.scan_chain_auto" value="true"/>
|
||||||
<intAttribute key="com.atollic.hardwaredebug.jlink_common.scan_chain_irpre" value="0" />
|
<intAttribute key="com.atollic.hardwaredebug.jlink_common.scan_chain_irpre" value="0"/>
|
||||||
<intAttribute key="com.atollic.hardwaredebug.jlink_common.scan_chain_pos" value="0" />
|
<intAttribute key="com.atollic.hardwaredebug.jlink_common.scan_chain_pos" value="0"/>
|
||||||
<stringAttribute key="com.atollic.hardwaredebug.launch.analyzeCommands" value="# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers
# 2=32 bit, 1=16 bit and 0=8 bit parallelism mode
monitor flash set_parallelism_mode 2

# Load the program executable
load		

# Enable Debug connection in low power modes (DBGMCU->CR)
set *0xE0042004 = (*0xE0042004) | 0x7
# Start the executable
continue" />
|
<stringAttribute key="com.atollic.hardwaredebug.launch.analyzeCommands" value="# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers # 2=32 bit, 1=16 bit and 0=8 bit parallelism mode monitor flash set_parallelism_mode 2 # Load the program executable load		 # Enable Debug connection in low power modes (DBGMCU->CR) set *0xE0042004 = (*0xE0042004) | 0x7 # Start the executable continue"/>
|
||||||
<booleanAttribute key="com.atollic.hardwaredebug.launch.enable_swv" value="false" />
|
<booleanAttribute key="com.atollic.hardwaredebug.launch.enable_swv" value="false"/>
|
||||||
<intAttribute key="com.atollic.hardwaredebug.launch.formatVersion" value="2" />
|
<intAttribute key="com.atollic.hardwaredebug.launch.formatVersion" value="2"/>
|
||||||
<stringAttribute key="com.atollic.hardwaredebug.launch.ipAddress" value="localhost" />
|
<stringAttribute key="com.atollic.hardwaredebug.launch.hwinitCommands" value="# Initialize your hardware here "/>
|
||||||
<stringAttribute key="com.atollic.hardwaredebug.launch.jtagDevice" value="ST-LINK" />
|
<stringAttribute key="com.atollic.hardwaredebug.launch.ipAddress" value="localhost"/>
|
||||||
<intAttribute key="com.atollic.hardwaredebug.launch.portNumber" value="61234" />
|
<stringAttribute key="com.atollic.hardwaredebug.launch.jtagDevice" value="ST-LINK"/>
|
||||||
<stringAttribute key="com.atollic.hardwaredebug.launch.remoteCommand" value="target extended-remote" />
|
<intAttribute key="com.atollic.hardwaredebug.launch.portNumber" value="61234"/>
|
||||||
<stringAttribute key="com.atollic.hardwaredebug.launch.runCommands" value="# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers
# 2=32 bit, 1=16 bit and 0=8 bit parallelism mode
monitor flash set_parallelism_mode 2

# Load the program executable
load		

# Enable Debug connection in low power modes (DBGMCU->CR)
set *0xE0042004 = (*0xE0042004) | 0x7
# Set a breakpoint at main().
tbreak main

# Run to the breakpoint.
continue" />
|
<stringAttribute key="com.atollic.hardwaredebug.launch.remoteCommand" value="target extended-remote"/>
|
||||||
<stringAttribute key="com.atollic.hardwaredebug.launch.serverParam" value="-p 61234 -l 1 -d" />
|
<stringAttribute key="com.atollic.hardwaredebug.launch.runCommands" value="# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers # 2=32 bit, 1=16 bit and 0=8 bit parallelism mode monitor flash set_parallelism_mode 2 # Load the program executable load		 # Enable Debug connection in low power modes (DBGMCU->CR) set *0xE0042004 = (*0xE0042004) | 0x7 # Set a breakpoint at main(). tbreak main # Run to the breakpoint. continue"/>
|
||||||
<booleanAttribute key="com.atollic.hardwaredebug.launch.startServer" value="true" />
|
<stringAttribute key="com.atollic.hardwaredebug.launch.serverParam" value="-p 61234 -l 1 -d -s -cp "C:\Program Files (x86)\Atollic\TrueSTUDIO for STM32 9.3.0\Servers\STM32CubeProgrammer\bin""/>
|
||||||
<booleanAttribute key="com.atollic.hardwaredebug.launch.swd_mode" value="true" />
|
<booleanAttribute key="com.atollic.hardwaredebug.launch.startServer" value="true"/>
|
||||||
<stringAttribute key="com.atollic.hardwaredebug.launch.swv_port" value="61235" />
|
<booleanAttribute key="com.atollic.hardwaredebug.launch.swd_mode" value="true"/>
|
||||||
<stringAttribute key="com.atollic.hardwaredebug.launch.swv_trace_div" value="120" />
|
<stringAttribute key="com.atollic.hardwaredebug.launch.swv_port" value="61235"/>
|
||||||
<stringAttribute key="com.atollic.hardwaredebug.launch.swv_trace_hclk" value="120000000" />
|
<stringAttribute key="com.atollic.hardwaredebug.launch.swv_trace_div" value="120"/>
|
||||||
<booleanAttribute key="com.atollic.hardwaredebug.launch.swv_wait_for_sync" value="true" />
|
<stringAttribute key="com.atollic.hardwaredebug.launch.swv_trace_hclk" value="120000000"/>
|
||||||
<booleanAttribute key="com.atollic.hardwaredebug.launch.useRemoteTarget" value="true" />
|
<booleanAttribute key="com.atollic.hardwaredebug.launch.swv_wait_for_sync" value="true"/>
|
||||||
<stringAttribute key="com.atollic.hardwaredebug.launch.verifyCommands" value="# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers
# 2=32 bit, 1=16 bit and 0=8 bit parallelism mode
monitor flash set_parallelism_mode 2

# Load the program executable
load		

# Enable Debug connection in low power modes (DBGMCU->CR)
set *0xE0042004 = (*0xE0042004) | 0x7
# The executable starts automatically" />
|
<intAttribute key="com.atollic.hardwaredebug.launch.trace_system" value="0"/>
|
||||||
<booleanAttribute key="com.atollic.hardwaredebug.stlink.enable_logging" value="false" />
|
<booleanAttribute key="com.atollic.hardwaredebug.launch.useRemoteTarget" value="true"/>
|
||||||
<stringAttribute key="com.atollic.hardwaredebug.stlink.log_file" value="D:/Dev/Code/STM32/EPROMEmu/\Debug\st-link_gdbserver_log.txt" />
|
<stringAttribute key="com.atollic.hardwaredebug.launch.verifyCommands" value="# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers # 2=32 bit, 1=16 bit and 0=8 bit parallelism mode monitor flash set_parallelism_mode 2 # Load the program executable load		 # Enable Debug connection in low power modes (DBGMCU->CR) set *0xE0042004 = (*0xE0042004) | 0x7 # The executable starts automatically"/>
|
||||||
<booleanAttribute key="com.atollic.hardwaredebug.stlink.verify_flash" value="false" />
|
<booleanAttribute key="com.atollic.hardwaredebug.launch.verify_flash_download" value="true"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="${TOOLCHAIN_PATH}/arm-atollic-eabi-gdb" />
|
<booleanAttribute key="com.atollic.hardwaredebug.stlink.enable_external_loader" value="false"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard (Windows)" />
|
<booleanAttribute key="com.atollic.hardwaredebug.stlink.enable_logging" value="false"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi" />
|
<stringAttribute key="com.atollic.hardwaredebug.stlink.external_loader" value=""/>
|
||||||
<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false" />
|
<stringAttribute key="com.atollic.hardwaredebug.stlink.log_file" value="D:/Dev/Code/STM32/EPROMEmu/\Debug\st-link_gdbserver_log.txt"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${TOOLCHAIN_PATH}/arm-atollic-eabi-gdb" />
|
<booleanAttribute key="com.atollic.hardwaredebug.stlink.stlink_check_serial_number" value="false"/>
|
||||||
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2" />
|
<stringAttribute key="com.atollic.hardwaredebug.stlink.stlink_txt_serial_number" value=""/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/EPROMEmu.elf" />
|
<booleanAttribute key="com.atollic.hardwaredebug.stlink.verify_flash" value="false"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="EPROMEmu" />
|
<stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="${TOOLCHAIN_PATH}/arm-atollic-eabi-gdb"/>
|
||||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="" />
|
<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard (Windows)"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${TOOLCHAIN_PATH}/arm-atollic-eabi-gdb"/>
|
||||||
|
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/EPROMEmu.elf"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="EPROMEmu"/>
|
||||||
|
<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">
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||||
<listEntry value="/EPROMEmu" />
|
<listEntry value="/EPROMEmu"/>
|
||||||
</listAttribute>
|
</listAttribute>
|
||||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||||
<listEntry value="4" />
|
<listEntry value="4"/>
|
||||||
</listAttribute>
|
</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="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="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
|
||||||
</launchConfiguration>
|
</launchConfiguration>
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
#ifndef DECODECOMMANDS_H
|
||||||
|
#define DECODECOMMANDS_H
|
||||||
|
|
||||||
|
#include "stm32f0xx_system.h"
|
||||||
|
|
||||||
|
enum CommsErrors
|
||||||
|
{
|
||||||
|
CMD_NO_ERROR = 0,
|
||||||
|
CMD_NOT_KNOWN = -1,
|
||||||
|
CMD_BUSY = -2,
|
||||||
|
CMD_PARAM_ERROR = -3,
|
||||||
|
CMD_RANGE_ERROR = -4
|
||||||
|
};
|
||||||
|
|
||||||
|
#define MAX_BUFFER_LENGTH 255
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
char *command; // Two character command code
|
||||||
|
int16_t (*function_ptr)(); // Pointer to command function
|
||||||
|
char *desc; // Pointer to description string for help
|
||||||
|
} command_entry_t;
|
||||||
|
|
||||||
|
void decode_command(char* commandStr);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -5,4 +5,7 @@
|
||||||
|
|
||||||
void initialise_gpio(void);
|
void initialise_gpio(void);
|
||||||
|
|
||||||
|
void set_target_reset_state(uint8_t state);
|
||||||
|
uint8_t read_target_vcc(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
#ifndef _SHIFTREGISTER_H_
|
||||||
|
#define _SHIFTREGISTER_H_
|
||||||
|
|
||||||
|
#include "stm32f0xx_system.h"
|
||||||
|
|
||||||
|
//Global Variables
|
||||||
|
extern uint32_t g_output_shift_data;
|
||||||
|
extern uint32_t g_input_shift_data;
|
||||||
|
|
||||||
|
|
||||||
|
void init_shift_registers(void);
|
||||||
|
uint32_t update_shift_registers();
|
||||||
|
|
||||||
|
void enableShiftRegisters(void);
|
||||||
|
void disableShiftRegisters(void);
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
|
@ -4,4 +4,6 @@
|
||||||
#include "stm32f0xx_system.h"
|
#include "stm32f0xx_system.h"
|
||||||
|
|
||||||
|
|
||||||
|
extern uint32_t g_time;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
46
Inc/usart.h
46
Inc/usart.h
|
@ -3,4 +3,50 @@
|
||||||
|
|
||||||
#include "stm32f0xx_system.h"
|
#include "stm32f0xx_system.h"
|
||||||
|
|
||||||
|
// Buffer sizes. Buffer size must be a power of 2
|
||||||
|
#define RXBUF_SIZE 512
|
||||||
|
#define TXBUF_SIZE 256
|
||||||
|
|
||||||
|
#if RXBUF_SIZE < 2
|
||||||
|
#error RXBUF_SIZE is too small. It must be larger than 1.
|
||||||
|
#elif ((RXBUF_SIZE & (RXBUF_SIZE-1)) != 0)
|
||||||
|
#error RXBUF_SIZE must be a power of 2.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if TXBUF_SIZE < 2
|
||||||
|
#error TXBUF_SIZE is too small. It must be larger than 1.
|
||||||
|
#elif ((TXBUF_SIZE & (TXBUF_SIZE-1)) != 0)
|
||||||
|
#error TXBUF_SIZE must be a power of 2.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint8_t *buf;
|
||||||
|
volatile uint16_t head;
|
||||||
|
volatile uint16_t tail;
|
||||||
|
volatile uint16_t count;
|
||||||
|
volatile uint16_t size;
|
||||||
|
uint16_t mask;
|
||||||
|
} ringbuffer_t;
|
||||||
|
|
||||||
|
extern ringbuffer_t g_rx_buf;
|
||||||
|
extern ringbuffer_t g_tx_buf;
|
||||||
|
volatile extern uint8_t g_tx_sending;
|
||||||
|
|
||||||
|
// Function prototypes
|
||||||
|
void init_uart(void);
|
||||||
|
|
||||||
|
void ring_buf_init(ringbuffer_t *buf, uint8_t *bufData, uint16_t size);
|
||||||
|
uint8_t ring_buf_get(ringbuffer_t *buf);
|
||||||
|
void ring_buf_put(ringbuffer_t *buf, const uint8_t c);
|
||||||
|
void ring_buf_wait_full(ringbuffer_t *buf);
|
||||||
|
uint8_t is_ring_buf_full(ringbuffer_t *buf);
|
||||||
|
uint8_t is_ring_buf_empty(ringbuffer_t *buf);
|
||||||
|
|
||||||
|
char get_line(char *lineBuf, uint16_t maxChars);
|
||||||
|
|
||||||
|
void USART1_IRQHandler(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -0,0 +1,116 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#include "commands.h"
|
||||||
|
#include "gpio.h"
|
||||||
|
|
||||||
|
extern const char *firmware_version;
|
||||||
|
|
||||||
|
int16_t cmd_print_help(void);
|
||||||
|
int16_t cmd_print_version(void);
|
||||||
|
int16_t cmd_reset_state(char *params);
|
||||||
|
|
||||||
|
const command_entry_t g_command_tab[] =
|
||||||
|
{
|
||||||
|
{"??", cmd_print_help, "Displays this help with a list of available commands"},
|
||||||
|
{":S", cmd_reset_state, "Sets the reset state of the target board, params 0 or 1"},
|
||||||
|
{":V", cmd_print_version, "Displays the version number"}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Number of commands in the Command Table
|
||||||
|
const uint16_t g_number_commands = sizeof(g_command_tab) / sizeof(command_entry_t);
|
||||||
|
|
||||||
|
// This allows commands from RS232 interface to control the board, format given above.
|
||||||
|
void decode_command(char* commandStr)
|
||||||
|
{
|
||||||
|
char tempCommand[3] = {0};
|
||||||
|
char *paramPtr;
|
||||||
|
|
||||||
|
// Convert command string to upper case
|
||||||
|
strupr(commandStr);
|
||||||
|
|
||||||
|
// skip whitespace characters
|
||||||
|
while (isspace(*commandStr) && (*commandStr != '\0'))
|
||||||
|
commandStr++;
|
||||||
|
|
||||||
|
if (*commandStr == '\0')
|
||||||
|
{
|
||||||
|
// no command found on
|
||||||
|
printf("%d\n", CMD_NOT_KNOWN);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// command found search for parameter string
|
||||||
|
paramPtr = commandStr + 2;
|
||||||
|
|
||||||
|
// skip whitespace characters
|
||||||
|
while (isspace(*paramPtr) && (*paramPtr != '\0'))
|
||||||
|
paramPtr++;
|
||||||
|
|
||||||
|
// set parameter pointer to zero if no parameter found on line
|
||||||
|
if (*paramPtr == '\0')
|
||||||
|
paramPtr = 0;
|
||||||
|
|
||||||
|
// copy 1st 2 characters of command string into tempCommand
|
||||||
|
tempCommand[0] = commandStr[0];
|
||||||
|
tempCommand[1] = commandStr[1];
|
||||||
|
|
||||||
|
// search for valid command
|
||||||
|
for (int cmd = 0; cmd < g_number_commands; cmd++)
|
||||||
|
{
|
||||||
|
if (strcmp(tempCommand, g_command_tab[cmd].command) == 0)
|
||||||
|
{
|
||||||
|
// jump to matching command and save error code from command handler
|
||||||
|
int tmpErr = (*g_command_tab[cmd].function_ptr)(paramPtr);
|
||||||
|
|
||||||
|
if (tmpErr != CMD_NO_ERROR)
|
||||||
|
printf("%d\n", tmpErr);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// here if no commands matched
|
||||||
|
printf("%d\n", CMD_NOT_KNOWN);
|
||||||
|
}
|
||||||
|
|
||||||
|
int16_t cmd_print_help()
|
||||||
|
{
|
||||||
|
printf("Commands available:\n");
|
||||||
|
|
||||||
|
// Print the command code and the description for each command in the table
|
||||||
|
for (uint16_t i = 0; i < g_number_commands; i++)
|
||||||
|
{
|
||||||
|
if (g_command_tab[i].command != NULL)
|
||||||
|
printf("\t%s - %s\n", g_command_tab[i].command, g_command_tab[i].desc);
|
||||||
|
else
|
||||||
|
printf("%s\n", g_command_tab[i].desc);
|
||||||
|
|
||||||
|
}
|
||||||
|
return CMD_NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
int16_t cmd_print_version()
|
||||||
|
{
|
||||||
|
printf("%d\nEPROM Emulator firmware version: %s\n", CMD_NO_ERROR, firmware_version);
|
||||||
|
return CMD_NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
int16_t cmd_reset_state(char *params)
|
||||||
|
{
|
||||||
|
int state;
|
||||||
|
|
||||||
|
int numParams = sscanf(params, "%d", &state);
|
||||||
|
|
||||||
|
if (numParams != 1)
|
||||||
|
{
|
||||||
|
printf("%d\n", CMD_PARAM_ERROR);
|
||||||
|
return CMD_PARAM_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
set_target_reset_state((uint8_t)state);
|
||||||
|
|
||||||
|
printf("%d\n", CMD_NO_ERROR);
|
||||||
|
return CMD_NO_ERROR;
|
||||||
|
}
|
11
Src/gpio.c
11
Src/gpio.c
|
@ -4,6 +4,15 @@ void initialise_gpio(void)
|
||||||
{
|
{
|
||||||
MX_GPIO_Init();
|
MX_GPIO_Init();
|
||||||
MX_ADC_Init();
|
MX_ADC_Init();
|
||||||
MX_USART1_UART_Init();
|
|
||||||
MX_TIM6_Init();
|
MX_TIM6_Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_target_reset_state(uint8_t state)
|
||||||
|
{
|
||||||
|
HAL_GPIO_WritePin(BOARD_RESET_GPIO_Port, BOARD_RESET_Pin, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t read_target_vcc(void)
|
||||||
|
{
|
||||||
|
(uint8_t)HAL_GPIO_ReadPin(BOARD_POWER_GPIO_Port, BOARD_POWER_Pin);
|
||||||
|
}
|
||||||
|
|
18
Src/main.c
18
Src/main.c
|
@ -3,19 +3,33 @@
|
||||||
#include "adc.h"
|
#include "adc.h"
|
||||||
#include "usart.h"
|
#include "usart.h"
|
||||||
#include "gpio.h"
|
#include "gpio.h"
|
||||||
|
#include "shiftregister.h"
|
||||||
|
#include "commands.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
const char *firmware_version = "v0.1";
|
||||||
|
|
||||||
|
char line_buf[MAX_BUFFER_LENGTH];
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
// Reset of all peripherals, Initializes the Flash interface and the Systick.
|
// Reset of all peripherals, Initialises the Flash interface and the Systick.
|
||||||
HAL_Init();
|
HAL_Init();
|
||||||
|
|
||||||
// Configure the system clock
|
// Configure the system clock
|
||||||
SystemClock_Config();
|
SystemClock_Config();
|
||||||
|
|
||||||
// Initialize all configured peripherals */
|
// Initialise all configured peripherals
|
||||||
initialise_gpio();
|
initialise_gpio();
|
||||||
|
init_uart();
|
||||||
|
init_shift_registers();
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
if (get_line(line_buf, sizeof(line_buf)))
|
||||||
|
{
|
||||||
|
decode_command(line_buf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,99 @@
|
||||||
|
#include "shiftregister.h"
|
||||||
|
|
||||||
|
//Global Variables
|
||||||
|
uint32_t g_output_shift_data = 0; //!< Data to be written to the shift register outputs
|
||||||
|
uint32_t g_input_shift_data = 0; //!< Data read back from the shift register inputs
|
||||||
|
|
||||||
|
|
||||||
|
void set_sr_clock(uint8_t state)
|
||||||
|
{
|
||||||
|
HAL_GPIO_WritePin(SR_CLK_GPIO_Port, SR_CLK_Pin, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_sr_latch(uint8_t state)
|
||||||
|
{
|
||||||
|
HAL_GPIO_WritePin(SR_STRB_GPIO_Port, SR_STRB_Pin, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_sr_data_out(uint8_t state)
|
||||||
|
{
|
||||||
|
HAL_GPIO_WritePin(SR_DATA_GPIO_Port, SR_DATA_Pin, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_sr_reset_state(uint8_t state)
|
||||||
|
{
|
||||||
|
HAL_GPIO_WritePin(SR_RST_GPIO_Port, SR_RST_Pin, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_sr_output_state(uint8_t state)
|
||||||
|
{
|
||||||
|
HAL_GPIO_WritePin(SR_OE_GPIO_Port, SR_OE_Pin, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t read_sr_data_in(void)
|
||||||
|
{
|
||||||
|
// Read a single bit from port pin.
|
||||||
|
return HAL_GPIO_ReadPin(SR_DATAIN_GPIO_Port, SR_DATAIN_Pin);
|
||||||
|
}
|
||||||
|
|
||||||
|
void init_shift_registers(void)
|
||||||
|
{
|
||||||
|
set_sr_latch(1);
|
||||||
|
set_sr_clock(1);
|
||||||
|
|
||||||
|
// Set the default value on the shift registers
|
||||||
|
update_shift_registers();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Updated the outputs on the Shift Register
|
||||||
|
uint32_t update_shift_registers(void)
|
||||||
|
{
|
||||||
|
uint32_t data_out = 0;
|
||||||
|
uint32_t data_in = 0;
|
||||||
|
uint32_t bit_mask;
|
||||||
|
uint8_t i;
|
||||||
|
|
||||||
|
// Shift Data out
|
||||||
|
data_out = g_output_shift_data;
|
||||||
|
bit_mask = 0x0800;
|
||||||
|
|
||||||
|
for (i = 0; i < 24; i++)
|
||||||
|
{
|
||||||
|
set_sr_clock(0);
|
||||||
|
|
||||||
|
if (data_out & bit_mask)
|
||||||
|
set_sr_data_out(1);
|
||||||
|
else
|
||||||
|
set_sr_data_out(0);
|
||||||
|
|
||||||
|
bit_mask >>= 1;
|
||||||
|
set_sr_clock(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Once 16 bits have been loaded in, strobe to send the data to U7/U8 parallel outputs.
|
||||||
|
set_sr_latch(0);
|
||||||
|
set_sr_latch(1);
|
||||||
|
|
||||||
|
|
||||||
|
// Read the data back in and verify that it's correct.
|
||||||
|
// Data is clocked on negative edge.
|
||||||
|
for (i = 0; i < 24; i++)
|
||||||
|
{
|
||||||
|
set_sr_clock(0);
|
||||||
|
data_in <<= 1; //Data is shifted in MSB to LSB.
|
||||||
|
data_in |= read_sr_data_in();
|
||||||
|
set_sr_clock(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
set_sr_clock(0);
|
||||||
|
|
||||||
|
// Check if the data read and sent the same
|
||||||
|
if ((data_in & 0x00FFFFFF) != g_output_shift_data)
|
||||||
|
{
|
||||||
|
//setShiftRegError();
|
||||||
|
}
|
||||||
|
|
||||||
|
g_input_shift_data = data_in;
|
||||||
|
return g_input_shift_data;
|
||||||
|
}
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
/* USER CODE BEGIN Header */
|
|
||||||
/**
|
|
||||||
******************************************************************************
|
|
||||||
* File Name : stm32f0xx_hal_msp.c
|
|
||||||
* Description : This file provides code for the MSP Initialization
|
|
||||||
* and de-Initialization codes.
|
|
||||||
******************************************************************************
|
|
||||||
* @attention
|
|
||||||
*
|
|
||||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
|
||||||
* All rights reserved.</center></h2>
|
|
||||||
*
|
|
||||||
* This software component is licensed by ST under BSD 3-Clause license,
|
|
||||||
* the "License"; You may not use this file except in compliance with the
|
|
||||||
* License. You may obtain a copy of the License at:
|
|
||||||
* opensource.org/licenses/BSD-3-Clause
|
|
||||||
*
|
|
||||||
******************************************************************************
|
|
||||||
*/
|
|
||||||
/* USER CODE END Header */
|
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
|
||||||
#include <port_definitions.h>
|
|
||||||
/* USER CODE BEGIN Includes */
|
|
||||||
|
|
||||||
/* USER CODE END Includes */
|
|
||||||
|
|
||||||
/* Private typedef -----------------------------------------------------------*/
|
|
||||||
/* USER CODE BEGIN TD */
|
|
||||||
|
|
||||||
/* USER CODE END TD */
|
|
||||||
|
|
||||||
/* Private define ------------------------------------------------------------*/
|
|
||||||
/* USER CODE BEGIN Define */
|
|
||||||
|
|
||||||
/* USER CODE END Define */
|
|
||||||
|
|
||||||
/* Private macro -------------------------------------------------------------*/
|
|
||||||
/* USER CODE BEGIN Macro */
|
|
||||||
|
|
||||||
/* USER CODE END Macro */
|
|
||||||
|
|
||||||
/* Private variables ---------------------------------------------------------*/
|
|
||||||
/* USER CODE BEGIN PV */
|
|
||||||
|
|
||||||
/* USER CODE END PV */
|
|
||||||
|
|
||||||
/* Private function prototypes -----------------------------------------------*/
|
|
||||||
/* USER CODE BEGIN PFP */
|
|
||||||
|
|
||||||
/* USER CODE END PFP */
|
|
||||||
|
|
||||||
/* External functions --------------------------------------------------------*/
|
|
||||||
/* USER CODE BEGIN ExternalFunctions */
|
|
||||||
|
|
||||||
/* USER CODE END ExternalFunctions */
|
|
||||||
|
|
||||||
/* USER CODE BEGIN 0 */
|
|
||||||
|
|
||||||
/* USER CODE END 0 */
|
|
||||||
/**
|
|
||||||
* Initializes the Global MSP.
|
|
||||||
*/
|
|
||||||
void HAL_MspInit(void)
|
|
||||||
{
|
|
||||||
/* USER CODE BEGIN MspInit 0 */
|
|
||||||
|
|
||||||
/* USER CODE END MspInit 0 */
|
|
||||||
|
|
||||||
__HAL_RCC_SYSCFG_CLK_ENABLE();
|
|
||||||
__HAL_RCC_PWR_CLK_ENABLE();
|
|
||||||
|
|
||||||
/* System interrupt init*/
|
|
||||||
|
|
||||||
/* USER CODE BEGIN MspInit 1 */
|
|
||||||
|
|
||||||
/* USER CODE END MspInit 1 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* USER CODE BEGIN 1 */
|
|
||||||
|
|
||||||
/* USER CODE END 1 */
|
|
||||||
|
|
||||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
|
@ -30,6 +30,13 @@ void SysTick_Handler(void)
|
||||||
HAL_SYSTICK_IRQHandler();
|
HAL_SYSTICK_IRQHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HAL_MspInit(void)
|
||||||
|
{
|
||||||
|
__HAL_RCC_SYSCFG_CLK_ENABLE();
|
||||||
|
__HAL_RCC_PWR_CLK_ENABLE();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SystemClock_Config(void)
|
void SystemClock_Config(void)
|
||||||
{
|
{
|
||||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||||
|
@ -37,12 +44,13 @@ void SystemClock_Config(void)
|
||||||
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
|
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
|
||||||
|
|
||||||
// Initializes the CPU, AHB and APB busses clocks
|
// Initializes the CPU, AHB and APB busses clocks
|
||||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI14 | RCC_OSCILLATORTYPE_HSE;
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSI14;
|
||||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||||
RCC_OscInitStruct.HSI14State = RCC_HSI14_ON;
|
RCC_OscInitStruct.HSI14State = RCC_HSI14_ON;
|
||||||
|
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||||
RCC_OscInitStruct.HSI14CalibrationValue = 16;
|
RCC_OscInitStruct.HSI14CalibrationValue = 16;
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||||
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;
|
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;
|
||||||
RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;
|
RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;
|
||||||
|
|
||||||
|
@ -52,7 +60,7 @@ void SystemClock_Config(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initializes the CPU, AHB and APB busses clocks
|
// Initializes the CPU, AHB and APB busses clocks
|
||||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1;
|
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1;
|
||||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
|
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
|
||||||
|
@ -75,7 +83,6 @@ void Error_Handler(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MX_ADC_Init(void)
|
void MX_ADC_Init(void)
|
||||||
{
|
{
|
||||||
ADC_ChannelConfTypeDef sConfig = {0};
|
ADC_ChannelConfTypeDef sConfig = {0};
|
||||||
|
@ -244,7 +251,7 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle)
|
||||||
void MX_USART1_UART_Init(void)
|
void MX_USART1_UART_Init(void)
|
||||||
{
|
{
|
||||||
huart1.Instance = USART1;
|
huart1.Instance = USART1;
|
||||||
huart1.Init.BaudRate = 115200;
|
huart1.Init.BaudRate = 57600; //115200;
|
||||||
huart1.Init.WordLength = UART_WORDLENGTH_8B;
|
huart1.Init.WordLength = UART_WORDLENGTH_8B;
|
||||||
huart1.Init.StopBits = UART_STOPBITS_1;
|
huart1.Init.StopBits = UART_STOPBITS_1;
|
||||||
huart1.Init.Parity = UART_PARITY_NONE;
|
huart1.Init.Parity = UART_PARITY_NONE;
|
||||||
|
@ -279,7 +286,7 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
|
||||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||||
|
|
||||||
// USART1 interrupt Init
|
// USART1 interrupt Init
|
||||||
HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
|
HAL_NVIC_SetPriority(USART1_IRQn, 1, 0);
|
||||||
HAL_NVIC_EnableIRQ(USART1_IRQn);
|
HAL_NVIC_EnableIRQ(USART1_IRQn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
**
|
**
|
||||||
** Environment : System Workbench for MCU
|
** Environment : System Workbench for MCU
|
||||||
**
|
**
|
||||||
** Distribution: The file is distributed “as is,” without any warranty
|
** Distribution: The file is distributed as is without any warranty
|
||||||
** of any kind.
|
** of any kind.
|
||||||
**
|
**
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
|
@ -88,7 +88,7 @@ void _exit (int status)
|
||||||
while (1) {} /* Make sure we hang here */
|
while (1) {} /* Make sure we hang here */
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((weak)) int _read(int file, char *ptr, int len)
|
int _read (int file, char *ptr, int len)
|
||||||
{
|
{
|
||||||
int DataIdx;
|
int DataIdx;
|
||||||
|
|
||||||
|
@ -100,7 +100,8 @@ __attribute__((weak)) int _read(int file, char *ptr, int len)
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((weak)) int _write(int file, char *ptr, int len)
|
/*
|
||||||
|
int _write(int file, char *ptr, int len)
|
||||||
{
|
{
|
||||||
int DataIdx;
|
int DataIdx;
|
||||||
|
|
||||||
|
@ -110,7 +111,7 @@ __attribute__((weak)) int _write(int file, char *ptr, int len)
|
||||||
}
|
}
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
caddr_t _sbrk(int incr)
|
caddr_t _sbrk(int incr)
|
||||||
{
|
{
|
||||||
extern char end asm("end");
|
extern char end asm("end");
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
#include "timers.h"
|
#include "timers.h"
|
||||||
|
|
||||||
|
uint32_t g_time = 0;
|
||||||
|
|
||||||
void TIM6_IRQHandler(void)
|
void TIM6_IRQHandler(void)
|
||||||
{
|
{
|
||||||
|
g_time++;
|
||||||
|
|
||||||
HAL_TIM_IRQHandler(&htim6);
|
HAL_TIM_IRQHandler(&htim6);
|
||||||
}
|
}
|
||||||
|
|
213
Src/usart.c
213
Src/usart.c
|
@ -1,6 +1,217 @@
|
||||||
#include "usart.h"
|
#include "usart.h"
|
||||||
|
|
||||||
|
// Defines
|
||||||
|
#define DEL 0x7F
|
||||||
|
#define BACKSPACE 0x08
|
||||||
|
#define CR 0x0D
|
||||||
|
#define LF 0x0A
|
||||||
|
|
||||||
|
// Global variables
|
||||||
|
ringbuffer_t g_rx_buf = { 0 };
|
||||||
|
ringbuffer_t g_tx_buf = { 0 };
|
||||||
|
volatile uint8_t g_tx_sending = 0;
|
||||||
|
uint8_t g_echo_serial = 1;
|
||||||
|
|
||||||
|
uint8_t g_rx_buffer_data[RXBUF_SIZE];
|
||||||
|
uint8_t g_tx_buffer_data[TXBUF_SIZE];
|
||||||
|
|
||||||
|
|
||||||
|
void init_uart(void)
|
||||||
|
{
|
||||||
|
MX_USART1_UART_Init();
|
||||||
|
|
||||||
|
// Initialise the RX and TX buffers
|
||||||
|
ring_buf_init(&g_rx_buf, g_rx_buffer_data, RXBUF_SIZE);
|
||||||
|
ring_buf_init(&g_tx_buf, g_tx_buffer_data, TXBUF_SIZE);
|
||||||
|
|
||||||
|
// Clear Overrun flag, in case characters have already been sent to USART
|
||||||
|
USART1->ICR = USART_ICR_ORECF;
|
||||||
|
|
||||||
|
// Enable RXNE interrupt
|
||||||
|
USART1->CR1 |= USART_CR1_RXNEIE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ring_buf_init(ringbuffer_t *buf, uint8_t *bufData, uint16_t size)
|
||||||
|
{
|
||||||
|
buf->buf = bufData;
|
||||||
|
buf->head = 0;
|
||||||
|
buf->tail = 0;
|
||||||
|
buf->count = 0;
|
||||||
|
buf->size = size;
|
||||||
|
buf->mask = size - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ring_buf_wait_full(ringbuffer_t *buf)
|
||||||
|
{
|
||||||
|
while (is_ring_buf_full(buf))
|
||||||
|
{
|
||||||
|
if (!g_tx_sending)
|
||||||
|
{
|
||||||
|
g_tx_sending = 1;
|
||||||
|
USART1->CR1 |= USART_CR1_TXEIE; // Enable the TX empty interrupt
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint8_t ring_buf_get(ringbuffer_t *buf)
|
||||||
|
{
|
||||||
|
if (!buf->buf)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
uint8_t ret = buf->buf[buf->tail];
|
||||||
|
buf->tail = (buf->tail + 1) & buf->mask;
|
||||||
|
buf->count--;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ring_buf_put(ringbuffer_t *buf, const uint8_t c)
|
||||||
|
{
|
||||||
|
if (!buf->buf)
|
||||||
|
return;
|
||||||
|
|
||||||
|
buf->buf[buf->head] = c;
|
||||||
|
// increment the head index
|
||||||
|
buf->head = (buf->head + 1) & buf->mask;
|
||||||
|
buf->count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline uint8_t is_ring_buf_full(ringbuffer_t *buf)
|
||||||
|
{
|
||||||
|
return ((buf->head - buf->tail) & buf->mask) == buf->mask;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline uint8_t is_ring_buf_empty(ringbuffer_t *buf)
|
||||||
|
{
|
||||||
|
return (buf->tail == buf->head);
|
||||||
|
}
|
||||||
|
|
||||||
|
int __io_putchar(int ch)
|
||||||
|
{
|
||||||
|
if (ch == '\n')
|
||||||
|
{
|
||||||
|
ring_buf_wait_full(&g_tx_buf);
|
||||||
|
ring_buf_put(&g_tx_buf, '\r');
|
||||||
|
}
|
||||||
|
|
||||||
|
ring_buf_wait_full(&g_tx_buf);
|
||||||
|
ring_buf_put(&g_tx_buf, ch);
|
||||||
|
|
||||||
|
if (!g_tx_sending)
|
||||||
|
{
|
||||||
|
g_tx_sending = 1;
|
||||||
|
USART1->CR1 |= USART_CR1_TXEIE; // Enable the TX empty interrupt
|
||||||
|
}
|
||||||
|
|
||||||
|
return ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _write(int file, char *ptr, int len)
|
||||||
|
{
|
||||||
|
for (int i= 0; i < len; i++)
|
||||||
|
__io_putchar( *ptr++ );
|
||||||
|
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
char get_line(char *lineBuf, uint16_t maxChars)
|
||||||
|
{
|
||||||
|
static int count = 0;
|
||||||
|
char res = 0;
|
||||||
|
|
||||||
|
if (g_rx_buf.count == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (count < maxChars - 1)
|
||||||
|
{
|
||||||
|
uint8_t c = ring_buf_get(&g_rx_buf);
|
||||||
|
|
||||||
|
if (c == CR)
|
||||||
|
c = LF; // Read character
|
||||||
|
|
||||||
|
if (c == BACKSPACE || c == DEL) // Process backspace
|
||||||
|
{
|
||||||
|
if (count != 0)
|
||||||
|
{
|
||||||
|
count--;
|
||||||
|
if (g_echo_serial)
|
||||||
|
{
|
||||||
|
__io_putchar(0x08); // Send Backspace and erase previous character
|
||||||
|
__io_putchar(' ');
|
||||||
|
__io_putchar(0x08);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (g_echo_serial)
|
||||||
|
{
|
||||||
|
__io_putchar(c);
|
||||||
|
}
|
||||||
|
lineBuf[count] = c; // store character
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c == LF)
|
||||||
|
{
|
||||||
|
lineBuf[count] = 0;
|
||||||
|
res = 1;
|
||||||
|
count = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// return the string without waiting for the CR if the line is too long
|
||||||
|
lineBuf[count] = 0;
|
||||||
|
count = 0;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
void USART1_IRQHandler(void)
|
void USART1_IRQHandler(void)
|
||||||
{
|
{
|
||||||
HAL_UART_IRQHandler(&huart1);
|
// Check Receive Not Empty interrupt enabled and active
|
||||||
|
if ((USART1->CR1 & USART_CR1_RXNEIE) && (USART1->ISR & USART_ISR_RXNE))
|
||||||
|
{
|
||||||
|
// Read the character from the serial port
|
||||||
|
uint8_t c = (uint8_t)(USART1->RDR);
|
||||||
|
|
||||||
|
// If the buffer is not full add the character otherwise it will be discarded
|
||||||
|
if (!is_ring_buf_full(&g_rx_buf))
|
||||||
|
{
|
||||||
|
ring_buf_put(&g_rx_buf, c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check Transmit Empty interrupt enabled and active
|
||||||
|
if ((USART1->CR1 & USART_CR1_TXEIE) && (USART1->ISR & USART_ISR_TXE))
|
||||||
|
{
|
||||||
|
// Send the next character
|
||||||
|
if (!is_ring_buf_empty(&g_tx_buf))
|
||||||
|
{
|
||||||
|
USART1->TDR = ring_buf_get(&g_tx_buf);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
USART1->CR1 &= ~USART_CR1_TXEIE; // Disable the TXE interrupt
|
||||||
|
USART1->CR1 |= USART_CR1_TCIE; // Enable the TC interrupt
|
||||||
|
g_tx_sending = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check Transmission Complete interrupt enabled and active
|
||||||
|
if ((USART1->CR1 & USART_CR1_TCIE) && (USART1->ISR, USART_ISR_TC))
|
||||||
|
{
|
||||||
|
USART1->ICR = USART_ICR_TCCF; // Clear the TC flag
|
||||||
|
|
||||||
|
if (g_tx_buf.count == 0)
|
||||||
|
{
|
||||||
|
USART1->CR1 &= ~USART_CR1_TCIE; // Disable the TC interrupt
|
||||||
|
g_tx_sending = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue