timer: add Timer class
Timer class consists of systack_handler functionality with an internal timer for global counter in main()
This commit is contained in:
parent
1b4c37b9c5
commit
52c4ebb003
242
Timer/.cproject
Normal file
242
Timer/.cproject
Normal file
@ -0,0 +1,242 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="com.crt.advproject.config.lib.debug.141066949">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.crt.advproject.config.lib.debug.141066949" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||
<externalSettings>
|
||||
<externalSetting>
|
||||
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/Timer"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/Timer/Debug"/>
|
||||
<entry flags="RESOLVED" kind="libraryFile" name="Timer" srcPrefixMapping="" srcRootPath=""/>
|
||||
</externalSetting>
|
||||
</externalSettings>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" 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="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" cleanCommand="rm -rf" description="Debug build" errorParsers="org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="com.crt.advproject.config.lib.debug.141066949" name="Debug" parent="com.crt.advproject.config.lib.debug" postannouncebuildStep="Performing post-build steps" postbuildStep="arm-none-eabi-size "lib${BuildArtifactFileName}" ; # arm-none-eabi-objdump -h -S "lib${BuildArtifactFileName}" >"${BuildArtifactFileBaseName}.lss"">
|
||||
<folderInfo id="com.crt.advproject.config.lib.debug.141066949." name="/" resourcePath="">
|
||||
<toolChain id="com.crt.advproject.toolchain.lib.debug.1864536258" name="NXP MCU Tools" superClass="com.crt.advproject.toolchain.lib.debug">
|
||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="com.crt.advproject.platform.lib.debug.715190497" name="ARM-based MCU (Debug)" superClass="com.crt.advproject.platform.lib.debug"/>
|
||||
<builder buildPath="${workspace_loc:/Timer}/Debug" id="com.crt.advproject.builder.lib.debug.362371353" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="com.crt.advproject.builder.lib.debug"/>
|
||||
<tool id="com.crt.advproject.cpp.lib.debug.1376747124" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.lib.debug">
|
||||
<option id="com.crt.advproject.cpp.thumb.853945744" name="Thumb mode" superClass="com.crt.advproject.cpp.thumb" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.crt.advproject.cpp.specs.1019234865" name="Specs" superClass="com.crt.advproject.cpp.specs" useByScannerDiscovery="false" value="com.crt.advproject.cpp.specs.newlib" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.cpp.arch.1483220001" name="Architecture" superClass="com.crt.advproject.cpp.arch" useByScannerDiscovery="true" value="com.crt.advproject.cpp.target.cm3" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.preprocessor.def.1211143163" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||
<listOptionValue builtIn="false" value="__CODE_RED"/>
|
||||
<listOptionValue builtIn="false" value="__NEWLIB__"/>
|
||||
<listOptionValue builtIn="false" value="CORE_M3"/>
|
||||
<listOptionValue builtIn="false" value="__USE_LPCOPEN"/>
|
||||
<listOptionValue builtIn="false" value="__LPC15XX__"/>
|
||||
</option>
|
||||
<option id="gnu.cpp.compiler.option.other.other.1973382433" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" valueType="string"/>
|
||||
<option id="gnu.cpp.compiler.option.optimization.flags.1419527755" name="Other optimization flags" superClass="gnu.cpp.compiler.option.optimization.flags" useByScannerDiscovery="false" value="-fno-common" valueType="string"/>
|
||||
<option id="com.crt.advproject.cpp.hdrlib.1666306902" name="Library headers" superClass="com.crt.advproject.cpp.hdrlib" useByScannerDiscovery="false" value="Newlib" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.cpp.fpu.1485407808" name="Floating point" superClass="com.crt.advproject.cpp.fpu" useByScannerDiscovery="true"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.include.paths.933211393" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_board_nxp_lpcxpresso_1549/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_15xx/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://inc}""/>
|
||||
</option>
|
||||
<option id="com.crt.advproject.cpp.misc.dialect.954981710" superClass="com.crt.advproject.cpp.misc.dialect" value="com.crt.advproject.misc.dialect.c++11" valueType="enumerated"/>
|
||||
<inputType id="com.crt.advproject.compiler.cpp.input.997653122" superClass="com.crt.advproject.compiler.cpp.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.gcc.lib.debug.54498589" name="MCU C Compiler" superClass="com.crt.advproject.gcc.lib.debug">
|
||||
<option id="com.crt.advproject.gcc.thumb.579066531" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.crt.advproject.gcc.arch.977470243" name="Architecture" superClass="com.crt.advproject.gcc.arch" useByScannerDiscovery="true" value="com.crt.advproject.gcc.target.cm3" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.286152175" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||
<listOptionValue builtIn="false" value="__CODE_RED"/>
|
||||
<listOptionValue builtIn="false" value="CORE_M3"/>
|
||||
<listOptionValue builtIn="false" value="__USE_LPCOPEN"/>
|
||||
<listOptionValue builtIn="false" value="__LPC15XX__"/>
|
||||
<listOptionValue builtIn="false" value="__NEWLIB__"/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.misc.other.1760689758" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections" valueType="string"/>
|
||||
<option id="gnu.c.compiler.option.optimization.flags.772772939" name="Other optimization flags" superClass="gnu.c.compiler.option.optimization.flags" useByScannerDiscovery="false" value="-fno-common" valueType="string"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.197503344" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_board_nxp_lpcxpresso_1549/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_15xx/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://inc}""/>
|
||||
</option>
|
||||
<option id="com.crt.advproject.c.misc.dialect.1063734703" superClass="com.crt.advproject.c.misc.dialect" value="com.crt.advproject.misc.dialect.c11" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.hdrlib.2095820491" superClass="com.crt.advproject.gcc.hdrlib" value="Newlib" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.specs.96244547" superClass="com.crt.advproject.gcc.specs" value="com.crt.advproject.gcc.specs.newlib" valueType="enumerated"/>
|
||||
<inputType id="com.crt.advproject.compiler.input.162099517" superClass="com.crt.advproject.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.gas.lib.debug.363561805" name="MCU Assembler" superClass="com.crt.advproject.gas.lib.debug">
|
||||
<option id="com.crt.advproject.gas.thumb.2066591309" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
|
||||
<option id="com.crt.advproject.gas.arch.2024241403" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm3" valueType="enumerated"/>
|
||||
<option id="gnu.both.asm.option.flags.crt.1776970218" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -DDEBUG -D__CODE_RED -DCORE_M3 -D__USE_LPCOPEN -D__LPC15XX__ -D__NEWLIB__" valueType="string"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.1243276742" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_board_nxp_lpcxpresso_1549/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_15xx/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://inc}""/>
|
||||
</option>
|
||||
<option id="com.crt.advproject.gas.hdrlib.1805294167" superClass="com.crt.advproject.gas.hdrlib" value="Newlib" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.specs.269530202" superClass="com.crt.advproject.gas.specs" value="com.crt.advproject.gas.specs.newlib" valueType="enumerated"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.469636420" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
<inputType id="com.crt.advproject.assembler.input.181644609" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.ar.lib.debug.802643729" name="MCU Archiver" superClass="com.crt.advproject.ar.lib.debug"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
<cconfiguration id="com.crt.advproject.config.lib.release.1759018253">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.crt.advproject.config.lib.release.1759018253" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||
<externalSettings>
|
||||
<externalSetting>
|
||||
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/Timer"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/Timer/Release"/>
|
||||
<entry flags="RESOLVED" kind="libraryFile" name="Timer" srcPrefixMapping="" srcRootPath=""/>
|
||||
</externalSetting>
|
||||
</externalSettings>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" 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="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" cleanCommand="rm -rf" description="Release build" errorParsers="org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="com.crt.advproject.config.lib.release.1759018253" name="Release" parent="com.crt.advproject.config.lib.release" postannouncebuildStep="Performing post-build steps" postbuildStep="arm-none-eabi-size "lib${BuildArtifactFileName}" ; # arm-none-eabi-objdump -h -S "lib${BuildArtifactFileName}" >"${BuildArtifactFileBaseName}.lss"">
|
||||
<folderInfo id="com.crt.advproject.config.lib.release.1759018253." name="/" resourcePath="">
|
||||
<toolChain id="com.crt.advproject.toolchain.lib.release.2133517867" name="NXP MCU Tools" superClass="com.crt.advproject.toolchain.lib.release">
|
||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="com.crt.advproject.platform.lib.release.1818530715" name="ARM-based MCU (Debug)" superClass="com.crt.advproject.platform.lib.release"/>
|
||||
<builder buildPath="${workspace_loc:/Timer}/Release" id="com.crt.advproject.builder.lib.release.556933730" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="com.crt.advproject.builder.lib.release"/>
|
||||
<tool id="com.crt.advproject.cpp.lib.release.2046270587" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.lib.release">
|
||||
<option id="com.crt.advproject.cpp.thumb.2007377019" name="Thumb mode" superClass="com.crt.advproject.cpp.thumb" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.crt.advproject.cpp.specs.1260187295" name="Specs" superClass="com.crt.advproject.cpp.specs" useByScannerDiscovery="false" value="com.crt.advproject.cpp.specs.newlib" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.cpp.arch.1789958096" name="Architecture" superClass="com.crt.advproject.cpp.arch" useByScannerDiscovery="true" value="com.crt.advproject.cpp.target.cm3" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.preprocessor.def.1653719661" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="NDEBUG"/>
|
||||
<listOptionValue builtIn="false" value="__CODE_RED"/>
|
||||
<listOptionValue builtIn="false" value="__NEWLIB__"/>
|
||||
<listOptionValue builtIn="false" value="CORE_M3"/>
|
||||
<listOptionValue builtIn="false" value="__USE_LPCOPEN"/>
|
||||
<listOptionValue builtIn="false" value="__LPC15XX__"/>
|
||||
</option>
|
||||
<option id="gnu.cpp.compiler.option.other.other.2087205212" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" valueType="string"/>
|
||||
<option id="gnu.cpp.compiler.option.optimization.flags.51742231" name="Other optimization flags" superClass="gnu.cpp.compiler.option.optimization.flags" useByScannerDiscovery="false" value="-fno-common -Os" valueType="string"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.include.paths.1051465865" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_board_nxp_lpcxpresso_1549/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_15xx/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://inc}""/>
|
||||
</option>
|
||||
<option id="com.crt.advproject.cpp.misc.dialect.830307454" superClass="com.crt.advproject.cpp.misc.dialect" value="com.crt.advproject.misc.dialect.c++11" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.cpp.hdrlib.1979223629" superClass="com.crt.advproject.cpp.hdrlib" value="Newlib" valueType="enumerated"/>
|
||||
<inputType id="com.crt.advproject.compiler.cpp.input.447511707" superClass="com.crt.advproject.compiler.cpp.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.gcc.lib.release.854009082" name="MCU C Compiler" superClass="com.crt.advproject.gcc.lib.release">
|
||||
<option id="com.crt.advproject.gcc.thumb.531224998" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.crt.advproject.gcc.arch.118103664" name="Architecture" superClass="com.crt.advproject.gcc.arch" useByScannerDiscovery="true" value="com.crt.advproject.gcc.target.cm3" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.349470409" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="NDEBUG"/>
|
||||
<listOptionValue builtIn="false" value="__CODE_RED"/>
|
||||
<listOptionValue builtIn="false" value="CORE_M3"/>
|
||||
<listOptionValue builtIn="false" value="__USE_LPCOPEN"/>
|
||||
<listOptionValue builtIn="false" value="__LPC15XX__"/>
|
||||
<listOptionValue builtIn="false" value="__NEWLIB__"/>
|
||||
</option>
|
||||
<option id="gnu.c.compiler.option.misc.other.1914235053" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections" valueType="string"/>
|
||||
<option id="gnu.c.compiler.option.optimization.flags.873667882" name="Other optimization flags" superClass="gnu.c.compiler.option.optimization.flags" useByScannerDiscovery="false" value="-fno-common" valueType="string"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.332010264" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_board_nxp_lpcxpresso_1549/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_15xx/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://inc}""/>
|
||||
</option>
|
||||
<option id="com.crt.advproject.c.misc.dialect.1421066475" superClass="com.crt.advproject.c.misc.dialect" value="com.crt.advproject.misc.dialect.c11" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.hdrlib.1624299149" superClass="com.crt.advproject.gcc.hdrlib" value="Newlib" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gcc.specs.736473378" superClass="com.crt.advproject.gcc.specs" value="com.crt.advproject.gcc.specs.newlib" valueType="enumerated"/>
|
||||
<inputType id="com.crt.advproject.compiler.input.2021903808" superClass="com.crt.advproject.compiler.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.gas.lib.release.715361413" name="MCU Assembler" superClass="com.crt.advproject.gas.lib.release">
|
||||
<option id="com.crt.advproject.gas.thumb.1214124388" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
|
||||
<option id="com.crt.advproject.gas.arch.2045542888" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm3" valueType="enumerated"/>
|
||||
<option id="gnu.both.asm.option.flags.crt.1015613135" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -DNDEBUG -D__CODE_RED -DCORE_M3 -D__USE_LPCOPEN -D__LPC15XX__ -D__NEWLIB__" valueType="string"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.588165123" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_board_nxp_lpcxpresso_1549/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/lpc_chip_15xx/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc://inc}""/>
|
||||
</option>
|
||||
<option id="com.crt.advproject.gas.hdrlib.1385331930" superClass="com.crt.advproject.gas.hdrlib" value="Newlib" valueType="enumerated"/>
|
||||
<option id="com.crt.advproject.gas.specs.493366594" superClass="com.crt.advproject.gas.specs" value="com.crt.advproject.gas.specs.newlib" valueType="enumerated"/>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.89226607" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
|
||||
<inputType id="com.crt.advproject.assembler.input.739713420" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
|
||||
</tool>
|
||||
<tool id="com.crt.advproject.ar.lib.release.3927665" name="MCU Archiver" superClass="com.crt.advproject.ar.lib.release"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="Timer.com.crt.advproject.projecttype.lib.808057918" name="Static Library" projectType="com.crt.advproject.projecttype.lib"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="com.crt.config">
|
||||
<projectStorage><?xml version="1.0" encoding="UTF-8"?>
|
||||
<TargetConfig>
|
||||
<Properties property_2="LPC15xx_256K.cfx" property_3="NXP" property_4="LPC1549" property_count="5" version="100300"/>
|
||||
<infoList vendor="NXP">
|
||||
<info chip="LPC1549" connectscript="LPC15RunBootRomConnect.scp" flash_driver="LPC15xx_256K.cfx" match_id="0x0" name="LPC1549" resetscript="LPC15RunBootRomReset.scp" stub="crt_emu_cm3_gen">
|
||||
<chip>
|
||||
<name>LPC1549</name>
|
||||
<family>LPC15xx</family>
|
||||
<vendor>NXP (formerly Philips)</vendor>
|
||||
<reset board="None" core="Real" sys="Real"/>
|
||||
<clock changeable="TRUE" freq="12MHz" is_accurate="TRUE"/>
|
||||
<memory can_program="true" id="Flash" is_ro="true" type="Flash"/>
|
||||
<memory id="RAM" type="RAM"/>
|
||||
<memory id="Periph" is_volatile="true" type="Peripheral"/>
|
||||
<memoryInstance derived_from="Flash" id="MFlash256" location="0x0" size="0x40000"/>
|
||||
<memoryInstance derived_from="RAM" id="Ram0_16" location="0x2000000" size="0x4000"/>
|
||||
<memoryInstance derived_from="RAM" id="Ram1_16" location="0x2004000" size="0x4000"/>
|
||||
<memoryInstance derived_from="RAM" id="Ram2_4" location="0x2008000" size="0x1000"/>
|
||||
</chip>
|
||||
<processor>
|
||||
<name gcc_name="cortex-m3">Cortex-M3</name>
|
||||
<family>Cortex-M</family>
|
||||
</processor>
|
||||
</info>
|
||||
</infoList>
|
||||
</TargetConfig></projectStorage>
|
||||
</storageModule>
|
||||
<storageModule moduleId="com.crt.advproject">
|
||||
<boardId>LPCXpresso1549</boardId>
|
||||
</storageModule>
|
||||
</cproject>
|
||||
28
Timer/.project
Normal file
28
Timer/.project
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Timer</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
<project>lpc_chip_15xx</project>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
75
Timer/inc/Timer.h
Normal file
75
Timer/inc/Timer.h
Normal file
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Timer.h
|
||||
*
|
||||
* Created on: Oct 14, 2022
|
||||
* Author: tylen
|
||||
*/
|
||||
|
||||
#ifndef TIMER_H_
|
||||
#define TIMER_H_
|
||||
|
||||
#include "board.h"
|
||||
#include <atomic>
|
||||
#include <climits>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
/**
|
||||
* @brief Handle interrupt from SysTick timer
|
||||
* @return Nothing
|
||||
*/
|
||||
void SysTick_Handler (void);
|
||||
}
|
||||
|
||||
class Timer
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Initalize the systick configuration with your frequency
|
||||
*
|
||||
*/
|
||||
Timer (uint32_t freq = 1000);
|
||||
virtual ~Timer ();
|
||||
|
||||
/**
|
||||
* @brief Tick the counter.
|
||||
*
|
||||
* Counter is incremented by one every tick,
|
||||
* if it gets over the INT_MAX (see limits.h),
|
||||
* the counter rolls up back to zero and starts
|
||||
* over.
|
||||
*
|
||||
*
|
||||
* @param ms Counter ticking frequency is provided in milliseconds
|
||||
*/
|
||||
void tickCounter (int ms);
|
||||
|
||||
/**
|
||||
* @brief Get the current counter value
|
||||
*
|
||||
* @return int counter value
|
||||
*/
|
||||
int getCounter ();
|
||||
|
||||
/**
|
||||
* @brief Set counter to 0.
|
||||
*
|
||||
*/
|
||||
void resetCounter ();
|
||||
|
||||
/**
|
||||
* @brief Sleep for amount of time
|
||||
*
|
||||
* Time is either in ms or in sec, defined
|
||||
* by systickInit_xx()
|
||||
*
|
||||
* @param ms milliseconds
|
||||
*/
|
||||
void Sleep (int ms);
|
||||
|
||||
private:
|
||||
volatile std::atomic_int counter;
|
||||
volatile std::atomic_int timer;
|
||||
};
|
||||
|
||||
#endif /* TIMER_H_ */
|
||||
32
Timer/liblinks.xml
Normal file
32
Timer/liblinks.xml
Normal file
@ -0,0 +1,32 @@
|
||||
<!-- liblinks.xml
|
||||
|
||||
NXP LPCXpresso IDE "Smart update wizard" script file
|
||||
When executed on a particular application project, will
|
||||
add appropriate links to the specified library project.
|
||||
|
||||
Note that this script assumes that the application project
|
||||
contains the standard 'Debug' and 'Release' build
|
||||
configurations.
|
||||
-->
|
||||
|
||||
<project name="" update="true">
|
||||
<setting id="all.compiler.inc">
|
||||
<value>${MacroStart}workspace_loc:/${ProjName}/inc${MacroEnd}</value>
|
||||
</setting>
|
||||
<setting id="assembler.inc">
|
||||
<value>${MacroStart}workspace_loc:/${ProjName}/inc${MacroEnd}</value>
|
||||
</setting>
|
||||
<setting id="linker.libs">
|
||||
<value>${ProjName}</value>
|
||||
</setting>
|
||||
<setting id="linker.paths" buildType="Debug">
|
||||
<value>${MacroStart}workspace_loc:/${ProjName}/Debug${MacroEnd}</value>
|
||||
</setting>
|
||||
<setting id="linker.paths" buildType="Release">
|
||||
<value>${MacroStart}workspace_loc:/${ProjName}/Release${MacroEnd}</value>
|
||||
</setting>
|
||||
<requires msg="Library project `${ProjName}` not found">
|
||||
<value>${ProjName}</value>
|
||||
</requires>
|
||||
</project>
|
||||
|
||||
64
Timer/src/Timer.cpp
Normal file
64
Timer/src/Timer.cpp
Normal file
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Timer.cpp
|
||||
*
|
||||
* Created on: Oct 14, 2022
|
||||
* Author: tylen
|
||||
*/
|
||||
|
||||
#include <Timer.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void
|
||||
SysTick_Handler (void)
|
||||
{
|
||||
if (timer > 0)
|
||||
timer--;
|
||||
}
|
||||
}
|
||||
|
||||
Timer::Timer (uint32_t freq = 1000)
|
||||
{
|
||||
Chip_Clock_SetSysTickClockDiv (1);
|
||||
uint32_t sysTickRate = Chip_Clock_GetSysTickClockRate ();
|
||||
SysTick_Config (sysTickRate / freq);
|
||||
counter = 0;
|
||||
}
|
||||
|
||||
Timer::~Timer ()
|
||||
{
|
||||
// TODO Auto-generated destructor stub
|
||||
}
|
||||
|
||||
void
|
||||
Timer::tickCounter (int ms)
|
||||
{
|
||||
if (counter >= INT_MAX)
|
||||
{
|
||||
counter = 0;
|
||||
}
|
||||
counter++;
|
||||
Sleep (ms);
|
||||
}
|
||||
|
||||
void
|
||||
Timer::Sleep (int ms)
|
||||
{
|
||||
timer = ms;
|
||||
while (timer > 0)
|
||||
{
|
||||
__WFI ();
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
Timer::getCounter ()
|
||||
{
|
||||
return counter;
|
||||
}
|
||||
|
||||
void
|
||||
Timer::resetCounter ()
|
||||
{
|
||||
counter = 0;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user