Cube version update && rename

This commit is contained in:
Attila Body 2025-05-25 13:34:14 +02:00
parent cf41cd6af0
commit 5afda45226
Signed by: abody
GPG key ID: BD0C6214E68FB5CF
75 changed files with 55323 additions and 53939 deletions

View file

@ -19,15 +19,19 @@
<toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug.1851572255" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug"> <toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug.1851572255" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug">
<option id="com.st.stm32cube.ide.mcu.option.internal.toolchain.type.2077243871" name="Internal Toolchain Type" superClass="com.st.stm32cube.ide.mcu.option.internal.toolchain.type" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.base.gnu-tools-for-stm32" valueType="string"/> <option id="com.st.stm32cube.ide.mcu.option.internal.toolchain.type.2077243871" name="Internal Toolchain Type" superClass="com.st.stm32cube.ide.mcu.option.internal.toolchain.type" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.base.gnu-tools-for-stm32" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.option.internal.toolchain.version.305934056" name="Internal Toolchain Version" superClass="com.st.stm32cube.ide.mcu.option.internal.toolchain.version" useByScannerDiscovery="false" value="7-2018-q2-update" valueType="string"/> <option id="com.st.stm32cube.ide.mcu.option.internal.toolchain.version.305934056" name="Internal Toolchain Version" superClass="com.st.stm32cube.ide.mcu.option.internal.toolchain.version" useByScannerDiscovery="false" value="7-2018-q2-update" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.163659404" name="Mcu" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" useByScannerDiscovery="true" value="STM32F103C8Tx" valueType="string"/> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.163659404" name="MCU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" useByScannerDiscovery="true" value="STM32F103C8Tx" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.1687550917" name="CpuId" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" useByScannerDiscovery="false" value="0" valueType="string"/> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.1687550917" name="CPU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" useByScannerDiscovery="false" value="0" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.1739656132" name="CpuCoreId" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.1739656132" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.162671610" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.162671610" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.416086734" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.3 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.base.gnu-tools-for-stm32 || STM32F103C8Tx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Middlewares/Third_Party/FreeRTOS/Source/include | ../Inc | ../Drivers/CMSIS/Device/ST/STM32F1xx/Include | ../Drivers/CMSIS/Include | ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy | ../Drivers/STM32F1xx_HAL_Driver/Inc | ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS | ../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3 || || || VDD_VALUE=3300 | HSE_VALUE=8000000 | STM32F103xB | LSI_VALUE=40000 | HSI_VALUE=8000000 | HSE_STARTUP_TIMEOUT=100 | USE_FULL_LL_DRIVER | LSE_STARTUP_TIMEOUT=5000 | LSE_VALUE=32768 | PREFETCH_ENABLE=1 || || Drivers | Src | Middlewares | Startup || || || ${workspace_loc:/${ProjName}/STM32F103C8TX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || " valueType="string"/> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.416086734" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.base.gnu-tools-for-stm32 || STM32F103C8Tx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Middlewares/Third_Party/FreeRTOS/Source/include | ../Inc | ../Drivers/CMSIS/Device/ST/STM32F1xx/Include | ../Drivers/CMSIS/Include | ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy | ../Drivers/STM32F1xx_HAL_Driver/Inc | ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS | ../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3 || || || VDD_VALUE=3300 | HSE_VALUE=8000000 | STM32F103xB | LSI_VALUE=40000 | HSI_VALUE=8000000 | HSE_STARTUP_TIMEOUT=100 | USE_FULL_LL_DRIVER | LSE_STARTUP_TIMEOUT=5000 | LSE_VALUE=32768 | PREFETCH_ENABLE=1 || || Drivers | Src | Middlewares | Startup || || || ${workspace_loc:/${ProjName}/STM32F103C8TX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || || || " valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.debug.option.cpuclock.1211014983" name="Cpu clock frequence" superClass="com.st.stm32cube.ide.mcu.debug.option.cpuclock" useByScannerDiscovery="false" value="72" valueType="string"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.910555751" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/> <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.910555751" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
<builder buildPath="${workspace_loc:/NeoPixelF103MVP}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1086059078" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/> <builder buildPath="${workspace_loc:/NeoPixelF103MVP}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1086059078" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.130003299" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler"> <tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.130003299" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.1274425108" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g3" valueType="enumerated"/> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.1274425108" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g3" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.1933077777" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="DEBUG"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.360637632" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/> <inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.360637632" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
</tool> </tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.2011441119" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler"> <tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.2011441119" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
@ -72,6 +76,7 @@
<listOptionValue builtIn="false" value="../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3"/> <listOptionValue builtIn="false" value="../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3"/>
<listOptionValue builtIn="false" value="../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS"/> <listOptionValue builtIn="false" value="../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS"/>
<listOptionValue builtIn="false" value="../components/"/> <listOptionValue builtIn="false" value="../components/"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy"/>
</option> </option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols.177173672" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols"> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols.177173672" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="VDD_VALUE=3300"/> <listOptionValue builtIn="false" value="VDD_VALUE=3300"/>
@ -143,15 +148,19 @@
<toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release.145514576" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release"> <toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release.145514576" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release">
<option id="com.st.stm32cube.ide.mcu.option.internal.toolchain.type.1450559294" name="Internal Toolchain Type" superClass="com.st.stm32cube.ide.mcu.option.internal.toolchain.type" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.base.gnu-tools-for-stm32" valueType="string"/> <option id="com.st.stm32cube.ide.mcu.option.internal.toolchain.type.1450559294" name="Internal Toolchain Type" superClass="com.st.stm32cube.ide.mcu.option.internal.toolchain.type" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.base.gnu-tools-for-stm32" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.option.internal.toolchain.version.1338283485" name="Internal Toolchain Version" superClass="com.st.stm32cube.ide.mcu.option.internal.toolchain.version" useByScannerDiscovery="false" value="7-2018-q2-update" valueType="string"/> <option id="com.st.stm32cube.ide.mcu.option.internal.toolchain.version.1338283485" name="Internal Toolchain Version" superClass="com.st.stm32cube.ide.mcu.option.internal.toolchain.version" useByScannerDiscovery="false" value="7-2018-q2-update" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.1017736702" name="Mcu" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" useByScannerDiscovery="true" value="STM32F103C8Tx" valueType="string"/> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.1017736702" name="MCU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" useByScannerDiscovery="true" value="STM32F103C8Tx" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.427092296" name="CpuId" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" useByScannerDiscovery="false" value="0" valueType="string"/> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.427092296" name="CPU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" useByScannerDiscovery="false" value="0" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.803288303" name="CpuCoreId" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.803288303" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.142185949" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.142185949" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.1897240971" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.3 || Release || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.base.gnu-tools-for-stm32 || STM32F103C8Tx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Middlewares/Third_Party/FreeRTOS/Source/include | ../Inc | ../Drivers/CMSIS/Device/ST/STM32F1xx/Include | ../Drivers/CMSIS/Include | ../Drivers/STM32F1xx_HAL_Driver/Inc | ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS | ../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3 || || || VDD_VALUE=3300 | HSE_VALUE=8000000 | STM32F103xB | LSI_VALUE=40000 | HSI_VALUE=8000000 | HSE_STARTUP_TIMEOUT=100 | USE_FULL_LL_DRIVER | LSE_STARTUP_TIMEOUT=5000 | LSE_VALUE=32768 | PREFETCH_ENABLE=1 || || Drivers | Src | Middlewares | Startup || || || ${workspace_loc:/${ProjName}/STM32F103C8TX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || " valueType="string"/> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.1897240971" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Release || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.base.gnu-tools-for-stm32 || STM32F103C8Tx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Middlewares/Third_Party/FreeRTOS/Source/include | ../Inc | ../Drivers/CMSIS/Device/ST/STM32F1xx/Include | ../Drivers/CMSIS/Include | ../Drivers/STM32F1xx_HAL_Driver/Inc | ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS | ../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3 || || || VDD_VALUE=3300 | HSE_VALUE=8000000 | STM32F103xB | LSI_VALUE=40000 | HSI_VALUE=8000000 | HSE_STARTUP_TIMEOUT=100 | USE_FULL_LL_DRIVER | LSE_STARTUP_TIMEOUT=5000 | LSE_VALUE=32768 | PREFETCH_ENABLE=1 || || Drivers | Src | Middlewares | Startup || || || ${workspace_loc:/${ProjName}/STM32F103C8TX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || || || " valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.debug.option.cpuclock.2017930330" name="Cpu clock frequence" superClass="com.st.stm32cube.ide.mcu.debug.option.cpuclock" useByScannerDiscovery="false" value="72" valueType="string"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.1774904877" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/> <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.1774904877" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
<builder buildPath="${workspace_loc:/NeoPixelF103MVP}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1500348018" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/> <builder buildPath="${workspace_loc:/NeoPixelF103MVP}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1500348018" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.2006730064" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler"> <tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.2006730064" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.270341904" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g0" valueType="enumerated"/> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.270341904" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g0" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.2133381304" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="DEBUG"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.1691278250" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/> <inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.1691278250" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
</tool> </tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.978753456" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler"> <tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.978753456" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
@ -282,4 +291,4 @@
</storageModule> </storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="refreshScope"/> <storageModule moduleId="refreshScope"/>
</cproject> </cproject>

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>NeoPixelF103MVP</name> <name>neopixel_f103_mvp</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>

File diff suppressed because it is too large Load diff

View file

@ -1,220 +1,273 @@
/** /**
****************************************************************************** ******************************************************************************
* @file stm32f1xx.h * @file stm32f1xx.h
* @author MCD Application Team * @author MCD Application Team
* @brief CMSIS STM32F1xx Device Peripheral Access Layer Header File. * @brief CMSIS STM32F1xx Device Peripheral Access Layer Header File.
* *
* The file is the unique include file that the application programmer * The file is the unique include file that the application programmer
* is using in the C source code, usually in main.c. This file contains: * is using in the C source code, usually in main.c. This file contains:
* - Configuration section that allows to select: * - Configuration section that allows to select:
* - The STM32F1xx device used in the target application * - The STM32F1xx device used in the target application
* - To use or not the peripherals drivers in application code(i.e. * - To use or not the peripheral's drivers in application code(i.e.
* code will be based on direct access to peripherals registers * code will be based on direct access to peripheral's registers
* rather than drivers API), this option is controlled by * rather than drivers API), this option is controlled by
* "#define USE_HAL_DRIVER" * "#define USE_HAL_DRIVER"
* *
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2017 STMicroelectronics. * Copyright (c) 2017-2021 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under BSD 3-Clause license, * This software is licensed under terms that can be found in the LICENSE file
* the "License"; You may not use this file except in compliance with the * in the root directory of this software component.
* License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* opensource.org/licenses/BSD-3-Clause *
* ******************************************************************************
****************************************************************************** */
*/
/** @addtogroup CMSIS
/** @addtogroup CMSIS * @{
* @{ */
*/
/** @addtogroup stm32f1xx
/** @addtogroup stm32f1xx * @{
* @{ */
*/
#ifndef __STM32F1XX_H
#ifndef __STM32F1XX_H #define __STM32F1XX_H
#define __STM32F1XX_H
#ifdef __cplusplus
#ifdef __cplusplus extern "C" {
extern "C" { #endif /* __cplusplus */
#endif /* __cplusplus */
/** @addtogroup Library_configuration_section
/** @addtogroup Library_configuration_section * @{
* @{ */
*/
/**
/** * @brief STM32 Family
* @brief STM32 Family */
*/ #if !defined (STM32F1)
#if !defined (STM32F1) #define STM32F1
#define STM32F1 #endif /* STM32F1 */
#endif /* STM32F1 */
/* Uncomment the line below according to the target STM32L device used in your
/* Uncomment the line below according to the target STM32L device used in your application
application */
*/
#if !defined (STM32F100xB) && !defined (STM32F100xE) && !defined (STM32F101x6) && \
#if !defined (STM32F100xB) && !defined (STM32F100xE) && !defined (STM32F101x6) && \ !defined (STM32F101xB) && !defined (STM32F101xE) && !defined (STM32F101xG) && !defined (STM32F102x6) && !defined (STM32F102xB) && !defined (STM32F103x6) && \
!defined (STM32F101xB) && !defined (STM32F101xE) && !defined (STM32F101xG) && !defined (STM32F102x6) && !defined (STM32F102xB) && !defined (STM32F103x6) && \ !defined (STM32F103xB) && !defined (STM32F103xE) && !defined (STM32F103xG) && !defined (STM32F105xC) && !defined (STM32F107xC)
!defined (STM32F103xB) && !defined (STM32F103xE) && !defined (STM32F103xG) && !defined (STM32F105xC) && !defined (STM32F107xC) /* #define STM32F100xB */ /*!< STM32F100C4, STM32F100R4, STM32F100C6, STM32F100R6, STM32F100C8, STM32F100R8, STM32F100V8, STM32F100CB, STM32F100RB and STM32F100VB */
/* #define STM32F100xB */ /*!< STM32F100C4, STM32F100R4, STM32F100C6, STM32F100R6, STM32F100C8, STM32F100R8, STM32F100V8, STM32F100CB, STM32F100RB and STM32F100VB */ /* #define STM32F100xE */ /*!< STM32F100RC, STM32F100VC, STM32F100ZC, STM32F100RD, STM32F100VD, STM32F100ZD, STM32F100RE, STM32F100VE and STM32F100ZE */
/* #define STM32F100xE */ /*!< STM32F100RC, STM32F100VC, STM32F100ZC, STM32F100RD, STM32F100VD, STM32F100ZD, STM32F100RE, STM32F100VE and STM32F100ZE */ /* #define STM32F101x6 */ /*!< STM32F101C4, STM32F101R4, STM32F101T4, STM32F101C6, STM32F101R6 and STM32F101T6 Devices */
/* #define STM32F101x6 */ /*!< STM32F101C4, STM32F101R4, STM32F101T4, STM32F101C6, STM32F101R6 and STM32F101T6 Devices */ /* #define STM32F101xB */ /*!< STM32F101C8, STM32F101R8, STM32F101T8, STM32F101V8, STM32F101CB, STM32F101RB, STM32F101TB and STM32F101VB */
/* #define STM32F101xB */ /*!< STM32F101C8, STM32F101R8, STM32F101T8, STM32F101V8, STM32F101CB, STM32F101RB, STM32F101TB and STM32F101VB */ /* #define STM32F101xE */ /*!< STM32F101RC, STM32F101VC, STM32F101ZC, STM32F101RD, STM32F101VD, STM32F101ZD, STM32F101RE, STM32F101VE and STM32F101ZE */
/* #define STM32F101xE */ /*!< STM32F101RC, STM32F101VC, STM32F101ZC, STM32F101RD, STM32F101VD, STM32F101ZD, STM32F101RE, STM32F101VE and STM32F101ZE */ /* #define STM32F101xG */ /*!< STM32F101RF, STM32F101VF, STM32F101ZF, STM32F101RG, STM32F101VG and STM32F101ZG */
/* #define STM32F101xG */ /*!< STM32F101RF, STM32F101VF, STM32F101ZF, STM32F101RG, STM32F101VG and STM32F101ZG */ /* #define STM32F102x6 */ /*!< STM32F102C4, STM32F102R4, STM32F102C6 and STM32F102R6 */
/* #define STM32F102x6 */ /*!< STM32F102C4, STM32F102R4, STM32F102C6 and STM32F102R6 */ /* #define STM32F102xB */ /*!< STM32F102C8, STM32F102R8, STM32F102CB and STM32F102RB */
/* #define STM32F102xB */ /*!< STM32F102C8, STM32F102R8, STM32F102CB and STM32F102RB */ /* #define STM32F103x6 */ /*!< STM32F103C4, STM32F103R4, STM32F103T4, STM32F103C6, STM32F103R6 and STM32F103T6 */
/* #define STM32F103x6 */ /*!< STM32F103C4, STM32F103R4, STM32F103T4, STM32F103C6, STM32F103R6 and STM32F103T6 */ /* #define STM32F103xB */ /*!< STM32F103C8, STM32F103R8, STM32F103T8, STM32F103V8, STM32F103CB, STM32F103RB, STM32F103TB and STM32F103VB */
/* #define STM32F103xB */ /*!< STM32F103C8, STM32F103R8, STM32F103T8, STM32F103V8, STM32F103CB, STM32F103RB, STM32F103TB and STM32F103VB */ /* #define STM32F103xE */ /*!< STM32F103RC, STM32F103VC, STM32F103ZC, STM32F103RD, STM32F103VD, STM32F103ZD, STM32F103RE, STM32F103VE and STM32F103ZE */
/* #define STM32F103xE */ /*!< STM32F103RC, STM32F103VC, STM32F103ZC, STM32F103RD, STM32F103VD, STM32F103ZD, STM32F103RE, STM32F103VE and STM32F103ZE */ /* #define STM32F103xG */ /*!< STM32F103RF, STM32F103VF, STM32F103ZF, STM32F103RG, STM32F103VG and STM32F103ZG */
/* #define STM32F103xG */ /*!< STM32F103RF, STM32F103VF, STM32F103ZF, STM32F103RG, STM32F103VG and STM32F103ZG */ /* #define STM32F105xC */ /*!< STM32F105R8, STM32F105V8, STM32F105RB, STM32F105VB, STM32F105RC and STM32F105VC */
/* #define STM32F105xC */ /*!< STM32F105R8, STM32F105V8, STM32F105RB, STM32F105VB, STM32F105RC and STM32F105VC */ /* #define STM32F107xC */ /*!< STM32F107RB, STM32F107VB, STM32F107RC and STM32F107VC */
/* #define STM32F107xC */ /*!< STM32F107RB, STM32F107VB, STM32F107RC and STM32F107VC */ #endif
#endif
/* Tip: To avoid modifying this file each time you need to switch between these
/* Tip: To avoid modifying this file each time you need to switch between these devices, you can define the device in your toolchain compiler preprocessor.
devices, you can define the device in your toolchain compiler preprocessor. */
*/
#if !defined (USE_HAL_DRIVER)
#if !defined (USE_HAL_DRIVER) /**
/** * @brief Comment the line below if you will not use the peripherals drivers.
* @brief Comment the line below if you will not use the peripherals drivers. In this case, these drivers will not be included and the application code will
In this case, these drivers will not be included and the application code will be based on direct access to peripherals registers
be based on direct access to peripherals registers */
*/ /*#define USE_HAL_DRIVER */
/*#define USE_HAL_DRIVER */ #endif /* USE_HAL_DRIVER */
#endif /* USE_HAL_DRIVER */
/**
/** * @brief CMSIS Device version number
* @brief CMSIS Device version number V4.3.2 */
*/ #define __STM32F1_CMSIS_VERSION_MAIN (0x04) /*!< [31:24] main version */
#define __STM32F1_CMSIS_VERSION_MAIN (0x04) /*!< [31:24] main version */ #define __STM32F1_CMSIS_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */
#define __STM32F1_CMSIS_VERSION_SUB1 (0x03) /*!< [23:16] sub1 version */ #define __STM32F1_CMSIS_VERSION_SUB2 (0x05) /*!< [15:8] sub2 version */
#define __STM32F1_CMSIS_VERSION_SUB2 (0x02) /*!< [15:8] sub2 version */ #define __STM32F1_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
#define __STM32F1_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */ #define __STM32F1_CMSIS_VERSION ((__STM32F1_CMSIS_VERSION_MAIN << 24)\
#define __STM32F1_CMSIS_VERSION ((__STM32F1_CMSIS_VERSION_MAIN << 24)\ |(__STM32F1_CMSIS_VERSION_SUB1 << 16)\
|(__STM32F1_CMSIS_VERSION_SUB1 << 16)\ |(__STM32F1_CMSIS_VERSION_SUB2 << 8 )\
|(__STM32F1_CMSIS_VERSION_SUB2 << 8 )\ |(__STM32F1_CMSIS_VERSION_RC))
|(__STM32F1_CMSIS_VERSION_RC))
/**
/** * @}
* @} */
*/
/** @addtogroup Device_Included
/** @addtogroup Device_Included * @{
* @{ */
*/
#if defined(STM32F100xB)
#if defined(STM32F100xB) #include "stm32f100xb.h"
#include "stm32f100xb.h" #elif defined(STM32F100xE)
#elif defined(STM32F100xE) #include "stm32f100xe.h"
#include "stm32f100xe.h" #elif defined(STM32F101x6)
#elif defined(STM32F101x6) #include "stm32f101x6.h"
#include "stm32f101x6.h" #elif defined(STM32F101xB)
#elif defined(STM32F101xB) #include "stm32f101xb.h"
#include "stm32f101xb.h" #elif defined(STM32F101xE)
#elif defined(STM32F101xE) #include "stm32f101xe.h"
#include "stm32f101xe.h" #elif defined(STM32F101xG)
#elif defined(STM32F101xG) #include "stm32f101xg.h"
#include "stm32f101xg.h" #elif defined(STM32F102x6)
#elif defined(STM32F102x6) #include "stm32f102x6.h"
#include "stm32f102x6.h" #elif defined(STM32F102xB)
#elif defined(STM32F102xB) #include "stm32f102xb.h"
#include "stm32f102xb.h" #elif defined(STM32F103x6)
#elif defined(STM32F103x6) #include "stm32f103x6.h"
#include "stm32f103x6.h" #elif defined(STM32F103xB)
#elif defined(STM32F103xB) #include "stm32f103xb.h"
#include "stm32f103xb.h" #elif defined(STM32F103xE)
#elif defined(STM32F103xE) #include "stm32f103xe.h"
#include "stm32f103xe.h" #elif defined(STM32F103xG)
#elif defined(STM32F103xG) #include "stm32f103xg.h"
#include "stm32f103xg.h" #elif defined(STM32F105xC)
#elif defined(STM32F105xC) #include "stm32f105xc.h"
#include "stm32f105xc.h" #elif defined(STM32F107xC)
#elif defined(STM32F107xC) #include "stm32f107xc.h"
#include "stm32f107xc.h" #else
#else #error "Please select first the target STM32F1xx device used in your application (in stm32f1xx.h file)"
#error "Please select first the target STM32F1xx device used in your application (in stm32f1xx.h file)" #endif
#endif
/**
/** * @}
* @} */
*/
/** @addtogroup Exported_types
/** @addtogroup Exported_types * @{
* @{ */
*/ typedef enum
typedef enum {
{ RESET = 0,
RESET = 0, SET = !RESET
SET = !RESET } FlagStatus, ITStatus;
} FlagStatus, ITStatus;
typedef enum
typedef enum {
{ DISABLE = 0,
DISABLE = 0, ENABLE = !DISABLE
ENABLE = !DISABLE } FunctionalState;
} FunctionalState; #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
typedef enum
typedef enum {
{ SUCCESS = 0U,
SUCCESS = 0U, ERROR = !SUCCESS
ERROR = !SUCCESS } ErrorStatus;
} ErrorStatus;
/**
/** * @}
* @} */
*/
/** @addtogroup Exported_macros
/** @addtogroup Exported_macros * @{
* @{ */
*/ #define SET_BIT(REG, BIT) ((REG) |= (BIT))
#define SET_BIT(REG, BIT) ((REG) |= (BIT))
#define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
#define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
#define READ_BIT(REG, BIT) ((REG) & (BIT))
#define READ_BIT(REG, BIT) ((REG) & (BIT))
#define CLEAR_REG(REG) ((REG) = (0x0))
#define CLEAR_REG(REG) ((REG) = (0x0))
#define WRITE_REG(REG, VAL) ((REG) = (VAL))
#define WRITE_REG(REG, VAL) ((REG) = (VAL))
#define READ_REG(REG) ((REG))
#define READ_REG(REG) ((REG))
#define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
#define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
#define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
#define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
/* Use of CMSIS compiler intrinsics for register exclusive access */
/* Atomic 32-bit register access macro to set one or several bits */
/** #define ATOMIC_SET_BIT(REG, BIT) \
* @} do { \
*/ uint32_t val; \
do { \
#if defined (USE_HAL_DRIVER) val = __LDREXW((__IO uint32_t *)&(REG)) | (BIT); \
#include "stm32f1xx_hal.h" } while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
#endif /* USE_HAL_DRIVER */ } while(0)
/* Atomic 32-bit register access macro to clear one or several bits */
#ifdef __cplusplus #define ATOMIC_CLEAR_BIT(REG, BIT) \
} do { \
#endif /* __cplusplus */ uint32_t val; \
do { \
#endif /* __STM32F1xx_H */ val = __LDREXW((__IO uint32_t *)&(REG)) & ~(BIT); \
/** } while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
* @} } while(0)
*/
/* Atomic 32-bit register access macro to clear and set one or several bits */
/** #define ATOMIC_MODIFY_REG(REG, CLEARMSK, SETMASK) \
* @} do { \
*/ uint32_t val; \
do { \
val = (__LDREXW((__IO uint32_t *)&(REG)) & ~(CLEARMSK)) | (SETMASK); \
} while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
} while(0)
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* Atomic 16-bit register access macro to set one or several bits */
#define ATOMIC_SETH_BIT(REG, BIT) \
do { \
uint16_t val; \
do { \
val = __LDREXH((__IO uint16_t *)&(REG)) | (BIT); \
} while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
} while(0)
/* Atomic 16-bit register access macro to clear one or several bits */
#define ATOMIC_CLEARH_BIT(REG, BIT) \
do { \
uint16_t val; \
do { \
val = __LDREXH((__IO uint16_t *)&(REG)) & ~(BIT); \
} while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
} while(0)
/* Atomic 16-bit register access macro to clear and set one or several bits */
#define ATOMIC_MODIFYH_REG(REG, CLEARMSK, SETMASK) \
do { \
uint16_t val; \
do { \
val = (__LDREXH((__IO uint16_t *)&(REG)) & ~(CLEARMSK)) | (SETMASK); \
} while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
} while(0)
/**
* @}
*/
#if defined (USE_HAL_DRIVER)
#include "stm32f1xx_hal.h"
#endif /* USE_HAL_DRIVER */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __STM32F1xx_H */
/**
* @}
*/
/**
* @}
*/

View file

@ -1,98 +1,96 @@
/** /**
****************************************************************************** ******************************************************************************
* @file system_stm32f10x.h * @file system_stm32f1xx.h
* @author MCD Application Team * @author MCD Application Team
* @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File. * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File.
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2017 STMicroelectronics. * Copyright (c) 2017-2021 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under BSD 3-Clause license, * This software is licensed under terms that can be found in the LICENSE file
* the "License"; You may not use this file except in compliance with the * in the root directory of this software component.
* License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* opensource.org/licenses/BSD-3-Clause *
* ******************************************************************************
****************************************************************************** */
*/
/** @addtogroup CMSIS
/** @addtogroup CMSIS * @{
* @{ */
*/
/** @addtogroup stm32f10x_system
/** @addtogroup stm32f10x_system * @{
* @{ */
*/
/**
/** * @brief Define to prevent recursive inclusion
* @brief Define to prevent recursive inclusion */
*/ #ifndef __SYSTEM_STM32F10X_H
#ifndef __SYSTEM_STM32F10X_H #define __SYSTEM_STM32F10X_H
#define __SYSTEM_STM32F10X_H
#ifdef __cplusplus
#ifdef __cplusplus extern "C" {
extern "C" { #endif
#endif
/** @addtogroup STM32F10x_System_Includes
/** @addtogroup STM32F10x_System_Includes * @{
* @{ */
*/
/**
/** * @}
* @} */
*/
/** @addtogroup STM32F10x_System_Exported_types
/** @addtogroup STM32F10x_System_Exported_types * @{
* @{ */
*/
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ extern const uint8_t AHBPrescTable[16U]; /*!< AHB prescalers table values */
extern const uint8_t AHBPrescTable[16U]; /*!< AHB prescalers table values */ extern const uint8_t APBPrescTable[8U]; /*!< APB prescalers table values */
extern const uint8_t APBPrescTable[8U]; /*!< APB prescalers table values */
/**
/** * @}
* @} */
*/
/** @addtogroup STM32F10x_System_Exported_Constants
/** @addtogroup STM32F10x_System_Exported_Constants * @{
* @{ */
*/
/**
/** * @}
* @} */
*/
/** @addtogroup STM32F10x_System_Exported_Macros
/** @addtogroup STM32F10x_System_Exported_Macros * @{
* @{ */
*/
/**
/** * @}
* @} */
*/
/** @addtogroup STM32F10x_System_Exported_Functions
/** @addtogroup STM32F10x_System_Exported_Functions * @{
* @{ */
*/
extern void SystemInit(void);
extern void SystemInit(void); extern void SystemCoreClockUpdate(void);
extern void SystemCoreClockUpdate(void); /**
/** * @}
* @} */
*/
#ifdef __cplusplus
#ifdef __cplusplus }
} #endif
#endif
#endif /*__SYSTEM_STM32F10X_H */
#endif /*__SYSTEM_STM32F10X_H */
/**
/** * @}
* @} */
*/
/**
/** * @}
* @} */
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -0,0 +1,6 @@
This software component is provided to you as part of a software package and
applicable license terms are in the Package_license file. If you received this
software component outside of a package or without applicable license terms,
the terms of the Apache-2.0 license shall apply.
You may obtain a copy of the Apache-2.0 at:
https://opensource.org/licenses/Apache-2.0

201
Drivers/CMSIS/LICENSE.txt Normal file
View file

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -6,13 +6,12 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under BSD 3-Clause license, * This software is licensed under terms that can be found in the LICENSE file
* the "License"; You may not use this file except in compliance with the * in the root directory of this software component.
* License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* opensource.org/licenses/BSD-3-Clause
* *
****************************************************************************** ******************************************************************************
*/ */
@ -898,7 +897,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_SPI1(void)
} }
/** /**
* @brief Check if SPI1 has been remaped or not * @brief Check if SPI1 has been remapped or not
* @rmtoll MAPR SPI1_REMAP LL_GPIO_AF_IsEnabledRemap_SPI1 * @rmtoll MAPR SPI1_REMAP LL_GPIO_AF_IsEnabledRemap_SPI1
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -930,7 +929,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_I2C1(void)
} }
/** /**
* @brief Check if I2C1 has been remaped or not * @brief Check if I2C1 has been remapped or not
* @rmtoll MAPR I2C1_REMAP LL_GPIO_AF_IsEnabledRemap_I2C1 * @rmtoll MAPR I2C1_REMAP LL_GPIO_AF_IsEnabledRemap_I2C1
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -962,7 +961,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_USART1(void)
} }
/** /**
* @brief Check if USART1 has been remaped or not * @brief Check if USART1 has been remapped or not
* @rmtoll MAPR USART1_REMAP LL_GPIO_AF_IsEnabledRemap_USART1 * @rmtoll MAPR USART1_REMAP LL_GPIO_AF_IsEnabledRemap_USART1
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -994,7 +993,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_USART2(void)
} }
/** /**
* @brief Check if USART2 has been remaped or not * @brief Check if USART2 has been remapped or not
* @rmtoll MAPR USART2_REMAP LL_GPIO_AF_IsEnabledRemap_USART2 * @rmtoll MAPR USART2_REMAP LL_GPIO_AF_IsEnabledRemap_USART2
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1176,7 +1175,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM4(void)
} }
/** /**
* @brief Check if TIM4 has been remaped or not * @brief Check if TIM4 has been remapped or not
* @rmtoll MAPR TIM4_REMAP LL_GPIO_AF_IsEnabledRemap_TIM4 * @rmtoll MAPR TIM4_REMAP LL_GPIO_AF_IsEnabledRemap_TIM4
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1251,7 +1250,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_PD01(void)
} }
/** /**
* @brief Check if PD01 has been remaped or not * @brief Check if PD01 has been remapped or not
* @rmtoll MAPR PD01_REMAP LL_GPIO_AF_IsEnabledRemap_PD01 * @rmtoll MAPR PD01_REMAP LL_GPIO_AF_IsEnabledRemap_PD01
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1286,7 +1285,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM5CH4(void)
} }
/** /**
* @brief Check if TIM5CH4 has been remaped or not * @brief Check if TIM5CH4 has been remapped or not
* @rmtoll MAPR TIM5CH4_IREMAP LL_GPIO_AF_IsEnabledRemap_TIM5CH4 * @rmtoll MAPR TIM5CH4_IREMAP LL_GPIO_AF_IsEnabledRemap_TIM5CH4
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1322,7 +1321,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_ETH(void)
} }
/** /**
* @brief Check if ETH has been remaped or not * @brief Check if ETH has been remapped or not
* @rmtoll MAPR ETH_REMAP LL_GPIO_AF_IsEnabledRemap_ETH * @rmtoll MAPR ETH_REMAP LL_GPIO_AF_IsEnabledRemap_ETH
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1358,7 +1357,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_CAN2(void)
} }
/** /**
* @brief Check if CAN2 has been remaped or not * @brief Check if CAN2 has been remapped or not
* @rmtoll MAPR CAN2_REMAP LL_GPIO_AF_IsEnabledRemap_CAN2 * @rmtoll MAPR CAN2_REMAP LL_GPIO_AF_IsEnabledRemap_CAN2
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1418,7 +1417,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_ADC1_ETRGINJ(void)
} }
/** /**
* @brief Check if ADC1_ETRGINJ has been remaped or not * @brief Check if ADC1_ETRGINJ has been remapped or not
* @rmtoll MAPR ADC1_ETRGINJ_REMAP LL_GPIO_AF_IsEnabledRemap_ADC1_ETRGINJ * @rmtoll MAPR ADC1_ETRGINJ_REMAP LL_GPIO_AF_IsEnabledRemap_ADC1_ETRGINJ
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1452,7 +1451,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_ADC1_ETRGREG(void)
} }
/** /**
* @brief Check if ADC1_ETRGREG has been remaped or not * @brief Check if ADC1_ETRGREG has been remapped or not
* @rmtoll MAPR ADC1_ETRGREG_REMAP LL_GPIO_AF_IsEnabledRemap_ADC1_ETRGREG * @rmtoll MAPR ADC1_ETRGREG_REMAP LL_GPIO_AF_IsEnabledRemap_ADC1_ETRGREG
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1487,7 +1486,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_ADC2_ETRGINJ(void)
} }
/** /**
* @brief Check if ADC2_ETRGINJ has been remaped or not * @brief Check if ADC2_ETRGINJ has been remapped or not
* @rmtoll MAPR ADC2_ETRGINJ_REMAP LL_GPIO_AF_IsEnabledRemap_ADC2_ETRGINJ * @rmtoll MAPR ADC2_ETRGINJ_REMAP LL_GPIO_AF_IsEnabledRemap_ADC2_ETRGINJ
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1522,7 +1521,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_ADC2_ETRGREG(void)
} }
/** /**
* @brief Check if ADC2_ETRGREG has been remaped or not * @brief Check if ADC2_ETRGREG has been remapped or not
* @rmtoll MAPR ADC2_ETRGREG_REMAP LL_GPIO_AF_IsEnabledRemap_ADC2_ETRGREG * @rmtoll MAPR ADC2_ETRGREG_REMAP LL_GPIO_AF_IsEnabledRemap_ADC2_ETRGREG
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1540,8 +1539,7 @@ __STATIC_INLINE uint32_t LL_GPIO_AF_IsEnabledRemap_ADC2_ETRGREG(void)
*/ */
__STATIC_INLINE void LL_GPIO_AF_EnableRemap_SWJ(void) __STATIC_INLINE void LL_GPIO_AF_EnableRemap_SWJ(void)
{ {
CLEAR_BIT(AFIO->MAPR,AFIO_MAPR_SWJ_CFG); MODIFY_REG(AFIO->MAPR, AFIO_MAPR_SWJ_CFG, AFIO_MAPR_SWJ_CFG_RESET);
SET_BIT(AFIO->MAPR, AFIO_MAPR_SWJ_CFG_RESET);
} }
/** /**
@ -1552,8 +1550,7 @@ __STATIC_INLINE void LL_GPIO_AF_EnableRemap_SWJ(void)
*/ */
__STATIC_INLINE void LL_GPIO_AF_Remap_SWJ_NONJTRST(void) __STATIC_INLINE void LL_GPIO_AF_Remap_SWJ_NONJTRST(void)
{ {
CLEAR_BIT(AFIO->MAPR,AFIO_MAPR_SWJ_CFG); MODIFY_REG(AFIO->MAPR, AFIO_MAPR_SWJ_CFG, AFIO_MAPR_SWJ_CFG_NOJNTRST);
SET_BIT(AFIO->MAPR, AFIO_MAPR_SWJ_CFG_NOJNTRST);
} }
/** /**
@ -1564,8 +1561,7 @@ __STATIC_INLINE void LL_GPIO_AF_Remap_SWJ_NONJTRST(void)
*/ */
__STATIC_INLINE void LL_GPIO_AF_Remap_SWJ_NOJTAG(void) __STATIC_INLINE void LL_GPIO_AF_Remap_SWJ_NOJTAG(void)
{ {
CLEAR_BIT(AFIO->MAPR,AFIO_MAPR_SWJ_CFG); MODIFY_REG(AFIO->MAPR, AFIO_MAPR_SWJ_CFG, AFIO_MAPR_SWJ_CFG_JTAGDISABLE);
SET_BIT(AFIO->MAPR, AFIO_MAPR_SWJ_CFG_JTAGDISABLE);
} }
/** /**
@ -1576,8 +1572,7 @@ __STATIC_INLINE void LL_GPIO_AF_Remap_SWJ_NOJTAG(void)
*/ */
__STATIC_INLINE void LL_GPIO_AF_DisableRemap_SWJ(void) __STATIC_INLINE void LL_GPIO_AF_DisableRemap_SWJ(void)
{ {
CLEAR_BIT(AFIO->MAPR,AFIO_MAPR_SWJ_CFG); MODIFY_REG(AFIO->MAPR, AFIO_MAPR_SWJ_CFG, AFIO_MAPR_SWJ_CFG_DISABLE);
SET_BIT(AFIO->MAPR, AFIO_MAPR_SWJ_CFG_DISABLE);
} }
#if defined(AFIO_MAPR_SPI3_REMAP) #if defined(AFIO_MAPR_SPI3_REMAP)
@ -1607,7 +1602,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_SPI3(void)
} }
/** /**
* @brief Check if SPI3 has been remaped or not * @brief Check if SPI3 has been remapped or not
* @rmtoll MAPR SPI3_REMAP LL_GPIO_AF_IsEnabledRemap_SPI3_REMAP * @rmtoll MAPR SPI3_REMAP LL_GPIO_AF_IsEnabledRemap_SPI3_REMAP
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1696,7 +1691,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM9(void)
} }
/** /**
* @brief Check if TIM9_CH1 and TIM9_CH2 have been remaped or not * @brief Check if TIM9_CH1 and TIM9_CH2 have been remapped or not
* @rmtoll MAPR2 TIM9_REMAP LL_GPIO_AF_IsEnabledRemap_TIM9 * @rmtoll MAPR2 TIM9_REMAP LL_GPIO_AF_IsEnabledRemap_TIM9
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1731,7 +1726,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM10(void)
} }
/** /**
* @brief Check if TIM10_CH1 has been remaped or not * @brief Check if TIM10_CH1 has been remapped or not
* @rmtoll MAPR2 TIM10_REMAP LL_GPIO_AF_IsEnabledRemap_TIM10 * @rmtoll MAPR2 TIM10_REMAP LL_GPIO_AF_IsEnabledRemap_TIM10
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1765,7 +1760,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM11(void)
} }
/** /**
* @brief Check if TIM11_CH1 has been remaped or not * @brief Check if TIM11_CH1 has been remapped or not
* @rmtoll MAPR2 TIM11_REMAP LL_GPIO_AF_IsEnabledRemap_TIM11 * @rmtoll MAPR2 TIM11_REMAP LL_GPIO_AF_IsEnabledRemap_TIM11
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1800,7 +1795,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM13(void)
} }
/** /**
* @brief Check if TIM13_CH1 has been remaped or not * @brief Check if TIM13_CH1 has been remapped or not
* @rmtoll MAPR2 TIM13_REMAP LL_GPIO_AF_IsEnabledRemap_TIM13 * @rmtoll MAPR2 TIM13_REMAP LL_GPIO_AF_IsEnabledRemap_TIM13
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1835,7 +1830,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM14(void)
} }
/** /**
* @brief Check if TIM14_CH1 has been remaped or not * @brief Check if TIM14_CH1 has been remapped or not
* @rmtoll MAPR2 TIM14_REMAP LL_GPIO_AF_IsEnabledRemap_TIM14 * @rmtoll MAPR2 TIM14_REMAP LL_GPIO_AF_IsEnabledRemap_TIM14
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1894,7 +1889,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM15(void)
} }
/** /**
* @brief Check if TIM15_CH1 has been remaped or not * @brief Check if TIM15_CH1 has been remapped or not
* @rmtoll MAPR2 TIM15_REMAP LL_GPIO_AF_IsEnabledRemap_TIM15 * @rmtoll MAPR2 TIM15_REMAP LL_GPIO_AF_IsEnabledRemap_TIM15
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1929,7 +1924,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM16(void)
} }
/** /**
* @brief Check if TIM16_CH1 has been remaped or not * @brief Check if TIM16_CH1 has been remapped or not
* @rmtoll MAPR2 TIM16_REMAP LL_GPIO_AF_IsEnabledRemap_TIM16 * @rmtoll MAPR2 TIM16_REMAP LL_GPIO_AF_IsEnabledRemap_TIM16
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1964,7 +1959,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM17(void)
} }
/** /**
* @brief Check if TIM17_CH1 has been remaped or not * @brief Check if TIM17_CH1 has been remapped or not
* @rmtoll MAPR2 TIM17_REMAP LL_GPIO_AF_IsEnabledRemap_TIM17 * @rmtoll MAPR2 TIM17_REMAP LL_GPIO_AF_IsEnabledRemap_TIM17
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -1999,7 +1994,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_CEC(void)
} }
/** /**
* @brief Check if CEC has been remaped or not * @brief Check if CEC has been remapped or not
* @rmtoll MAPR2 CEC_REMAP LL_GPIO_AF_IsEnabledRemap_CEC * @rmtoll MAPR2 CEC_REMAP LL_GPIO_AF_IsEnabledRemap_CEC
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -2034,7 +2029,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM1DMA(void)
} }
/** /**
* @brief Check if TIM1DMA has been remaped or not * @brief Check if TIM1DMA has been remapped or not
* @rmtoll MAPR2 TIM1_DMA_REMAP LL_GPIO_AF_IsEnabledRemap_TIM1DMA * @rmtoll MAPR2 TIM1_DMA_REMAP LL_GPIO_AF_IsEnabledRemap_TIM1DMA
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -2069,7 +2064,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM67DACDMA(void)
} }
/** /**
* @brief Check if TIM67DACDMA has been remaped or not * @brief Check if TIM67DACDMA has been remapped or not
* @rmtoll MAPR2 TIM76_DAC_DMA_REMAP LL_GPIO_AF_IsEnabledRemap_TIM67DACDMA * @rmtoll MAPR2 TIM76_DAC_DMA_REMAP LL_GPIO_AF_IsEnabledRemap_TIM67DACDMA
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -2106,7 +2101,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_TIM12(void)
} }
/** /**
* @brief Check if TIM12_CH1 has been remaped or not * @brief Check if TIM12_CH1 has been remapped or not
* @rmtoll MAPR2 TIM12_REMAP LL_GPIO_AF_IsEnabledRemap_TIM12 * @rmtoll MAPR2 TIM12_REMAP LL_GPIO_AF_IsEnabledRemap_TIM12
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -2151,7 +2146,7 @@ __STATIC_INLINE void LL_GPIO_AF_DisableRemap_MISC(void)
} }
/** /**
* @brief Check if MISC has been remaped or not * @brief Check if MISC has been remapped or not
* @rmtoll MAPR2 MISC_REMAP LL_GPIO_AF_IsEnabledRemap_MISC * @rmtoll MAPR2 MISC_REMAP LL_GPIO_AF_IsEnabledRemap_MISC
* @retval State of bit (1 or 0). * @retval State of bit (1 or 0).
*/ */
@ -2344,4 +2339,3 @@ void LL_GPIO_StructInit(LL_GPIO_InitTypeDef *GPIO_InitStruct);
#endif /* STM32F1xx_LL_GPIO_H */ #endif /* STM32F1xx_LL_GPIO_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -1,440 +1,437 @@
/** /**
****************************************************************************** ******************************************************************************
* @file stm32f1xx_ll_pwr.h * @file stm32f1xx_ll_pwr.h
* @author MCD Application Team * @author MCD Application Team
* @brief Header file of PWR LL module. * @brief Header file of PWR LL module.
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under BSD 3-Clause license, * This software is licensed under terms that can be found in the LICENSE file
* the "License"; You may not use this file except in compliance with the * in the root directory of this software component.
* License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* opensource.org/licenses/BSD-3-Clause *
* ******************************************************************************
****************************************************************************** */
*/
/* Define to prevent recursive inclusion -------------------------------------*/
/* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F1xx_LL_PWR_H
#ifndef __STM32F1xx_LL_PWR_H #define __STM32F1xx_LL_PWR_H
#define __STM32F1xx_LL_PWR_H
#ifdef __cplusplus
#ifdef __cplusplus extern "C" {
extern "C" { #endif
#endif
/* Includes ------------------------------------------------------------------*/
/* Includes ------------------------------------------------------------------*/ #include "stm32f1xx.h"
#include "stm32f1xx.h"
/** @addtogroup STM32F1xx_LL_Driver
/** @addtogroup STM32F1xx_LL_Driver * @{
* @{ */
*/
#if defined(PWR)
#if defined(PWR)
/** @defgroup PWR_LL PWR
/** @defgroup PWR_LL PWR * @{
* @{ */
*/
/* Private types -------------------------------------------------------------*/
/* Private types -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/ /* Private constants ---------------------------------------------------------*/
/* Private constants ---------------------------------------------------------*/ /* Private macros ------------------------------------------------------------*/
/* Private macros ------------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/ /** @defgroup PWR_LL_Exported_Constants PWR Exported Constants
/** @defgroup PWR_LL_Exported_Constants PWR Exported Constants * @{
* @{ */
*/
/** @defgroup PWR_LL_EC_CLEAR_FLAG Clear Flags Defines
/** @defgroup PWR_LL_EC_CLEAR_FLAG Clear Flags Defines * @brief Flags defines which can be used with LL_PWR_WriteReg function
* @brief Flags defines which can be used with LL_PWR_WriteReg function * @{
* @{ */
*/ #define LL_PWR_CR_CSBF PWR_CR_CSBF /*!< Clear standby flag */
#define LL_PWR_CR_CSBF PWR_CR_CSBF /*!< Clear standby flag */ #define LL_PWR_CR_CWUF PWR_CR_CWUF /*!< Clear wakeup flag */
#define LL_PWR_CR_CWUF PWR_CR_CWUF /*!< Clear wakeup flag */ /**
/** * @}
* @} */
*/
/** @defgroup PWR_LL_EC_GET_FLAG Get Flags Defines
/** @defgroup PWR_LL_EC_GET_FLAG Get Flags Defines * @brief Flags defines which can be used with LL_PWR_ReadReg function
* @brief Flags defines which can be used with LL_PWR_ReadReg function * @{
* @{ */
*/ #define LL_PWR_CSR_WUF PWR_CSR_WUF /*!< Wakeup flag */
#define LL_PWR_CSR_WUF PWR_CSR_WUF /*!< Wakeup flag */ #define LL_PWR_CSR_SBF PWR_CSR_SBF /*!< Standby flag */
#define LL_PWR_CSR_SBF PWR_CSR_SBF /*!< Standby flag */ #define LL_PWR_CSR_PVDO PWR_CSR_PVDO /*!< Power voltage detector output flag */
#define LL_PWR_CSR_PVDO PWR_CSR_PVDO /*!< Power voltage detector output flag */ #define LL_PWR_CSR_EWUP1 PWR_CSR_EWUP /*!< Enable WKUP pin 1 */
#define LL_PWR_CSR_EWUP1 PWR_CSR_EWUP /*!< Enable WKUP pin 1 */ /**
/** * @}
* @} */
*/
/** @defgroup PWR_LL_EC_MODE_PWR Mode Power
/** @defgroup PWR_LL_EC_MODE_PWR Mode Power * @{
* @{ */
*/ #define LL_PWR_MODE_STOP_MAINREGU 0x00000000U /*!< Enter Stop mode when the CPU enters deepsleep */
#define LL_PWR_MODE_STOP_MAINREGU 0x00000000U /*!< Enter Stop mode when the CPU enters deepsleep */ #define LL_PWR_MODE_STOP_LPREGU (PWR_CR_LPDS) /*!< Enter Stop mode (with low power Regulator ON) when the CPU enters deepsleep */
#define LL_PWR_MODE_STOP_LPREGU (PWR_CR_LPDS) /*!< Enter Stop mode (with low power Regulator ON) when the CPU enters deepsleep */ #define LL_PWR_MODE_STANDBY (PWR_CR_PDDS) /*!< Enter Standby mode when the CPU enters deepsleep */
#define LL_PWR_MODE_STANDBY (PWR_CR_PDDS) /*!< Enter Standby mode when the CPU enters deepsleep */ /**
/** * @}
* @} */
*/
/** @defgroup PWR_LL_EC_REGU_MODE_DS_MODE Regulator Mode In Deep Sleep Mode
/** @defgroup PWR_LL_EC_REGU_MODE_DS_MODE Regulator Mode In Deep Sleep Mode * @{
* @{ */
*/ #define LL_PWR_REGU_DSMODE_MAIN 0x00000000U /*!< Voltage Regulator in main mode during deepsleep mode */
#define LL_PWR_REGU_DSMODE_MAIN 0x00000000U /*!< Voltage Regulator in main mode during deepsleep mode */ #define LL_PWR_REGU_DSMODE_LOW_POWER (PWR_CR_LPDS) /*!< Voltage Regulator in low-power mode during deepsleep mode */
#define LL_PWR_REGU_DSMODE_LOW_POWER (PWR_CR_LPDS) /*!< Voltage Regulator in low-power mode during deepsleep mode */ /**
/** * @}
* @} */
*/
/** @defgroup PWR_LL_EC_PVDLEVEL Power Voltage Detector Level
/** @defgroup PWR_LL_EC_PVDLEVEL Power Voltage Detector Level * @{
* @{ */
*/ #define LL_PWR_PVDLEVEL_0 (PWR_CR_PLS_LEV0) /*!< Voltage threshold detected by PVD 2.2 V */
#define LL_PWR_PVDLEVEL_0 (PWR_CR_PLS_LEV0) /*!< Voltage threshold detected by PVD 2.2 V */ #define LL_PWR_PVDLEVEL_1 (PWR_CR_PLS_LEV1) /*!< Voltage threshold detected by PVD 2.3 V */
#define LL_PWR_PVDLEVEL_1 (PWR_CR_PLS_LEV1) /*!< Voltage threshold detected by PVD 2.3 V */ #define LL_PWR_PVDLEVEL_2 (PWR_CR_PLS_LEV2) /*!< Voltage threshold detected by PVD 2.4 V */
#define LL_PWR_PVDLEVEL_2 (PWR_CR_PLS_LEV2) /*!< Voltage threshold detected by PVD 2.4 V */ #define LL_PWR_PVDLEVEL_3 (PWR_CR_PLS_LEV3) /*!< Voltage threshold detected by PVD 2.5 V */
#define LL_PWR_PVDLEVEL_3 (PWR_CR_PLS_LEV3) /*!< Voltage threshold detected by PVD 2.5 V */ #define LL_PWR_PVDLEVEL_4 (PWR_CR_PLS_LEV4) /*!< Voltage threshold detected by PVD 2.6 V */
#define LL_PWR_PVDLEVEL_4 (PWR_CR_PLS_LEV4) /*!< Voltage threshold detected by PVD 2.6 V */ #define LL_PWR_PVDLEVEL_5 (PWR_CR_PLS_LEV5) /*!< Voltage threshold detected by PVD 2.7 V */
#define LL_PWR_PVDLEVEL_5 (PWR_CR_PLS_LEV5) /*!< Voltage threshold detected by PVD 2.7 V */ #define LL_PWR_PVDLEVEL_6 (PWR_CR_PLS_LEV6) /*!< Voltage threshold detected by PVD 2.8 V */
#define LL_PWR_PVDLEVEL_6 (PWR_CR_PLS_LEV6) /*!< Voltage threshold detected by PVD 2.8 V */ #define LL_PWR_PVDLEVEL_7 (PWR_CR_PLS_LEV7) /*!< Voltage threshold detected by PVD 2.9 V */
#define LL_PWR_PVDLEVEL_7 (PWR_CR_PLS_LEV7) /*!< Voltage threshold detected by PVD 2.9 V */ /**
/** * @}
* @} */
*/ /** @defgroup PWR_LL_EC_WAKEUP_PIN Wakeup Pins
/** @defgroup PWR_LL_EC_WAKEUP_PIN Wakeup Pins * @{
* @{ */
*/ #define LL_PWR_WAKEUP_PIN1 (PWR_CSR_EWUP) /*!< WKUP pin 1 : PA0 */
#define LL_PWR_WAKEUP_PIN1 (PWR_CSR_EWUP) /*!< WKUP pin 1 : PA0 */ /**
/** * @}
* @} */
*/
/**
/** * @}
* @} */
*/
/* Exported macro ------------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/ /** @defgroup PWR_LL_Exported_Macros PWR Exported Macros
/** @defgroup PWR_LL_Exported_Macros PWR Exported Macros * @{
* @{ */
*/
/** @defgroup PWR_LL_EM_WRITE_READ Common write and read registers Macros
/** @defgroup PWR_LL_EM_WRITE_READ Common write and read registers Macros * @{
* @{ */
*/
/**
/** * @brief Write a value in PWR register
* @brief Write a value in PWR register * @param __REG__ Register to be written
* @param __REG__ Register to be written * @param __VALUE__ Value to be written in the register
* @param __VALUE__ Value to be written in the register * @retval None
* @retval None */
*/ #define LL_PWR_WriteReg(__REG__, __VALUE__) WRITE_REG(PWR->__REG__, (__VALUE__))
#define LL_PWR_WriteReg(__REG__, __VALUE__) WRITE_REG(PWR->__REG__, (__VALUE__))
/**
/** * @brief Read a value in PWR register
* @brief Read a value in PWR register * @param __REG__ Register to be read
* @param __REG__ Register to be read * @retval Register value
* @retval Register value */
*/ #define LL_PWR_ReadReg(__REG__) READ_REG(PWR->__REG__)
#define LL_PWR_ReadReg(__REG__) READ_REG(PWR->__REG__) /**
/** * @}
* @} */
*/
/**
/** * @}
* @} */
*/
/* Exported functions --------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/ /** @defgroup PWR_LL_Exported_Functions PWR Exported Functions
/** @defgroup PWR_LL_Exported_Functions PWR Exported Functions * @{
* @{ */
*/
/** @defgroup PWR_LL_EF_Configuration Configuration
/** @defgroup PWR_LL_EF_Configuration Configuration * @{
* @{ */
*/
/**
/** * @brief Enable access to the backup domain
* @brief Enable access to the backup domain * @rmtoll CR DBP LL_PWR_EnableBkUpAccess
* @rmtoll CR DBP LL_PWR_EnableBkUpAccess * @retval None
* @retval None */
*/ __STATIC_INLINE void LL_PWR_EnableBkUpAccess(void)
__STATIC_INLINE void LL_PWR_EnableBkUpAccess(void) {
{ SET_BIT(PWR->CR, PWR_CR_DBP);
SET_BIT(PWR->CR, PWR_CR_DBP); }
}
/**
/** * @brief Disable access to the backup domain
* @brief Disable access to the backup domain * @rmtoll CR DBP LL_PWR_DisableBkUpAccess
* @rmtoll CR DBP LL_PWR_DisableBkUpAccess * @retval None
* @retval None */
*/ __STATIC_INLINE void LL_PWR_DisableBkUpAccess(void)
__STATIC_INLINE void LL_PWR_DisableBkUpAccess(void) {
{ CLEAR_BIT(PWR->CR, PWR_CR_DBP);
CLEAR_BIT(PWR->CR, PWR_CR_DBP); }
}
/**
/** * @brief Check if the backup domain is enabled
* @brief Check if the backup domain is enabled * @rmtoll CR DBP LL_PWR_IsEnabledBkUpAccess
* @rmtoll CR DBP LL_PWR_IsEnabledBkUpAccess * @retval State of bit (1 or 0).
* @retval State of bit (1 or 0). */
*/ __STATIC_INLINE uint32_t LL_PWR_IsEnabledBkUpAccess(void)
__STATIC_INLINE uint32_t LL_PWR_IsEnabledBkUpAccess(void) {
{ return (READ_BIT(PWR->CR, PWR_CR_DBP) == (PWR_CR_DBP));
return (READ_BIT(PWR->CR, PWR_CR_DBP) == (PWR_CR_DBP)); }
}
/**
/** * @brief Set voltage Regulator mode during deep sleep mode
* @brief Set voltage Regulator mode during deep sleep mode * @rmtoll CR LPDS LL_PWR_SetRegulModeDS
* @rmtoll CR LPDS LL_PWR_SetRegulModeDS * @param RegulMode This parameter can be one of the following values:
* @param RegulMode This parameter can be one of the following values: * @arg @ref LL_PWR_REGU_DSMODE_MAIN
* @arg @ref LL_PWR_REGU_DSMODE_MAIN * @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER
* @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER * @retval None
* @retval None */
*/ __STATIC_INLINE void LL_PWR_SetRegulModeDS(uint32_t RegulMode)
__STATIC_INLINE void LL_PWR_SetRegulModeDS(uint32_t RegulMode) {
{ MODIFY_REG(PWR->CR, PWR_CR_LPDS, RegulMode);
MODIFY_REG(PWR->CR, PWR_CR_LPDS, RegulMode); }
}
/**
/** * @brief Get voltage Regulator mode during deep sleep mode
* @brief Get voltage Regulator mode during deep sleep mode * @rmtoll CR LPDS LL_PWR_GetRegulModeDS
* @rmtoll CR LPDS LL_PWR_GetRegulModeDS * @retval Returned value can be one of the following values:
* @retval Returned value can be one of the following values: * @arg @ref LL_PWR_REGU_DSMODE_MAIN
* @arg @ref LL_PWR_REGU_DSMODE_MAIN * @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER
* @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER */
*/ __STATIC_INLINE uint32_t LL_PWR_GetRegulModeDS(void)
__STATIC_INLINE uint32_t LL_PWR_GetRegulModeDS(void) {
{ return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_LPDS));
return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_LPDS)); }
}
/**
/** * @brief Set Power Down mode when CPU enters deepsleep
* @brief Set Power Down mode when CPU enters deepsleep * @rmtoll CR PDDS LL_PWR_SetPowerMode\n
* @rmtoll CR PDDS LL_PWR_SetPowerMode\n * @rmtoll CR LPDS LL_PWR_SetPowerMode
* @rmtoll CR LPDS LL_PWR_SetPowerMode * @param PDMode This parameter can be one of the following values:
* @param PDMode This parameter can be one of the following values: * @arg @ref LL_PWR_MODE_STOP_MAINREGU
* @arg @ref LL_PWR_MODE_STOP_MAINREGU * @arg @ref LL_PWR_MODE_STOP_LPREGU
* @arg @ref LL_PWR_MODE_STOP_LPREGU * @arg @ref LL_PWR_MODE_STANDBY
* @arg @ref LL_PWR_MODE_STANDBY * @retval None
* @retval None */
*/ __STATIC_INLINE void LL_PWR_SetPowerMode(uint32_t PDMode)
__STATIC_INLINE void LL_PWR_SetPowerMode(uint32_t PDMode) {
{ MODIFY_REG(PWR->CR, (PWR_CR_PDDS| PWR_CR_LPDS), PDMode);
MODIFY_REG(PWR->CR, (PWR_CR_PDDS| PWR_CR_LPDS), PDMode); }
}
/**
/** * @brief Get Power Down mode when CPU enters deepsleep
* @brief Get Power Down mode when CPU enters deepsleep * @rmtoll CR PDDS LL_PWR_GetPowerMode\n
* @rmtoll CR PDDS LL_PWR_GetPowerMode\n * @rmtoll CR LPDS LL_PWR_GetPowerMode
* @rmtoll CR LPDS LL_PWR_GetPowerMode * @retval Returned value can be one of the following values:
* @retval Returned value can be one of the following values: * @arg @ref LL_PWR_MODE_STOP_MAINREGU
* @arg @ref LL_PWR_MODE_STOP_MAINREGU * @arg @ref LL_PWR_MODE_STOP_LPREGU
* @arg @ref LL_PWR_MODE_STOP_LPREGU * @arg @ref LL_PWR_MODE_STANDBY
* @arg @ref LL_PWR_MODE_STANDBY */
*/ __STATIC_INLINE uint32_t LL_PWR_GetPowerMode(void)
__STATIC_INLINE uint32_t LL_PWR_GetPowerMode(void) {
{ return (uint32_t)(READ_BIT(PWR->CR, (PWR_CR_PDDS| PWR_CR_LPDS)));
return (uint32_t)(READ_BIT(PWR->CR, (PWR_CR_PDDS| PWR_CR_LPDS))); }
}
/**
/** * @brief Configure the voltage threshold detected by the Power Voltage Detector
* @brief Configure the voltage threshold detected by the Power Voltage Detector * @rmtoll CR PLS LL_PWR_SetPVDLevel
* @rmtoll CR PLS LL_PWR_SetPVDLevel * @param PVDLevel This parameter can be one of the following values:
* @param PVDLevel This parameter can be one of the following values: * @arg @ref LL_PWR_PVDLEVEL_0
* @arg @ref LL_PWR_PVDLEVEL_0 * @arg @ref LL_PWR_PVDLEVEL_1
* @arg @ref LL_PWR_PVDLEVEL_1 * @arg @ref LL_PWR_PVDLEVEL_2
* @arg @ref LL_PWR_PVDLEVEL_2 * @arg @ref LL_PWR_PVDLEVEL_3
* @arg @ref LL_PWR_PVDLEVEL_3 * @arg @ref LL_PWR_PVDLEVEL_4
* @arg @ref LL_PWR_PVDLEVEL_4 * @arg @ref LL_PWR_PVDLEVEL_5
* @arg @ref LL_PWR_PVDLEVEL_5 * @arg @ref LL_PWR_PVDLEVEL_6
* @arg @ref LL_PWR_PVDLEVEL_6 * @arg @ref LL_PWR_PVDLEVEL_7
* @arg @ref LL_PWR_PVDLEVEL_7 * @retval None
* @retval None */
*/ __STATIC_INLINE void LL_PWR_SetPVDLevel(uint32_t PVDLevel)
__STATIC_INLINE void LL_PWR_SetPVDLevel(uint32_t PVDLevel) {
{ MODIFY_REG(PWR->CR, PWR_CR_PLS, PVDLevel);
MODIFY_REG(PWR->CR, PWR_CR_PLS, PVDLevel); }
}
/**
/** * @brief Get the voltage threshold detection
* @brief Get the voltage threshold detection * @rmtoll CR PLS LL_PWR_GetPVDLevel
* @rmtoll CR PLS LL_PWR_GetPVDLevel * @retval Returned value can be one of the following values:
* @retval Returned value can be one of the following values: * @arg @ref LL_PWR_PVDLEVEL_0
* @arg @ref LL_PWR_PVDLEVEL_0 * @arg @ref LL_PWR_PVDLEVEL_1
* @arg @ref LL_PWR_PVDLEVEL_1 * @arg @ref LL_PWR_PVDLEVEL_2
* @arg @ref LL_PWR_PVDLEVEL_2 * @arg @ref LL_PWR_PVDLEVEL_3
* @arg @ref LL_PWR_PVDLEVEL_3 * @arg @ref LL_PWR_PVDLEVEL_4
* @arg @ref LL_PWR_PVDLEVEL_4 * @arg @ref LL_PWR_PVDLEVEL_5
* @arg @ref LL_PWR_PVDLEVEL_5 * @arg @ref LL_PWR_PVDLEVEL_6
* @arg @ref LL_PWR_PVDLEVEL_6 * @arg @ref LL_PWR_PVDLEVEL_7
* @arg @ref LL_PWR_PVDLEVEL_7 */
*/ __STATIC_INLINE uint32_t LL_PWR_GetPVDLevel(void)
__STATIC_INLINE uint32_t LL_PWR_GetPVDLevel(void) {
{ return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_PLS));
return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_PLS)); }
}
/**
/** * @brief Enable Power Voltage Detector
* @brief Enable Power Voltage Detector * @rmtoll CR PVDE LL_PWR_EnablePVD
* @rmtoll CR PVDE LL_PWR_EnablePVD * @retval None
* @retval None */
*/ __STATIC_INLINE void LL_PWR_EnablePVD(void)
__STATIC_INLINE void LL_PWR_EnablePVD(void) {
{ SET_BIT(PWR->CR, PWR_CR_PVDE);
SET_BIT(PWR->CR, PWR_CR_PVDE); }
}
/**
/** * @brief Disable Power Voltage Detector
* @brief Disable Power Voltage Detector * @rmtoll CR PVDE LL_PWR_DisablePVD
* @rmtoll CR PVDE LL_PWR_DisablePVD * @retval None
* @retval None */
*/ __STATIC_INLINE void LL_PWR_DisablePVD(void)
__STATIC_INLINE void LL_PWR_DisablePVD(void) {
{ CLEAR_BIT(PWR->CR, PWR_CR_PVDE);
CLEAR_BIT(PWR->CR, PWR_CR_PVDE); }
}
/**
/** * @brief Check if Power Voltage Detector is enabled
* @brief Check if Power Voltage Detector is enabled * @rmtoll CR PVDE LL_PWR_IsEnabledPVD
* @rmtoll CR PVDE LL_PWR_IsEnabledPVD * @retval State of bit (1 or 0).
* @retval State of bit (1 or 0). */
*/ __STATIC_INLINE uint32_t LL_PWR_IsEnabledPVD(void)
__STATIC_INLINE uint32_t LL_PWR_IsEnabledPVD(void) {
{ return (READ_BIT(PWR->CR, PWR_CR_PVDE) == (PWR_CR_PVDE));
return (READ_BIT(PWR->CR, PWR_CR_PVDE) == (PWR_CR_PVDE)); }
}
/**
/** * @brief Enable the WakeUp PINx functionality
* @brief Enable the WakeUp PINx functionality * @rmtoll CSR EWUP LL_PWR_EnableWakeUpPin
* @rmtoll CSR EWUP LL_PWR_EnableWakeUpPin * @param WakeUpPin This parameter can be one of the following values:
* @param WakeUpPin This parameter can be one of the following values: * @arg @ref LL_PWR_WAKEUP_PIN1
* @arg @ref LL_PWR_WAKEUP_PIN1 * @retval None
* @retval None */
*/ __STATIC_INLINE void LL_PWR_EnableWakeUpPin(uint32_t WakeUpPin)
__STATIC_INLINE void LL_PWR_EnableWakeUpPin(uint32_t WakeUpPin) {
{ SET_BIT(PWR->CSR, WakeUpPin);
SET_BIT(PWR->CSR, WakeUpPin); }
}
/**
/** * @brief Disable the WakeUp PINx functionality
* @brief Disable the WakeUp PINx functionality * @rmtoll CSR EWUP LL_PWR_DisableWakeUpPin
* @rmtoll CSR EWUP LL_PWR_DisableWakeUpPin * @param WakeUpPin This parameter can be one of the following values:
* @param WakeUpPin This parameter can be one of the following values: * @arg @ref LL_PWR_WAKEUP_PIN1
* @arg @ref LL_PWR_WAKEUP_PIN1 * @retval None
* @retval None */
*/ __STATIC_INLINE void LL_PWR_DisableWakeUpPin(uint32_t WakeUpPin)
__STATIC_INLINE void LL_PWR_DisableWakeUpPin(uint32_t WakeUpPin) {
{ CLEAR_BIT(PWR->CSR, WakeUpPin);
CLEAR_BIT(PWR->CSR, WakeUpPin); }
}
/**
/** * @brief Check if the WakeUp PINx functionality is enabled
* @brief Check if the WakeUp PINx functionality is enabled * @rmtoll CSR EWUP LL_PWR_IsEnabledWakeUpPin
* @rmtoll CSR EWUP LL_PWR_IsEnabledWakeUpPin * @param WakeUpPin This parameter can be one of the following values:
* @param WakeUpPin This parameter can be one of the following values: * @arg @ref LL_PWR_WAKEUP_PIN1
* @arg @ref LL_PWR_WAKEUP_PIN1 * @retval State of bit (1 or 0).
* @retval State of bit (1 or 0). */
*/ __STATIC_INLINE uint32_t LL_PWR_IsEnabledWakeUpPin(uint32_t WakeUpPin)
__STATIC_INLINE uint32_t LL_PWR_IsEnabledWakeUpPin(uint32_t WakeUpPin) {
{ return (READ_BIT(PWR->CSR, WakeUpPin) == (WakeUpPin));
return (READ_BIT(PWR->CSR, WakeUpPin) == (WakeUpPin)); }
}
/**
/** * @}
* @} */
*/
/** @defgroup PWR_LL_EF_FLAG_Management FLAG_Management
/** @defgroup PWR_LL_EF_FLAG_Management FLAG_Management * @{
* @{ */
*/
/**
/** * @brief Get Wake-up Flag
* @brief Get Wake-up Flag * @rmtoll CSR WUF LL_PWR_IsActiveFlag_WU
* @rmtoll CSR WUF LL_PWR_IsActiveFlag_WU * @retval State of bit (1 or 0).
* @retval State of bit (1 or 0). */
*/ __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU(void)
__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU(void) {
{ return (READ_BIT(PWR->CSR, PWR_CSR_WUF) == (PWR_CSR_WUF));
return (READ_BIT(PWR->CSR, PWR_CSR_WUF) == (PWR_CSR_WUF)); }
}
/**
/** * @brief Get Standby Flag
* @brief Get Standby Flag * @rmtoll CSR SBF LL_PWR_IsActiveFlag_SB
* @rmtoll CSR SBF LL_PWR_IsActiveFlag_SB * @retval State of bit (1 or 0).
* @retval State of bit (1 or 0). */
*/ __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_SB(void)
__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_SB(void) {
{ return (READ_BIT(PWR->CSR, PWR_CSR_SBF) == (PWR_CSR_SBF));
return (READ_BIT(PWR->CSR, PWR_CSR_SBF) == (PWR_CSR_SBF)); }
}
/**
/** * @brief Indicate whether VDD voltage is below the selected PVD threshold
* @brief Indicate whether VDD voltage is below the selected PVD threshold * @rmtoll CSR PVDO LL_PWR_IsActiveFlag_PVDO
* @rmtoll CSR PVDO LL_PWR_IsActiveFlag_PVDO * @retval State of bit (1 or 0).
* @retval State of bit (1 or 0). */
*/ __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_PVDO(void)
__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_PVDO(void) {
{ return (READ_BIT(PWR->CSR, PWR_CSR_PVDO) == (PWR_CSR_PVDO));
return (READ_BIT(PWR->CSR, PWR_CSR_PVDO) == (PWR_CSR_PVDO)); }
}
/**
/** * @brief Clear Standby Flag
* @brief Clear Standby Flag * @rmtoll CR CSBF LL_PWR_ClearFlag_SB
* @rmtoll CR CSBF LL_PWR_ClearFlag_SB * @retval None
* @retval None */
*/ __STATIC_INLINE void LL_PWR_ClearFlag_SB(void)
__STATIC_INLINE void LL_PWR_ClearFlag_SB(void) {
{ SET_BIT(PWR->CR, PWR_CR_CSBF);
SET_BIT(PWR->CR, PWR_CR_CSBF); }
}
/**
/** * @brief Clear Wake-up Flags
* @brief Clear Wake-up Flags * @rmtoll CR CWUF LL_PWR_ClearFlag_WU
* @rmtoll CR CWUF LL_PWR_ClearFlag_WU * @retval None
* @retval None */
*/ __STATIC_INLINE void LL_PWR_ClearFlag_WU(void)
__STATIC_INLINE void LL_PWR_ClearFlag_WU(void) {
{ SET_BIT(PWR->CR, PWR_CR_CWUF);
SET_BIT(PWR->CR, PWR_CR_CWUF); }
}
/**
/** * @}
* @} */
*/
#if defined(USE_FULL_LL_DRIVER)
#if defined(USE_FULL_LL_DRIVER) /** @defgroup PWR_LL_EF_Init De-initialization function
/** @defgroup PWR_LL_EF_Init De-initialization function * @{
* @{ */
*/ ErrorStatus LL_PWR_DeInit(void);
ErrorStatus LL_PWR_DeInit(void); /**
/** * @}
* @} */
*/ #endif /* USE_FULL_LL_DRIVER */
#endif /* USE_FULL_LL_DRIVER */
/**
/** * @}
* @} */
*/
/**
/** * @}
* @} */
*/
#endif /* defined(PWR) */
#endif /* defined(PWR) */
/**
/** * @}
* @} */
*/
#ifdef __cplusplus
#ifdef __cplusplus }
} #endif
#endif
#endif /* __STM32F1xx_LL_PWR_H */
#endif /* __STM32F1xx_LL_PWR_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,269 +1,270 @@
/** /**
****************************************************************************** ******************************************************************************
* @file stm32f1xx_ll_utils.h * @file stm32f1xx_ll_utils.h
* @author MCD Application Team * @author MCD Application Team
* @brief Header file of UTILS LL module. * @brief Header file of UTILS LL module.
@verbatim ******************************************************************************
============================================================================== * @attention
##### How to use this driver ##### *
============================================================================== * Copyright (c) 2016 STMicroelectronics.
[..] * All rights reserved.
The LL UTILS driver contains a set of generic APIs that can be *
used by user: * This software is licensed under terms that can be found in the LICENSE file
(+) Device electronic signature * in the root directory of this software component.
(+) Timing functions * If no LICENSE file comes with this software, it is provided AS-IS.
(+) PLL configuration functions *
******************************************************************************
@endverbatim @verbatim
****************************************************************************** ==============================================================================
* @attention ##### How to use this driver #####
* ==============================================================================
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. [..]
* All rights reserved.</center></h2> The LL UTILS driver contains a set of generic APIs that can be
* used by user:
* This software component is licensed by ST under BSD 3-Clause license, (+) Device electronic signature
* the "License"; You may not use this file except in compliance with the (+) Timing functions
* License. You may obtain a copy of the License at: (+) PLL configuration functions
* opensource.org/licenses/BSD-3-Clause
* @endverbatim
****************************************************************************** ******************************************************************************
*/ */
/* Define to prevent recursive inclusion -------------------------------------*/ /* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F1xx_LL_UTILS_H #ifndef __STM32F1xx_LL_UTILS_H
#define __STM32F1xx_LL_UTILS_H #define __STM32F1xx_LL_UTILS_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "stm32f1xx.h" #include "stm32f1xx.h"
/** @addtogroup STM32F1xx_LL_Driver /** @addtogroup STM32F1xx_LL_Driver
* @{ * @{
*/ */
/** @defgroup UTILS_LL UTILS /** @defgroup UTILS_LL UTILS
* @{ * @{
*/ */
/* Private types -------------------------------------------------------------*/ /* Private types -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/
/* Private constants ---------------------------------------------------------*/ /* Private constants ---------------------------------------------------------*/
/** @defgroup UTILS_LL_Private_Constants UTILS Private Constants /** @defgroup UTILS_LL_Private_Constants UTILS Private Constants
* @{ * @{
*/ */
/* Max delay can be used in LL_mDelay */ /* Max delay can be used in LL_mDelay */
#define LL_MAX_DELAY 0xFFFFFFFFU #define LL_MAX_DELAY 0xFFFFFFFFU
/** /**
* @brief Unique device ID register base address * @brief Unique device ID register base address
*/ */
#define UID_BASE_ADDRESS UID_BASE #define UID_BASE_ADDRESS UID_BASE
/** /**
* @brief Flash size data register base address * @brief Flash size data register base address
*/ */
#define FLASHSIZE_BASE_ADDRESS FLASHSIZE_BASE #define FLASHSIZE_BASE_ADDRESS FLASHSIZE_BASE
/** /**
* @} * @}
*/ */
/* Private macros ------------------------------------------------------------*/ /* Private macros ------------------------------------------------------------*/
/** @defgroup UTILS_LL_Private_Macros UTILS Private Macros /** @defgroup UTILS_LL_Private_Macros UTILS Private Macros
* @{ * @{
*/ */
/** /**
* @} * @}
*/ */
/* Exported types ------------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/
/** @defgroup UTILS_LL_ES_INIT UTILS Exported structures /** @defgroup UTILS_LL_ES_INIT UTILS Exported structures
* @{ * @{
*/ */
/** /**
* @brief UTILS PLL structure definition * @brief UTILS PLL structure definition
*/ */
typedef struct typedef struct
{ {
uint32_t PLLMul; /*!< Multiplication factor for PLL VCO input clock. uint32_t PLLMul; /*!< Multiplication factor for PLL VCO input clock.
This parameter can be a value of @ref RCC_LL_EC_PLL_MUL This parameter can be a value of @ref RCC_LL_EC_PLL_MUL
This feature can be modified afterwards using unitary function This feature can be modified afterwards using unitary function
@ref LL_RCC_PLL_ConfigDomain_SYS(). */ @ref LL_RCC_PLL_ConfigDomain_SYS(). */
uint32_t Prediv; /*!< Division factor for HSE used as PLL clock source. uint32_t Prediv; /*!< Division factor for HSE used as PLL clock source.
This parameter can be a value of @ref RCC_LL_EC_PREDIV_DIV This parameter can be a value of @ref RCC_LL_EC_PREDIV_DIV
This feature can be modified afterwards using unitary function This feature can be modified afterwards using unitary function
@ref LL_RCC_PLL_ConfigDomain_SYS(). */ @ref LL_RCC_PLL_ConfigDomain_SYS(). */
} LL_UTILS_PLLInitTypeDef; } LL_UTILS_PLLInitTypeDef;
/** /**
* @brief UTILS System, AHB and APB buses clock configuration structure definition * @brief UTILS System, AHB and APB buses clock configuration structure definition
*/ */
typedef struct typedef struct
{ {
uint32_t AHBCLKDivider; /*!< The AHB clock (HCLK) divider. This clock is derived from the system clock (SYSCLK). uint32_t AHBCLKDivider; /*!< The AHB clock (HCLK) divider. This clock is derived from the system clock (SYSCLK).
This parameter can be a value of @ref RCC_LL_EC_SYSCLK_DIV This parameter can be a value of @ref RCC_LL_EC_SYSCLK_DIV
This feature can be modified afterwards using unitary function This feature can be modified afterwards using unitary function
@ref LL_RCC_SetAHBPrescaler(). */ @ref LL_RCC_SetAHBPrescaler(). */
uint32_t APB1CLKDivider; /*!< The APB1 clock (PCLK1) divider. This clock is derived from the AHB clock (HCLK). uint32_t APB1CLKDivider; /*!< The APB1 clock (PCLK1) divider. This clock is derived from the AHB clock (HCLK).
This parameter can be a value of @ref RCC_LL_EC_APB1_DIV This parameter can be a value of @ref RCC_LL_EC_APB1_DIV
This feature can be modified afterwards using unitary function This feature can be modified afterwards using unitary function
@ref LL_RCC_SetAPB1Prescaler(). */ @ref LL_RCC_SetAPB1Prescaler(). */
uint32_t APB2CLKDivider; /*!< The APB2 clock (PCLK2) divider. This clock is derived from the AHB clock (HCLK). uint32_t APB2CLKDivider; /*!< The APB2 clock (PCLK2) divider. This clock is derived from the AHB clock (HCLK).
This parameter can be a value of @ref RCC_LL_EC_APB2_DIV This parameter can be a value of @ref RCC_LL_EC_APB2_DIV
This feature can be modified afterwards using unitary function This feature can be modified afterwards using unitary function
@ref LL_RCC_SetAPB2Prescaler(). */ @ref LL_RCC_SetAPB2Prescaler(). */
} LL_UTILS_ClkInitTypeDef; } LL_UTILS_ClkInitTypeDef;
/** /**
* @} * @}
*/ */
/* Exported constants --------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/
/** @defgroup UTILS_LL_Exported_Constants UTILS Exported Constants /** @defgroup UTILS_LL_Exported_Constants UTILS Exported Constants
* @{ * @{
*/ */
/** @defgroup UTILS_EC_HSE_BYPASS HSE Bypass activation /** @defgroup UTILS_EC_HSE_BYPASS HSE Bypass activation
* @{ * @{
*/ */
#define LL_UTILS_HSEBYPASS_OFF 0x00000000U /*!< HSE Bypass is not enabled */ #define LL_UTILS_HSEBYPASS_OFF 0x00000000U /*!< HSE Bypass is not enabled */
#define LL_UTILS_HSEBYPASS_ON 0x00000001U /*!< HSE Bypass is enabled */ #define LL_UTILS_HSEBYPASS_ON 0x00000001U /*!< HSE Bypass is enabled */
/** /**
* @} * @}
*/ */
/** /**
* @} * @}
*/ */
/* Exported macro ------------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/ /* Exported functions --------------------------------------------------------*/
/** @defgroup UTILS_LL_Exported_Functions UTILS Exported Functions /** @defgroup UTILS_LL_Exported_Functions UTILS Exported Functions
* @{ * @{
*/ */
/** @defgroup UTILS_EF_DEVICE_ELECTRONIC_SIGNATURE DEVICE ELECTRONIC SIGNATURE /** @defgroup UTILS_EF_DEVICE_ELECTRONIC_SIGNATURE DEVICE ELECTRONIC SIGNATURE
* @{ * @{
*/ */
/** /**
* @brief Get Word0 of the unique device identifier (UID based on 96 bits) * @brief Get Word0 of the unique device identifier (UID based on 96 bits)
* @retval UID[31:0] * @retval UID[31:0]
*/ */
__STATIC_INLINE uint32_t LL_GetUID_Word0(void) __STATIC_INLINE uint32_t LL_GetUID_Word0(void)
{ {
return (uint32_t)(READ_REG(*((uint32_t *)UID_BASE_ADDRESS))); return (uint32_t)(READ_REG(*((uint32_t *)UID_BASE_ADDRESS)));
} }
/** /**
* @brief Get Word1 of the unique device identifier (UID based on 96 bits) * @brief Get Word1 of the unique device identifier (UID based on 96 bits)
* @retval UID[63:32] * @retval UID[63:32]
*/ */
__STATIC_INLINE uint32_t LL_GetUID_Word1(void) __STATIC_INLINE uint32_t LL_GetUID_Word1(void)
{ {
return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 4U)))); return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 4U))));
} }
/** /**
* @brief Get Word2 of the unique device identifier (UID based on 96 bits) * @brief Get Word2 of the unique device identifier (UID based on 96 bits)
* @retval UID[95:64] * @retval UID[95:64]
*/ */
__STATIC_INLINE uint32_t LL_GetUID_Word2(void) __STATIC_INLINE uint32_t LL_GetUID_Word2(void)
{ {
return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 8U)))); return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 8U))));
} }
/** /**
* @brief Get Flash memory size * @brief Get Flash memory size
* @note This bitfield indicates the size of the device Flash memory expressed in * @note This bitfield indicates the size of the device Flash memory expressed in
* Kbytes. As an example, 0x040 corresponds to 64 Kbytes. * Kbytes. As an example, 0x040 corresponds to 64 Kbytes.
* @retval FLASH_SIZE[15:0]: Flash memory size * @retval FLASH_SIZE[15:0]: Flash memory size
*/ */
__STATIC_INLINE uint32_t LL_GetFlashSize(void) __STATIC_INLINE uint32_t LL_GetFlashSize(void)
{ {
return (uint16_t)(READ_REG(*((uint32_t *)FLASHSIZE_BASE_ADDRESS))); return (uint16_t)(READ_REG(*((uint32_t *)FLASHSIZE_BASE_ADDRESS)));
} }
/** /**
* @} * @}
*/ */
/** @defgroup UTILS_LL_EF_DELAY DELAY /** @defgroup UTILS_LL_EF_DELAY DELAY
* @{ * @{
*/ */
/** /**
* @brief This function configures the Cortex-M SysTick source of the time base. * @brief This function configures the Cortex-M SysTick source of the time base.
* @param HCLKFrequency HCLK frequency in Hz (can be calculated thanks to RCC helper macro) * @param HCLKFrequency HCLK frequency in Hz (can be calculated thanks to RCC helper macro)
* @note When a RTOS is used, it is recommended to avoid changing the SysTick * @note When a RTOS is used, it is recommended to avoid changing the SysTick
* configuration by calling this function, for a delay use rather osDelay RTOS service. * configuration by calling this function, for a delay use rather osDelay RTOS service.
* @param Ticks Number of ticks * @param Ticks Frequency of Ticks (Hz)
* @retval None * @retval None
*/ */
__STATIC_INLINE void LL_InitTick(uint32_t HCLKFrequency, uint32_t Ticks) __STATIC_INLINE void LL_InitTick(uint32_t HCLKFrequency, uint32_t Ticks)
{ {
/* Configure the SysTick to have interrupt in 1ms time base */ /* Configure the SysTick to have interrupt in 1ms time base */
SysTick->LOAD = (uint32_t)((HCLKFrequency / Ticks) - 1UL); /* set reload register */ SysTick->LOAD = (uint32_t)((HCLKFrequency / Ticks) - 1UL); /* set reload register */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
SysTick_CTRL_ENABLE_Msk; /* Enable the Systick Timer */ SysTick_CTRL_ENABLE_Msk; /* Enable the Systick Timer */
} }
void LL_Init1msTick(uint32_t HCLKFrequency); void LL_Init1msTick(uint32_t HCLKFrequency);
void LL_mDelay(uint32_t Delay); void LL_mDelay(uint32_t Delay);
/** /**
* @} * @}
*/ */
/** @defgroup UTILS_EF_SYSTEM SYSTEM /** @defgroup UTILS_EF_SYSTEM SYSTEM
* @{ * @{
*/ */
void LL_SetSystemCoreClock(uint32_t HCLKFrequency); void LL_SetSystemCoreClock(uint32_t HCLKFrequency);
#if defined(FLASH_ACR_LATENCY) #if defined(FLASH_ACR_LATENCY)
ErrorStatus LL_SetFlashLatency(uint32_t Frequency); ErrorStatus LL_SetFlashLatency(uint32_t Frequency);
#endif /* FLASH_ACR_LATENCY */ #endif /* FLASH_ACR_LATENCY */
ErrorStatus LL_PLL_ConfigSystemClock_HSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct, ErrorStatus LL_PLL_ConfigSystemClock_HSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct,
LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct); LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct);
ErrorStatus LL_PLL_ConfigSystemClock_HSE(uint32_t HSEFrequency, uint32_t HSEBypass, ErrorStatus LL_PLL_ConfigSystemClock_HSE(uint32_t HSEFrequency, uint32_t HSEBypass,
LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct); LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct);
#if defined(RCC_PLL2_SUPPORT)
/** ErrorStatus LL_PLL_ConfigSystemClock_PLL2(uint32_t HSEFrequency, uint32_t HSEBypass, LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct,
* @} LL_UTILS_PLLInitTypeDef *UTILS_PLL2InitStruct, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct);
*/ #endif /* RCC_PLL2_SUPPORT */
/**
/** * @}
* @} */
*/
/**
/** * @}
* @} */
*/
/**
/** * @}
* @} */
*/
/**
#ifdef __cplusplus * @}
} */
#endif
#ifdef __cplusplus
#endif /* __STM32F1xx_LL_UTILS_H */ }
#endif
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#endif /* __STM32F1xx_LL_UTILS_H */

View file

@ -0,0 +1,6 @@
This software component is provided to you as part of a software package and
applicable license terms are in the Package_license file. If you received this
software component outside of a package or without applicable license terms,
the terms of the BSD-3-Clause license shall apply.
You may obtain a copy of the BSD-3-Clause at:
https://opensource.org/licenses/BSD-3-Clause

View file

@ -1,314 +1,312 @@
/** /**
****************************************************************************** ******************************************************************************
* @file stm32f1xx_ll_dma.c * @file stm32f1xx_ll_dma.c
* @author MCD Application Team * @author MCD Application Team
* @brief DMA LL module driver. * @brief DMA LL module driver.
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under BSD 3-Clause license, * This software is licensed under terms that can be found in the LICENSE file in
* the "License"; You may not use this file except in compliance with the * the root directory of this software component.
* License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* opensource.org/licenses/BSD-3-Clause *
* ******************************************************************************
****************************************************************************** */
*/
#if defined(USE_FULL_LL_DRIVER)
#if defined(USE_FULL_LL_DRIVER)
/* Includes ------------------------------------------------------------------*/
/* Includes ------------------------------------------------------------------*/ #include "stm32f1xx_ll_dma.h"
#include "stm32f1xx_ll_dma.h" #include "stm32f1xx_ll_bus.h"
#include "stm32f1xx_ll_bus.h" #ifdef USE_FULL_ASSERT
#ifdef USE_FULL_ASSERT #include "stm32_assert.h"
#include "stm32_assert.h" #else
#else #define assert_param(expr) ((void)0U)
#define assert_param(expr) ((void)0U) #endif
#endif
/** @addtogroup STM32F1xx_LL_Driver
/** @addtogroup STM32F1xx_LL_Driver * @{
* @{ */
*/
#if defined (DMA1) || defined (DMA2)
#if defined (DMA1) || defined (DMA2)
/** @defgroup DMA_LL DMA
/** @defgroup DMA_LL DMA * @{
* @{ */
*/
/* Private types -------------------------------------------------------------*/
/* Private types -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/ /* Private constants ---------------------------------------------------------*/
/* Private constants ---------------------------------------------------------*/ /* Private macros ------------------------------------------------------------*/
/* Private macros ------------------------------------------------------------*/ /** @addtogroup DMA_LL_Private_Macros
/** @addtogroup DMA_LL_Private_Macros * @{
* @{ */
*/ #define IS_LL_DMA_DIRECTION(__VALUE__) (((__VALUE__) == LL_DMA_DIRECTION_PERIPH_TO_MEMORY) || \
#define IS_LL_DMA_DIRECTION(__VALUE__) (((__VALUE__) == LL_DMA_DIRECTION_PERIPH_TO_MEMORY) || \ ((__VALUE__) == LL_DMA_DIRECTION_MEMORY_TO_PERIPH) || \
((__VALUE__) == LL_DMA_DIRECTION_MEMORY_TO_PERIPH) || \ ((__VALUE__) == LL_DMA_DIRECTION_MEMORY_TO_MEMORY))
((__VALUE__) == LL_DMA_DIRECTION_MEMORY_TO_MEMORY))
#define IS_LL_DMA_MODE(__VALUE__) (((__VALUE__) == LL_DMA_MODE_NORMAL) || \
#define IS_LL_DMA_MODE(__VALUE__) (((__VALUE__) == LL_DMA_MODE_NORMAL) || \ ((__VALUE__) == LL_DMA_MODE_CIRCULAR))
((__VALUE__) == LL_DMA_MODE_CIRCULAR))
#define IS_LL_DMA_PERIPHINCMODE(__VALUE__) (((__VALUE__) == LL_DMA_PERIPH_INCREMENT) || \
#define IS_LL_DMA_PERIPHINCMODE(__VALUE__) (((__VALUE__) == LL_DMA_PERIPH_INCREMENT) || \ ((__VALUE__) == LL_DMA_PERIPH_NOINCREMENT))
((__VALUE__) == LL_DMA_PERIPH_NOINCREMENT))
#define IS_LL_DMA_MEMORYINCMODE(__VALUE__) (((__VALUE__) == LL_DMA_MEMORY_INCREMENT) || \
#define IS_LL_DMA_MEMORYINCMODE(__VALUE__) (((__VALUE__) == LL_DMA_MEMORY_INCREMENT) || \ ((__VALUE__) == LL_DMA_MEMORY_NOINCREMENT))
((__VALUE__) == LL_DMA_MEMORY_NOINCREMENT))
#define IS_LL_DMA_PERIPHDATASIZE(__VALUE__) (((__VALUE__) == LL_DMA_PDATAALIGN_BYTE) || \
#define IS_LL_DMA_PERIPHDATASIZE(__VALUE__) (((__VALUE__) == LL_DMA_PDATAALIGN_BYTE) || \ ((__VALUE__) == LL_DMA_PDATAALIGN_HALFWORD) || \
((__VALUE__) == LL_DMA_PDATAALIGN_HALFWORD) || \ ((__VALUE__) == LL_DMA_PDATAALIGN_WORD))
((__VALUE__) == LL_DMA_PDATAALIGN_WORD))
#define IS_LL_DMA_MEMORYDATASIZE(__VALUE__) (((__VALUE__) == LL_DMA_MDATAALIGN_BYTE) || \
#define IS_LL_DMA_MEMORYDATASIZE(__VALUE__) (((__VALUE__) == LL_DMA_MDATAALIGN_BYTE) || \ ((__VALUE__) == LL_DMA_MDATAALIGN_HALFWORD) || \
((__VALUE__) == LL_DMA_MDATAALIGN_HALFWORD) || \ ((__VALUE__) == LL_DMA_MDATAALIGN_WORD))
((__VALUE__) == LL_DMA_MDATAALIGN_WORD))
#define IS_LL_DMA_NBDATA(__VALUE__) ((__VALUE__) <= 0x0000FFFFU)
#define IS_LL_DMA_NBDATA(__VALUE__) ((__VALUE__) <= 0x0000FFFFU)
#define IS_LL_DMA_PRIORITY(__VALUE__) (((__VALUE__) == LL_DMA_PRIORITY_LOW) || \
#define IS_LL_DMA_PRIORITY(__VALUE__) (((__VALUE__) == LL_DMA_PRIORITY_LOW) || \ ((__VALUE__) == LL_DMA_PRIORITY_MEDIUM) || \
((__VALUE__) == LL_DMA_PRIORITY_MEDIUM) || \ ((__VALUE__) == LL_DMA_PRIORITY_HIGH) || \
((__VALUE__) == LL_DMA_PRIORITY_HIGH) || \ ((__VALUE__) == LL_DMA_PRIORITY_VERYHIGH))
((__VALUE__) == LL_DMA_PRIORITY_VERYHIGH))
#if defined (DMA2)
#if defined (DMA2) #define IS_LL_DMA_ALL_CHANNEL_INSTANCE(INSTANCE, CHANNEL) ((((INSTANCE) == DMA1) && \
#define IS_LL_DMA_ALL_CHANNEL_INSTANCE(INSTANCE, CHANNEL) ((((INSTANCE) == DMA1) && \ (((CHANNEL) == LL_DMA_CHANNEL_1) || \
(((CHANNEL) == LL_DMA_CHANNEL_1) || \ ((CHANNEL) == LL_DMA_CHANNEL_2) || \
((CHANNEL) == LL_DMA_CHANNEL_2) || \ ((CHANNEL) == LL_DMA_CHANNEL_3) || \
((CHANNEL) == LL_DMA_CHANNEL_3) || \ ((CHANNEL) == LL_DMA_CHANNEL_4) || \
((CHANNEL) == LL_DMA_CHANNEL_4) || \ ((CHANNEL) == LL_DMA_CHANNEL_5) || \
((CHANNEL) == LL_DMA_CHANNEL_5) || \ ((CHANNEL) == LL_DMA_CHANNEL_6) || \
((CHANNEL) == LL_DMA_CHANNEL_6) || \ ((CHANNEL) == LL_DMA_CHANNEL_7))) || \
((CHANNEL) == LL_DMA_CHANNEL_7))) || \ (((INSTANCE) == DMA2) && \
(((INSTANCE) == DMA2) && \ (((CHANNEL) == LL_DMA_CHANNEL_1) || \
(((CHANNEL) == LL_DMA_CHANNEL_1) || \ ((CHANNEL) == LL_DMA_CHANNEL_2) || \
((CHANNEL) == LL_DMA_CHANNEL_2) || \ ((CHANNEL) == LL_DMA_CHANNEL_3) || \
((CHANNEL) == LL_DMA_CHANNEL_3) || \ ((CHANNEL) == LL_DMA_CHANNEL_4) || \
((CHANNEL) == LL_DMA_CHANNEL_4) || \ ((CHANNEL) == LL_DMA_CHANNEL_5))))
((CHANNEL) == LL_DMA_CHANNEL_5)))) #else
#else #define IS_LL_DMA_ALL_CHANNEL_INSTANCE(INSTANCE, CHANNEL) ((((INSTANCE) == DMA1) && \
#define IS_LL_DMA_ALL_CHANNEL_INSTANCE(INSTANCE, CHANNEL) ((((INSTANCE) == DMA1) && \ (((CHANNEL) == LL_DMA_CHANNEL_1) || \
(((CHANNEL) == LL_DMA_CHANNEL_1) || \ ((CHANNEL) == LL_DMA_CHANNEL_2) || \
((CHANNEL) == LL_DMA_CHANNEL_2) || \ ((CHANNEL) == LL_DMA_CHANNEL_3) || \
((CHANNEL) == LL_DMA_CHANNEL_3) || \ ((CHANNEL) == LL_DMA_CHANNEL_4) || \
((CHANNEL) == LL_DMA_CHANNEL_4) || \ ((CHANNEL) == LL_DMA_CHANNEL_5) || \
((CHANNEL) == LL_DMA_CHANNEL_5) || \ ((CHANNEL) == LL_DMA_CHANNEL_6) || \
((CHANNEL) == LL_DMA_CHANNEL_6) || \ ((CHANNEL) == LL_DMA_CHANNEL_7))))
((CHANNEL) == LL_DMA_CHANNEL_7)))) #endif
#endif /**
/** * @}
* @} */
*/
/* Private function prototypes -----------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/ /* Exported functions --------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/ /** @addtogroup DMA_LL_Exported_Functions
/** @addtogroup DMA_LL_Exported_Functions * @{
* @{ */
*/
/** @addtogroup DMA_LL_EF_Init
/** @addtogroup DMA_LL_EF_Init * @{
* @{ */
*/
/**
/** * @brief De-initialize the DMA registers to their default reset values.
* @brief De-initialize the DMA registers to their default reset values. * @param DMAx DMAx Instance
* @param DMAx DMAx Instance * @param Channel This parameter can be one of the following values:
* @param Channel This parameter can be one of the following values: * @arg @ref LL_DMA_CHANNEL_1
* @arg @ref LL_DMA_CHANNEL_1 * @arg @ref LL_DMA_CHANNEL_2
* @arg @ref LL_DMA_CHANNEL_2 * @arg @ref LL_DMA_CHANNEL_3
* @arg @ref LL_DMA_CHANNEL_3 * @arg @ref LL_DMA_CHANNEL_4
* @arg @ref LL_DMA_CHANNEL_4 * @arg @ref LL_DMA_CHANNEL_5
* @arg @ref LL_DMA_CHANNEL_5 * @arg @ref LL_DMA_CHANNEL_6
* @arg @ref LL_DMA_CHANNEL_6 * @arg @ref LL_DMA_CHANNEL_7
* @arg @ref LL_DMA_CHANNEL_7 * @retval An ErrorStatus enumeration value:
* @retval An ErrorStatus enumeration value: * - SUCCESS: DMA registers are de-initialized
* - SUCCESS: DMA registers are de-initialized * - ERROR: DMA registers are not de-initialized
* - ERROR: DMA registers are not de-initialized */
*/ uint32_t LL_DMA_DeInit(DMA_TypeDef *DMAx, uint32_t Channel)
uint32_t LL_DMA_DeInit(DMA_TypeDef *DMAx, uint32_t Channel) {
{ DMA_Channel_TypeDef *tmp = (DMA_Channel_TypeDef *)DMA1_Channel1;
DMA_Channel_TypeDef *tmp = (DMA_Channel_TypeDef *)DMA1_Channel1; ErrorStatus status = SUCCESS;
ErrorStatus status = SUCCESS;
/* Check the DMA Instance DMAx and Channel parameters*/
/* Check the DMA Instance DMAx and Channel parameters*/ assert_param(IS_LL_DMA_ALL_CHANNEL_INSTANCE(DMAx, Channel));
assert_param(IS_LL_DMA_ALL_CHANNEL_INSTANCE(DMAx, Channel));
tmp = (DMA_Channel_TypeDef *)(__LL_DMA_GET_CHANNEL_INSTANCE(DMAx, Channel));
tmp = (DMA_Channel_TypeDef *)(__LL_DMA_GET_CHANNEL_INSTANCE(DMAx, Channel));
/* Disable the selected DMAx_Channely */
/* Disable the selected DMAx_Channely */ CLEAR_BIT(tmp->CCR, DMA_CCR_EN);
CLEAR_BIT(tmp->CCR, DMA_CCR_EN);
/* Reset DMAx_Channely control register */
/* Reset DMAx_Channely control register */ LL_DMA_WriteReg(tmp, CCR, 0U);
LL_DMA_WriteReg(tmp, CCR, 0U);
/* Reset DMAx_Channely remaining bytes register */
/* Reset DMAx_Channely remaining bytes register */ LL_DMA_WriteReg(tmp, CNDTR, 0U);
LL_DMA_WriteReg(tmp, CNDTR, 0U);
/* Reset DMAx_Channely peripheral address register */
/* Reset DMAx_Channely peripheral address register */ LL_DMA_WriteReg(tmp, CPAR, 0U);
LL_DMA_WriteReg(tmp, CPAR, 0U);
/* Reset DMAx_Channely memory address register */
/* Reset DMAx_Channely memory address register */ LL_DMA_WriteReg(tmp, CMAR, 0U);
LL_DMA_WriteReg(tmp, CMAR, 0U);
if (Channel == LL_DMA_CHANNEL_1)
if (Channel == LL_DMA_CHANNEL_1) {
{ /* Reset interrupt pending bits for DMAx Channel1 */
/* Reset interrupt pending bits for DMAx Channel1 */ LL_DMA_ClearFlag_GI1(DMAx);
LL_DMA_ClearFlag_GI1(DMAx); }
} else if (Channel == LL_DMA_CHANNEL_2)
else if (Channel == LL_DMA_CHANNEL_2) {
{ /* Reset interrupt pending bits for DMAx Channel2 */
/* Reset interrupt pending bits for DMAx Channel2 */ LL_DMA_ClearFlag_GI2(DMAx);
LL_DMA_ClearFlag_GI2(DMAx); }
} else if (Channel == LL_DMA_CHANNEL_3)
else if (Channel == LL_DMA_CHANNEL_3) {
{ /* Reset interrupt pending bits for DMAx Channel3 */
/* Reset interrupt pending bits for DMAx Channel3 */ LL_DMA_ClearFlag_GI3(DMAx);
LL_DMA_ClearFlag_GI3(DMAx); }
} else if (Channel == LL_DMA_CHANNEL_4)
else if (Channel == LL_DMA_CHANNEL_4) {
{ /* Reset interrupt pending bits for DMAx Channel4 */
/* Reset interrupt pending bits for DMAx Channel4 */ LL_DMA_ClearFlag_GI4(DMAx);
LL_DMA_ClearFlag_GI4(DMAx); }
} else if (Channel == LL_DMA_CHANNEL_5)
else if (Channel == LL_DMA_CHANNEL_5) {
{ /* Reset interrupt pending bits for DMAx Channel5 */
/* Reset interrupt pending bits for DMAx Channel5 */ LL_DMA_ClearFlag_GI5(DMAx);
LL_DMA_ClearFlag_GI5(DMAx); }
}
else if (Channel == LL_DMA_CHANNEL_6)
else if (Channel == LL_DMA_CHANNEL_6) {
{ /* Reset interrupt pending bits for DMAx Channel6 */
/* Reset interrupt pending bits for DMAx Channel6 */ LL_DMA_ClearFlag_GI6(DMAx);
LL_DMA_ClearFlag_GI6(DMAx); }
} else if (Channel == LL_DMA_CHANNEL_7)
else if (Channel == LL_DMA_CHANNEL_7) {
{ /* Reset interrupt pending bits for DMAx Channel7 */
/* Reset interrupt pending bits for DMAx Channel7 */ LL_DMA_ClearFlag_GI7(DMAx);
LL_DMA_ClearFlag_GI7(DMAx); }
} else
else {
{ status = ERROR;
status = ERROR; }
}
return status;
return status; }
}
/**
/** * @brief Initialize the DMA registers according to the specified parameters in DMA_InitStruct.
* @brief Initialize the DMA registers according to the specified parameters in DMA_InitStruct. * @note To convert DMAx_Channely Instance to DMAx Instance and Channely, use helper macros :
* @note To convert DMAx_Channely Instance to DMAx Instance and Channely, use helper macros : * @arg @ref __LL_DMA_GET_INSTANCE
* @arg @ref __LL_DMA_GET_INSTANCE * @arg @ref __LL_DMA_GET_CHANNEL
* @arg @ref __LL_DMA_GET_CHANNEL * @param DMAx DMAx Instance
* @param DMAx DMAx Instance * @param Channel This parameter can be one of the following values:
* @param Channel This parameter can be one of the following values: * @arg @ref LL_DMA_CHANNEL_1
* @arg @ref LL_DMA_CHANNEL_1 * @arg @ref LL_DMA_CHANNEL_2
* @arg @ref LL_DMA_CHANNEL_2 * @arg @ref LL_DMA_CHANNEL_3
* @arg @ref LL_DMA_CHANNEL_3 * @arg @ref LL_DMA_CHANNEL_4
* @arg @ref LL_DMA_CHANNEL_4 * @arg @ref LL_DMA_CHANNEL_5
* @arg @ref LL_DMA_CHANNEL_5 * @arg @ref LL_DMA_CHANNEL_6
* @arg @ref LL_DMA_CHANNEL_6 * @arg @ref LL_DMA_CHANNEL_7
* @arg @ref LL_DMA_CHANNEL_7 * @param DMA_InitStruct pointer to a @ref LL_DMA_InitTypeDef structure.
* @param DMA_InitStruct pointer to a @ref LL_DMA_InitTypeDef structure. * @retval An ErrorStatus enumeration value:
* @retval An ErrorStatus enumeration value: * - SUCCESS: DMA registers are initialized
* - SUCCESS: DMA registers are initialized * - ERROR: Not applicable
* - ERROR: Not applicable */
*/ uint32_t LL_DMA_Init(DMA_TypeDef *DMAx, uint32_t Channel, LL_DMA_InitTypeDef *DMA_InitStruct)
uint32_t LL_DMA_Init(DMA_TypeDef *DMAx, uint32_t Channel, LL_DMA_InitTypeDef *DMA_InitStruct) {
{ /* Check the DMA Instance DMAx and Channel parameters*/
/* Check the DMA Instance DMAx and Channel parameters*/ assert_param(IS_LL_DMA_ALL_CHANNEL_INSTANCE(DMAx, Channel));
assert_param(IS_LL_DMA_ALL_CHANNEL_INSTANCE(DMAx, Channel));
/* Check the DMA parameters from DMA_InitStruct */
/* Check the DMA parameters from DMA_InitStruct */ assert_param(IS_LL_DMA_DIRECTION(DMA_InitStruct->Direction));
assert_param(IS_LL_DMA_DIRECTION(DMA_InitStruct->Direction)); assert_param(IS_LL_DMA_MODE(DMA_InitStruct->Mode));
assert_param(IS_LL_DMA_MODE(DMA_InitStruct->Mode)); assert_param(IS_LL_DMA_PERIPHINCMODE(DMA_InitStruct->PeriphOrM2MSrcIncMode));
assert_param(IS_LL_DMA_PERIPHINCMODE(DMA_InitStruct->PeriphOrM2MSrcIncMode)); assert_param(IS_LL_DMA_MEMORYINCMODE(DMA_InitStruct->MemoryOrM2MDstIncMode));
assert_param(IS_LL_DMA_MEMORYINCMODE(DMA_InitStruct->MemoryOrM2MDstIncMode)); assert_param(IS_LL_DMA_PERIPHDATASIZE(DMA_InitStruct->PeriphOrM2MSrcDataSize));
assert_param(IS_LL_DMA_PERIPHDATASIZE(DMA_InitStruct->PeriphOrM2MSrcDataSize)); assert_param(IS_LL_DMA_MEMORYDATASIZE(DMA_InitStruct->MemoryOrM2MDstDataSize));
assert_param(IS_LL_DMA_MEMORYDATASIZE(DMA_InitStruct->MemoryOrM2MDstDataSize)); assert_param(IS_LL_DMA_NBDATA(DMA_InitStruct->NbData));
assert_param(IS_LL_DMA_NBDATA(DMA_InitStruct->NbData)); assert_param(IS_LL_DMA_PRIORITY(DMA_InitStruct->Priority));
assert_param(IS_LL_DMA_PRIORITY(DMA_InitStruct->Priority));
/*---------------------------- DMAx CCR Configuration ------------------------
/*---------------------------- DMAx CCR Configuration ------------------------ * Configure DMAx_Channely: data transfer direction, data transfer mode,
* Configure DMAx_Channely: data transfer direction, data transfer mode, * peripheral and memory increment mode,
* peripheral and memory increment mode, * data size alignment and priority level with parameters :
* data size alignment and priority level with parameters : * - Direction: DMA_CCR_DIR and DMA_CCR_MEM2MEM bits
* - Direction: DMA_CCR_DIR and DMA_CCR_MEM2MEM bits * - Mode: DMA_CCR_CIRC bit
* - Mode: DMA_CCR_CIRC bit * - PeriphOrM2MSrcIncMode: DMA_CCR_PINC bit
* - PeriphOrM2MSrcIncMode: DMA_CCR_PINC bit * - MemoryOrM2MDstIncMode: DMA_CCR_MINC bit
* - MemoryOrM2MDstIncMode: DMA_CCR_MINC bit * - PeriphOrM2MSrcDataSize: DMA_CCR_PSIZE[1:0] bits
* - PeriphOrM2MSrcDataSize: DMA_CCR_PSIZE[1:0] bits * - MemoryOrM2MDstDataSize: DMA_CCR_MSIZE[1:0] bits
* - MemoryOrM2MDstDataSize: DMA_CCR_MSIZE[1:0] bits * - Priority: DMA_CCR_PL[1:0] bits
* - Priority: DMA_CCR_PL[1:0] bits */
*/ LL_DMA_ConfigTransfer(DMAx, Channel, DMA_InitStruct->Direction | \
LL_DMA_ConfigTransfer(DMAx, Channel, DMA_InitStruct->Direction | \ DMA_InitStruct->Mode | \
DMA_InitStruct->Mode | \ DMA_InitStruct->PeriphOrM2MSrcIncMode | \
DMA_InitStruct->PeriphOrM2MSrcIncMode | \ DMA_InitStruct->MemoryOrM2MDstIncMode | \
DMA_InitStruct->MemoryOrM2MDstIncMode | \ DMA_InitStruct->PeriphOrM2MSrcDataSize | \
DMA_InitStruct->PeriphOrM2MSrcDataSize | \ DMA_InitStruct->MemoryOrM2MDstDataSize | \
DMA_InitStruct->MemoryOrM2MDstDataSize | \ DMA_InitStruct->Priority);
DMA_InitStruct->Priority);
/*-------------------------- DMAx CMAR Configuration -------------------------
/*-------------------------- DMAx CMAR Configuration ------------------------- * Configure the memory or destination base address with parameter :
* Configure the memory or destination base address with parameter : * - MemoryOrM2MDstAddress: DMA_CMAR_MA[31:0] bits
* - MemoryOrM2MDstAddress: DMA_CMAR_MA[31:0] bits */
*/ LL_DMA_SetMemoryAddress(DMAx, Channel, DMA_InitStruct->MemoryOrM2MDstAddress);
LL_DMA_SetMemoryAddress(DMAx, Channel, DMA_InitStruct->MemoryOrM2MDstAddress);
/*-------------------------- DMAx CPAR Configuration -------------------------
/*-------------------------- DMAx CPAR Configuration ------------------------- * Configure the peripheral or source base address with parameter :
* Configure the peripheral or source base address with parameter : * - PeriphOrM2MSrcAddress: DMA_CPAR_PA[31:0] bits
* - PeriphOrM2MSrcAddress: DMA_CPAR_PA[31:0] bits */
*/ LL_DMA_SetPeriphAddress(DMAx, Channel, DMA_InitStruct->PeriphOrM2MSrcAddress);
LL_DMA_SetPeriphAddress(DMAx, Channel, DMA_InitStruct->PeriphOrM2MSrcAddress);
/*--------------------------- DMAx CNDTR Configuration -----------------------
/*--------------------------- DMAx CNDTR Configuration ----------------------- * Configure the peripheral base address with parameter :
* Configure the peripheral base address with parameter : * - NbData: DMA_CNDTR_NDT[15:0] bits
* - NbData: DMA_CNDTR_NDT[15:0] bits */
*/ LL_DMA_SetDataLength(DMAx, Channel, DMA_InitStruct->NbData);
LL_DMA_SetDataLength(DMAx, Channel, DMA_InitStruct->NbData);
return SUCCESS;
return SUCCESS; }
}
/**
/** * @brief Set each @ref LL_DMA_InitTypeDef field to default value.
* @brief Set each @ref LL_DMA_InitTypeDef field to default value. * @param DMA_InitStruct Pointer to a @ref LL_DMA_InitTypeDef structure.
* @param DMA_InitStruct Pointer to a @ref LL_DMA_InitTypeDef structure. * @retval None
* @retval None */
*/ void LL_DMA_StructInit(LL_DMA_InitTypeDef *DMA_InitStruct)
void LL_DMA_StructInit(LL_DMA_InitTypeDef *DMA_InitStruct) {
{ /* Set DMA_InitStruct fields to default values */
/* Set DMA_InitStruct fields to default values */ DMA_InitStruct->PeriphOrM2MSrcAddress = 0x00000000U;
DMA_InitStruct->PeriphOrM2MSrcAddress = 0x00000000U; DMA_InitStruct->MemoryOrM2MDstAddress = 0x00000000U;
DMA_InitStruct->MemoryOrM2MDstAddress = 0x00000000U; DMA_InitStruct->Direction = LL_DMA_DIRECTION_PERIPH_TO_MEMORY;
DMA_InitStruct->Direction = LL_DMA_DIRECTION_PERIPH_TO_MEMORY; DMA_InitStruct->Mode = LL_DMA_MODE_NORMAL;
DMA_InitStruct->Mode = LL_DMA_MODE_NORMAL; DMA_InitStruct->PeriphOrM2MSrcIncMode = LL_DMA_PERIPH_NOINCREMENT;
DMA_InitStruct->PeriphOrM2MSrcIncMode = LL_DMA_PERIPH_NOINCREMENT; DMA_InitStruct->MemoryOrM2MDstIncMode = LL_DMA_MEMORY_NOINCREMENT;
DMA_InitStruct->MemoryOrM2MDstIncMode = LL_DMA_MEMORY_NOINCREMENT; DMA_InitStruct->PeriphOrM2MSrcDataSize = LL_DMA_PDATAALIGN_BYTE;
DMA_InitStruct->PeriphOrM2MSrcDataSize = LL_DMA_PDATAALIGN_BYTE; DMA_InitStruct->MemoryOrM2MDstDataSize = LL_DMA_MDATAALIGN_BYTE;
DMA_InitStruct->MemoryOrM2MDstDataSize = LL_DMA_MDATAALIGN_BYTE; DMA_InitStruct->NbData = 0x00000000U;
DMA_InitStruct->NbData = 0x00000000U; DMA_InitStruct->Priority = LL_DMA_PRIORITY_LOW;
DMA_InitStruct->Priority = LL_DMA_PRIORITY_LOW; }
}
/**
/** * @}
* @} */
*/
/**
/** * @}
* @} */
*/
/**
/** * @}
* @} */
*/
#endif /* DMA1 || DMA2 */
#endif /* DMA1 || DMA2 */
/**
/** * @}
* @} */
*/
#endif /* USE_FULL_LL_DRIVER */
#endif /* USE_FULL_LL_DRIVER */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -1,215 +1,213 @@
/** /**
****************************************************************************** ******************************************************************************
* @file stm32f1xx_ll_exti.c * @file stm32f1xx_ll_exti.c
* @author MCD Application Team * @author MCD Application Team
* @brief EXTI LL module driver. * @brief EXTI LL module driver.
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under BSD 3-Clause license, * This software is licensed under terms that can be found in the LICENSE file
* the "License"; You may not use this file except in compliance with the * in the root directory of this software component.
* License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* opensource.org/licenses/BSD-3-Clause *
* ******************************************************************************
****************************************************************************** */
*/
#if defined(USE_FULL_LL_DRIVER)
#if defined(USE_FULL_LL_DRIVER)
/* Includes ------------------------------------------------------------------*/
/* Includes ------------------------------------------------------------------*/ #include "stm32f1xx_ll_exti.h"
#include "stm32f1xx_ll_exti.h" #ifdef USE_FULL_ASSERT
#ifdef USE_FULL_ASSERT #include "stm32_assert.h"
#include "stm32_assert.h" #else
#else #define assert_param(expr) ((void)0U)
#define assert_param(expr) ((void)0U) #endif
#endif
/** @addtogroup STM32F1xx_LL_Driver
/** @addtogroup STM32F1xx_LL_Driver * @{
* @{ */
*/
#if defined (EXTI)
#if defined (EXTI)
/** @defgroup EXTI_LL EXTI
/** @defgroup EXTI_LL EXTI * @{
* @{ */
*/
/* Private types -------------------------------------------------------------*/
/* Private types -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/ /* Private constants ---------------------------------------------------------*/
/* Private constants ---------------------------------------------------------*/ /* Private macros ------------------------------------------------------------*/
/* Private macros ------------------------------------------------------------*/ /** @addtogroup EXTI_LL_Private_Macros
/** @addtogroup EXTI_LL_Private_Macros * @{
* @{ */
*/
#define IS_LL_EXTI_LINE_0_31(__VALUE__) (((__VALUE__) & ~LL_EXTI_LINE_ALL_0_31) == 0x00000000U)
#define IS_LL_EXTI_LINE_0_31(__VALUE__) (((__VALUE__) & ~LL_EXTI_LINE_ALL_0_31) == 0x00000000U)
#define IS_LL_EXTI_MODE(__VALUE__) (((__VALUE__) == LL_EXTI_MODE_IT) \
#define IS_LL_EXTI_MODE(__VALUE__) (((__VALUE__) == LL_EXTI_MODE_IT) \ || ((__VALUE__) == LL_EXTI_MODE_EVENT) \
|| ((__VALUE__) == LL_EXTI_MODE_EVENT) \ || ((__VALUE__) == LL_EXTI_MODE_IT_EVENT))
|| ((__VALUE__) == LL_EXTI_MODE_IT_EVENT))
#define IS_LL_EXTI_TRIGGER(__VALUE__) (((__VALUE__) == LL_EXTI_TRIGGER_NONE) \
#define IS_LL_EXTI_TRIGGER(__VALUE__) (((__VALUE__) == LL_EXTI_TRIGGER_NONE) \ || ((__VALUE__) == LL_EXTI_TRIGGER_RISING) \
|| ((__VALUE__) == LL_EXTI_TRIGGER_RISING) \ || ((__VALUE__) == LL_EXTI_TRIGGER_FALLING) \
|| ((__VALUE__) == LL_EXTI_TRIGGER_FALLING) \ || ((__VALUE__) == LL_EXTI_TRIGGER_RISING_FALLING))
|| ((__VALUE__) == LL_EXTI_TRIGGER_RISING_FALLING))
/**
/** * @}
* @} */
*/
/* Private function prototypes -----------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/ /** @addtogroup EXTI_LL_Exported_Functions
/** @addtogroup EXTI_LL_Exported_Functions * @{
* @{ */
*/
/** @addtogroup EXTI_LL_EF_Init
/** @addtogroup EXTI_LL_EF_Init * @{
* @{ */
*/
/**
/** * @brief De-initialize the EXTI registers to their default reset values.
* @brief De-initialize the EXTI registers to their default reset values. * @retval An ErrorStatus enumeration value:
* @retval An ErrorStatus enumeration value: * - SUCCESS: EXTI registers are de-initialized
* - SUCCESS: EXTI registers are de-initialized * - ERROR: not applicable
* - ERROR: not applicable */
*/ uint32_t LL_EXTI_DeInit(void)
uint32_t LL_EXTI_DeInit(void) {
{ /* Interrupt mask register set to default reset values */
/* Interrupt mask register set to default reset values */ LL_EXTI_WriteReg(IMR, 0x00000000U);
LL_EXTI_WriteReg(IMR, 0x00000000U); /* Event mask register set to default reset values */
/* Event mask register set to default reset values */ LL_EXTI_WriteReg(EMR, 0x00000000U);
LL_EXTI_WriteReg(EMR, 0x00000000U); /* Rising Trigger selection register set to default reset values */
/* Rising Trigger selection register set to default reset values */ LL_EXTI_WriteReg(RTSR, 0x00000000U);
LL_EXTI_WriteReg(RTSR, 0x00000000U); /* Falling Trigger selection register set to default reset values */
/* Falling Trigger selection register set to default reset values */ LL_EXTI_WriteReg(FTSR, 0x00000000U);
LL_EXTI_WriteReg(FTSR, 0x00000000U); /* Software interrupt event register set to default reset values */
/* Software interrupt event register set to default reset values */ LL_EXTI_WriteReg(SWIER, 0x00000000U);
LL_EXTI_WriteReg(SWIER, 0x00000000U); /* Pending register clear */
/* Pending register clear */ LL_EXTI_WriteReg(PR, 0x000FFFFFU);
LL_EXTI_WriteReg(PR, 0x000FFFFFU);
return SUCCESS;
return SUCCESS; }
}
/**
/** * @brief Initialize the EXTI registers according to the specified parameters in EXTI_InitStruct.
* @brief Initialize the EXTI registers according to the specified parameters in EXTI_InitStruct. * @param EXTI_InitStruct pointer to a @ref LL_EXTI_InitTypeDef structure.
* @param EXTI_InitStruct pointer to a @ref LL_EXTI_InitTypeDef structure. * @retval An ErrorStatus enumeration value:
* @retval An ErrorStatus enumeration value: * - SUCCESS: EXTI registers are initialized
* - SUCCESS: EXTI registers are initialized * - ERROR: not applicable
* - ERROR: not applicable */
*/ uint32_t LL_EXTI_Init(LL_EXTI_InitTypeDef *EXTI_InitStruct)
uint32_t LL_EXTI_Init(LL_EXTI_InitTypeDef *EXTI_InitStruct) {
{ ErrorStatus status = SUCCESS;
ErrorStatus status = SUCCESS; /* Check the parameters */
/* Check the parameters */ assert_param(IS_LL_EXTI_LINE_0_31(EXTI_InitStruct->Line_0_31));
assert_param(IS_LL_EXTI_LINE_0_31(EXTI_InitStruct->Line_0_31)); assert_param(IS_FUNCTIONAL_STATE(EXTI_InitStruct->LineCommand));
assert_param(IS_FUNCTIONAL_STATE(EXTI_InitStruct->LineCommand)); assert_param(IS_LL_EXTI_MODE(EXTI_InitStruct->Mode));
assert_param(IS_LL_EXTI_MODE(EXTI_InitStruct->Mode));
/* ENABLE LineCommand */
/* ENABLE LineCommand */ if (EXTI_InitStruct->LineCommand != DISABLE)
if (EXTI_InitStruct->LineCommand != DISABLE) {
{ assert_param(IS_LL_EXTI_TRIGGER(EXTI_InitStruct->Trigger));
assert_param(IS_LL_EXTI_TRIGGER(EXTI_InitStruct->Trigger));
/* Configure EXTI Lines in range from 0 to 31 */
/* Configure EXTI Lines in range from 0 to 31 */ if (EXTI_InitStruct->Line_0_31 != LL_EXTI_LINE_NONE)
if (EXTI_InitStruct->Line_0_31 != LL_EXTI_LINE_NONE) {
{ switch (EXTI_InitStruct->Mode)
switch (EXTI_InitStruct->Mode) {
{ case LL_EXTI_MODE_IT:
case LL_EXTI_MODE_IT: /* First Disable Event on provided Lines */
/* First Disable Event on provided Lines */ LL_EXTI_DisableEvent_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_DisableEvent_0_31(EXTI_InitStruct->Line_0_31); /* Then Enable IT on provided Lines */
/* Then Enable IT on provided Lines */ LL_EXTI_EnableIT_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_EnableIT_0_31(EXTI_InitStruct->Line_0_31); break;
break; case LL_EXTI_MODE_EVENT:
case LL_EXTI_MODE_EVENT: /* First Disable IT on provided Lines */
/* First Disable IT on provided Lines */ LL_EXTI_DisableIT_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_DisableIT_0_31(EXTI_InitStruct->Line_0_31); /* Then Enable Event on provided Lines */
/* Then Enable Event on provided Lines */ LL_EXTI_EnableEvent_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_EnableEvent_0_31(EXTI_InitStruct->Line_0_31); break;
break; case LL_EXTI_MODE_IT_EVENT:
case LL_EXTI_MODE_IT_EVENT: /* Directly Enable IT & Event on provided Lines */
/* Directly Enable IT & Event on provided Lines */ LL_EXTI_EnableIT_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_EnableIT_0_31(EXTI_InitStruct->Line_0_31); LL_EXTI_EnableEvent_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_EnableEvent_0_31(EXTI_InitStruct->Line_0_31); break;
break; default:
default: status = ERROR;
status = ERROR; break;
break; }
} if (EXTI_InitStruct->Trigger != LL_EXTI_TRIGGER_NONE)
if (EXTI_InitStruct->Trigger != LL_EXTI_TRIGGER_NONE) {
{ switch (EXTI_InitStruct->Trigger)
switch (EXTI_InitStruct->Trigger) {
{ case LL_EXTI_TRIGGER_RISING:
case LL_EXTI_TRIGGER_RISING: /* First Disable Falling Trigger on provided Lines */
/* First Disable Falling Trigger on provided Lines */ LL_EXTI_DisableFallingTrig_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_DisableFallingTrig_0_31(EXTI_InitStruct->Line_0_31); /* Then Enable Rising Trigger on provided Lines */
/* Then Enable Rising Trigger on provided Lines */ LL_EXTI_EnableRisingTrig_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_EnableRisingTrig_0_31(EXTI_InitStruct->Line_0_31); break;
break; case LL_EXTI_TRIGGER_FALLING:
case LL_EXTI_TRIGGER_FALLING: /* First Disable Rising Trigger on provided Lines */
/* First Disable Rising Trigger on provided Lines */ LL_EXTI_DisableRisingTrig_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_DisableRisingTrig_0_31(EXTI_InitStruct->Line_0_31); /* Then Enable Falling Trigger on provided Lines */
/* Then Enable Falling Trigger on provided Lines */ LL_EXTI_EnableFallingTrig_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_EnableFallingTrig_0_31(EXTI_InitStruct->Line_0_31); break;
break; case LL_EXTI_TRIGGER_RISING_FALLING:
case LL_EXTI_TRIGGER_RISING_FALLING: LL_EXTI_EnableRisingTrig_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_EnableRisingTrig_0_31(EXTI_InitStruct->Line_0_31); LL_EXTI_EnableFallingTrig_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_EnableFallingTrig_0_31(EXTI_InitStruct->Line_0_31); break;
break; default:
default: status = ERROR;
status = ERROR; break;
break; }
} }
} }
} }
} /* DISABLE LineCommand */
/* DISABLE LineCommand */ else
else {
{ /* De-configure EXTI Lines in range from 0 to 31 */
/* De-configure EXTI Lines in range from 0 to 31 */ LL_EXTI_DisableIT_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_DisableIT_0_31(EXTI_InitStruct->Line_0_31); LL_EXTI_DisableEvent_0_31(EXTI_InitStruct->Line_0_31);
LL_EXTI_DisableEvent_0_31(EXTI_InitStruct->Line_0_31); }
} return status;
return status; }
}
/**
/** * @brief Set each @ref LL_EXTI_InitTypeDef field to default value.
* @brief Set each @ref LL_EXTI_InitTypeDef field to default value. * @param EXTI_InitStruct Pointer to a @ref LL_EXTI_InitTypeDef structure.
* @param EXTI_InitStruct Pointer to a @ref LL_EXTI_InitTypeDef structure. * @retval None
* @retval None */
*/ void LL_EXTI_StructInit(LL_EXTI_InitTypeDef *EXTI_InitStruct)
void LL_EXTI_StructInit(LL_EXTI_InitTypeDef *EXTI_InitStruct) {
{ EXTI_InitStruct->Line_0_31 = LL_EXTI_LINE_NONE;
EXTI_InitStruct->Line_0_31 = LL_EXTI_LINE_NONE; EXTI_InitStruct->LineCommand = DISABLE;
EXTI_InitStruct->LineCommand = DISABLE; EXTI_InitStruct->Mode = LL_EXTI_MODE_IT;
EXTI_InitStruct->Mode = LL_EXTI_MODE_IT; EXTI_InitStruct->Trigger = LL_EXTI_TRIGGER_FALLING;
EXTI_InitStruct->Trigger = LL_EXTI_TRIGGER_FALLING; }
}
/**
/** * @}
* @} */
*/
/**
/** * @}
* @} */
*/
/**
/** * @}
* @} */
*/
#endif /* defined (EXTI) */
#endif /* defined (EXTI) */
/**
/** * @}
* @} */
*/
#endif /* USE_FULL_LL_DRIVER */
#endif /* USE_FULL_LL_DRIVER */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -6,13 +6,12 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under BSD 3-Clause license, * This software is licensed under terms that can be found in the LICENSE file
* the "License"; You may not use this file except in compliance with the * in the root directory of this software component.
* License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* opensource.org/licenses/BSD-3-Clause
* *
****************************************************************************** ******************************************************************************
*/ */
@ -185,13 +184,18 @@ ErrorStatus LL_GPIO_Init(GPIO_TypeDef *GPIOx, LL_GPIO_InitTypeDef *GPIO_InitStru
currentpin = ((0x00010001u << (pinpos - GPIO_PIN_MASK_POS)) | 0x04000000u); currentpin = ((0x00010001u << (pinpos - GPIO_PIN_MASK_POS)) | 0x04000000u);
} }
/* Check Pin Mode and Pin Pull parameters */ if (GPIO_InitStruct->Mode == LL_GPIO_MODE_INPUT)
{
/* Check The Pull parameter */
assert_param(IS_LL_GPIO_PULL(GPIO_InitStruct->Pull));
/* Pull-up Pull-down resistor configuration*/
LL_GPIO_SetPinPull(GPIOx, currentpin, GPIO_InitStruct->Pull);
}
/* Check Pin Mode parameters */
assert_param(IS_LL_GPIO_MODE(GPIO_InitStruct->Mode)); assert_param(IS_LL_GPIO_MODE(GPIO_InitStruct->Mode));
assert_param(IS_LL_GPIO_PULL(GPIO_InitStruct->Pull));
/* Pull-up Pull-down resistor configuration*/
LL_GPIO_SetPinPull(GPIOx, currentpin, GPIO_InitStruct->Pull);
/* Pin Mode configuration */ /* Pin Mode configuration */
LL_GPIO_SetPinMode(GPIOx, currentpin, GPIO_InitStruct->Mode); LL_GPIO_SetPinMode(GPIOx, currentpin, GPIO_InitStruct->Mode);
@ -250,4 +254,3 @@ void LL_GPIO_StructInit(LL_GPIO_InitTypeDef *GPIO_InitStruct)
#endif /* USE_FULL_LL_DRIVER */ #endif /* USE_FULL_LL_DRIVER */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -1,86 +1,83 @@
/** /**
****************************************************************************** ******************************************************************************
* @file stm32f1xx_ll_pwr.c * @file stm32f1xx_ll_pwr.c
* @author MCD Application Team * @author MCD Application Team
* @brief PWR LL module driver. * @brief PWR LL module driver.
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under BSD 3-Clause license, * This software is licensed under terms that can be found in the LICENSE file
* the "License"; You may not use this file except in compliance with the * in the root directory of this software component.
* License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* opensource.org/licenses/BSD-3-Clause *
* ******************************************************************************
****************************************************************************** */
*/
#if defined(USE_FULL_LL_DRIVER)
#if defined(USE_FULL_LL_DRIVER)
/* Includes ------------------------------------------------------------------*/
/* Includes ------------------------------------------------------------------*/ #include "stm32f1xx_ll_pwr.h"
#include "stm32f1xx_ll_pwr.h" #include "stm32f1xx_ll_bus.h"
#include "stm32f1xx_ll_bus.h"
/** @addtogroup STM32F1xx_LL_Driver
/** @addtogroup STM32F1xx_LL_Driver * @{
* @{ */
*/
#if defined(PWR)
#if defined(PWR)
/** @defgroup PWR_LL PWR
/** @defgroup PWR_LL PWR * @{
* @{ */
*/
/* Private types -------------------------------------------------------------*/
/* Private types -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/ /* Private constants ---------------------------------------------------------*/
/* Private constants ---------------------------------------------------------*/ /* Private macros ------------------------------------------------------------*/
/* Private macros ------------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/ /** @addtogroup PWR_LL_Exported_Functions
/** @addtogroup PWR_LL_Exported_Functions * @{
* @{ */
*/
/** @addtogroup PWR_LL_EF_Init
/** @addtogroup PWR_LL_EF_Init * @{
* @{ */
*/
/**
/** * @brief De-initialize the PWR registers to their default reset values.
* @brief De-initialize the PWR registers to their default reset values. * @retval An ErrorStatus enumeration value:
* @retval An ErrorStatus enumeration value: * - SUCCESS: PWR registers are de-initialized
* - SUCCESS: PWR registers are de-initialized * - ERROR: not applicable
* - ERROR: not applicable */
*/ ErrorStatus LL_PWR_DeInit(void)
ErrorStatus LL_PWR_DeInit(void) {
{ /* Force reset of PWR clock */
/* Force reset of PWR clock */ LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_PWR);
LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_PWR);
/* Release reset of PWR clock */
/* Release reset of PWR clock */ LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_PWR);
LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_PWR);
return SUCCESS;
return SUCCESS; }
}
/**
/** * @}
* @} */
*/
/**
/** * @}
* @} */
*/
/**
/** * @}
* @} */
*/ #endif /* defined(PWR) */
#endif /* defined(PWR) */ /**
/** * @}
* @} */
*/
#endif /* USE_FULL_LL_DRIVER */
#endif /* USE_FULL_LL_DRIVER */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -1,474 +1,471 @@
/** /**
****************************************************************************** ******************************************************************************
* @file stm32f1xx_ll_rcc.c * @file stm32f1xx_ll_rcc.c
* @author MCD Application Team * @author MCD Application Team
* @brief RCC LL module driver. * @brief RCC LL module driver.
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under BSD 3-Clause license, * This software is licensed under terms that can be found in the LICENSE file in
* the "License"; You may not use this file except in compliance with the * the root directory of this software component.
* License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* opensource.org/licenses/BSD-3-Clause ******************************************************************************
* */
******************************************************************************
*/ #if defined(USE_FULL_LL_DRIVER)
#if defined(USE_FULL_LL_DRIVER) /* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_ll_rcc.h"
/* Includes ------------------------------------------------------------------*/ #ifdef USE_FULL_ASSERT
#include "stm32f1xx_ll_rcc.h" #include "stm32_assert.h"
#ifdef USE_FULL_ASSERT #else
#include "stm32_assert.h" #define assert_param(expr) ((void)0U)
#else #endif /* USE_FULL_ASSERT */
#define assert_param(expr) ((void)0U) /** @addtogroup STM32F1xx_LL_Driver
#endif /* USE_FULL_ASSERT */ * @{
/** @addtogroup STM32F1xx_LL_Driver */
* @{
*/ #if defined(RCC)
#if defined(RCC) /** @defgroup RCC_LL RCC
* @{
/** @defgroup RCC_LL RCC */
* @{
*/ /* Private types -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private types -------------------------------------------------------------*/ /* Private constants ---------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/ /* Private macros ------------------------------------------------------------*/
/* Private constants ---------------------------------------------------------*/ /** @addtogroup RCC_LL_Private_Macros
/* Private macros ------------------------------------------------------------*/ * @{
/** @addtogroup RCC_LL_Private_Macros */
* @{ #if defined(RCC_PLLI2S_SUPPORT)
*/ #define IS_LL_RCC_I2S_CLKSOURCE(__VALUE__) (((__VALUE__) == LL_RCC_I2S2_CLKSOURCE) \
#if defined(RCC_PLLI2S_SUPPORT) || ((__VALUE__) == LL_RCC_I2S3_CLKSOURCE))
#define IS_LL_RCC_I2S_CLKSOURCE(__VALUE__) (((__VALUE__) == LL_RCC_I2S2_CLKSOURCE) \ #endif /* RCC_PLLI2S_SUPPORT */
|| ((__VALUE__) == LL_RCC_I2S3_CLKSOURCE))
#endif /* RCC_PLLI2S_SUPPORT */ #if defined(USB) || defined(USB_OTG_FS)
#define IS_LL_RCC_USB_CLKSOURCE(__VALUE__) (((__VALUE__) == LL_RCC_USB_CLKSOURCE))
#if defined(USB) || defined(USB_OTG_FS) #endif /* USB */
#define IS_LL_RCC_USB_CLKSOURCE(__VALUE__) (((__VALUE__) == LL_RCC_USB_CLKSOURCE))
#endif /* USB */ #define IS_LL_RCC_ADC_CLKSOURCE(__VALUE__) (((__VALUE__) == LL_RCC_ADC_CLKSOURCE))
/**
#define IS_LL_RCC_ADC_CLKSOURCE(__VALUE__) (((__VALUE__) == LL_RCC_ADC_CLKSOURCE)) * @}
/** */
* @}
*/ /* Private function prototypes -----------------------------------------------*/
/** @defgroup RCC_LL_Private_Functions RCC Private functions
/* Private function prototypes -----------------------------------------------*/ * @{
/** @defgroup RCC_LL_Private_Functions RCC Private functions */
* @{ uint32_t RCC_GetSystemClockFreq(void);
*/ uint32_t RCC_GetHCLKClockFreq(uint32_t SYSCLK_Frequency);
uint32_t RCC_GetSystemClockFreq(void); uint32_t RCC_GetPCLK1ClockFreq(uint32_t HCLK_Frequency);
uint32_t RCC_GetHCLKClockFreq(uint32_t SYSCLK_Frequency); uint32_t RCC_GetPCLK2ClockFreq(uint32_t HCLK_Frequency);
uint32_t RCC_GetPCLK1ClockFreq(uint32_t HCLK_Frequency); uint32_t RCC_PLL_GetFreqDomain_SYS(void);
uint32_t RCC_GetPCLK2ClockFreq(uint32_t HCLK_Frequency); #if defined(RCC_PLLI2S_SUPPORT)
uint32_t RCC_PLL_GetFreqDomain_SYS(void); uint32_t RCC_PLLI2S_GetFreqDomain_I2S(void);
#if defined(RCC_PLLI2S_SUPPORT) #endif /* RCC_PLLI2S_SUPPORT */
uint32_t RCC_PLLI2S_GetFreqDomain_I2S(void); #if defined(RCC_PLL2_SUPPORT)
#endif /* RCC_PLLI2S_SUPPORT */ uint32_t RCC_PLL2_GetFreqClockFreq(void);
#if defined(RCC_PLL2_SUPPORT) #endif /* RCC_PLL2_SUPPORT */
uint32_t RCC_PLL2_GetFreqClockFreq(void); /**
#endif /* RCC_PLL2_SUPPORT */ * @}
/** */
* @}
*/ /* Exported functions --------------------------------------------------------*/
/** @addtogroup RCC_LL_Exported_Functions
/* Exported functions --------------------------------------------------------*/ * @{
/** @addtogroup RCC_LL_Exported_Functions */
* @{
*/ /** @addtogroup RCC_LL_EF_Init
* @{
/** @addtogroup RCC_LL_EF_Init */
* @{
*/ /**
* @brief Reset the RCC clock configuration to the default reset state.
/** * @note The default reset state of the clock configuration is given below:
* @brief Reset the RCC clock configuration to the default reset state. * - HSI ON and used as system clock source
* @note The default reset state of the clock configuration is given below: * - HSE PLL, PLL2 & PLL3 are OFF
* - HSI ON and used as system clock source * - AHB, APB1 and APB2 prescaler set to 1.
* - HSE PLL, PLL2 & PLL3 are OFF * - CSS, MCO OFF
* - AHB, APB1 and APB2 prescaler set to 1. * - All interrupts disabled
* - CSS, MCO OFF * @note This function doesn't modify the configuration of the
* - All interrupts disabled * - Peripheral clocks
* @note This function doesn't modify the configuration of the * - LSI, LSE and RTC clocks
* - Peripheral clocks * @retval An ErrorStatus enumeration value:
* - LSI, LSE and RTC clocks * - SUCCESS: RCC registers are de-initialized
* @retval An ErrorStatus enumeration value: * - ERROR: not applicable
* - SUCCESS: RCC registers are de-initialized */
* - ERROR: not applicable ErrorStatus LL_RCC_DeInit(void)
*/ {
ErrorStatus LL_RCC_DeInit(void) /* Set HSION bit */
{ LL_RCC_HSI_Enable();
/* Set HSION bit */
LL_RCC_HSI_Enable(); /* Wait for HSI READY bit */
while (LL_RCC_HSI_IsReady() != 1U)
/* Wait for HSI READY bit */ {}
while (LL_RCC_HSI_IsReady() != 1U)
{} /* Configure HSI as system clock source */
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSI);
/* Configure HSI as system clock source */
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSI); /* Wait till clock switch is ready */
while (LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_HSI)
/* Wait till clock switch is ready */ {}
while (LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_HSI)
{} /* Reset PLLON bit */
CLEAR_BIT(RCC->CR, RCC_CR_PLLON);
/* Reset PLLON bit */
CLEAR_BIT(RCC->CR, RCC_CR_PLLON); /* Wait for PLL READY bit to be reset */
while (LL_RCC_PLL_IsReady() != 0U)
/* Wait for PLL READY bit to be reset */ {}
while (LL_RCC_PLL_IsReady() != 0U)
{} /* Reset CFGR register */
LL_RCC_WriteReg(CFGR, 0x00000000U);
/* Reset CFGR register */
LL_RCC_WriteReg(CFGR, 0x00000000U); /* Reset HSEON, HSEBYP & CSSON bits */
CLEAR_BIT(RCC->CR, (RCC_CR_CSSON | RCC_CR_HSEON | RCC_CR_HSEBYP));
/* Reset HSEON, HSEBYP & CSSON bits */
CLEAR_BIT(RCC->CR, (RCC_CR_CSSON | RCC_CR_HSEON | RCC_CR_HSEBYP)); #if defined(RCC_CR_PLL2ON)
/* Reset PLL2ON bit */
#if defined(RCC_CR_PLL2ON) CLEAR_BIT(RCC->CR, RCC_CR_PLL2ON);
/* Reset PLL2ON bit */ #endif /* RCC_CR_PLL2ON */
CLEAR_BIT(RCC->CR, RCC_CR_PLL2ON);
#endif /* RCC_CR_PLL2ON */ #if defined(RCC_CR_PLL3ON)
/* Reset PLL3ON bit */
#if defined(RCC_CR_PLL3ON) CLEAR_BIT(RCC->CR, RCC_CR_PLL3ON);
/* Reset PLL3ON bit */ #endif /* RCC_CR_PLL3ON */
CLEAR_BIT(RCC->CR, RCC_CR_PLL3ON);
#endif /* RCC_CR_PLL3ON */ /* Set HSITRIM bits to the reset value */
LL_RCC_HSI_SetCalibTrimming(0x10U);
/* Set HSITRIM bits to the reset value */
LL_RCC_HSI_SetCalibTrimming(0x10U); #if defined(RCC_CFGR2_PREDIV1)
/* Reset CFGR2 register */
#if defined(RCC_CFGR2_PREDIV1) LL_RCC_WriteReg(CFGR2, 0x00000000U);
/* Reset CFGR2 register */ #endif /* RCC_CFGR2_PREDIV1 */
LL_RCC_WriteReg(CFGR2, 0x00000000U);
#endif /* RCC_CFGR2_PREDIV1 */ /* Disable all interrupts */
LL_RCC_WriteReg(CIR, 0x00000000U);
/* Disable all interrupts */
LL_RCC_WriteReg(CIR, 0x00000000U); /* Clear reset flags */
LL_RCC_ClearResetFlags();
/* Clear reset flags */
LL_RCC_ClearResetFlags(); return SUCCESS;
}
return SUCCESS;
} /**
* @}
/** */
* @}
*/ /** @addtogroup RCC_LL_EF_Get_Freq
* @brief Return the frequencies of different on chip clocks; System, AHB, APB1 and APB2 buses clocks
/** @addtogroup RCC_LL_EF_Get_Freq * and different peripheral clocks available on the device.
* @brief Return the frequencies of different on chip clocks; System, AHB, APB1 and APB2 buses clocks * @note If SYSCLK source is HSI, function returns values based on HSI_VALUE(**)
* and different peripheral clocks available on the device. * @note If SYSCLK source is HSE, function returns values based on HSE_VALUE(***)
* @note If SYSCLK source is HSI, function returns values based on HSI_VALUE(**) * @note If SYSCLK source is PLL, function returns values based on
* @note If SYSCLK source is HSE, function returns values based on HSE_VALUE(***) * HSI_VALUE(**) or HSE_VALUE(***) multiplied/divided by the PLL factors.
* @note If SYSCLK source is PLL, function returns values based on * @note (**) HSI_VALUE is a defined constant but the real value may vary
* HSI_VALUE(**) or HSE_VALUE(***) multiplied/divided by the PLL factors. * depending on the variations in voltage and temperature.
* @note (**) HSI_VALUE is a defined constant but the real value may vary * @note (***) HSE_VALUE is a defined constant, user has to ensure that
* depending on the variations in voltage and temperature. * HSE_VALUE is same as the real frequency of the crystal used.
* @note (***) HSE_VALUE is a defined constant, user has to ensure that * Otherwise, this function may have wrong result.
* HSE_VALUE is same as the real frequency of the crystal used. * @note The result of this function could be incorrect when using fractional
* Otherwise, this function may have wrong result. * value for HSE crystal.
* @note The result of this function could be incorrect when using fractional * @note This function can be used by the user application to compute the
* value for HSE crystal. * baud-rate for the communication peripherals or configure other parameters.
* @note This function can be used by the user application to compute the * @{
* baud-rate for the communication peripherals or configure other parameters. */
* @{
*/ /**
* @brief Return the frequencies of different on chip clocks; System, AHB, APB1 and APB2 buses clocks
/** * @note Each time SYSCLK, HCLK, PCLK1 and/or PCLK2 clock changes, this function
* @brief Return the frequencies of different on chip clocks; System, AHB, APB1 and APB2 buses clocks * must be called to update structure fields. Otherwise, any
* @note Each time SYSCLK, HCLK, PCLK1 and/or PCLK2 clock changes, this function * configuration based on this function will be incorrect.
* must be called to update structure fields. Otherwise, any * @param RCC_Clocks pointer to a @ref LL_RCC_ClocksTypeDef structure which will hold the clocks frequencies
* configuration based on this function will be incorrect. * @retval None
* @param RCC_Clocks pointer to a @ref LL_RCC_ClocksTypeDef structure which will hold the clocks frequencies */
* @retval None void LL_RCC_GetSystemClocksFreq(LL_RCC_ClocksTypeDef *RCC_Clocks)
*/ {
void LL_RCC_GetSystemClocksFreq(LL_RCC_ClocksTypeDef *RCC_Clocks) /* Get SYSCLK frequency */
{ RCC_Clocks->SYSCLK_Frequency = RCC_GetSystemClockFreq();
/* Get SYSCLK frequency */
RCC_Clocks->SYSCLK_Frequency = RCC_GetSystemClockFreq(); /* HCLK clock frequency */
RCC_Clocks->HCLK_Frequency = RCC_GetHCLKClockFreq(RCC_Clocks->SYSCLK_Frequency);
/* HCLK clock frequency */
RCC_Clocks->HCLK_Frequency = RCC_GetHCLKClockFreq(RCC_Clocks->SYSCLK_Frequency); /* PCLK1 clock frequency */
RCC_Clocks->PCLK1_Frequency = RCC_GetPCLK1ClockFreq(RCC_Clocks->HCLK_Frequency);
/* PCLK1 clock frequency */
RCC_Clocks->PCLK1_Frequency = RCC_GetPCLK1ClockFreq(RCC_Clocks->HCLK_Frequency); /* PCLK2 clock frequency */
RCC_Clocks->PCLK2_Frequency = RCC_GetPCLK2ClockFreq(RCC_Clocks->HCLK_Frequency);
/* PCLK2 clock frequency */ }
RCC_Clocks->PCLK2_Frequency = RCC_GetPCLK2ClockFreq(RCC_Clocks->HCLK_Frequency);
} #if defined(RCC_CFGR2_I2S2SRC)
/**
#if defined(RCC_CFGR2_I2S2SRC) * @brief Return I2Sx clock frequency
/** * @param I2SxSource This parameter can be one of the following values:
* @brief Return I2Sx clock frequency * @arg @ref LL_RCC_I2S2_CLKSOURCE
* @param I2SxSource This parameter can be one of the following values: * @arg @ref LL_RCC_I2S3_CLKSOURCE
* @arg @ref LL_RCC_I2S2_CLKSOURCE * @retval I2S clock frequency (in Hz)
* @arg @ref LL_RCC_I2S3_CLKSOURCE */
* @retval I2S clock frequency (in Hz) uint32_t LL_RCC_GetI2SClockFreq(uint32_t I2SxSource)
*/ {
uint32_t LL_RCC_GetI2SClockFreq(uint32_t I2SxSource) uint32_t i2s_frequency = LL_RCC_PERIPH_FREQUENCY_NO;
{
uint32_t i2s_frequency = LL_RCC_PERIPH_FREQUENCY_NO; /* Check parameter */
assert_param(IS_LL_RCC_I2S_CLKSOURCE(I2SxSource));
/* Check parameter */
assert_param(IS_LL_RCC_I2S_CLKSOURCE(I2SxSource)); /* I2S1CLK clock frequency */
switch (LL_RCC_GetI2SClockSource(I2SxSource))
/* I2S1CLK clock frequency */ {
switch (LL_RCC_GetI2SClockSource(I2SxSource)) case LL_RCC_I2S2_CLKSOURCE_SYSCLK: /*!< System clock selected as I2S clock source */
{ case LL_RCC_I2S3_CLKSOURCE_SYSCLK:
case LL_RCC_I2S2_CLKSOURCE_SYSCLK: /*!< System clock selected as I2S clock source */ i2s_frequency = RCC_GetSystemClockFreq();
case LL_RCC_I2S3_CLKSOURCE_SYSCLK: break;
i2s_frequency = RCC_GetSystemClockFreq();
break; case LL_RCC_I2S2_CLKSOURCE_PLLI2S_VCO: /*!< PLLI2S oscillator clock selected as I2S clock source */
case LL_RCC_I2S3_CLKSOURCE_PLLI2S_VCO:
case LL_RCC_I2S2_CLKSOURCE_PLLI2S_VCO: /*!< PLLI2S oscillator clock selected as I2S clock source */ default:
case LL_RCC_I2S3_CLKSOURCE_PLLI2S_VCO: i2s_frequency = RCC_PLLI2S_GetFreqDomain_I2S() * 2U;
default: break;
i2s_frequency = RCC_PLLI2S_GetFreqDomain_I2S() * 2U; }
break;
} return i2s_frequency;
}
return i2s_frequency; #endif /* RCC_CFGR2_I2S2SRC */
}
#endif /* RCC_CFGR2_I2S2SRC */ #if defined(USB) || defined(USB_OTG_FS)
/**
#if defined(USB) || defined(USB_OTG_FS) * @brief Return USBx clock frequency
/** * @param USBxSource This parameter can be one of the following values:
* @brief Return USBx clock frequency * @arg @ref LL_RCC_USB_CLKSOURCE
* @param USBxSource This parameter can be one of the following values: * @retval USB clock frequency (in Hz)
* @arg @ref LL_RCC_USB_CLKSOURCE * @arg @ref LL_RCC_PERIPH_FREQUENCY_NO indicates that oscillator (HSI), HSE or PLL is not ready
* @retval USB clock frequency (in Hz) */
* @arg @ref LL_RCC_PERIPH_FREQUENCY_NO indicates that oscillator (HSI), HSE or PLL is not ready uint32_t LL_RCC_GetUSBClockFreq(uint32_t USBxSource)
*/ {
uint32_t LL_RCC_GetUSBClockFreq(uint32_t USBxSource) uint32_t usb_frequency = LL_RCC_PERIPH_FREQUENCY_NO;
{
uint32_t usb_frequency = LL_RCC_PERIPH_FREQUENCY_NO; /* Check parameter */
assert_param(IS_LL_RCC_USB_CLKSOURCE(USBxSource));
/* Check parameter */
assert_param(IS_LL_RCC_USB_CLKSOURCE(USBxSource)); /* USBCLK clock frequency */
switch (LL_RCC_GetUSBClockSource(USBxSource))
/* USBCLK clock frequency */ {
switch (LL_RCC_GetUSBClockSource(USBxSource)) #if defined(RCC_CFGR_USBPRE)
{ case LL_RCC_USB_CLKSOURCE_PLL: /* PLL clock used as USB clock source */
#if defined(RCC_CFGR_USBPRE) if (LL_RCC_PLL_IsReady())
case LL_RCC_USB_CLKSOURCE_PLL: /* PLL clock used as USB clock source */ {
if (LL_RCC_PLL_IsReady()) usb_frequency = RCC_PLL_GetFreqDomain_SYS();
{ }
usb_frequency = RCC_PLL_GetFreqDomain_SYS(); break;
}
break; case LL_RCC_USB_CLKSOURCE_PLL_DIV_1_5: /* PLL clock divided by 1.5 used as USB clock source */
default:
case LL_RCC_USB_CLKSOURCE_PLL_DIV_1_5: /* PLL clock divided by 1.5 used as USB clock source */ if (LL_RCC_PLL_IsReady())
default: {
if (LL_RCC_PLL_IsReady()) usb_frequency = (RCC_PLL_GetFreqDomain_SYS() * 3U) / 2U;
{ }
usb_frequency = (RCC_PLL_GetFreqDomain_SYS() * 3U) / 2U; break;
} #endif /* RCC_CFGR_USBPRE */
break; #if defined(RCC_CFGR_OTGFSPRE)
#endif /* RCC_CFGR_USBPRE */ /* USBCLK = PLLVCO/2
#if defined(RCC_CFGR_OTGFSPRE) = (2 x PLLCLK) / 2
/* USBCLK = PLLVCO/2 = PLLCLK */
= (2 x PLLCLK) / 2 case LL_RCC_USB_CLKSOURCE_PLL_DIV_2: /* PLL clock used as USB clock source */
= PLLCLK */ if (LL_RCC_PLL_IsReady())
case LL_RCC_USB_CLKSOURCE_PLL_DIV_2: /* PLL clock used as USB clock source */ {
if (LL_RCC_PLL_IsReady()) usb_frequency = RCC_PLL_GetFreqDomain_SYS();
{ }
usb_frequency = RCC_PLL_GetFreqDomain_SYS(); break;
}
break; /* USBCLK = PLLVCO/3
= (2 x PLLCLK) / 3 */
/* USBCLK = PLLVCO/3 case LL_RCC_USB_CLKSOURCE_PLL_DIV_3: /* PLL clock divided by 3 used as USB clock source */
= (2 x PLLCLK) / 3 */ default:
case LL_RCC_USB_CLKSOURCE_PLL_DIV_3: /* PLL clock divided by 3 used as USB clock source */ if (LL_RCC_PLL_IsReady())
default: {
if (LL_RCC_PLL_IsReady()) usb_frequency = (RCC_PLL_GetFreqDomain_SYS() * 2U) / 3U;
{ }
usb_frequency = (RCC_PLL_GetFreqDomain_SYS() * 2U) / 3U; break;
} #endif /* RCC_CFGR_OTGFSPRE */
break; }
#endif /* RCC_CFGR_OTGFSPRE */
} return usb_frequency;
}
return usb_frequency; #endif /* USB */
}
#endif /* USB */ /**
* @brief Return ADCx clock frequency
/** * @param ADCxSource This parameter can be one of the following values:
* @brief Return ADCx clock frequency * @arg @ref LL_RCC_ADC_CLKSOURCE
* @param ADCxSource This parameter can be one of the following values: * @retval ADC clock frequency (in Hz)
* @arg @ref LL_RCC_ADC_CLKSOURCE */
* @retval ADC clock frequency (in Hz) uint32_t LL_RCC_GetADCClockFreq(uint32_t ADCxSource)
*/ {
uint32_t LL_RCC_GetADCClockFreq(uint32_t ADCxSource) uint32_t adc_prescaler = 0U;
{ uint32_t adc_frequency = 0U;
uint32_t adc_prescaler = 0U;
uint32_t adc_frequency = 0U; /* Check parameter */
assert_param(IS_LL_RCC_ADC_CLKSOURCE(ADCxSource));
/* Check parameter */
assert_param(IS_LL_RCC_ADC_CLKSOURCE(ADCxSource)); /* Get ADC prescaler */
adc_prescaler = LL_RCC_GetADCClockSource(ADCxSource);
/* Get ADC prescaler */
adc_prescaler = LL_RCC_GetADCClockSource(ADCxSource); /* ADC frequency = PCLK2 frequency / ADC prescaler (2, 4, 6 or 8) */
adc_frequency = RCC_GetPCLK2ClockFreq(RCC_GetHCLKClockFreq(RCC_GetSystemClockFreq()))
/* ADC frequency = PCLK2 frequency / ADC prescaler (2, 4, 6 or 8) */ / (((adc_prescaler >> POSITION_VAL(ADCxSource)) + 1U) * 2U);
adc_frequency = RCC_GetPCLK2ClockFreq(RCC_GetHCLKClockFreq(RCC_GetSystemClockFreq()))
/ (((adc_prescaler >> POSITION_VAL(ADCxSource)) + 1U) * 2U); return adc_frequency;
}
return adc_frequency;
} /**
* @}
/** */
* @}
*/ /**
* @}
/** */
* @}
*/ /** @addtogroup RCC_LL_Private_Functions
* @{
/** @addtogroup RCC_LL_Private_Functions */
* @{
*/ /**
* @brief Return SYSTEM clock frequency
/** * @retval SYSTEM clock frequency (in Hz)
* @brief Return SYSTEM clock frequency */
* @retval SYSTEM clock frequency (in Hz) uint32_t RCC_GetSystemClockFreq(void)
*/ {
uint32_t RCC_GetSystemClockFreq(void) uint32_t frequency = 0U;
{
uint32_t frequency = 0U; /* Get SYSCLK source -------------------------------------------------------*/
switch (LL_RCC_GetSysClkSource())
/* Get SYSCLK source -------------------------------------------------------*/ {
switch (LL_RCC_GetSysClkSource()) case LL_RCC_SYS_CLKSOURCE_STATUS_HSI: /* HSI used as system clock source */
{ frequency = HSI_VALUE;
case LL_RCC_SYS_CLKSOURCE_STATUS_HSI: /* HSI used as system clock source */ break;
frequency = HSI_VALUE;
break; case LL_RCC_SYS_CLKSOURCE_STATUS_HSE: /* HSE used as system clock source */
frequency = HSE_VALUE;
case LL_RCC_SYS_CLKSOURCE_STATUS_HSE: /* HSE used as system clock source */ break;
frequency = HSE_VALUE;
break; case LL_RCC_SYS_CLKSOURCE_STATUS_PLL: /* PLL used as system clock source */
frequency = RCC_PLL_GetFreqDomain_SYS();
case LL_RCC_SYS_CLKSOURCE_STATUS_PLL: /* PLL used as system clock source */ break;
frequency = RCC_PLL_GetFreqDomain_SYS();
break; default:
frequency = HSI_VALUE;
default: break;
frequency = HSI_VALUE; }
break;
} return frequency;
}
return frequency;
} /**
* @brief Return HCLK clock frequency
/** * @param SYSCLK_Frequency SYSCLK clock frequency
* @brief Return HCLK clock frequency * @retval HCLK clock frequency (in Hz)
* @param SYSCLK_Frequency SYSCLK clock frequency */
* @retval HCLK clock frequency (in Hz) uint32_t RCC_GetHCLKClockFreq(uint32_t SYSCLK_Frequency)
*/ {
uint32_t RCC_GetHCLKClockFreq(uint32_t SYSCLK_Frequency) /* HCLK clock frequency */
{ return __LL_RCC_CALC_HCLK_FREQ(SYSCLK_Frequency, LL_RCC_GetAHBPrescaler());
/* HCLK clock frequency */ }
return __LL_RCC_CALC_HCLK_FREQ(SYSCLK_Frequency, LL_RCC_GetAHBPrescaler());
} /**
* @brief Return PCLK1 clock frequency
/** * @param HCLK_Frequency HCLK clock frequency
* @brief Return PCLK1 clock frequency * @retval PCLK1 clock frequency (in Hz)
* @param HCLK_Frequency HCLK clock frequency */
* @retval PCLK1 clock frequency (in Hz) uint32_t RCC_GetPCLK1ClockFreq(uint32_t HCLK_Frequency)
*/ {
uint32_t RCC_GetPCLK1ClockFreq(uint32_t HCLK_Frequency) /* PCLK1 clock frequency */
{ return __LL_RCC_CALC_PCLK1_FREQ(HCLK_Frequency, LL_RCC_GetAPB1Prescaler());
/* PCLK1 clock frequency */ }
return __LL_RCC_CALC_PCLK1_FREQ(HCLK_Frequency, LL_RCC_GetAPB1Prescaler());
} /**
* @brief Return PCLK2 clock frequency
/** * @param HCLK_Frequency HCLK clock frequency
* @brief Return PCLK2 clock frequency * @retval PCLK2 clock frequency (in Hz)
* @param HCLK_Frequency HCLK clock frequency */
* @retval PCLK2 clock frequency (in Hz) uint32_t RCC_GetPCLK2ClockFreq(uint32_t HCLK_Frequency)
*/ {
uint32_t RCC_GetPCLK2ClockFreq(uint32_t HCLK_Frequency) /* PCLK2 clock frequency */
{ return __LL_RCC_CALC_PCLK2_FREQ(HCLK_Frequency, LL_RCC_GetAPB2Prescaler());
/* PCLK2 clock frequency */ }
return __LL_RCC_CALC_PCLK2_FREQ(HCLK_Frequency, LL_RCC_GetAPB2Prescaler());
} /**
* @brief Return PLL clock frequency used for system domain
/** * @retval PLL clock frequency (in Hz)
* @brief Return PLL clock frequency used for system domain */
* @retval PLL clock frequency (in Hz) uint32_t RCC_PLL_GetFreqDomain_SYS(void)
*/ {
uint32_t RCC_PLL_GetFreqDomain_SYS(void) uint32_t pllinputfreq = 0U, pllsource = 0U;
{
uint32_t pllinputfreq = 0U, pllsource = 0U; /* PLL_VCO = (HSE_VALUE, HSI_VALUE or PLL2 / PLL Predivider) * PLL Multiplicator */
/* PLL_VCO = (HSE_VALUE, HSI_VALUE or PLL2 / PLL Predivider) * PLL Multiplicator */ /* Get PLL source */
pllsource = LL_RCC_PLL_GetMainSource();
/* Get PLL source */
pllsource = LL_RCC_PLL_GetMainSource(); switch (pllsource)
{
switch (pllsource) case LL_RCC_PLLSOURCE_HSI_DIV_2: /* HSI used as PLL clock source */
{ pllinputfreq = HSI_VALUE / 2U;
case LL_RCC_PLLSOURCE_HSI_DIV_2: /* HSI used as PLL clock source */ break;
pllinputfreq = HSI_VALUE / 2U;
break; case LL_RCC_PLLSOURCE_HSE: /* HSE used as PLL clock source */
pllinputfreq = HSE_VALUE / (LL_RCC_PLL_GetPrediv() + 1U);
case LL_RCC_PLLSOURCE_HSE: /* HSE used as PLL clock source */ break;
pllinputfreq = HSE_VALUE / (LL_RCC_PLL_GetPrediv() + 1U);
break; #if defined(RCC_PLL2_SUPPORT)
case LL_RCC_PLLSOURCE_PLL2: /* PLL2 used as PLL clock source */
#if defined(RCC_PLL2_SUPPORT) pllinputfreq = RCC_PLL2_GetFreqClockFreq() / (LL_RCC_PLL_GetPrediv() + 1U);
case LL_RCC_PLLSOURCE_PLL2: /* PLL2 used as PLL clock source */ break;
pllinputfreq = RCC_PLL2_GetFreqClockFreq() / (LL_RCC_PLL_GetPrediv() + 1U); #endif /* RCC_PLL2_SUPPORT */
break;
#endif /* RCC_PLL2_SUPPORT */ default:
pllinputfreq = HSI_VALUE / 2U;
default: break;
pllinputfreq = HSI_VALUE / 2U; }
break; return __LL_RCC_CALC_PLLCLK_FREQ(pllinputfreq, LL_RCC_PLL_GetMultiplicator());
} }
return __LL_RCC_CALC_PLLCLK_FREQ(pllinputfreq, LL_RCC_PLL_GetMultiplicator());
} #if defined(RCC_PLL2_SUPPORT)
/**
#if defined(RCC_PLL2_SUPPORT) * @brief Return PLL clock frequency used for system domain
/** * @retval PLL clock frequency (in Hz)
* @brief Return PLL clock frequency used for system domain */
* @retval PLL clock frequency (in Hz) uint32_t RCC_PLL2_GetFreqClockFreq(void)
*/ {
uint32_t RCC_PLL2_GetFreqClockFreq(void) return __LL_RCC_CALC_PLL2CLK_FREQ(HSE_VALUE, LL_RCC_PLL2_GetMultiplicator(), LL_RCC_HSE_GetPrediv2());
{ }
return __LL_RCC_CALC_PLL2CLK_FREQ(HSE_VALUE, LL_RCC_PLL2_GetMultiplicator(), LL_RCC_HSE_GetPrediv2()); #endif /* RCC_PLL2_SUPPORT */
}
#endif /* RCC_PLL2_SUPPORT */ #if defined(RCC_PLLI2S_SUPPORT)
/**
#if defined(RCC_PLLI2S_SUPPORT) * @brief Return PLL clock frequency used for system domain
/** * @retval PLL clock frequency (in Hz)
* @brief Return PLL clock frequency used for system domain */
* @retval PLL clock frequency (in Hz) uint32_t RCC_PLLI2S_GetFreqDomain_I2S(void)
*/ {
uint32_t RCC_PLLI2S_GetFreqDomain_I2S(void) return __LL_RCC_CALC_PLLI2SCLK_FREQ(HSE_VALUE, LL_RCC_PLLI2S_GetMultiplicator(), LL_RCC_HSE_GetPrediv2());
{ }
return __LL_RCC_CALC_PLLI2SCLK_FREQ(HSE_VALUE, LL_RCC_PLLI2S_GetMultiplicator(), LL_RCC_HSE_GetPrediv2()); #endif /* RCC_PLLI2S_SUPPORT */
}
#endif /* RCC_PLLI2S_SUPPORT */ /**
* @}
/** */
* @}
*/ /**
* @}
/** */
* @}
*/ #endif /* defined(RCC) */
#endif /* defined(RCC) */ /**
* @}
/** */
* @}
*/ #endif /* USE_FULL_LL_DRIVER */
#endif /* USE_FULL_LL_DRIVER */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

File diff suppressed because it is too large Load diff

View file

@ -1,446 +1,438 @@
/** /**
****************************************************************************** ******************************************************************************
* @file stm32f1xx_ll_usart.c * @file stm32f1xx_ll_usart.c
* @author MCD Application Team * @author MCD Application Team
* @brief USART LL module driver. * @brief USART LL module driver.
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under BSD 3-Clause license, * This software is licensed under terms that can be found in the LICENSE file
* the "License"; You may not use this file except in compliance with the * in the root directory of this software component.
* License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* opensource.org/licenses/BSD-3-Clause *
* ******************************************************************************
****************************************************************************** */
*/
#if defined(USE_FULL_LL_DRIVER)
#if defined(USE_FULL_LL_DRIVER)
/* Includes ------------------------------------------------------------------*/
/* Includes ------------------------------------------------------------------*/ #include "stm32f1xx_ll_usart.h"
#include "stm32f1xx_ll_usart.h" #include "stm32f1xx_ll_rcc.h"
#include "stm32f1xx_ll_rcc.h" #include "stm32f1xx_ll_bus.h"
#include "stm32f1xx_ll_bus.h" #ifdef USE_FULL_ASSERT
#ifdef USE_FULL_ASSERT #include "stm32_assert.h"
#include "stm32_assert.h" #else
#else #define assert_param(expr) ((void)0U)
#define assert_param(expr) ((void)0U) #endif
#endif
/** @addtogroup STM32F1xx_LL_Driver
/** @addtogroup STM32F1xx_LL_Driver * @{
* @{ */
*/
#if defined (USART1) || defined (USART2) || defined (USART3) || defined (UART4) || defined (UART5)
#if defined (USART1) || defined (USART2) || defined (USART3) || defined (UART4) || defined (UART5)
/** @addtogroup USART_LL
/** @addtogroup USART_LL * @{
* @{ */
*/
/* Private types -------------------------------------------------------------*/
/* Private types -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/ /* Private constants ---------------------------------------------------------*/
/* Private constants ---------------------------------------------------------*/ /** @addtogroup USART_LL_Private_Constants
/** @addtogroup USART_LL_Private_Constants * @{
* @{ */
*/
/**
/** * @}
* @} */
*/
/* Private macros ------------------------------------------------------------*/
/* Private macros ------------------------------------------------------------*/ /** @addtogroup USART_LL_Private_Macros
/** @addtogroup USART_LL_Private_Macros * @{
* @{ */
*/
/* __BAUDRATE__ The maximum Baud Rate is derived from the maximum clock available
/* __BAUDRATE__ The maximum Baud Rate is derived from the maximum clock available * divided by the smallest oversampling used on the USART (i.e. 8) */
* divided by the smallest oversampling used on the USART (i.e. 8) */ #define IS_LL_USART_BAUDRATE(__BAUDRATE__) ((__BAUDRATE__) <= 4500000U)
#define IS_LL_USART_BAUDRATE(__BAUDRATE__) ((__BAUDRATE__) <= 4500000U)
/* __VALUE__ In case of oversampling by 16 and 8, BRR content must be greater than or equal to 16d. */
/* __VALUE__ In case of oversampling by 16 and 8, BRR content must be greater than or equal to 16d. */ #define IS_LL_USART_BRR_MIN(__VALUE__) ((__VALUE__) >= 16U)
#define IS_LL_USART_BRR_MIN(__VALUE__) ((__VALUE__) >= 16U)
#define IS_LL_USART_DIRECTION(__VALUE__) (((__VALUE__) == LL_USART_DIRECTION_NONE) \
/* __VALUE__ BRR content must be lower than or equal to 0xFFFF. */ || ((__VALUE__) == LL_USART_DIRECTION_RX) \
#define IS_LL_USART_BRR_MAX(__VALUE__) ((__VALUE__) <= 0x0000FFFFU) || ((__VALUE__) == LL_USART_DIRECTION_TX) \
|| ((__VALUE__) == LL_USART_DIRECTION_TX_RX))
#define IS_LL_USART_DIRECTION(__VALUE__) (((__VALUE__) == LL_USART_DIRECTION_NONE) \
|| ((__VALUE__) == LL_USART_DIRECTION_RX) \ #define IS_LL_USART_PARITY(__VALUE__) (((__VALUE__) == LL_USART_PARITY_NONE) \
|| ((__VALUE__) == LL_USART_DIRECTION_TX) \ || ((__VALUE__) == LL_USART_PARITY_EVEN) \
|| ((__VALUE__) == LL_USART_DIRECTION_TX_RX)) || ((__VALUE__) == LL_USART_PARITY_ODD))
#define IS_LL_USART_PARITY(__VALUE__) (((__VALUE__) == LL_USART_PARITY_NONE) \ #define IS_LL_USART_DATAWIDTH(__VALUE__) (((__VALUE__) == LL_USART_DATAWIDTH_8B) \
|| ((__VALUE__) == LL_USART_PARITY_EVEN) \ || ((__VALUE__) == LL_USART_DATAWIDTH_9B))
|| ((__VALUE__) == LL_USART_PARITY_ODD))
#define IS_LL_USART_OVERSAMPLING(__VALUE__) (((__VALUE__) == LL_USART_OVERSAMPLING_16) \
#define IS_LL_USART_DATAWIDTH(__VALUE__) (((__VALUE__) == LL_USART_DATAWIDTH_8B) \ || ((__VALUE__) == LL_USART_OVERSAMPLING_8))
|| ((__VALUE__) == LL_USART_DATAWIDTH_9B))
#define IS_LL_USART_LASTBITCLKOUTPUT(__VALUE__) (((__VALUE__) == LL_USART_LASTCLKPULSE_NO_OUTPUT) \
#define IS_LL_USART_OVERSAMPLING(__VALUE__) (((__VALUE__) == LL_USART_OVERSAMPLING_16) \ || ((__VALUE__) == LL_USART_LASTCLKPULSE_OUTPUT))
|| ((__VALUE__) == LL_USART_OVERSAMPLING_8))
#define IS_LL_USART_CLOCKPHASE(__VALUE__) (((__VALUE__) == LL_USART_PHASE_1EDGE) \
#define IS_LL_USART_LASTBITCLKOUTPUT(__VALUE__) (((__VALUE__) == LL_USART_LASTCLKPULSE_NO_OUTPUT) \ || ((__VALUE__) == LL_USART_PHASE_2EDGE))
|| ((__VALUE__) == LL_USART_LASTCLKPULSE_OUTPUT))
#define IS_LL_USART_CLOCKPOLARITY(__VALUE__) (((__VALUE__) == LL_USART_POLARITY_LOW) \
#define IS_LL_USART_CLOCKPHASE(__VALUE__) (((__VALUE__) == LL_USART_PHASE_1EDGE) \ || ((__VALUE__) == LL_USART_POLARITY_HIGH))
|| ((__VALUE__) == LL_USART_PHASE_2EDGE))
#define IS_LL_USART_CLOCKOUTPUT(__VALUE__) (((__VALUE__) == LL_USART_CLOCK_DISABLE) \
#define IS_LL_USART_CLOCKPOLARITY(__VALUE__) (((__VALUE__) == LL_USART_POLARITY_LOW) \ || ((__VALUE__) == LL_USART_CLOCK_ENABLE))
|| ((__VALUE__) == LL_USART_POLARITY_HIGH))
#define IS_LL_USART_STOPBITS(__VALUE__) (((__VALUE__) == LL_USART_STOPBITS_0_5) \
#define IS_LL_USART_CLOCKOUTPUT(__VALUE__) (((__VALUE__) == LL_USART_CLOCK_DISABLE) \ || ((__VALUE__) == LL_USART_STOPBITS_1) \
|| ((__VALUE__) == LL_USART_CLOCK_ENABLE)) || ((__VALUE__) == LL_USART_STOPBITS_1_5) \
|| ((__VALUE__) == LL_USART_STOPBITS_2))
#define IS_LL_USART_STOPBITS(__VALUE__) (((__VALUE__) == LL_USART_STOPBITS_0_5) \
|| ((__VALUE__) == LL_USART_STOPBITS_1) \ #define IS_LL_USART_HWCONTROL(__VALUE__) (((__VALUE__) == LL_USART_HWCONTROL_NONE) \
|| ((__VALUE__) == LL_USART_STOPBITS_1_5) \ || ((__VALUE__) == LL_USART_HWCONTROL_RTS) \
|| ((__VALUE__) == LL_USART_STOPBITS_2)) || ((__VALUE__) == LL_USART_HWCONTROL_CTS) \
|| ((__VALUE__) == LL_USART_HWCONTROL_RTS_CTS))
#define IS_LL_USART_HWCONTROL(__VALUE__) (((__VALUE__) == LL_USART_HWCONTROL_NONE) \
|| ((__VALUE__) == LL_USART_HWCONTROL_RTS) \ /**
|| ((__VALUE__) == LL_USART_HWCONTROL_CTS) \ * @}
|| ((__VALUE__) == LL_USART_HWCONTROL_RTS_CTS)) */
/** /* Private function prototypes -----------------------------------------------*/
* @}
*/ /* Exported functions --------------------------------------------------------*/
/** @addtogroup USART_LL_Exported_Functions
/* Private function prototypes -----------------------------------------------*/ * @{
*/
/* Exported functions --------------------------------------------------------*/
/** @addtogroup USART_LL_Exported_Functions /** @addtogroup USART_LL_EF_Init
* @{ * @{
*/ */
/** @addtogroup USART_LL_EF_Init /**
* @{ * @brief De-initialize USART registers (Registers restored to their default values).
*/ * @param USARTx USART Instance
* @retval An ErrorStatus enumeration value:
/** * - SUCCESS: USART registers are de-initialized
* @brief De-initialize USART registers (Registers restored to their default values). * - ERROR: USART registers are not de-initialized
* @param USARTx USART Instance */
* @retval An ErrorStatus enumeration value: ErrorStatus LL_USART_DeInit(const USART_TypeDef *USARTx)
* - SUCCESS: USART registers are de-initialized {
* - ERROR: USART registers are not de-initialized ErrorStatus status = SUCCESS;
*/
ErrorStatus LL_USART_DeInit(USART_TypeDef *USARTx) /* Check the parameters */
{ assert_param(IS_UART_INSTANCE(USARTx));
ErrorStatus status = SUCCESS;
if (USARTx == USART1)
/* Check the parameters */ {
assert_param(IS_UART_INSTANCE(USARTx)); /* Force reset of USART clock */
LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_USART1);
if (USARTx == USART1)
{ /* Release reset of USART clock */
/* Force reset of USART clock */ LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_USART1);
LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_USART1); }
else if (USARTx == USART2)
/* Release reset of USART clock */ {
LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_USART1); /* Force reset of USART clock */
} LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_USART2);
else if (USARTx == USART2)
{ /* Release reset of USART clock */
/* Force reset of USART clock */ LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_USART2);
LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_USART2); }
#if defined(USART3)
/* Release reset of USART clock */ else if (USARTx == USART3)
LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_USART2); {
} /* Force reset of USART clock */
#if defined(USART3) LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_USART3);
else if (USARTx == USART3)
{ /* Release reset of USART clock */
/* Force reset of USART clock */ LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_USART3);
LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_USART3); }
#endif /* USART3 */
/* Release reset of USART clock */ #if defined(UART4)
LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_USART3); else if (USARTx == UART4)
} {
#endif /* USART3 */ /* Force reset of UART clock */
#if defined(UART4) LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_UART4);
else if (USARTx == UART4)
{ /* Release reset of UART clock */
/* Force reset of UART clock */ LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_UART4);
LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_UART4); }
#endif /* UART4 */
/* Release reset of UART clock */ #if defined(UART5)
LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_UART4); else if (USARTx == UART5)
} {
#endif /* UART4 */ /* Force reset of UART clock */
#if defined(UART5) LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_UART5);
else if (USARTx == UART5)
{ /* Release reset of UART clock */
/* Force reset of UART clock */ LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_UART5);
LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_UART5); }
#endif /* UART5 */
/* Release reset of UART clock */ else
LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_UART5); {
} status = ERROR;
#endif /* UART5 */ }
else
{ return (status);
status = ERROR; }
}
/**
return (status); * @brief Initialize USART registers according to the specified
} * parameters in USART_InitStruct.
* @note As some bits in USART configuration registers can only be written when the USART is disabled (USART_CR1_UE bit =0),
/** * USART IP should be in disabled state prior calling this function. Otherwise, ERROR result will be returned.
* @brief Initialize USART registers according to the specified * @note Baud rate value stored in USART_InitStruct BaudRate field, should be valid (different from 0).
* parameters in USART_InitStruct. * @param USARTx USART Instance
* @note As some bits in USART configuration registers can only be written when the USART is disabled (USART_CR1_UE bit =0), * @param USART_InitStruct pointer to a LL_USART_InitTypeDef structure
* USART IP should be in disabled state prior calling this function. Otherwise, ERROR result will be returned. * that contains the configuration information for the specified USART peripheral.
* @note Baud rate value stored in USART_InitStruct BaudRate field, should be valid (different from 0). * @retval An ErrorStatus enumeration value:
* @param USARTx USART Instance * - SUCCESS: USART registers are initialized according to USART_InitStruct content
* @param USART_InitStruct pointer to a LL_USART_InitTypeDef structure * - ERROR: Problem occurred during USART Registers initialization
* that contains the configuration information for the specified USART peripheral. */
* @retval An ErrorStatus enumeration value: ErrorStatus LL_USART_Init(USART_TypeDef *USARTx, const LL_USART_InitTypeDef *USART_InitStruct)
* - SUCCESS: USART registers are initialized according to USART_InitStruct content {
* - ERROR: Problem occurred during USART Registers initialization ErrorStatus status = ERROR;
*/ uint32_t periphclk = LL_RCC_PERIPH_FREQUENCY_NO;
ErrorStatus LL_USART_Init(USART_TypeDef *USARTx, LL_USART_InitTypeDef *USART_InitStruct) LL_RCC_ClocksTypeDef rcc_clocks;
{
ErrorStatus status = ERROR; /* Check the parameters */
uint32_t periphclk = LL_RCC_PERIPH_FREQUENCY_NO; assert_param(IS_UART_INSTANCE(USARTx));
LL_RCC_ClocksTypeDef rcc_clocks; assert_param(IS_LL_USART_BAUDRATE(USART_InitStruct->BaudRate));
assert_param(IS_LL_USART_DATAWIDTH(USART_InitStruct->DataWidth));
/* Check the parameters */ assert_param(IS_LL_USART_STOPBITS(USART_InitStruct->StopBits));
assert_param(IS_UART_INSTANCE(USARTx)); assert_param(IS_LL_USART_PARITY(USART_InitStruct->Parity));
assert_param(IS_LL_USART_BAUDRATE(USART_InitStruct->BaudRate)); assert_param(IS_LL_USART_DIRECTION(USART_InitStruct->TransferDirection));
assert_param(IS_LL_USART_DATAWIDTH(USART_InitStruct->DataWidth)); assert_param(IS_LL_USART_HWCONTROL(USART_InitStruct->HardwareFlowControl));
assert_param(IS_LL_USART_STOPBITS(USART_InitStruct->StopBits)); #if defined(USART_CR1_OVER8)
assert_param(IS_LL_USART_PARITY(USART_InitStruct->Parity)); assert_param(IS_LL_USART_OVERSAMPLING(USART_InitStruct->OverSampling));
assert_param(IS_LL_USART_DIRECTION(USART_InitStruct->TransferDirection)); #endif /* USART_OverSampling_Feature */
assert_param(IS_LL_USART_HWCONTROL(USART_InitStruct->HardwareFlowControl));
#if defined(USART_CR1_OVER8) /* USART needs to be in disabled state, in order to be able to configure some bits in
assert_param(IS_LL_USART_OVERSAMPLING(USART_InitStruct->OverSampling)); CRx registers */
#endif /* USART_OverSampling_Feature */ if (LL_USART_IsEnabled(USARTx) == 0U)
{
/* USART needs to be in disabled state, in order to be able to configure some bits in /*---------------------------- USART CR1 Configuration -----------------------
CRx registers */ * Configure USARTx CR1 (USART Word Length, Parity, Mode and Oversampling bits) with parameters:
if (LL_USART_IsEnabled(USARTx) == 0U) * - DataWidth: USART_CR1_M bits according to USART_InitStruct->DataWidth value
{ * - Parity: USART_CR1_PCE, USART_CR1_PS bits according to USART_InitStruct->Parity value
/*---------------------------- USART CR1 Configuration ----------------------- * - TransferDirection: USART_CR1_TE, USART_CR1_RE bits according to USART_InitStruct->TransferDirection value
* Configure USARTx CR1 (USART Word Length, Parity, Mode and Oversampling bits) with parameters: * - Oversampling: USART_CR1_OVER8 bit according to USART_InitStruct->OverSampling value.
* - DataWidth: USART_CR1_M bits according to USART_InitStruct->DataWidth value */
* - Parity: USART_CR1_PCE, USART_CR1_PS bits according to USART_InitStruct->Parity value #if defined(USART_CR1_OVER8)
* - TransferDirection: USART_CR1_TE, USART_CR1_RE bits according to USART_InitStruct->TransferDirection value MODIFY_REG(USARTx->CR1,
* - Oversampling: USART_CR1_OVER8 bit according to USART_InitStruct->OverSampling value. (USART_CR1_M | USART_CR1_PCE | USART_CR1_PS |
*/ USART_CR1_TE | USART_CR1_RE | USART_CR1_OVER8),
#if defined(USART_CR1_OVER8) (USART_InitStruct->DataWidth | USART_InitStruct->Parity |
MODIFY_REG(USARTx->CR1, USART_InitStruct->TransferDirection | USART_InitStruct->OverSampling));
(USART_CR1_M | USART_CR1_PCE | USART_CR1_PS | #else
USART_CR1_TE | USART_CR1_RE | USART_CR1_OVER8), MODIFY_REG(USARTx->CR1,
(USART_InitStruct->DataWidth | USART_InitStruct->Parity | (USART_CR1_M | USART_CR1_PCE | USART_CR1_PS |
USART_InitStruct->TransferDirection | USART_InitStruct->OverSampling)); USART_CR1_TE | USART_CR1_RE),
#else (USART_InitStruct->DataWidth | USART_InitStruct->Parity |
MODIFY_REG(USARTx->CR1, USART_InitStruct->TransferDirection));
(USART_CR1_M | USART_CR1_PCE | USART_CR1_PS | #endif /* USART_OverSampling_Feature */
USART_CR1_TE | USART_CR1_RE),
(USART_InitStruct->DataWidth | USART_InitStruct->Parity | /*---------------------------- USART CR2 Configuration -----------------------
USART_InitStruct->TransferDirection)); * Configure USARTx CR2 (Stop bits) with parameters:
#endif /* USART_OverSampling_Feature */ * - Stop Bits: USART_CR2_STOP bits according to USART_InitStruct->StopBits value.
* - CLKEN, CPOL, CPHA and LBCL bits are to be configured using LL_USART_ClockInit().
/*---------------------------- USART CR2 Configuration ----------------------- */
* Configure USARTx CR2 (Stop bits) with parameters: LL_USART_SetStopBitsLength(USARTx, USART_InitStruct->StopBits);
* - Stop Bits: USART_CR2_STOP bits according to USART_InitStruct->StopBits value.
* - CLKEN, CPOL, CPHA and LBCL bits are to be configured using LL_USART_ClockInit(). /*---------------------------- USART CR3 Configuration -----------------------
*/ * Configure USARTx CR3 (Hardware Flow Control) with parameters:
LL_USART_SetStopBitsLength(USARTx, USART_InitStruct->StopBits); * - HardwareFlowControl: USART_CR3_RTSE, USART_CR3_CTSE bits according to USART_InitStruct->HardwareFlowControl value.
*/
/*---------------------------- USART CR3 Configuration ----------------------- LL_USART_SetHWFlowCtrl(USARTx, USART_InitStruct->HardwareFlowControl);
* Configure USARTx CR3 (Hardware Flow Control) with parameters:
* - HardwareFlowControl: USART_CR3_RTSE, USART_CR3_CTSE bits according to USART_InitStruct->HardwareFlowControl value. /*---------------------------- USART BRR Configuration -----------------------
*/ * Retrieve Clock frequency used for USART Peripheral
LL_USART_SetHWFlowCtrl(USARTx, USART_InitStruct->HardwareFlowControl); */
LL_RCC_GetSystemClocksFreq(&rcc_clocks);
/*---------------------------- USART BRR Configuration ----------------------- if (USARTx == USART1)
* Retrieve Clock frequency used for USART Peripheral {
*/ periphclk = rcc_clocks.PCLK2_Frequency;
LL_RCC_GetSystemClocksFreq(&rcc_clocks); }
if (USARTx == USART1) else if (USARTx == USART2)
{ {
periphclk = rcc_clocks.PCLK2_Frequency; periphclk = rcc_clocks.PCLK1_Frequency;
} }
else if (USARTx == USART2) #if defined(USART3)
{ else if (USARTx == USART3)
periphclk = rcc_clocks.PCLK1_Frequency; {
} periphclk = rcc_clocks.PCLK1_Frequency;
#if defined(USART3) }
else if (USARTx == USART3) #endif /* USART3 */
{ #if defined(UART4)
periphclk = rcc_clocks.PCLK1_Frequency; else if (USARTx == UART4)
} {
#endif /* USART3 */ periphclk = rcc_clocks.PCLK1_Frequency;
#if defined(UART4) }
else if (USARTx == UART4) #endif /* UART4 */
{ #if defined(UART5)
periphclk = rcc_clocks.PCLK1_Frequency; else if (USARTx == UART5)
} {
#endif /* UART4 */ periphclk = rcc_clocks.PCLK1_Frequency;
#if defined(UART5) }
else if (USARTx == UART5) #endif /* UART5 */
{ else
periphclk = rcc_clocks.PCLK1_Frequency; {
} /* Nothing to do, as error code is already assigned to ERROR value */
#endif /* UART5 */ }
else
{ /* Configure the USART Baud Rate :
/* Nothing to do, as error code is already assigned to ERROR value */ - valid baud rate value (different from 0) is required
} - Peripheral clock as returned by RCC service, should be valid (different from 0).
*/
/* Configure the USART Baud Rate : if ((periphclk != LL_RCC_PERIPH_FREQUENCY_NO)
- valid baud rate value (different from 0) is required && (USART_InitStruct->BaudRate != 0U))
- Peripheral clock as returned by RCC service, should be valid (different from 0). {
*/ status = SUCCESS;
if ((periphclk != LL_RCC_PERIPH_FREQUENCY_NO) #if defined(USART_CR1_OVER8)
&& (USART_InitStruct->BaudRate != 0U)) LL_USART_SetBaudRate(USARTx,
{ periphclk,
status = SUCCESS; USART_InitStruct->OverSampling,
#if defined(USART_CR1_OVER8) USART_InitStruct->BaudRate);
LL_USART_SetBaudRate(USARTx, #else
periphclk, LL_USART_SetBaudRate(USARTx,
USART_InitStruct->OverSampling, periphclk,
USART_InitStruct->BaudRate); USART_InitStruct->BaudRate);
#else #endif /* USART_OverSampling_Feature */
LL_USART_SetBaudRate(USARTx,
periphclk, /* Check BRR is greater than or equal to 16d */
USART_InitStruct->BaudRate); assert_param(IS_LL_USART_BRR_MIN(USARTx->BRR));
#endif /* USART_OverSampling_Feature */ }
}
/* Check BRR is greater than or equal to 16d */ /* Endif (=> USART not in Disabled state => return ERROR) */
assert_param(IS_LL_USART_BRR_MIN(USARTx->BRR));
return (status);
/* Check BRR is greater than or equal to 16d */ }
assert_param(IS_LL_USART_BRR_MAX(USARTx->BRR));
} /**
} * @brief Set each @ref LL_USART_InitTypeDef field to default value.
/* Endif (=> USART not in Disabled state => return ERROR) */ * @param USART_InitStruct Pointer to a @ref LL_USART_InitTypeDef structure
* whose fields will be set to default values.
return (status); * @retval None
} */
/** void LL_USART_StructInit(LL_USART_InitTypeDef *USART_InitStruct)
* @brief Set each @ref LL_USART_InitTypeDef field to default value. {
* @param USART_InitStruct Pointer to a @ref LL_USART_InitTypeDef structure /* Set USART_InitStruct fields to default values */
* whose fields will be set to default values. USART_InitStruct->BaudRate = 9600U;
* @retval None USART_InitStruct->DataWidth = LL_USART_DATAWIDTH_8B;
*/ USART_InitStruct->StopBits = LL_USART_STOPBITS_1;
USART_InitStruct->Parity = LL_USART_PARITY_NONE ;
void LL_USART_StructInit(LL_USART_InitTypeDef *USART_InitStruct) USART_InitStruct->TransferDirection = LL_USART_DIRECTION_TX_RX;
{ USART_InitStruct->HardwareFlowControl = LL_USART_HWCONTROL_NONE;
/* Set USART_InitStruct fields to default values */ #if defined(USART_CR1_OVER8)
USART_InitStruct->BaudRate = 9600U; USART_InitStruct->OverSampling = LL_USART_OVERSAMPLING_16;
USART_InitStruct->DataWidth = LL_USART_DATAWIDTH_8B; #endif /* USART_OverSampling_Feature */
USART_InitStruct->StopBits = LL_USART_STOPBITS_1; }
USART_InitStruct->Parity = LL_USART_PARITY_NONE ;
USART_InitStruct->TransferDirection = LL_USART_DIRECTION_TX_RX; /**
USART_InitStruct->HardwareFlowControl = LL_USART_HWCONTROL_NONE; * @brief Initialize USART Clock related settings according to the
#if defined(USART_CR1_OVER8) * specified parameters in the USART_ClockInitStruct.
USART_InitStruct->OverSampling = LL_USART_OVERSAMPLING_16; * @note As some bits in USART configuration registers can only be written when the USART is disabled (USART_CR1_UE bit =0),
#endif /* USART_OverSampling_Feature */ * USART IP should be in disabled state prior calling this function. Otherwise, ERROR result will be returned.
} * @param USARTx USART Instance
* @param USART_ClockInitStruct Pointer to a @ref LL_USART_ClockInitTypeDef structure
/** * that contains the Clock configuration information for the specified USART peripheral.
* @brief Initialize USART Clock related settings according to the * @retval An ErrorStatus enumeration value:
* specified parameters in the USART_ClockInitStruct. * - SUCCESS: USART registers related to Clock settings are initialized according to USART_ClockInitStruct content
* @note As some bits in USART configuration registers can only be written when the USART is disabled (USART_CR1_UE bit =0), * - ERROR: Problem occurred during USART Registers initialization
* USART IP should be in disabled state prior calling this function. Otherwise, ERROR result will be returned. */
* @param USARTx USART Instance ErrorStatus LL_USART_ClockInit(USART_TypeDef *USARTx, const LL_USART_ClockInitTypeDef *USART_ClockInitStruct)
* @param USART_ClockInitStruct Pointer to a @ref LL_USART_ClockInitTypeDef structure {
* that contains the Clock configuration information for the specified USART peripheral. ErrorStatus status = SUCCESS;
* @retval An ErrorStatus enumeration value:
* - SUCCESS: USART registers related to Clock settings are initialized according to USART_ClockInitStruct content /* Check USART Instance and Clock signal output parameters */
* - ERROR: Problem occurred during USART Registers initialization assert_param(IS_UART_INSTANCE(USARTx));
*/ assert_param(IS_LL_USART_CLOCKOUTPUT(USART_ClockInitStruct->ClockOutput));
ErrorStatus LL_USART_ClockInit(USART_TypeDef *USARTx, LL_USART_ClockInitTypeDef *USART_ClockInitStruct)
{ /* USART needs to be in disabled state, in order to be able to configure some bits in
ErrorStatus status = SUCCESS; CRx registers */
if (LL_USART_IsEnabled(USARTx) == 0U)
/* Check USART Instance and Clock signal output parameters */ {
assert_param(IS_UART_INSTANCE(USARTx)); /*---------------------------- USART CR2 Configuration -----------------------*/
assert_param(IS_LL_USART_CLOCKOUTPUT(USART_ClockInitStruct->ClockOutput)); /* If Clock signal has to be output */
if (USART_ClockInitStruct->ClockOutput == LL_USART_CLOCK_DISABLE)
/* USART needs to be in disabled state, in order to be able to configure some bits in {
CRx registers */ /* Deactivate Clock signal delivery :
if (LL_USART_IsEnabled(USARTx) == 0U) * - Disable Clock Output: USART_CR2_CLKEN cleared
{ */
/*---------------------------- USART CR2 Configuration -----------------------*/ LL_USART_DisableSCLKOutput(USARTx);
/* If Clock signal has to be output */ }
if (USART_ClockInitStruct->ClockOutput == LL_USART_CLOCK_DISABLE) else
{ {
/* Deactivate Clock signal delivery : /* Ensure USART instance is USART capable */
* - Disable Clock Output: USART_CR2_CLKEN cleared assert_param(IS_USART_INSTANCE(USARTx));
*/
LL_USART_DisableSCLKOutput(USARTx); /* Check clock related parameters */
} assert_param(IS_LL_USART_CLOCKPOLARITY(USART_ClockInitStruct->ClockPolarity));
else assert_param(IS_LL_USART_CLOCKPHASE(USART_ClockInitStruct->ClockPhase));
{ assert_param(IS_LL_USART_LASTBITCLKOUTPUT(USART_ClockInitStruct->LastBitClockPulse));
/* Ensure USART instance is USART capable */
assert_param(IS_USART_INSTANCE(USARTx)); /*---------------------------- USART CR2 Configuration -----------------------
* Configure USARTx CR2 (Clock signal related bits) with parameters:
/* Check clock related parameters */ * - Enable Clock Output: USART_CR2_CLKEN set
assert_param(IS_LL_USART_CLOCKPOLARITY(USART_ClockInitStruct->ClockPolarity)); * - Clock Polarity: USART_CR2_CPOL bit according to USART_ClockInitStruct->ClockPolarity value
assert_param(IS_LL_USART_CLOCKPHASE(USART_ClockInitStruct->ClockPhase)); * - Clock Phase: USART_CR2_CPHA bit according to USART_ClockInitStruct->ClockPhase value
assert_param(IS_LL_USART_LASTBITCLKOUTPUT(USART_ClockInitStruct->LastBitClockPulse)); * - Last Bit Clock Pulse Output: USART_CR2_LBCL bit according to USART_ClockInitStruct->LastBitClockPulse value.
*/
/*---------------------------- USART CR2 Configuration ----------------------- MODIFY_REG(USARTx->CR2,
* Configure USARTx CR2 (Clock signal related bits) with parameters: USART_CR2_CLKEN | USART_CR2_CPHA | USART_CR2_CPOL | USART_CR2_LBCL,
* - Enable Clock Output: USART_CR2_CLKEN set USART_CR2_CLKEN | USART_ClockInitStruct->ClockPolarity |
* - Clock Polarity: USART_CR2_CPOL bit according to USART_ClockInitStruct->ClockPolarity value USART_ClockInitStruct->ClockPhase | USART_ClockInitStruct->LastBitClockPulse);
* - Clock Phase: USART_CR2_CPHA bit according to USART_ClockInitStruct->ClockPhase value }
* - Last Bit Clock Pulse Output: USART_CR2_LBCL bit according to USART_ClockInitStruct->LastBitClockPulse value. }
*/ /* Else (USART not in Disabled state => return ERROR */
MODIFY_REG(USARTx->CR2, else
USART_CR2_CLKEN | USART_CR2_CPHA | USART_CR2_CPOL | USART_CR2_LBCL, {
USART_CR2_CLKEN | USART_ClockInitStruct->ClockPolarity | status = ERROR;
USART_ClockInitStruct->ClockPhase | USART_ClockInitStruct->LastBitClockPulse); }
}
} return (status);
/* Else (USART not in Disabled state => return ERROR */ }
else
{ /**
status = ERROR; * @brief Set each field of a @ref LL_USART_ClockInitTypeDef type structure to default value.
} * @param USART_ClockInitStruct Pointer to a @ref LL_USART_ClockInitTypeDef structure
* whose fields will be set to default values.
return (status); * @retval None
} */
void LL_USART_ClockStructInit(LL_USART_ClockInitTypeDef *USART_ClockInitStruct)
/** {
* @brief Set each field of a @ref LL_USART_ClockInitTypeDef type structure to default value. /* Set LL_USART_ClockInitStruct fields with default values */
* @param USART_ClockInitStruct Pointer to a @ref LL_USART_ClockInitTypeDef structure USART_ClockInitStruct->ClockOutput = LL_USART_CLOCK_DISABLE;
* whose fields will be set to default values. USART_ClockInitStruct->ClockPolarity = LL_USART_POLARITY_LOW; /* Not relevant when ClockOutput = LL_USART_CLOCK_DISABLE */
* @retval None USART_ClockInitStruct->ClockPhase = LL_USART_PHASE_1EDGE; /* Not relevant when ClockOutput = LL_USART_CLOCK_DISABLE */
*/ USART_ClockInitStruct->LastBitClockPulse = LL_USART_LASTCLKPULSE_NO_OUTPUT; /* Not relevant when ClockOutput = LL_USART_CLOCK_DISABLE */
void LL_USART_ClockStructInit(LL_USART_ClockInitTypeDef *USART_ClockInitStruct) }
{
/* Set LL_USART_ClockInitStruct fields with default values */ /**
USART_ClockInitStruct->ClockOutput = LL_USART_CLOCK_DISABLE; * @}
USART_ClockInitStruct->ClockPolarity = LL_USART_POLARITY_LOW; /* Not relevant when ClockOutput = LL_USART_CLOCK_DISABLE */ */
USART_ClockInitStruct->ClockPhase = LL_USART_PHASE_1EDGE; /* Not relevant when ClockOutput = LL_USART_CLOCK_DISABLE */
USART_ClockInitStruct->LastBitClockPulse = LL_USART_LASTCLKPULSE_NO_OUTPUT; /* Not relevant when ClockOutput = LL_USART_CLOCK_DISABLE */ /**
} * @}
*/
/**
* @} /**
*/ * @}
*/
/**
* @} #endif /* USART1 || USART2 || USART3 || UART4 || UART5 */
*/
/**
/** * @}
* @} */
*/
#endif /* USE_FULL_LL_DRIVER */
#endif /* USART1 || USART2 || USART3 || UART4 || UART5 */
/**
* @}
*/
#endif /* USE_FULL_LL_DRIVER */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

File diff suppressed because it is too large Load diff

View file

@ -78,6 +78,9 @@
#define configTIMER_QUEUE_LENGTH 10 #define configTIMER_QUEUE_LENGTH 10
#define configTIMER_TASK_STACK_DEPTH 64 #define configTIMER_TASK_STACK_DEPTH 64
/* The following flag must be enabled only when using newlib */
#define configUSE_NEWLIB_REENTRANT 1
/* Set the following definitions to 1 to include the API function, or zero /* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */ to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1 #define INCLUDE_vTaskPrioritySet 1

View file

@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/** /**
****************************************************************************** ******************************************************************************
* @file dma.h * @file dma.h
@ -6,16 +7,16 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2020 STMicroelectronics. * Copyright (c) 2025 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under Ultimate Liberty license * This software is licensed under terms that can be found in the LICENSE file
* SLA0044, the "License"; You may not use this file except in compliance with * in the root directory of this software component.
* the License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* www.st.com/SLA0044
* *
****************************************************************************** ******************************************************************************
*/ */
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/ /* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __DMA_H__ #ifndef __DMA_H__
#define __DMA_H__ #define __DMA_H__
@ -49,4 +50,3 @@ void MX_DMA_Init(void);
#endif /* __DMA_H__ */ #endif /* __DMA_H__ */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/** /**
****************************************************************************** ******************************************************************************
* @file gpio.h * @file gpio.h
@ -6,16 +7,16 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2020 STMicroelectronics. * Copyright (c) 2025 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under Ultimate Liberty license * This software is licensed under terms that can be found in the LICENSE file
* SLA0044, the "License"; You may not use this file except in compliance with * in the root directory of this software component.
* the License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* www.st.com/SLA0044
* *
****************************************************************************** ******************************************************************************
*/ */
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/ /* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __GPIO_H__ #ifndef __GPIO_H__
#define __GPIO_H__ #define __GPIO_H__
@ -46,4 +47,3 @@ void MX_GPIO_Init(void);
#endif #endif
#endif /*__ GPIO_H__ */ #endif /*__ GPIO_H__ */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -28,6 +28,7 @@ extern "C" {
#endif #endif
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_ll_dma.h" #include "stm32f1xx_ll_dma.h"
#include "stm32f1xx_ll_rcc.h" #include "stm32f1xx_ll_rcc.h"
#include "stm32f1xx_ll_bus.h" #include "stm32f1xx_ll_bus.h"
@ -38,7 +39,6 @@ extern "C" {
#include "stm32f1xx_ll_pwr.h" #include "stm32f1xx_ll_pwr.h"
#include "stm32f1xx_ll_spi.h" #include "stm32f1xx_ll_spi.h"
#include "stm32f1xx_ll_usart.h" #include "stm32f1xx_ll_usart.h"
#include "stm32f1xx.h"
#include "stm32f1xx_ll_gpio.h" #include "stm32f1xx_ll_gpio.h"
#if defined(USE_FULL_ASSERT) #if defined(USE_FULL_ASSERT)
@ -86,6 +86,7 @@ void Error_Handler(void);
#define NVIC_PRIORITYGROUP_4 ((uint32_t)0x00000003) /*!< 4 bits for pre-emption priority, #define NVIC_PRIORITYGROUP_4 ((uint32_t)0x00000003) /*!< 4 bits for pre-emption priority,
0 bit for subpriority */ 0 bit for subpriority */
#endif #endif
/* USER CODE BEGIN Private defines */ /* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */ /* USER CODE END Private defines */
@ -95,5 +96,3 @@ void Error_Handler(void);
#endif #endif
#endif /* __MAIN_H */ #endif /* __MAIN_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/** /**
****************************************************************************** ******************************************************************************
* @file spi.h * @file spi.h
@ -6,16 +7,16 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2020 STMicroelectronics. * Copyright (c) 2025 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under Ultimate Liberty license * This software is licensed under terms that can be found in the LICENSE file
* SLA0044, the "License"; You may not use this file except in compliance with * in the root directory of this software component.
* the License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* www.st.com/SLA0044
* *
****************************************************************************** ******************************************************************************
*/ */
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/ /* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __SPI_H__ #ifndef __SPI_H__
#define __SPI_H__ #define __SPI_H__
@ -47,4 +48,3 @@ void MX_SPI1_Init(void);
#endif /* __SPI_H__ */ #endif /* __SPI_H__ */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -1,27 +1,28 @@
/* USER CODE BEGIN Header */
/** /**
****************************************************************************** ******************************************************************************
* @file stm32_assert.h * @file stm32_assert.h
* @author MCD Application Team
* @brief STM32 assert file. * @brief STM32 assert file.
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2018 STMicroelectronics. * Copyright (c) 2018 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under BSD 3-Clause license, * This software is licensed under terms that can be found in the LICENSE file
* the "License"; You may not use this file except in compliance with the * in the root directory of this software component.
* License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* opensource.org/licenses/BSD-3-Clause
* *
****************************************************************************** ******************************************************************************
*/ */
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/ /* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_ASSERT_H #ifndef __STM32_ASSERT_H
#define __STM32_ASSERT_H #define __STM32_ASSERT_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* Exported types ------------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/
@ -31,17 +32,17 @@
#ifdef USE_FULL_ASSERT #ifdef USE_FULL_ASSERT
/** /**
* @brief The assert_param macro is used for function's parameters check. * @brief The assert_param macro is used for function's parameters check.
* @param expr: If expr is false, it calls assert_failed function * @param expr If expr is false, it calls assert_failed function
* which reports the name of the source file and the source * which reports the name of the source file and the source
* line number of the call that failed. * line number of the call that failed.
* If expr is true, it returns no value. * If expr is true, it returns no value.
* @retval None * @retval None
*/ */
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */ /* Exported functions ------------------------------------------------------- */
void assert_failed(uint8_t* file, uint32_t line); void assert_failed(uint8_t *file, uint32_t line);
#else #else
#define assert_param(expr) ((void)0U) #define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */ #endif /* USE_FULL_ASSERT */
#ifdef __cplusplus #ifdef __cplusplus
@ -50,4 +51,3 @@
#endif /* __STM32_ASSERT_H */ #endif /* __STM32_ASSERT_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -63,5 +63,3 @@ void SysTick_Handler(void);
#endif #endif
#endif /* __STM32F1xx_IT_H */ #endif /* __STM32F1xx_IT_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/** /**
****************************************************************************** ******************************************************************************
* @file usart.h * @file usart.h
@ -6,16 +7,16 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2020 STMicroelectronics. * Copyright (c) 2025 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under Ultimate Liberty license * This software is licensed under terms that can be found in the LICENSE file
* SLA0044, the "License"; You may not use this file except in compliance with * in the root directory of this software component.
* the License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* www.st.com/SLA0044
* *
****************************************************************************** ******************************************************************************
*/ */
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/ /* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __USART_H__ #ifndef __USART_H__
#define __USART_H__ #define __USART_H__
@ -47,4 +48,3 @@ void MX_USART1_UART_Init(void);
#endif /* __USART_H__ */ #endif /* __USART_H__ */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,18 @@
Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -1,353 +1,353 @@
/* /*
* FreeRTOS Kernel V10.0.1 * FreeRTOS Kernel V10.3.1
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions: * subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* http://www.FreeRTOS.org * http://www.FreeRTOS.org
* http://aws.amazon.com/freertos * http://aws.amazon.com/freertos
* *
* 1 tab == 4 spaces! * 1 tab == 4 spaces!
*/ */
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "task.h" #include "task.h"
#include "croutine.h" #include "croutine.h"
/* Remove the whole file is co-routines are not being used. */ /* Remove the whole file is co-routines are not being used. */
#if( configUSE_CO_ROUTINES != 0 ) #if( configUSE_CO_ROUTINES != 0 )
/* /*
* Some kernel aware debuggers require data to be viewed to be global, rather * Some kernel aware debuggers require data to be viewed to be global, rather
* than file scope. * than file scope.
*/ */
#ifdef portREMOVE_STATIC_QUALIFIER #ifdef portREMOVE_STATIC_QUALIFIER
#define static #define static
#endif #endif
/* Lists for ready and blocked co-routines. --------------------*/ /* Lists for ready and blocked co-routines. --------------------*/
static List_t pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /*< Prioritised ready co-routines. */ static List_t pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /*< Prioritised ready co-routines. */
static List_t xDelayedCoRoutineList1; /*< Delayed co-routines. */ static List_t xDelayedCoRoutineList1; /*< Delayed co-routines. */
static List_t xDelayedCoRoutineList2; /*< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */ static List_t xDelayedCoRoutineList2; /*< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */
static List_t * pxDelayedCoRoutineList; /*< Points to the delayed co-routine list currently being used. */ static List_t * pxDelayedCoRoutineList; /*< Points to the delayed co-routine list currently being used. */
static List_t * pxOverflowDelayedCoRoutineList; /*< Points to the delayed co-routine list currently being used to hold co-routines that have overflowed the current tick count. */ static List_t * pxOverflowDelayedCoRoutineList; /*< Points to the delayed co-routine list currently being used to hold co-routines that have overflowed the current tick count. */
static List_t xPendingReadyCoRoutineList; /*< Holds co-routines that have been readied by an external event. They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */ static List_t xPendingReadyCoRoutineList; /*< Holds co-routines that have been readied by an external event. They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */
/* Other file private variables. --------------------------------*/ /* Other file private variables. --------------------------------*/
CRCB_t * pxCurrentCoRoutine = NULL; CRCB_t * pxCurrentCoRoutine = NULL;
static UBaseType_t uxTopCoRoutineReadyPriority = 0; static UBaseType_t uxTopCoRoutineReadyPriority = 0;
static TickType_t xCoRoutineTickCount = 0, xLastTickCount = 0, xPassedTicks = 0; static TickType_t xCoRoutineTickCount = 0, xLastTickCount = 0, xPassedTicks = 0;
/* The initial state of the co-routine when it is created. */ /* The initial state of the co-routine when it is created. */
#define corINITIAL_STATE ( 0 ) #define corINITIAL_STATE ( 0 )
/* /*
* Place the co-routine represented by pxCRCB into the appropriate ready queue * Place the co-routine represented by pxCRCB into the appropriate ready queue
* for the priority. It is inserted at the end of the list. * for the priority. It is inserted at the end of the list.
* *
* This macro accesses the co-routine ready lists and therefore must not be * This macro accesses the co-routine ready lists and therefore must not be
* used from within an ISR. * used from within an ISR.
*/ */
#define prvAddCoRoutineToReadyQueue( pxCRCB ) \ #define prvAddCoRoutineToReadyQueue( pxCRCB ) \
{ \ { \
if( pxCRCB->uxPriority > uxTopCoRoutineReadyPriority ) \ if( pxCRCB->uxPriority > uxTopCoRoutineReadyPriority ) \
{ \ { \
uxTopCoRoutineReadyPriority = pxCRCB->uxPriority; \ uxTopCoRoutineReadyPriority = pxCRCB->uxPriority; \
} \ } \
vListInsertEnd( ( List_t * ) &( pxReadyCoRoutineLists[ pxCRCB->uxPriority ] ), &( pxCRCB->xGenericListItem ) ); \ vListInsertEnd( ( List_t * ) &( pxReadyCoRoutineLists[ pxCRCB->uxPriority ] ), &( pxCRCB->xGenericListItem ) ); \
} }
/* /*
* Utility to ready all the lists used by the scheduler. This is called * Utility to ready all the lists used by the scheduler. This is called
* automatically upon the creation of the first co-routine. * automatically upon the creation of the first co-routine.
*/ */
static void prvInitialiseCoRoutineLists( void ); static void prvInitialiseCoRoutineLists( void );
/* /*
* Co-routines that are readied by an interrupt cannot be placed directly into * Co-routines that are readied by an interrupt cannot be placed directly into
* the ready lists (there is no mutual exclusion). Instead they are placed in * the ready lists (there is no mutual exclusion). Instead they are placed in
* in the pending ready list in order that they can later be moved to the ready * in the pending ready list in order that they can later be moved to the ready
* list by the co-routine scheduler. * list by the co-routine scheduler.
*/ */
static void prvCheckPendingReadyList( void ); static void prvCheckPendingReadyList( void );
/* /*
* Macro that looks at the list of co-routines that are currently delayed to * Macro that looks at the list of co-routines that are currently delayed to
* see if any require waking. * see if any require waking.
* *
* Co-routines are stored in the queue in the order of their wake time - * Co-routines are stored in the queue in the order of their wake time -
* meaning once one co-routine has been found whose timer has not expired * meaning once one co-routine has been found whose timer has not expired
* we need not look any further down the list. * we need not look any further down the list.
*/ */
static void prvCheckDelayedList( void ); static void prvCheckDelayedList( void );
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
BaseType_t xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, UBaseType_t uxPriority, UBaseType_t uxIndex ) BaseType_t xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, UBaseType_t uxPriority, UBaseType_t uxIndex )
{ {
BaseType_t xReturn; BaseType_t xReturn;
CRCB_t *pxCoRoutine; CRCB_t *pxCoRoutine;
/* Allocate the memory that will store the co-routine control block. */ /* Allocate the memory that will store the co-routine control block. */
pxCoRoutine = ( CRCB_t * ) pvPortMalloc( sizeof( CRCB_t ) ); pxCoRoutine = ( CRCB_t * ) pvPortMalloc( sizeof( CRCB_t ) );
if( pxCoRoutine ) if( pxCoRoutine )
{ {
/* If pxCurrentCoRoutine is NULL then this is the first co-routine to /* If pxCurrentCoRoutine is NULL then this is the first co-routine to
be created and the co-routine data structures need initialising. */ be created and the co-routine data structures need initialising. */
if( pxCurrentCoRoutine == NULL ) if( pxCurrentCoRoutine == NULL )
{ {
pxCurrentCoRoutine = pxCoRoutine; pxCurrentCoRoutine = pxCoRoutine;
prvInitialiseCoRoutineLists(); prvInitialiseCoRoutineLists();
} }
/* Check the priority is within limits. */ /* Check the priority is within limits. */
if( uxPriority >= configMAX_CO_ROUTINE_PRIORITIES ) if( uxPriority >= configMAX_CO_ROUTINE_PRIORITIES )
{ {
uxPriority = configMAX_CO_ROUTINE_PRIORITIES - 1; uxPriority = configMAX_CO_ROUTINE_PRIORITIES - 1;
} }
/* Fill out the co-routine control block from the function parameters. */ /* Fill out the co-routine control block from the function parameters. */
pxCoRoutine->uxState = corINITIAL_STATE; pxCoRoutine->uxState = corINITIAL_STATE;
pxCoRoutine->uxPriority = uxPriority; pxCoRoutine->uxPriority = uxPriority;
pxCoRoutine->uxIndex = uxIndex; pxCoRoutine->uxIndex = uxIndex;
pxCoRoutine->pxCoRoutineFunction = pxCoRoutineCode; pxCoRoutine->pxCoRoutineFunction = pxCoRoutineCode;
/* Initialise all the other co-routine control block parameters. */ /* Initialise all the other co-routine control block parameters. */
vListInitialiseItem( &( pxCoRoutine->xGenericListItem ) ); vListInitialiseItem( &( pxCoRoutine->xGenericListItem ) );
vListInitialiseItem( &( pxCoRoutine->xEventListItem ) ); vListInitialiseItem( &( pxCoRoutine->xEventListItem ) );
/* Set the co-routine control block as a link back from the ListItem_t. /* Set the co-routine control block as a link back from the ListItem_t.
This is so we can get back to the containing CRCB from a generic item This is so we can get back to the containing CRCB from a generic item
in a list. */ in a list. */
listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xGenericListItem ), pxCoRoutine ); listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xGenericListItem ), pxCoRoutine );
listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xEventListItem ), pxCoRoutine ); listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xEventListItem ), pxCoRoutine );
/* Event lists are always in priority order. */ /* Event lists are always in priority order. */
listSET_LIST_ITEM_VALUE( &( pxCoRoutine->xEventListItem ), ( ( TickType_t ) configMAX_CO_ROUTINE_PRIORITIES - ( TickType_t ) uxPriority ) ); listSET_LIST_ITEM_VALUE( &( pxCoRoutine->xEventListItem ), ( ( TickType_t ) configMAX_CO_ROUTINE_PRIORITIES - ( TickType_t ) uxPriority ) );
/* Now the co-routine has been initialised it can be added to the ready /* Now the co-routine has been initialised it can be added to the ready
list at the correct priority. */ list at the correct priority. */
prvAddCoRoutineToReadyQueue( pxCoRoutine ); prvAddCoRoutineToReadyQueue( pxCoRoutine );
xReturn = pdPASS; xReturn = pdPASS;
} }
else else
{ {
xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY; xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
} }
return xReturn; return xReturn;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vCoRoutineAddToDelayedList( TickType_t xTicksToDelay, List_t *pxEventList ) void vCoRoutineAddToDelayedList( TickType_t xTicksToDelay, List_t *pxEventList )
{ {
TickType_t xTimeToWake; TickType_t xTimeToWake;
/* Calculate the time to wake - this may overflow but this is /* Calculate the time to wake - this may overflow but this is
not a problem. */ not a problem. */
xTimeToWake = xCoRoutineTickCount + xTicksToDelay; xTimeToWake = xCoRoutineTickCount + xTicksToDelay;
/* We must remove ourselves from the ready list before adding /* We must remove ourselves from the ready list before adding
ourselves to the blocked list as the same list item is used for ourselves to the blocked list as the same list item is used for
both lists. */ both lists. */
( void ) uxListRemove( ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) ); ( void ) uxListRemove( ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) );
/* The list item will be inserted in wake time order. */ /* The list item will be inserted in wake time order. */
listSET_LIST_ITEM_VALUE( &( pxCurrentCoRoutine->xGenericListItem ), xTimeToWake ); listSET_LIST_ITEM_VALUE( &( pxCurrentCoRoutine->xGenericListItem ), xTimeToWake );
if( xTimeToWake < xCoRoutineTickCount ) if( xTimeToWake < xCoRoutineTickCount )
{ {
/* Wake time has overflowed. Place this item in the /* Wake time has overflowed. Place this item in the
overflow list. */ overflow list. */
vListInsert( ( List_t * ) pxOverflowDelayedCoRoutineList, ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) ); vListInsert( ( List_t * ) pxOverflowDelayedCoRoutineList, ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) );
} }
else else
{ {
/* The wake time has not overflowed, so we can use the /* The wake time has not overflowed, so we can use the
current block list. */ current block list. */
vListInsert( ( List_t * ) pxDelayedCoRoutineList, ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) ); vListInsert( ( List_t * ) pxDelayedCoRoutineList, ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) );
} }
if( pxEventList ) if( pxEventList )
{ {
/* Also add the co-routine to an event list. If this is done then the /* Also add the co-routine to an event list. If this is done then the
function must be called with interrupts disabled. */ function must be called with interrupts disabled. */
vListInsert( pxEventList, &( pxCurrentCoRoutine->xEventListItem ) ); vListInsert( pxEventList, &( pxCurrentCoRoutine->xEventListItem ) );
} }
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static void prvCheckPendingReadyList( void ) static void prvCheckPendingReadyList( void )
{ {
/* Are there any co-routines waiting to get moved to the ready list? These /* Are there any co-routines waiting to get moved to the ready list? These
are co-routines that have been readied by an ISR. The ISR cannot access are co-routines that have been readied by an ISR. The ISR cannot access
the ready lists itself. */ the ready lists itself. */
while( listLIST_IS_EMPTY( &xPendingReadyCoRoutineList ) == pdFALSE ) while( listLIST_IS_EMPTY( &xPendingReadyCoRoutineList ) == pdFALSE )
{ {
CRCB_t *pxUnblockedCRCB; CRCB_t *pxUnblockedCRCB;
/* The pending ready list can be accessed by an ISR. */ /* The pending ready list can be accessed by an ISR. */
portDISABLE_INTERRUPTS(); portDISABLE_INTERRUPTS();
{ {
pxUnblockedCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( (&xPendingReadyCoRoutineList) ); pxUnblockedCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( (&xPendingReadyCoRoutineList) );
( void ) uxListRemove( &( pxUnblockedCRCB->xEventListItem ) ); ( void ) uxListRemove( &( pxUnblockedCRCB->xEventListItem ) );
} }
portENABLE_INTERRUPTS(); portENABLE_INTERRUPTS();
( void ) uxListRemove( &( pxUnblockedCRCB->xGenericListItem ) ); ( void ) uxListRemove( &( pxUnblockedCRCB->xGenericListItem ) );
prvAddCoRoutineToReadyQueue( pxUnblockedCRCB ); prvAddCoRoutineToReadyQueue( pxUnblockedCRCB );
} }
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static void prvCheckDelayedList( void ) static void prvCheckDelayedList( void )
{ {
CRCB_t *pxCRCB; CRCB_t *pxCRCB;
xPassedTicks = xTaskGetTickCount() - xLastTickCount; xPassedTicks = xTaskGetTickCount() - xLastTickCount;
while( xPassedTicks ) while( xPassedTicks )
{ {
xCoRoutineTickCount++; xCoRoutineTickCount++;
xPassedTicks--; xPassedTicks--;
/* If the tick count has overflowed we need to swap the ready lists. */ /* If the tick count has overflowed we need to swap the ready lists. */
if( xCoRoutineTickCount == 0 ) if( xCoRoutineTickCount == 0 )
{ {
List_t * pxTemp; List_t * pxTemp;
/* Tick count has overflowed so we need to swap the delay lists. If there are /* Tick count has overflowed so we need to swap the delay lists. If there are
any items in pxDelayedCoRoutineList here then there is an error! */ any items in pxDelayedCoRoutineList here then there is an error! */
pxTemp = pxDelayedCoRoutineList; pxTemp = pxDelayedCoRoutineList;
pxDelayedCoRoutineList = pxOverflowDelayedCoRoutineList; pxDelayedCoRoutineList = pxOverflowDelayedCoRoutineList;
pxOverflowDelayedCoRoutineList = pxTemp; pxOverflowDelayedCoRoutineList = pxTemp;
} }
/* See if this tick has made a timeout expire. */ /* See if this tick has made a timeout expire. */
while( listLIST_IS_EMPTY( pxDelayedCoRoutineList ) == pdFALSE ) while( listLIST_IS_EMPTY( pxDelayedCoRoutineList ) == pdFALSE )
{ {
pxCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedCoRoutineList ); pxCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedCoRoutineList );
if( xCoRoutineTickCount < listGET_LIST_ITEM_VALUE( &( pxCRCB->xGenericListItem ) ) ) if( xCoRoutineTickCount < listGET_LIST_ITEM_VALUE( &( pxCRCB->xGenericListItem ) ) )
{ {
/* Timeout not yet expired. */ /* Timeout not yet expired. */
break; break;
} }
portDISABLE_INTERRUPTS(); portDISABLE_INTERRUPTS();
{ {
/* The event could have occurred just before this critical /* The event could have occurred just before this critical
section. If this is the case then the generic list item will section. If this is the case then the generic list item will
have been moved to the pending ready list and the following have been moved to the pending ready list and the following
line is still valid. Also the pvContainer parameter will have line is still valid. Also the pvContainer parameter will have
been set to NULL so the following lines are also valid. */ been set to NULL so the following lines are also valid. */
( void ) uxListRemove( &( pxCRCB->xGenericListItem ) ); ( void ) uxListRemove( &( pxCRCB->xGenericListItem ) );
/* Is the co-routine waiting on an event also? */ /* Is the co-routine waiting on an event also? */
if( pxCRCB->xEventListItem.pvContainer ) if( pxCRCB->xEventListItem.pxContainer )
{ {
( void ) uxListRemove( &( pxCRCB->xEventListItem ) ); ( void ) uxListRemove( &( pxCRCB->xEventListItem ) );
} }
} }
portENABLE_INTERRUPTS(); portENABLE_INTERRUPTS();
prvAddCoRoutineToReadyQueue( pxCRCB ); prvAddCoRoutineToReadyQueue( pxCRCB );
} }
} }
xLastTickCount = xCoRoutineTickCount; xLastTickCount = xCoRoutineTickCount;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vCoRoutineSchedule( void ) void vCoRoutineSchedule( void )
{ {
/* See if any co-routines readied by events need moving to the ready lists. */ /* See if any co-routines readied by events need moving to the ready lists. */
prvCheckPendingReadyList(); prvCheckPendingReadyList();
/* See if any delayed co-routines have timed out. */ /* See if any delayed co-routines have timed out. */
prvCheckDelayedList(); prvCheckDelayedList();
/* Find the highest priority queue that contains ready co-routines. */ /* Find the highest priority queue that contains ready co-routines. */
while( listLIST_IS_EMPTY( &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) ) ) while( listLIST_IS_EMPTY( &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) ) )
{ {
if( uxTopCoRoutineReadyPriority == 0 ) if( uxTopCoRoutineReadyPriority == 0 )
{ {
/* No more co-routines to check. */ /* No more co-routines to check. */
return; return;
} }
--uxTopCoRoutineReadyPriority; --uxTopCoRoutineReadyPriority;
} }
/* listGET_OWNER_OF_NEXT_ENTRY walks through the list, so the co-routines /* listGET_OWNER_OF_NEXT_ENTRY walks through the list, so the co-routines
of the same priority get an equal share of the processor time. */ of the same priority get an equal share of the processor time. */
listGET_OWNER_OF_NEXT_ENTRY( pxCurrentCoRoutine, &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) ); listGET_OWNER_OF_NEXT_ENTRY( pxCurrentCoRoutine, &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) );
/* Call the co-routine. */ /* Call the co-routine. */
( pxCurrentCoRoutine->pxCoRoutineFunction )( pxCurrentCoRoutine, pxCurrentCoRoutine->uxIndex ); ( pxCurrentCoRoutine->pxCoRoutineFunction )( pxCurrentCoRoutine, pxCurrentCoRoutine->uxIndex );
return; return;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static void prvInitialiseCoRoutineLists( void ) static void prvInitialiseCoRoutineLists( void )
{ {
UBaseType_t uxPriority; UBaseType_t uxPriority;
for( uxPriority = 0; uxPriority < configMAX_CO_ROUTINE_PRIORITIES; uxPriority++ ) for( uxPriority = 0; uxPriority < configMAX_CO_ROUTINE_PRIORITIES; uxPriority++ )
{ {
vListInitialise( ( List_t * ) &( pxReadyCoRoutineLists[ uxPriority ] ) ); vListInitialise( ( List_t * ) &( pxReadyCoRoutineLists[ uxPriority ] ) );
} }
vListInitialise( ( List_t * ) &xDelayedCoRoutineList1 ); vListInitialise( ( List_t * ) &xDelayedCoRoutineList1 );
vListInitialise( ( List_t * ) &xDelayedCoRoutineList2 ); vListInitialise( ( List_t * ) &xDelayedCoRoutineList2 );
vListInitialise( ( List_t * ) &xPendingReadyCoRoutineList ); vListInitialise( ( List_t * ) &xPendingReadyCoRoutineList );
/* Start with pxDelayedCoRoutineList using list1 and the /* Start with pxDelayedCoRoutineList using list1 and the
pxOverflowDelayedCoRoutineList using list2. */ pxOverflowDelayedCoRoutineList using list2. */
pxDelayedCoRoutineList = &xDelayedCoRoutineList1; pxDelayedCoRoutineList = &xDelayedCoRoutineList1;
pxOverflowDelayedCoRoutineList = &xDelayedCoRoutineList2; pxOverflowDelayedCoRoutineList = &xDelayedCoRoutineList2;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
BaseType_t xCoRoutineRemoveFromEventList( const List_t *pxEventList ) BaseType_t xCoRoutineRemoveFromEventList( const List_t *pxEventList )
{ {
CRCB_t *pxUnblockedCRCB; CRCB_t *pxUnblockedCRCB;
BaseType_t xReturn; BaseType_t xReturn;
/* This function is called from within an interrupt. It can only access /* This function is called from within an interrupt. It can only access
event lists and the pending ready list. This function assumes that a event lists and the pending ready list. This function assumes that a
check has already been made to ensure pxEventList is not empty. */ check has already been made to ensure pxEventList is not empty. */
pxUnblockedCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxEventList ); pxUnblockedCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxEventList );
( void ) uxListRemove( &( pxUnblockedCRCB->xEventListItem ) ); ( void ) uxListRemove( &( pxUnblockedCRCB->xEventListItem ) );
vListInsertEnd( ( List_t * ) &( xPendingReadyCoRoutineList ), &( pxUnblockedCRCB->xEventListItem ) ); vListInsertEnd( ( List_t * ) &( xPendingReadyCoRoutineList ), &( pxUnblockedCRCB->xEventListItem ) );
if( pxUnblockedCRCB->uxPriority >= pxCurrentCoRoutine->uxPriority ) if( pxUnblockedCRCB->uxPriority >= pxCurrentCoRoutine->uxPriority )
{ {
xReturn = pdTRUE; xReturn = pdTRUE;
} }
else else
{ {
xReturn = pdFALSE; xReturn = pdFALSE;
} }
return xReturn; return xReturn;
} }
#endif /* configUSE_CO_ROUTINES == 0 */ #endif /* configUSE_CO_ROUTINES == 0 */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,133 +1,133 @@
/* /*
* FreeRTOS Kernel V10.0.1 * FreeRTOS Kernel V10.3.1
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions: * subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* http://www.FreeRTOS.org * http://www.FreeRTOS.org
* http://aws.amazon.com/freertos * http://aws.amazon.com/freertos
* *
* 1 tab == 4 spaces! * 1 tab == 4 spaces!
*/ */
#ifndef STACK_MACROS_H #ifndef STACK_MACROS_H
#define STACK_MACROS_H #define STACK_MACROS_H
#ifndef _MSC_VER /* Visual Studio doesn't support #warning. */ #ifndef _MSC_VER /* Visual Studio doesn't support #warning. */
#warning The name of this file has changed to stack_macros.h. Please update your code accordingly. This source file (which has the original name) will be removed in future released. #warning The name of this file has changed to stack_macros.h. Please update your code accordingly. This source file (which has the original name) will be removed in future released.
#endif #endif
/* /*
* Call the stack overflow hook function if the stack of the task being swapped * Call the stack overflow hook function if the stack of the task being swapped
* out is currently overflowed, or looks like it might have overflowed in the * out is currently overflowed, or looks like it might have overflowed in the
* past. * past.
* *
* Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check * Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check
* the current stack state only - comparing the current top of stack value to * the current stack state only - comparing the current top of stack value to
* the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1 * the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1
* will also cause the last few stack bytes to be checked to ensure the value * will also cause the last few stack bytes to be checked to ensure the value
* to which the bytes were set when the task was created have not been * to which the bytes were set when the task was created have not been
* overwritten. Note this second test does not guarantee that an overflowed * overwritten. Note this second test does not guarantee that an overflowed
* stack will always be recognised. * stack will always be recognised.
*/ */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) ) #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) )
/* Only the current stack state is to be checked. */ /* Only the current stack state is to be checked. */
#define taskCHECK_FOR_STACK_OVERFLOW() \ #define taskCHECK_FOR_STACK_OVERFLOW() \
{ \ { \
/* Is the currently saved stack pointer within the stack limit? */ \ /* Is the currently saved stack pointer within the stack limit? */ \
if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \ if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \
{ \ { \
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
} \ } \
} }
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) ) #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) )
/* Only the current stack state is to be checked. */ /* Only the current stack state is to be checked. */
#define taskCHECK_FOR_STACK_OVERFLOW() \ #define taskCHECK_FOR_STACK_OVERFLOW() \
{ \ { \
\ \
/* Is the currently saved stack pointer within the stack limit? */ \ /* Is the currently saved stack pointer within the stack limit? */ \
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \ if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \
{ \ { \
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
} \ } \
} }
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) ) #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) )
#define taskCHECK_FOR_STACK_OVERFLOW() \ #define taskCHECK_FOR_STACK_OVERFLOW() \
{ \ { \
const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \ const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \
const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \ const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \
\ \
if( ( pulStack[ 0 ] != ulCheckValue ) || \ if( ( pulStack[ 0 ] != ulCheckValue ) || \
( pulStack[ 1 ] != ulCheckValue ) || \ ( pulStack[ 1 ] != ulCheckValue ) || \
( pulStack[ 2 ] != ulCheckValue ) || \ ( pulStack[ 2 ] != ulCheckValue ) || \
( pulStack[ 3 ] != ulCheckValue ) ) \ ( pulStack[ 3 ] != ulCheckValue ) ) \
{ \ { \
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
} \ } \
} }
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) ) #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) )
#define taskCHECK_FOR_STACK_OVERFLOW() \ #define taskCHECK_FOR_STACK_OVERFLOW() \
{ \ { \
int8_t *pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \ int8_t *pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \
static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \
\ \
\ \
pcEndOfStack -= sizeof( ucExpectedStackBytes ); \ pcEndOfStack -= sizeof( ucExpectedStackBytes ); \
\ \
/* Has the extremity of the task stack ever been written over? */ \ /* Has the extremity of the task stack ever been written over? */ \
if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \ if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \
{ \ { \
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
} \ } \
} }
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Remove stack overflow macro if not being used. */ /* Remove stack overflow macro if not being used. */
#ifndef taskCHECK_FOR_STACK_OVERFLOW #ifndef taskCHECK_FOR_STACK_OVERFLOW
#define taskCHECK_FOR_STACK_OVERFLOW() #define taskCHECK_FOR_STACK_OVERFLOW()
#endif #endif
#endif /* STACK_MACROS_H */ #endif /* STACK_MACROS_H */

File diff suppressed because it is too large Load diff

View file

@ -1,279 +1,279 @@
/* /*
* FreeRTOS Kernel V10.0.1 * FreeRTOS Kernel V10.3.1
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions: * subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* http://www.FreeRTOS.org * http://www.FreeRTOS.org
* http://aws.amazon.com/freertos * http://aws.amazon.com/freertos
* *
* 1 tab == 4 spaces! * 1 tab == 4 spaces!
*/ */
#ifndef DEPRECATED_DEFINITIONS_H #ifndef DEPRECATED_DEFINITIONS_H
#define DEPRECATED_DEFINITIONS_H #define DEPRECATED_DEFINITIONS_H
/* Each FreeRTOS port has a unique portmacro.h header file. Originally a /* Each FreeRTOS port has a unique portmacro.h header file. Originally a
pre-processor definition was used to ensure the pre-processor found the correct pre-processor definition was used to ensure the pre-processor found the correct
portmacro.h file for the port being used. That scheme was deprecated in favour portmacro.h file for the port being used. That scheme was deprecated in favour
of setting the compiler's include path such that it found the correct of setting the compiler's include path such that it found the correct
portmacro.h file - removing the need for the constant and allowing the portmacro.h file - removing the need for the constant and allowing the
portmacro.h file to be located anywhere in relation to the port being used. The portmacro.h file to be located anywhere in relation to the port being used. The
definitions below remain in the code for backward compatibility only. New definitions below remain in the code for backward compatibility only. New
projects should not use them. */ projects should not use them. */
#ifdef OPEN_WATCOM_INDUSTRIAL_PC_PORT #ifdef OPEN_WATCOM_INDUSTRIAL_PC_PORT
#include "..\..\Source\portable\owatcom\16bitdos\pc\portmacro.h" #include "..\..\Source\portable\owatcom\16bitdos\pc\portmacro.h"
typedef void ( __interrupt __far *pxISR )(); typedef void ( __interrupt __far *pxISR )();
#endif #endif
#ifdef OPEN_WATCOM_FLASH_LITE_186_PORT #ifdef OPEN_WATCOM_FLASH_LITE_186_PORT
#include "..\..\Source\portable\owatcom\16bitdos\flsh186\portmacro.h" #include "..\..\Source\portable\owatcom\16bitdos\flsh186\portmacro.h"
typedef void ( __interrupt __far *pxISR )(); typedef void ( __interrupt __far *pxISR )();
#endif #endif
#ifdef GCC_MEGA_AVR #ifdef GCC_MEGA_AVR
#include "../portable/GCC/ATMega323/portmacro.h" #include "../portable/GCC/ATMega323/portmacro.h"
#endif #endif
#ifdef IAR_MEGA_AVR #ifdef IAR_MEGA_AVR
#include "../portable/IAR/ATMega323/portmacro.h" #include "../portable/IAR/ATMega323/portmacro.h"
#endif #endif
#ifdef MPLAB_PIC24_PORT #ifdef MPLAB_PIC24_PORT
#include "../../Source/portable/MPLAB/PIC24_dsPIC/portmacro.h" #include "../../Source/portable/MPLAB/PIC24_dsPIC/portmacro.h"
#endif #endif
#ifdef MPLAB_DSPIC_PORT #ifdef MPLAB_DSPIC_PORT
#include "../../Source/portable/MPLAB/PIC24_dsPIC/portmacro.h" #include "../../Source/portable/MPLAB/PIC24_dsPIC/portmacro.h"
#endif #endif
#ifdef MPLAB_PIC18F_PORT #ifdef MPLAB_PIC18F_PORT
#include "../../Source/portable/MPLAB/PIC18F/portmacro.h" #include "../../Source/portable/MPLAB/PIC18F/portmacro.h"
#endif #endif
#ifdef MPLAB_PIC32MX_PORT #ifdef MPLAB_PIC32MX_PORT
#include "../../Source/portable/MPLAB/PIC32MX/portmacro.h" #include "../../Source/portable/MPLAB/PIC32MX/portmacro.h"
#endif #endif
#ifdef _FEDPICC #ifdef _FEDPICC
#include "libFreeRTOS/Include/portmacro.h" #include "libFreeRTOS/Include/portmacro.h"
#endif #endif
#ifdef SDCC_CYGNAL #ifdef SDCC_CYGNAL
#include "../../Source/portable/SDCC/Cygnal/portmacro.h" #include "../../Source/portable/SDCC/Cygnal/portmacro.h"
#endif #endif
#ifdef GCC_ARM7 #ifdef GCC_ARM7
#include "../../Source/portable/GCC/ARM7_LPC2000/portmacro.h" #include "../../Source/portable/GCC/ARM7_LPC2000/portmacro.h"
#endif #endif
#ifdef GCC_ARM7_ECLIPSE #ifdef GCC_ARM7_ECLIPSE
#include "portmacro.h" #include "portmacro.h"
#endif #endif
#ifdef ROWLEY_LPC23xx #ifdef ROWLEY_LPC23xx
#include "../../Source/portable/GCC/ARM7_LPC23xx/portmacro.h" #include "../../Source/portable/GCC/ARM7_LPC23xx/portmacro.h"
#endif #endif
#ifdef IAR_MSP430 #ifdef IAR_MSP430
#include "..\..\Source\portable\IAR\MSP430\portmacro.h" #include "..\..\Source\portable\IAR\MSP430\portmacro.h"
#endif #endif
#ifdef GCC_MSP430 #ifdef GCC_MSP430
#include "../../Source/portable/GCC/MSP430F449/portmacro.h" #include "../../Source/portable/GCC/MSP430F449/portmacro.h"
#endif #endif
#ifdef ROWLEY_MSP430 #ifdef ROWLEY_MSP430
#include "../../Source/portable/Rowley/MSP430F449/portmacro.h" #include "../../Source/portable/Rowley/MSP430F449/portmacro.h"
#endif #endif
#ifdef ARM7_LPC21xx_KEIL_RVDS #ifdef ARM7_LPC21xx_KEIL_RVDS
#include "..\..\Source\portable\RVDS\ARM7_LPC21xx\portmacro.h" #include "..\..\Source\portable\RVDS\ARM7_LPC21xx\portmacro.h"
#endif #endif
#ifdef SAM7_GCC #ifdef SAM7_GCC
#include "../../Source/portable/GCC/ARM7_AT91SAM7S/portmacro.h" #include "../../Source/portable/GCC/ARM7_AT91SAM7S/portmacro.h"
#endif #endif
#ifdef SAM7_IAR #ifdef SAM7_IAR
#include "..\..\Source\portable\IAR\AtmelSAM7S64\portmacro.h" #include "..\..\Source\portable\IAR\AtmelSAM7S64\portmacro.h"
#endif #endif
#ifdef SAM9XE_IAR #ifdef SAM9XE_IAR
#include "..\..\Source\portable\IAR\AtmelSAM9XE\portmacro.h" #include "..\..\Source\portable\IAR\AtmelSAM9XE\portmacro.h"
#endif #endif
#ifdef LPC2000_IAR #ifdef LPC2000_IAR
#include "..\..\Source\portable\IAR\LPC2000\portmacro.h" #include "..\..\Source\portable\IAR\LPC2000\portmacro.h"
#endif #endif
#ifdef STR71X_IAR #ifdef STR71X_IAR
#include "..\..\Source\portable\IAR\STR71x\portmacro.h" #include "..\..\Source\portable\IAR\STR71x\portmacro.h"
#endif #endif
#ifdef STR75X_IAR #ifdef STR75X_IAR
#include "..\..\Source\portable\IAR\STR75x\portmacro.h" #include "..\..\Source\portable\IAR\STR75x\portmacro.h"
#endif #endif
#ifdef STR75X_GCC #ifdef STR75X_GCC
#include "..\..\Source\portable\GCC\STR75x\portmacro.h" #include "..\..\Source\portable\GCC\STR75x\portmacro.h"
#endif #endif
#ifdef STR91X_IAR #ifdef STR91X_IAR
#include "..\..\Source\portable\IAR\STR91x\portmacro.h" #include "..\..\Source\portable\IAR\STR91x\portmacro.h"
#endif #endif
#ifdef GCC_H8S #ifdef GCC_H8S
#include "../../Source/portable/GCC/H8S2329/portmacro.h" #include "../../Source/portable/GCC/H8S2329/portmacro.h"
#endif #endif
#ifdef GCC_AT91FR40008 #ifdef GCC_AT91FR40008
#include "../../Source/portable/GCC/ARM7_AT91FR40008/portmacro.h" #include "../../Source/portable/GCC/ARM7_AT91FR40008/portmacro.h"
#endif #endif
#ifdef RVDS_ARMCM3_LM3S102 #ifdef RVDS_ARMCM3_LM3S102
#include "../../Source/portable/RVDS/ARM_CM3/portmacro.h" #include "../../Source/portable/RVDS/ARM_CM3/portmacro.h"
#endif #endif
#ifdef GCC_ARMCM3_LM3S102 #ifdef GCC_ARMCM3_LM3S102
#include "../../Source/portable/GCC/ARM_CM3/portmacro.h" #include "../../Source/portable/GCC/ARM_CM3/portmacro.h"
#endif #endif
#ifdef GCC_ARMCM3 #ifdef GCC_ARMCM3
#include "../../Source/portable/GCC/ARM_CM3/portmacro.h" #include "../../Source/portable/GCC/ARM_CM3/portmacro.h"
#endif #endif
#ifdef IAR_ARM_CM3 #ifdef IAR_ARM_CM3
#include "../../Source/portable/IAR/ARM_CM3/portmacro.h" #include "../../Source/portable/IAR/ARM_CM3/portmacro.h"
#endif #endif
#ifdef IAR_ARMCM3_LM #ifdef IAR_ARMCM3_LM
#include "../../Source/portable/IAR/ARM_CM3/portmacro.h" #include "../../Source/portable/IAR/ARM_CM3/portmacro.h"
#endif #endif
#ifdef HCS12_CODE_WARRIOR #ifdef HCS12_CODE_WARRIOR
#include "../../Source/portable/CodeWarrior/HCS12/portmacro.h" #include "../../Source/portable/CodeWarrior/HCS12/portmacro.h"
#endif #endif
#ifdef MICROBLAZE_GCC #ifdef MICROBLAZE_GCC
#include "../../Source/portable/GCC/MicroBlaze/portmacro.h" #include "../../Source/portable/GCC/MicroBlaze/portmacro.h"
#endif #endif
#ifdef TERN_EE #ifdef TERN_EE
#include "..\..\Source\portable\Paradigm\Tern_EE\small\portmacro.h" #include "..\..\Source\portable\Paradigm\Tern_EE\small\portmacro.h"
#endif #endif
#ifdef GCC_HCS12 #ifdef GCC_HCS12
#include "../../Source/portable/GCC/HCS12/portmacro.h" #include "../../Source/portable/GCC/HCS12/portmacro.h"
#endif #endif
#ifdef GCC_MCF5235 #ifdef GCC_MCF5235
#include "../../Source/portable/GCC/MCF5235/portmacro.h" #include "../../Source/portable/GCC/MCF5235/portmacro.h"
#endif #endif
#ifdef COLDFIRE_V2_GCC #ifdef COLDFIRE_V2_GCC
#include "../../../Source/portable/GCC/ColdFire_V2/portmacro.h" #include "../../../Source/portable/GCC/ColdFire_V2/portmacro.h"
#endif #endif
#ifdef COLDFIRE_V2_CODEWARRIOR #ifdef COLDFIRE_V2_CODEWARRIOR
#include "../../Source/portable/CodeWarrior/ColdFire_V2/portmacro.h" #include "../../Source/portable/CodeWarrior/ColdFire_V2/portmacro.h"
#endif #endif
#ifdef GCC_PPC405 #ifdef GCC_PPC405
#include "../../Source/portable/GCC/PPC405_Xilinx/portmacro.h" #include "../../Source/portable/GCC/PPC405_Xilinx/portmacro.h"
#endif #endif
#ifdef GCC_PPC440 #ifdef GCC_PPC440
#include "../../Source/portable/GCC/PPC440_Xilinx/portmacro.h" #include "../../Source/portable/GCC/PPC440_Xilinx/portmacro.h"
#endif #endif
#ifdef _16FX_SOFTUNE #ifdef _16FX_SOFTUNE
#include "..\..\Source\portable\Softune\MB96340\portmacro.h" #include "..\..\Source\portable\Softune\MB96340\portmacro.h"
#endif #endif
#ifdef BCC_INDUSTRIAL_PC_PORT #ifdef BCC_INDUSTRIAL_PC_PORT
/* A short file name has to be used in place of the normal /* A short file name has to be used in place of the normal
FreeRTOSConfig.h when using the Borland compiler. */ FreeRTOSConfig.h when using the Borland compiler. */
#include "frconfig.h" #include "frconfig.h"
#include "..\portable\BCC\16BitDOS\PC\prtmacro.h" #include "..\portable\BCC\16BitDOS\PC\prtmacro.h"
typedef void ( __interrupt __far *pxISR )(); typedef void ( __interrupt __far *pxISR )();
#endif #endif
#ifdef BCC_FLASH_LITE_186_PORT #ifdef BCC_FLASH_LITE_186_PORT
/* A short file name has to be used in place of the normal /* A short file name has to be used in place of the normal
FreeRTOSConfig.h when using the Borland compiler. */ FreeRTOSConfig.h when using the Borland compiler. */
#include "frconfig.h" #include "frconfig.h"
#include "..\portable\BCC\16BitDOS\flsh186\prtmacro.h" #include "..\portable\BCC\16BitDOS\flsh186\prtmacro.h"
typedef void ( __interrupt __far *pxISR )(); typedef void ( __interrupt __far *pxISR )();
#endif #endif
#ifdef __GNUC__ #ifdef __GNUC__
#ifdef __AVR32_AVR32A__ #ifdef __AVR32_AVR32A__
#include "portmacro.h" #include "portmacro.h"
#endif #endif
#endif #endif
#ifdef __ICCAVR32__ #ifdef __ICCAVR32__
#ifdef __CORE__ #ifdef __CORE__
#if __CORE__ == __AVR32A__ #if __CORE__ == __AVR32A__
#include "portmacro.h" #include "portmacro.h"
#endif #endif
#endif #endif
#endif #endif
#ifdef __91467D #ifdef __91467D
#include "portmacro.h" #include "portmacro.h"
#endif #endif
#ifdef __96340 #ifdef __96340
#include "portmacro.h" #include "portmacro.h"
#endif #endif
#ifdef __IAR_V850ES_Fx3__ #ifdef __IAR_V850ES_Fx3__
#include "../../Source/portable/IAR/V850ES/portmacro.h" #include "../../Source/portable/IAR/V850ES/portmacro.h"
#endif #endif
#ifdef __IAR_V850ES_Jx3__ #ifdef __IAR_V850ES_Jx3__
#include "../../Source/portable/IAR/V850ES/portmacro.h" #include "../../Source/portable/IAR/V850ES/portmacro.h"
#endif #endif
#ifdef __IAR_V850ES_Jx3_L__ #ifdef __IAR_V850ES_Jx3_L__
#include "../../Source/portable/IAR/V850ES/portmacro.h" #include "../../Source/portable/IAR/V850ES/portmacro.h"
#endif #endif
#ifdef __IAR_V850ES_Jx2__ #ifdef __IAR_V850ES_Jx2__
#include "../../Source/portable/IAR/V850ES/portmacro.h" #include "../../Source/portable/IAR/V850ES/portmacro.h"
#endif #endif
#ifdef __IAR_V850ES_Hx2__ #ifdef __IAR_V850ES_Hx2__
#include "../../Source/portable/IAR/V850ES/portmacro.h" #include "../../Source/portable/IAR/V850ES/portmacro.h"
#endif #endif
#ifdef __IAR_78K0R_Kx3__ #ifdef __IAR_78K0R_Kx3__
#include "../../Source/portable/IAR/78K0R/portmacro.h" #include "../../Source/portable/IAR/78K0R/portmacro.h"
#endif #endif
#ifdef __IAR_78K0R_Kx3L__ #ifdef __IAR_78K0R_Kx3L__
#include "../../Source/portable/IAR/78K0R/portmacro.h" #include "../../Source/portable/IAR/78K0R/portmacro.h"
#endif #endif
#endif /* DEPRECATED_DEFINITIONS_H */ #endif /* DEPRECATED_DEFINITIONS_H */

File diff suppressed because it is too large Load diff

View file

@ -1,411 +1,412 @@
/* /*
* FreeRTOS Kernel V10.0.1 * FreeRTOS Kernel V10.3.1
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions: * subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* http://www.FreeRTOS.org * http://www.FreeRTOS.org
* http://aws.amazon.com/freertos * http://aws.amazon.com/freertos
* *
* 1 tab == 4 spaces! * 1 tab == 4 spaces!
*/ */
/* /*
* This is the list implementation used by the scheduler. While it is tailored * This is the list implementation used by the scheduler. While it is tailored
* heavily for the schedulers needs, it is also available for use by * heavily for the schedulers needs, it is also available for use by
* application code. * application code.
* *
* list_ts can only store pointers to list_item_ts. Each ListItem_t contains a * list_ts can only store pointers to list_item_ts. Each ListItem_t contains a
* numeric value (xItemValue). Most of the time the lists are sorted in * numeric value (xItemValue). Most of the time the lists are sorted in
* descending item value order. * descending item value order.
* *
* Lists are created already containing one list item. The value of this * Lists are created already containing one list item. The value of this
* item is the maximum possible that can be stored, it is therefore always at * item is the maximum possible that can be stored, it is therefore always at
* the end of the list and acts as a marker. The list member pxHead always * the end of the list and acts as a marker. The list member pxHead always
* points to this marker - even though it is at the tail of the list. This * points to this marker - even though it is at the tail of the list. This
* is because the tail contains a wrap back pointer to the true head of * is because the tail contains a wrap back pointer to the true head of
* the list. * the list.
* *
* In addition to it's value, each list item contains a pointer to the next * In addition to it's value, each list item contains a pointer to the next
* item in the list (pxNext), a pointer to the list it is in (pxContainer) * item in the list (pxNext), a pointer to the list it is in (pxContainer)
* and a pointer to back to the object that contains it. These later two * and a pointer to back to the object that contains it. These later two
* pointers are included for efficiency of list manipulation. There is * pointers are included for efficiency of list manipulation. There is
* effectively a two way link between the object containing the list item and * effectively a two way link between the object containing the list item and
* the list item itself. * the list item itself.
* *
* *
* \page ListIntroduction List Implementation * \page ListIntroduction List Implementation
* \ingroup FreeRTOSIntro * \ingroup FreeRTOSIntro
*/ */
#ifndef INC_FREERTOS_H #ifndef INC_FREERTOS_H
#error FreeRTOS.h must be included before list.h #error FreeRTOS.h must be included before list.h
#endif #endif
#ifndef LIST_H #ifndef LIST_H
#define LIST_H #define LIST_H
/* /*
* The list structure members are modified from within interrupts, and therefore * The list structure members are modified from within interrupts, and therefore
* by rights should be declared volatile. However, they are only modified in a * by rights should be declared volatile. However, they are only modified in a
* functionally atomic way (within critical sections of with the scheduler * functionally atomic way (within critical sections of with the scheduler
* suspended) and are either passed by reference into a function or indexed via * suspended) and are either passed by reference into a function or indexed via
* a volatile variable. Therefore, in all use cases tested so far, the volatile * a volatile variable. Therefore, in all use cases tested so far, the volatile
* qualifier can be omitted in order to provide a moderate performance * qualifier can be omitted in order to provide a moderate performance
* improvement without adversely affecting functional behaviour. The assembly * improvement without adversely affecting functional behaviour. The assembly
* instructions generated by the IAR, ARM and GCC compilers when the respective * instructions generated by the IAR, ARM and GCC compilers when the respective
* compiler's options were set for maximum optimisation has been inspected and * compiler's options were set for maximum optimisation has been inspected and
* deemed to be as intended. That said, as compiler technology advances, and * deemed to be as intended. That said, as compiler technology advances, and
* especially if aggressive cross module optimisation is used (a use case that * especially if aggressive cross module optimisation is used (a use case that
* has not been exercised to any great extend) then it is feasible that the * has not been exercised to any great extend) then it is feasible that the
* volatile qualifier will be needed for correct optimisation. It is expected * volatile qualifier will be needed for correct optimisation. It is expected
* that a compiler removing essential code because, without the volatile * that a compiler removing essential code because, without the volatile
* qualifier on the list structure members and with aggressive cross module * qualifier on the list structure members and with aggressive cross module
* optimisation, the compiler deemed the code unnecessary will result in * optimisation, the compiler deemed the code unnecessary will result in
* complete and obvious failure of the scheduler. If this is ever experienced * complete and obvious failure of the scheduler. If this is ever experienced
* then the volatile qualifier can be inserted in the relevant places within the * then the volatile qualifier can be inserted in the relevant places within the
* list structures by simply defining configLIST_VOLATILE to volatile in * list structures by simply defining configLIST_VOLATILE to volatile in
* FreeRTOSConfig.h (as per the example at the bottom of this comment block). * FreeRTOSConfig.h (as per the example at the bottom of this comment block).
* If configLIST_VOLATILE is not defined then the preprocessor directives below * If configLIST_VOLATILE is not defined then the preprocessor directives below
* will simply #define configLIST_VOLATILE away completely. * will simply #define configLIST_VOLATILE away completely.
* *
* To use volatile list structure members then add the following line to * To use volatile list structure members then add the following line to
* FreeRTOSConfig.h (without the quotes): * FreeRTOSConfig.h (without the quotes):
* "#define configLIST_VOLATILE volatile" * "#define configLIST_VOLATILE volatile"
*/ */
#ifndef configLIST_VOLATILE #ifndef configLIST_VOLATILE
#define configLIST_VOLATILE #define configLIST_VOLATILE
#endif /* configSUPPORT_CROSS_MODULE_OPTIMISATION */ #endif /* configSUPPORT_CROSS_MODULE_OPTIMISATION */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* Macros that can be used to place known values within the list structures, /* Macros that can be used to place known values within the list structures,
then check that the known values do not get corrupted during the execution of then check that the known values do not get corrupted during the execution of
the application. These may catch the list data structures being overwritten in the application. These may catch the list data structures being overwritten in
memory. They will not catch data errors caused by incorrect configuration or memory. They will not catch data errors caused by incorrect configuration or
use of FreeRTOS.*/ use of FreeRTOS.*/
#if( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 ) #if( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 )
/* Define the macros to do nothing. */ /* Define the macros to do nothing. */
#define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE #define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE
#define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE #define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE
#define listFIRST_LIST_INTEGRITY_CHECK_VALUE #define listFIRST_LIST_INTEGRITY_CHECK_VALUE
#define listSECOND_LIST_INTEGRITY_CHECK_VALUE #define listSECOND_LIST_INTEGRITY_CHECK_VALUE
#define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) #define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem )
#define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) #define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem )
#define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList ) #define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList )
#define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList ) #define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList )
#define listTEST_LIST_ITEM_INTEGRITY( pxItem ) #define listTEST_LIST_ITEM_INTEGRITY( pxItem )
#define listTEST_LIST_INTEGRITY( pxList ) #define listTEST_LIST_INTEGRITY( pxList )
#else #else
/* Define macros that add new members into the list structures. */ /* Define macros that add new members into the list structures. */
#define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue1; #define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue1;
#define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue2; #define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue2;
#define listFIRST_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue1; #define listFIRST_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue1;
#define listSECOND_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue2; #define listSECOND_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue2;
/* Define macros that set the new structure members to known values. */ /* Define macros that set the new structure members to known values. */
#define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue1 = pdINTEGRITY_CHECK_VALUE #define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue1 = pdINTEGRITY_CHECK_VALUE
#define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue2 = pdINTEGRITY_CHECK_VALUE #define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue2 = pdINTEGRITY_CHECK_VALUE
#define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList ) ( pxList )->xListIntegrityValue1 = pdINTEGRITY_CHECK_VALUE #define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList ) ( pxList )->xListIntegrityValue1 = pdINTEGRITY_CHECK_VALUE
#define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList ) ( pxList )->xListIntegrityValue2 = pdINTEGRITY_CHECK_VALUE #define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList ) ( pxList )->xListIntegrityValue2 = pdINTEGRITY_CHECK_VALUE
/* Define macros that will assert if one of the structure members does not /* Define macros that will assert if one of the structure members does not
contain its expected value. */ contain its expected value. */
#define listTEST_LIST_ITEM_INTEGRITY( pxItem ) configASSERT( ( ( pxItem )->xListItemIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxItem )->xListItemIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) ) #define listTEST_LIST_ITEM_INTEGRITY( pxItem ) configASSERT( ( ( pxItem )->xListItemIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxItem )->xListItemIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) )
#define listTEST_LIST_INTEGRITY( pxList ) configASSERT( ( ( pxList )->xListIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxList )->xListIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) ) #define listTEST_LIST_INTEGRITY( pxList ) configASSERT( ( ( pxList )->xListIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxList )->xListIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) )
#endif /* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES */ #endif /* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES */
/* /*
* Definition of the only type of object that a list can contain. * Definition of the only type of object that a list can contain.
*/ */
struct xLIST_ITEM struct xLIST;
{ struct xLIST_ITEM
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ {
configLIST_VOLATILE TickType_t xItemValue; /*< The value being listed. In most cases this is used to sort the list in descending order. */ listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
struct xLIST_ITEM * configLIST_VOLATILE pxNext; /*< Pointer to the next ListItem_t in the list. */ configLIST_VOLATILE TickType_t xItemValue; /*< The value being listed. In most cases this is used to sort the list in descending order. */
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious; /*< Pointer to the previous ListItem_t in the list. */ struct xLIST_ITEM * configLIST_VOLATILE pxNext; /*< Pointer to the next ListItem_t in the list. */
void * pvOwner; /*< Pointer to the object (normally a TCB) that contains the list item. There is therefore a two way link between the object containing the list item and the list item itself. */ struct xLIST_ITEM * configLIST_VOLATILE pxPrevious; /*< Pointer to the previous ListItem_t in the list. */
void * configLIST_VOLATILE pvContainer; /*< Pointer to the list in which this list item is placed (if any). */ void * pvOwner; /*< Pointer to the object (normally a TCB) that contains the list item. There is therefore a two way link between the object containing the list item and the list item itself. */
listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ struct xLIST * configLIST_VOLATILE pxContainer; /*< Pointer to the list in which this list item is placed (if any). */
}; listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
typedef struct xLIST_ITEM ListItem_t; /* For some reason lint wants this as two separate definitions. */ };
typedef struct xLIST_ITEM ListItem_t; /* For some reason lint wants this as two separate definitions. */
struct xMINI_LIST_ITEM
{ struct xMINI_LIST_ITEM
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ {
configLIST_VOLATILE TickType_t xItemValue; listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
struct xLIST_ITEM * configLIST_VOLATILE pxNext; configLIST_VOLATILE TickType_t xItemValue;
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious; struct xLIST_ITEM * configLIST_VOLATILE pxNext;
}; struct xLIST_ITEM * configLIST_VOLATILE pxPrevious;
typedef struct xMINI_LIST_ITEM MiniListItem_t; };
typedef struct xMINI_LIST_ITEM MiniListItem_t;
/*
* Definition of the type of queue used by the scheduler. /*
*/ * Definition of the type of queue used by the scheduler.
typedef struct xLIST */
{ typedef struct xLIST
listFIRST_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ {
volatile UBaseType_t uxNumberOfItems; listFIRST_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
ListItem_t * configLIST_VOLATILE pxIndex; /*< Used to walk through the list. Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */ volatile UBaseType_t uxNumberOfItems;
MiniListItem_t xListEnd; /*< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */ ListItem_t * configLIST_VOLATILE pxIndex; /*< Used to walk through the list. Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */
listSECOND_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ MiniListItem_t xListEnd; /*< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */
} List_t; listSECOND_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
} List_t;
/*
* Access macro to set the owner of a list item. The owner of a list item /*
* is the object (usually a TCB) that contains the list item. * Access macro to set the owner of a list item. The owner of a list item
* * is the object (usually a TCB) that contains the list item.
* \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER *
* \ingroup LinkedList * \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER
*/ * \ingroup LinkedList
#define listSET_LIST_ITEM_OWNER( pxListItem, pxOwner ) ( ( pxListItem )->pvOwner = ( void * ) ( pxOwner ) ) */
#define listSET_LIST_ITEM_OWNER( pxListItem, pxOwner ) ( ( pxListItem )->pvOwner = ( void * ) ( pxOwner ) )
/*
* Access macro to get the owner of a list item. The owner of a list item /*
* is the object (usually a TCB) that contains the list item. * Access macro to get the owner of a list item. The owner of a list item
* * is the object (usually a TCB) that contains the list item.
* \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER *
* \ingroup LinkedList * \page listGET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER
*/ * \ingroup LinkedList
#define listGET_LIST_ITEM_OWNER( pxListItem ) ( ( pxListItem )->pvOwner ) */
#define listGET_LIST_ITEM_OWNER( pxListItem ) ( ( pxListItem )->pvOwner )
/*
* Access macro to set the value of the list item. In most cases the value is /*
* used to sort the list in descending order. * Access macro to set the value of the list item. In most cases the value is
* * used to sort the list in descending order.
* \page listSET_LIST_ITEM_VALUE listSET_LIST_ITEM_VALUE *
* \ingroup LinkedList * \page listSET_LIST_ITEM_VALUE listSET_LIST_ITEM_VALUE
*/ * \ingroup LinkedList
#define listSET_LIST_ITEM_VALUE( pxListItem, xValue ) ( ( pxListItem )->xItemValue = ( xValue ) ) */
#define listSET_LIST_ITEM_VALUE( pxListItem, xValue ) ( ( pxListItem )->xItemValue = ( xValue ) )
/*
* Access macro to retrieve the value of the list item. The value can /*
* represent anything - for example the priority of a task, or the time at * Access macro to retrieve the value of the list item. The value can
* which a task should be unblocked. * represent anything - for example the priority of a task, or the time at
* * which a task should be unblocked.
* \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE *
* \ingroup LinkedList * \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE
*/ * \ingroup LinkedList
#define listGET_LIST_ITEM_VALUE( pxListItem ) ( ( pxListItem )->xItemValue ) */
#define listGET_LIST_ITEM_VALUE( pxListItem ) ( ( pxListItem )->xItemValue )
/*
* Access macro to retrieve the value of the list item at the head of a given /*
* list. * Access macro to retrieve the value of the list item at the head of a given
* * list.
* \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE *
* \ingroup LinkedList * \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE
*/ * \ingroup LinkedList
#define listGET_ITEM_VALUE_OF_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext->xItemValue ) */
#define listGET_ITEM_VALUE_OF_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext->xItemValue )
/*
* Return the list item at the head of the list. /*
* * Return the list item at the head of the list.
* \page listGET_HEAD_ENTRY listGET_HEAD_ENTRY *
* \ingroup LinkedList * \page listGET_HEAD_ENTRY listGET_HEAD_ENTRY
*/ * \ingroup LinkedList
#define listGET_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext ) */
#define listGET_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext )
/*
* Return the list item at the head of the list. /*
* * Return the next list item.
* \page listGET_NEXT listGET_NEXT *
* \ingroup LinkedList * \page listGET_NEXT listGET_NEXT
*/ * \ingroup LinkedList
#define listGET_NEXT( pxListItem ) ( ( pxListItem )->pxNext ) */
#define listGET_NEXT( pxListItem ) ( ( pxListItem )->pxNext )
/*
* Return the list item that marks the end of the list /*
* * Return the list item that marks the end of the list
* \page listGET_END_MARKER listGET_END_MARKER *
* \ingroup LinkedList * \page listGET_END_MARKER listGET_END_MARKER
*/ * \ingroup LinkedList
#define listGET_END_MARKER( pxList ) ( ( ListItem_t const * ) ( &( ( pxList )->xListEnd ) ) ) */
#define listGET_END_MARKER( pxList ) ( ( ListItem_t const * ) ( &( ( pxList )->xListEnd ) ) )
/*
* Access macro to determine if a list contains any items. The macro will /*
* only have the value true if the list is empty. * Access macro to determine if a list contains any items. The macro will
* * only have the value true if the list is empty.
* \page listLIST_IS_EMPTY listLIST_IS_EMPTY *
* \ingroup LinkedList * \page listLIST_IS_EMPTY listLIST_IS_EMPTY
*/ * \ingroup LinkedList
#define listLIST_IS_EMPTY( pxList ) ( ( BaseType_t ) ( ( pxList )->uxNumberOfItems == ( UBaseType_t ) 0 ) ) */
#define listLIST_IS_EMPTY( pxList ) ( ( ( pxList )->uxNumberOfItems == ( UBaseType_t ) 0 ) ? pdTRUE : pdFALSE )
/*
* Access macro to return the number of items in the list. /*
*/ * Access macro to return the number of items in the list.
#define listCURRENT_LIST_LENGTH( pxList ) ( ( pxList )->uxNumberOfItems ) */
#define listCURRENT_LIST_LENGTH( pxList ) ( ( pxList )->uxNumberOfItems )
/*
* Access function to obtain the owner of the next entry in a list. /*
* * Access function to obtain the owner of the next entry in a list.
* The list member pxIndex is used to walk through a list. Calling *
* listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list * The list member pxIndex is used to walk through a list. Calling
* and returns that entry's pxOwner parameter. Using multiple calls to this * listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list
* function it is therefore possible to move through every item contained in * and returns that entry's pxOwner parameter. Using multiple calls to this
* a list. * function it is therefore possible to move through every item contained in
* * a list.
* The pxOwner parameter of a list item is a pointer to the object that owns *
* the list item. In the scheduler this is normally a task control block. * The pxOwner parameter of a list item is a pointer to the object that owns
* The pxOwner parameter effectively creates a two way link between the list * the list item. In the scheduler this is normally a task control block.
* item and its owner. * The pxOwner parameter effectively creates a two way link between the list
* * item and its owner.
* @param pxTCB pxTCB is set to the address of the owner of the next list item. *
* @param pxList The list from which the next item owner is to be returned. * @param pxTCB pxTCB is set to the address of the owner of the next list item.
* * @param pxList The list from which the next item owner is to be returned.
* \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY *
* \ingroup LinkedList * \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY
*/ * \ingroup LinkedList
#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \ */
{ \ #define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \
List_t * const pxConstList = ( pxList ); \ { \
/* Increment the index to the next item and return the item, ensuring */ \ List_t * const pxConstList = ( pxList ); \
/* we don't return the marker used at the end of the list. */ \ /* Increment the index to the next item and return the item, ensuring */ \
( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \ /* we don't return the marker used at the end of the list. */ \
if( ( void * ) ( pxConstList )->pxIndex == ( void * ) &( ( pxConstList )->xListEnd ) ) \ ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
{ \ if( ( void * ) ( pxConstList )->pxIndex == ( void * ) &( ( pxConstList )->xListEnd ) ) \
( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \ { \
} \ ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \ } \
} ( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \
}
/*
* Access function to obtain the owner of the first entry in a list. Lists /*
* are normally sorted in ascending item value order. * Access function to obtain the owner of the first entry in a list. Lists
* * are normally sorted in ascending item value order.
* This function returns the pxOwner member of the first item in the list. *
* The pxOwner parameter of a list item is a pointer to the object that owns * This function returns the pxOwner member of the first item in the list.
* the list item. In the scheduler this is normally a task control block. * The pxOwner parameter of a list item is a pointer to the object that owns
* The pxOwner parameter effectively creates a two way link between the list * the list item. In the scheduler this is normally a task control block.
* item and its owner. * The pxOwner parameter effectively creates a two way link between the list
* * item and its owner.
* @param pxList The list from which the owner of the head item is to be *
* returned. * @param pxList The list from which the owner of the head item is to be
* * returned.
* \page listGET_OWNER_OF_HEAD_ENTRY listGET_OWNER_OF_HEAD_ENTRY *
* \ingroup LinkedList * \page listGET_OWNER_OF_HEAD_ENTRY listGET_OWNER_OF_HEAD_ENTRY
*/ * \ingroup LinkedList
#define listGET_OWNER_OF_HEAD_ENTRY( pxList ) ( (&( ( pxList )->xListEnd ))->pxNext->pvOwner ) */
#define listGET_OWNER_OF_HEAD_ENTRY( pxList ) ( (&( ( pxList )->xListEnd ))->pxNext->pvOwner )
/*
* Check to see if a list item is within a list. The list item maintains a /*
* "container" pointer that points to the list it is in. All this macro does * Check to see if a list item is within a list. The list item maintains a
* is check to see if the container and the list match. * "container" pointer that points to the list it is in. All this macro does
* * is check to see if the container and the list match.
* @param pxList The list we want to know if the list item is within. *
* @param pxListItem The list item we want to know if is in the list. * @param pxList The list we want to know if the list item is within.
* @return pdTRUE if the list item is in the list, otherwise pdFALSE. * @param pxListItem The list item we want to know if is in the list.
*/ * @return pdTRUE if the list item is in the list, otherwise pdFALSE.
#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( BaseType_t ) ( ( pxListItem )->pvContainer == ( void * ) ( pxList ) ) ) */
#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( ( pxListItem )->pxContainer == ( pxList ) ) ? ( pdTRUE ) : ( pdFALSE ) )
/*
* Return the list a list item is contained within (referenced from). /*
* * Return the list a list item is contained within (referenced from).
* @param pxListItem The list item being queried. *
* @return A pointer to the List_t object that references the pxListItem * @param pxListItem The list item being queried.
*/ * @return A pointer to the List_t object that references the pxListItem
#define listLIST_ITEM_CONTAINER( pxListItem ) ( ( pxListItem )->pvContainer ) */
#define listLIST_ITEM_CONTAINER( pxListItem ) ( ( pxListItem )->pxContainer )
/*
* This provides a crude means of knowing if a list has been initialised, as /*
* pxList->xListEnd.xItemValue is set to portMAX_DELAY by the vListInitialise() * This provides a crude means of knowing if a list has been initialised, as
* function. * pxList->xListEnd.xItemValue is set to portMAX_DELAY by the vListInitialise()
*/ * function.
#define listLIST_IS_INITIALISED( pxList ) ( ( pxList )->xListEnd.xItemValue == portMAX_DELAY ) */
#define listLIST_IS_INITIALISED( pxList ) ( ( pxList )->xListEnd.xItemValue == portMAX_DELAY )
/*
* Must be called before a list is used! This initialises all the members /*
* of the list structure and inserts the xListEnd item into the list as a * Must be called before a list is used! This initialises all the members
* marker to the back of the list. * of the list structure and inserts the xListEnd item into the list as a
* * marker to the back of the list.
* @param pxList Pointer to the list being initialised. *
* * @param pxList Pointer to the list being initialised.
* \page vListInitialise vListInitialise *
* \ingroup LinkedList * \page vListInitialise vListInitialise
*/ * \ingroup LinkedList
void vListInitialise( List_t * const pxList ) PRIVILEGED_FUNCTION; */
void vListInitialise( List_t * const pxList ) PRIVILEGED_FUNCTION;
/*
* Must be called before a list item is used. This sets the list container to /*
* null so the item does not think that it is already contained in a list. * Must be called before a list item is used. This sets the list container to
* * null so the item does not think that it is already contained in a list.
* @param pxItem Pointer to the list item being initialised. *
* * @param pxItem Pointer to the list item being initialised.
* \page vListInitialiseItem vListInitialiseItem *
* \ingroup LinkedList * \page vListInitialiseItem vListInitialiseItem
*/ * \ingroup LinkedList
void vListInitialiseItem( ListItem_t * const pxItem ) PRIVILEGED_FUNCTION; */
void vListInitialiseItem( ListItem_t * const pxItem ) PRIVILEGED_FUNCTION;
/*
* Insert a list item into a list. The item will be inserted into the list in /*
* a position determined by its item value (descending item value order). * Insert a list item into a list. The item will be inserted into the list in
* * a position determined by its item value (descending item value order).
* @param pxList The list into which the item is to be inserted. *
* * @param pxList The list into which the item is to be inserted.
* @param pxNewListItem The item that is to be placed in the list. *
* * @param pxNewListItem The item that is to be placed in the list.
* \page vListInsert vListInsert *
* \ingroup LinkedList * \page vListInsert vListInsert
*/ * \ingroup LinkedList
void vListInsert( List_t * const pxList, ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION; */
void vListInsert( List_t * const pxList, ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION;
/*
* Insert a list item into a list. The item will be inserted in a position /*
* such that it will be the last item within the list returned by multiple * Insert a list item into a list. The item will be inserted in a position
* calls to listGET_OWNER_OF_NEXT_ENTRY. * such that it will be the last item within the list returned by multiple
* * calls to listGET_OWNER_OF_NEXT_ENTRY.
* The list member pxIndex is used to walk through a list. Calling *
* listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list. * The list member pxIndex is used to walk through a list. Calling
* Placing an item in a list using vListInsertEnd effectively places the item * listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list.
* in the list position pointed to by pxIndex. This means that every other * Placing an item in a list using vListInsertEnd effectively places the item
* item within the list will be returned by listGET_OWNER_OF_NEXT_ENTRY before * in the list position pointed to by pxIndex. This means that every other
* the pxIndex parameter again points to the item being inserted. * item within the list will be returned by listGET_OWNER_OF_NEXT_ENTRY before
* * the pxIndex parameter again points to the item being inserted.
* @param pxList The list into which the item is to be inserted. *
* * @param pxList The list into which the item is to be inserted.
* @param pxNewListItem The list item to be inserted into the list. *
* * @param pxNewListItem The list item to be inserted into the list.
* \page vListInsertEnd vListInsertEnd *
* \ingroup LinkedList * \page vListInsertEnd vListInsertEnd
*/ * \ingroup LinkedList
void vListInsertEnd( List_t * const pxList, ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION; */
void vListInsertEnd( List_t * const pxList, ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION;
/*
* Remove an item from a list. The list item has a pointer to the list that /*
* it is in, so only the list item need be passed into the function. * Remove an item from a list. The list item has a pointer to the list that
* * it is in, so only the list item need be passed into the function.
* @param uxListRemove The item to be removed. The item will remove itself from *
* the list pointed to by it's pxContainer parameter. * @param uxListRemove The item to be removed. The item will remove itself from
* * the list pointed to by it's pxContainer parameter.
* @return The number of items that remain in the list after the list item has *
* been removed. * @return The number of items that remain in the list after the list item has
* * been removed.
* \page uxListRemove uxListRemove *
* \ingroup LinkedList * \page uxListRemove uxListRemove
*/ * \ingroup LinkedList
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) PRIVILEGED_FUNCTION; */
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) PRIVILEGED_FUNCTION;
#ifdef __cplusplus
} #ifdef __cplusplus
#endif }
#endif
#endif
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,155 +1,160 @@
/* /*
* FreeRTOS Kernel V10.0.1 * FreeRTOS Kernel V10.3.1
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions: * subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* http://www.FreeRTOS.org * http://www.FreeRTOS.org
* http://aws.amazon.com/freertos * http://aws.amazon.com/freertos
* *
* 1 tab == 4 spaces! * 1 tab == 4 spaces!
*/ */
/* /*
* When the MPU is used the standard (non MPU) API functions are mapped to * When the MPU is used the standard (non MPU) API functions are mapped to
* equivalents that start "MPU_", the prototypes for which are defined in this * equivalents that start "MPU_", the prototypes for which are defined in this
* header files. This will cause the application code to call the MPU_ version * header files. This will cause the application code to call the MPU_ version
* which wraps the non-MPU version with privilege promoting then demoting code, * which wraps the non-MPU version with privilege promoting then demoting code,
* so the kernel code always runs will full privileges. * so the kernel code always runs will full privileges.
*/ */
#ifndef MPU_PROTOTYPES_H #ifndef MPU_PROTOTYPES_H
#define MPU_PROTOTYPES_H #define MPU_PROTOTYPES_H
/* MPU versions of tasks.h API functions. */ /* MPU versions of tasks.h API functions. */
BaseType_t MPU_xTaskCreate( TaskFunction_t pxTaskCode, const char * const pcName, const uint16_t usStackDepth, void * const pvParameters, UBaseType_t uxPriority, TaskHandle_t * const pxCreatedTask ); BaseType_t MPU_xTaskCreate( TaskFunction_t pxTaskCode, const char * const pcName, const uint16_t usStackDepth, void * const pvParameters, UBaseType_t uxPriority, TaskHandle_t * const pxCreatedTask ) FREERTOS_SYSTEM_CALL;
TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode, const char * const pcName, const uint32_t ulStackDepth, void * const pvParameters, UBaseType_t uxPriority, StackType_t * const puxStackBuffer, StaticTask_t * const pxTaskBuffer ); TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode, const char * const pcName, const uint32_t ulStackDepth, void * const pvParameters, UBaseType_t uxPriority, StackType_t * const puxStackBuffer, StaticTask_t * const pxTaskBuffer ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t *pxCreatedTask ); BaseType_t MPU_xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t *pxCreatedTask ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskCreateRestrictedStatic( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t *pxCreatedTask ); BaseType_t MPU_xTaskCreateRestrictedStatic( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t *pxCreatedTask ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions ); void MPU_vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskDelete( TaskHandle_t xTaskToDelete ); void MPU_vTaskDelete( TaskHandle_t xTaskToDelete ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskDelay( const TickType_t xTicksToDelay ); void MPU_vTaskDelay( const TickType_t xTicksToDelay ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement ); void MPU_vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask ); BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxTaskPriorityGet( TaskHandle_t xTask ); UBaseType_t MPU_uxTaskPriorityGet( const TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
eTaskState MPU_eTaskGetState( TaskHandle_t xTask ); eTaskState MPU_eTaskGetState( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskGetInfo( TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState ); void MPU_vTaskGetInfo( TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority ); void MPU_vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskSuspend( TaskHandle_t xTaskToSuspend ); void MPU_vTaskSuspend( TaskHandle_t xTaskToSuspend ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskResume( TaskHandle_t xTaskToResume ); void MPU_vTaskResume( TaskHandle_t xTaskToResume ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskStartScheduler( void ); void MPU_vTaskStartScheduler( void ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskSuspendAll( void ); void MPU_vTaskSuspendAll( void ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskResumeAll( void ); BaseType_t MPU_xTaskResumeAll( void ) FREERTOS_SYSTEM_CALL;
TickType_t MPU_xTaskGetTickCount( void ); TickType_t MPU_xTaskGetTickCount( void ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxTaskGetNumberOfTasks( void ); UBaseType_t MPU_uxTaskGetNumberOfTasks( void ) FREERTOS_SYSTEM_CALL;
char * MPU_pcTaskGetName( TaskHandle_t xTaskToQuery ); char * MPU_pcTaskGetName( TaskHandle_t xTaskToQuery ) FREERTOS_SYSTEM_CALL;
TaskHandle_t MPU_xTaskGetHandle( const char *pcNameToQuery ); TaskHandle_t MPU_xTaskGetHandle( const char *pcNameToQuery ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask ); UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction ); configSTACK_DEPTH_TYPE MPU_uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask ); void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue ); TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery, BaseType_t xIndex ); void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter ); void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery, BaseType_t xIndex ) FREERTOS_SYSTEM_CALL;
TaskHandle_t MPU_xTaskGetIdleTaskHandle( void ); BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray, const UBaseType_t uxArraySize, uint32_t * const pulTotalRunTime ); TaskHandle_t MPU_xTaskGetIdleTaskHandle( void ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskList( char * pcWriteBuffer ); UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray, const UBaseType_t uxArraySize, uint32_t * const pulTotalRunTime ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskGetRunTimeStats( char *pcWriteBuffer ); uint32_t MPU_ulTaskGetIdleRunTimeCounter( void ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskGenericNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue ); void MPU_vTaskList( char * pcWriteBuffer ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait ); void MPU_vTaskGetRunTimeStats( char *pcWriteBuffer ) FREERTOS_SYSTEM_CALL;
uint32_t MPU_ulTaskNotifyTake( BaseType_t xClearCountOnExit, TickType_t xTicksToWait ); BaseType_t MPU_xTaskGenericNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskNotifyStateClear( TaskHandle_t xTask ); BaseType_t MPU_xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskIncrementTick( void ); uint32_t MPU_ulTaskNotifyTake( BaseType_t xClearCountOnExit, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void ); BaseType_t MPU_xTaskNotifyStateClear( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ); uint32_t MPU_ulTaskNotifyValueClear( TaskHandle_t xTask, uint32_t ulBitsToClear ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, TickType_t * const pxTicksToWait ); BaseType_t MPU_xTaskIncrementTick( void ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskMissedYield( void ); TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskGetSchedulerState( void ); void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, TickType_t * const pxTicksToWait ) FREERTOS_SYSTEM_CALL;
/* MPU versions of queue.h API functions. */ void MPU_vTaskMissedYield( void ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, const BaseType_t xCopyPosition ); BaseType_t MPU_xTaskGetSchedulerState( void ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueueReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait ); BaseType_t MPU_xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueuePeek( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait );
BaseType_t MPU_xQueueSemaphoreTake( QueueHandle_t xQueue, TickType_t xTicksToWait ); /* MPU versions of queue.h API functions. */
UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t xQueue ); BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, const BaseType_t xCopyPosition ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue ); BaseType_t MPU_xQueueReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
void MPU_vQueueDelete( QueueHandle_t xQueue ); BaseType_t MPU_xQueuePeek( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType ); BaseType_t MPU_xQueueSemaphoreTake( QueueHandle_t xQueue, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType, StaticQueue_t *pxStaticQueue ); UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount ); UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount, StaticQueue_t *pxStaticQueue ); void MPU_vQueueDelete( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
void* MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore ); QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xTicksToWait ); QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType, StaticQueue_t *pxStaticQueue ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t pxMutex ); QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount ) FREERTOS_SYSTEM_CALL;
void MPU_vQueueAddToRegistry( QueueHandle_t xQueue, const char *pcName ); QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount, StaticQueue_t *pxStaticQueue ) FREERTOS_SYSTEM_CALL;
void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue ); TaskHandle_t MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore ) FREERTOS_SYSTEM_CALL;
const char * MPU_pcQueueGetName( QueueHandle_t xQueue ); BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, const uint8_t ucQueueType ); BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) FREERTOS_SYSTEM_CALL;
QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, uint8_t *pucQueueStorage, StaticQueue_t *pxStaticQueue, const uint8_t ucQueueType ); void MPU_vQueueAddToRegistry( QueueHandle_t xQueue, const char *pcName ) FREERTOS_SYSTEM_CALL;
QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength ); void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ); const char * MPU_pcQueueGetName( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ); QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet, const TickType_t xTicksToWait ); QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, uint8_t *pucQueueStorage, StaticQueue_t *pxStaticQueue, const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue, BaseType_t xNewQueue ); QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength ) FREERTOS_SYSTEM_CALL;
void MPU_vQueueSetQueueNumber( QueueHandle_t xQueue, UBaseType_t uxQueueNumber ); BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxQueueGetQueueNumber( QueueHandle_t xQueue ); BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) FREERTOS_SYSTEM_CALL;
uint8_t MPU_ucQueueGetQueueType( QueueHandle_t xQueue ); QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet, const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue, BaseType_t xNewQueue ) FREERTOS_SYSTEM_CALL;
/* MPU versions of timers.h API functions. */ void MPU_vQueueSetQueueNumber( QueueHandle_t xQueue, UBaseType_t uxQueueNumber ) FREERTOS_SYSTEM_CALL;
TimerHandle_t MPU_xTimerCreate( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction ); UBaseType_t MPU_uxQueueGetQueueNumber( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
TimerHandle_t MPU_xTimerCreateStatic( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction, StaticTimer_t *pxTimerBuffer ); uint8_t MPU_ucQueueGetQueueType( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
void * MPU_pvTimerGetTimerID( const TimerHandle_t xTimer );
void MPU_vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID ); /* MPU versions of timers.h API functions. */
BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer ); TimerHandle_t MPU_xTimerCreate( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction ) FREERTOS_SYSTEM_CALL;
TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void ); TimerHandle_t MPU_xTimerCreateStatic( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction, StaticTimer_t *pxTimerBuffer ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait ); void * MPU_pvTimerGetTimerID( const TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
const char * MPU_pcTimerGetName( TimerHandle_t xTimer ); void MPU_vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID ) FREERTOS_SYSTEM_CALL;
TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer ); BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer ); TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTimerCreateTimerTask( void ); BaseType_t MPU_xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue, BaseType_t * const pxHigherPriorityTaskWoken, const TickType_t xTicksToWait ); const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
void MPU_vTimerSetReloadMode( TimerHandle_t xTimer, const UBaseType_t uxAutoReload ) FREERTOS_SYSTEM_CALL;
/* MPU versions of event_group.h API functions. */ UBaseType_t MPU_uxTimerGetReloadMode( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
EventGroupHandle_t MPU_xEventGroupCreate( void ); TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t *pxEventGroupBuffer ); TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait ); BaseType_t MPU_xTimerCreateTimerTask( void ) FREERTOS_SYSTEM_CALL;
EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear ); BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue, BaseType_t * const pxHigherPriorityTaskWoken, const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );
EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait ); /* MPU versions of event_group.h API functions. */
void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup ); EventGroupHandle_t MPU_xEventGroupCreate( void ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxEventGroupGetNumber( void* xEventGroup ); EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t *pxEventGroupBuffer ) FREERTOS_SYSTEM_CALL;
EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
/* MPU versions of message/stream_buffer.h API functions. */ EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear ) FREERTOS_SYSTEM_CALL;
size_t MPU_xStreamBufferSend( StreamBufferHandle_t xStreamBuffer, const void *pvTxData, size_t xDataLengthBytes, TickType_t xTicksToWait ); EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet ) FREERTOS_SYSTEM_CALL;
size_t MPU_xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer, const void *pvTxData, size_t xDataLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken ); EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
size_t MPU_xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer, void *pvRxData, size_t xBufferLengthBytes, TickType_t xTicksToWait ); void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup ) FREERTOS_SYSTEM_CALL;
size_t MPU_xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer, void *pvRxData, size_t xBufferLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken ); UBaseType_t MPU_uxEventGroupGetNumber( void* xEventGroup ) FREERTOS_SYSTEM_CALL;
void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer );
BaseType_t MPU_xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ); /* MPU versions of message/stream_buffer.h API functions. */
BaseType_t MPU_xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ); size_t MPU_xStreamBufferSend( StreamBufferHandle_t xStreamBuffer, const void *pvTxData, size_t xDataLengthBytes, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ); size_t MPU_xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer, void *pvRxData, size_t xBufferLengthBytes, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
size_t MPU_xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ); size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
size_t MPU_xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ); void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer, size_t xTriggerLevel ); BaseType_t MPU_xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
StreamBufferHandle_t MPU_xStreamBufferGenericCreate( size_t xBufferSizeBytes, size_t xTriggerLevelBytes, BaseType_t xIsMessageBuffer ); BaseType_t MPU_xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
StreamBufferHandle_t MPU_xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes, size_t xTriggerLevelBytes, BaseType_t xIsMessageBuffer, uint8_t * const pucStreamBufferStorageArea, StaticStreamBuffer_t * const pxStaticStreamBuffer ); BaseType_t MPU_xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
size_t MPU_xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
size_t MPU_xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer, size_t xTriggerLevel ) FREERTOS_SYSTEM_CALL;
#endif /* MPU_PROTOTYPES_H */ StreamBufferHandle_t MPU_xStreamBufferGenericCreate( size_t xBufferSizeBytes, size_t xTriggerLevelBytes, BaseType_t xIsMessageBuffer ) FREERTOS_SYSTEM_CALL;
StreamBufferHandle_t MPU_xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes, size_t xTriggerLevelBytes, BaseType_t xIsMessageBuffer, uint8_t * const pucStreamBufferStorageArea, StaticStreamBuffer_t * const pxStaticStreamBuffer ) FREERTOS_SYSTEM_CALL;
#endif /* MPU_PROTOTYPES_H */

View file

@ -1,181 +1,189 @@
/* /*
* FreeRTOS Kernel V10.0.1 * FreeRTOS Kernel V10.3.1
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions: * subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* http://www.FreeRTOS.org * http://www.FreeRTOS.org
* http://aws.amazon.com/freertos * http://aws.amazon.com/freertos
* *
* 1 tab == 4 spaces! * 1 tab == 4 spaces!
*/ */
#ifndef MPU_WRAPPERS_H #ifndef MPU_WRAPPERS_H
#define MPU_WRAPPERS_H #define MPU_WRAPPERS_H
/* This file redefines API functions to be called through a wrapper macro, but /* This file redefines API functions to be called through a wrapper macro, but
only for ports that are using the MPU. */ only for ports that are using the MPU. */
#ifdef portUSING_MPU_WRAPPERS #ifdef portUSING_MPU_WRAPPERS
/* MPU_WRAPPERS_INCLUDED_FROM_API_FILE will be defined when this file is /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE will be defined when this file is
included from queue.c or task.c to prevent it from having an effect within included from queue.c or task.c to prevent it from having an effect within
those files. */ those files. */
#ifndef MPU_WRAPPERS_INCLUDED_FROM_API_FILE #ifndef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/* /*
* Map standard (non MPU) API functions to equivalents that start * Map standard (non MPU) API functions to equivalents that start
* "MPU_". This will cause the application code to call the MPU_ * "MPU_". This will cause the application code to call the MPU_
* version, which wraps the non-MPU version with privilege promoting * version, which wraps the non-MPU version with privilege promoting
* then demoting code, so the kernel code always runs will full * then demoting code, so the kernel code always runs will full
* privileges. * privileges.
*/ */
/* Map standard tasks.h API functions to the MPU equivalents. */ /* Map standard tasks.h API functions to the MPU equivalents. */
#define xTaskCreate MPU_xTaskCreate #define xTaskCreate MPU_xTaskCreate
#define xTaskCreateStatic MPU_xTaskCreateStatic #define xTaskCreateStatic MPU_xTaskCreateStatic
#define xTaskCreateRestricted MPU_xTaskCreateRestricted #define xTaskCreateRestricted MPU_xTaskCreateRestricted
#define vTaskAllocateMPURegions MPU_vTaskAllocateMPURegions #define vTaskAllocateMPURegions MPU_vTaskAllocateMPURegions
#define vTaskDelete MPU_vTaskDelete #define vTaskDelete MPU_vTaskDelete
#define vTaskDelay MPU_vTaskDelay #define vTaskDelay MPU_vTaskDelay
#define vTaskDelayUntil MPU_vTaskDelayUntil #define vTaskDelayUntil MPU_vTaskDelayUntil
#define xTaskAbortDelay MPU_xTaskAbortDelay #define xTaskAbortDelay MPU_xTaskAbortDelay
#define uxTaskPriorityGet MPU_uxTaskPriorityGet #define uxTaskPriorityGet MPU_uxTaskPriorityGet
#define eTaskGetState MPU_eTaskGetState #define eTaskGetState MPU_eTaskGetState
#define vTaskGetInfo MPU_vTaskGetInfo #define vTaskGetInfo MPU_vTaskGetInfo
#define vTaskPrioritySet MPU_vTaskPrioritySet #define vTaskPrioritySet MPU_vTaskPrioritySet
#define vTaskSuspend MPU_vTaskSuspend #define vTaskSuspend MPU_vTaskSuspend
#define vTaskResume MPU_vTaskResume #define vTaskResume MPU_vTaskResume
#define vTaskSuspendAll MPU_vTaskSuspendAll #define vTaskSuspendAll MPU_vTaskSuspendAll
#define xTaskResumeAll MPU_xTaskResumeAll #define xTaskResumeAll MPU_xTaskResumeAll
#define xTaskGetTickCount MPU_xTaskGetTickCount #define xTaskGetTickCount MPU_xTaskGetTickCount
#define uxTaskGetNumberOfTasks MPU_uxTaskGetNumberOfTasks #define uxTaskGetNumberOfTasks MPU_uxTaskGetNumberOfTasks
#define pcTaskGetName MPU_pcTaskGetName #define pcTaskGetName MPU_pcTaskGetName
#define xTaskGetHandle MPU_xTaskGetHandle #define xTaskGetHandle MPU_xTaskGetHandle
#define uxTaskGetStackHighWaterMark MPU_uxTaskGetStackHighWaterMark #define uxTaskGetStackHighWaterMark MPU_uxTaskGetStackHighWaterMark
#define vTaskSetApplicationTaskTag MPU_vTaskSetApplicationTaskTag #define uxTaskGetStackHighWaterMark2 MPU_uxTaskGetStackHighWaterMark2
#define xTaskGetApplicationTaskTag MPU_xTaskGetApplicationTaskTag #define vTaskSetApplicationTaskTag MPU_vTaskSetApplicationTaskTag
#define vTaskSetThreadLocalStoragePointer MPU_vTaskSetThreadLocalStoragePointer #define xTaskGetApplicationTaskTag MPU_xTaskGetApplicationTaskTag
#define pvTaskGetThreadLocalStoragePointer MPU_pvTaskGetThreadLocalStoragePointer #define vTaskSetThreadLocalStoragePointer MPU_vTaskSetThreadLocalStoragePointer
#define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook #define pvTaskGetThreadLocalStoragePointer MPU_pvTaskGetThreadLocalStoragePointer
#define xTaskGetIdleTaskHandle MPU_xTaskGetIdleTaskHandle #define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook
#define uxTaskGetSystemState MPU_uxTaskGetSystemState #define xTaskGetIdleTaskHandle MPU_xTaskGetIdleTaskHandle
#define vTaskList MPU_vTaskList #define uxTaskGetSystemState MPU_uxTaskGetSystemState
#define vTaskGetRunTimeStats MPU_vTaskGetRunTimeStats #define vTaskList MPU_vTaskList
#define xTaskGenericNotify MPU_xTaskGenericNotify #define vTaskGetRunTimeStats MPU_vTaskGetRunTimeStats
#define xTaskNotifyWait MPU_xTaskNotifyWait #define ulTaskGetIdleRunTimeCounter MPU_ulTaskGetIdleRunTimeCounter
#define ulTaskNotifyTake MPU_ulTaskNotifyTake #define xTaskGenericNotify MPU_xTaskGenericNotify
#define xTaskNotifyStateClear MPU_xTaskNotifyStateClear #define xTaskNotifyWait MPU_xTaskNotifyWait
#define ulTaskNotifyTake MPU_ulTaskNotifyTake
#define xTaskGetCurrentTaskHandle MPU_xTaskGetCurrentTaskHandle #define xTaskNotifyStateClear MPU_xTaskNotifyStateClear
#define vTaskSetTimeOutState MPU_vTaskSetTimeOutState #define ulTaskNotifyValueClear MPU_ulTaskNotifyValueClear
#define xTaskCheckForTimeOut MPU_xTaskCheckForTimeOut #define xTaskCatchUpTicks MPU_xTaskCatchUpTicks
#define xTaskGetSchedulerState MPU_xTaskGetSchedulerState
#define xTaskGetCurrentTaskHandle MPU_xTaskGetCurrentTaskHandle
/* Map standard queue.h API functions to the MPU equivalents. */ #define vTaskSetTimeOutState MPU_vTaskSetTimeOutState
#define xQueueGenericSend MPU_xQueueGenericSend #define xTaskCheckForTimeOut MPU_xTaskCheckForTimeOut
#define xQueueReceive MPU_xQueueReceive #define xTaskGetSchedulerState MPU_xTaskGetSchedulerState
#define xQueuePeek MPU_xQueuePeek
#define xQueueSemaphoreTake MPU_xQueueSemaphoreTake /* Map standard queue.h API functions to the MPU equivalents. */
#define uxQueueMessagesWaiting MPU_uxQueueMessagesWaiting #define xQueueGenericSend MPU_xQueueGenericSend
#define uxQueueSpacesAvailable MPU_uxQueueSpacesAvailable #define xQueueReceive MPU_xQueueReceive
#define vQueueDelete MPU_vQueueDelete #define xQueuePeek MPU_xQueuePeek
#define xQueueCreateMutex MPU_xQueueCreateMutex #define xQueueSemaphoreTake MPU_xQueueSemaphoreTake
#define xQueueCreateMutexStatic MPU_xQueueCreateMutexStatic #define uxQueueMessagesWaiting MPU_uxQueueMessagesWaiting
#define xQueueCreateCountingSemaphore MPU_xQueueCreateCountingSemaphore #define uxQueueSpacesAvailable MPU_uxQueueSpacesAvailable
#define xQueueCreateCountingSemaphoreStatic MPU_xQueueCreateCountingSemaphoreStatic #define vQueueDelete MPU_vQueueDelete
#define xQueueGetMutexHolder MPU_xQueueGetMutexHolder #define xQueueCreateMutex MPU_xQueueCreateMutex
#define xQueueTakeMutexRecursive MPU_xQueueTakeMutexRecursive #define xQueueCreateMutexStatic MPU_xQueueCreateMutexStatic
#define xQueueGiveMutexRecursive MPU_xQueueGiveMutexRecursive #define xQueueCreateCountingSemaphore MPU_xQueueCreateCountingSemaphore
#define xQueueGenericCreate MPU_xQueueGenericCreate #define xQueueCreateCountingSemaphoreStatic MPU_xQueueCreateCountingSemaphoreStatic
#define xQueueGenericCreateStatic MPU_xQueueGenericCreateStatic #define xQueueGetMutexHolder MPU_xQueueGetMutexHolder
#define xQueueCreateSet MPU_xQueueCreateSet #define xQueueTakeMutexRecursive MPU_xQueueTakeMutexRecursive
#define xQueueAddToSet MPU_xQueueAddToSet #define xQueueGiveMutexRecursive MPU_xQueueGiveMutexRecursive
#define xQueueRemoveFromSet MPU_xQueueRemoveFromSet #define xQueueGenericCreate MPU_xQueueGenericCreate
#define xQueueSelectFromSet MPU_xQueueSelectFromSet #define xQueueGenericCreateStatic MPU_xQueueGenericCreateStatic
#define xQueueGenericReset MPU_xQueueGenericReset #define xQueueCreateSet MPU_xQueueCreateSet
#define xQueueAddToSet MPU_xQueueAddToSet
#if( configQUEUE_REGISTRY_SIZE > 0 ) #define xQueueRemoveFromSet MPU_xQueueRemoveFromSet
#define vQueueAddToRegistry MPU_vQueueAddToRegistry #define xQueueSelectFromSet MPU_xQueueSelectFromSet
#define vQueueUnregisterQueue MPU_vQueueUnregisterQueue #define xQueueGenericReset MPU_xQueueGenericReset
#define pcQueueGetName MPU_pcQueueGetName
#endif #if( configQUEUE_REGISTRY_SIZE > 0 )
#define vQueueAddToRegistry MPU_vQueueAddToRegistry
/* Map standard timer.h API functions to the MPU equivalents. */ #define vQueueUnregisterQueue MPU_vQueueUnregisterQueue
#define xTimerCreate MPU_xTimerCreate #define pcQueueGetName MPU_pcQueueGetName
#define xTimerCreateStatic MPU_xTimerCreateStatic #endif
#define pvTimerGetTimerID MPU_pvTimerGetTimerID
#define vTimerSetTimerID MPU_vTimerSetTimerID /* Map standard timer.h API functions to the MPU equivalents. */
#define xTimerIsTimerActive MPU_xTimerIsTimerActive #define xTimerCreate MPU_xTimerCreate
#define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle #define xTimerCreateStatic MPU_xTimerCreateStatic
#define xTimerPendFunctionCall MPU_xTimerPendFunctionCall #define pvTimerGetTimerID MPU_pvTimerGetTimerID
#define pcTimerGetName MPU_pcTimerGetName #define vTimerSetTimerID MPU_vTimerSetTimerID
#define xTimerGetPeriod MPU_xTimerGetPeriod #define xTimerIsTimerActive MPU_xTimerIsTimerActive
#define xTimerGetExpiryTime MPU_xTimerGetExpiryTime #define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle
#define xTimerGenericCommand MPU_xTimerGenericCommand #define xTimerPendFunctionCall MPU_xTimerPendFunctionCall
#define pcTimerGetName MPU_pcTimerGetName
/* Map standard event_group.h API functions to the MPU equivalents. */ #define vTimerSetReloadMode MPU_vTimerSetReloadMode
#define xEventGroupCreate MPU_xEventGroupCreate #define uxTimerGetReloadMode MPU_uxTimerGetReloadMode
#define xEventGroupCreateStatic MPU_xEventGroupCreateStatic #define xTimerGetPeriod MPU_xTimerGetPeriod
#define xEventGroupWaitBits MPU_xEventGroupWaitBits #define xTimerGetExpiryTime MPU_xTimerGetExpiryTime
#define xEventGroupClearBits MPU_xEventGroupClearBits #define xTimerGenericCommand MPU_xTimerGenericCommand
#define xEventGroupSetBits MPU_xEventGroupSetBits
#define xEventGroupSync MPU_xEventGroupSync /* Map standard event_group.h API functions to the MPU equivalents. */
#define vEventGroupDelete MPU_vEventGroupDelete #define xEventGroupCreate MPU_xEventGroupCreate
#define xEventGroupCreateStatic MPU_xEventGroupCreateStatic
/* Map standard message/stream_buffer.h API functions to the MPU #define xEventGroupWaitBits MPU_xEventGroupWaitBits
equivalents. */ #define xEventGroupClearBits MPU_xEventGroupClearBits
#define xStreamBufferSend MPU_xStreamBufferSend #define xEventGroupSetBits MPU_xEventGroupSetBits
#define xStreamBufferSendFromISR MPU_xStreamBufferSendFromISR #define xEventGroupSync MPU_xEventGroupSync
#define xStreamBufferReceive MPU_xStreamBufferReceive #define vEventGroupDelete MPU_vEventGroupDelete
#define xStreamBufferReceiveFromISR MPU_xStreamBufferReceiveFromISR
#define vStreamBufferDelete MPU_vStreamBufferDelete /* Map standard message/stream_buffer.h API functions to the MPU
#define xStreamBufferIsFull MPU_xStreamBufferIsFull equivalents. */
#define xStreamBufferIsEmpty MPU_xStreamBufferIsEmpty #define xStreamBufferSend MPU_xStreamBufferSend
#define xStreamBufferReset MPU_xStreamBufferReset #define xStreamBufferReceive MPU_xStreamBufferReceive
#define xStreamBufferSpacesAvailable MPU_xStreamBufferSpacesAvailable #define xStreamBufferNextMessageLengthBytes MPU_xStreamBufferNextMessageLengthBytes
#define xStreamBufferBytesAvailable MPU_xStreamBufferBytesAvailable #define vStreamBufferDelete MPU_vStreamBufferDelete
#define xStreamBufferSetTriggerLevel MPU_xStreamBufferSetTriggerLevel #define xStreamBufferIsFull MPU_xStreamBufferIsFull
#define xStreamBufferGenericCreate MPU_xStreamBufferGenericCreate #define xStreamBufferIsEmpty MPU_xStreamBufferIsEmpty
#define xStreamBufferGenericCreateStatic MPU_xStreamBufferGenericCreateStatic #define xStreamBufferReset MPU_xStreamBufferReset
#define xStreamBufferSpacesAvailable MPU_xStreamBufferSpacesAvailable
#define xStreamBufferBytesAvailable MPU_xStreamBufferBytesAvailable
/* Remove the privileged function macro, but keep the PRIVILEGED_DATA #define xStreamBufferSetTriggerLevel MPU_xStreamBufferSetTriggerLevel
macro so applications can place data in privileged access sections #define xStreamBufferGenericCreate MPU_xStreamBufferGenericCreate
(useful when using statically allocated objects). */ #define xStreamBufferGenericCreateStatic MPU_xStreamBufferGenericCreateStatic
#define PRIVILEGED_FUNCTION
#define PRIVILEGED_DATA __attribute__((section("privileged_data")))
/* Remove the privileged function macro, but keep the PRIVILEGED_DATA
#else /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */ macro so applications can place data in privileged access sections
(useful when using statically allocated objects). */
/* Ensure API functions go in the privileged execution section. */ #define PRIVILEGED_FUNCTION
#define PRIVILEGED_FUNCTION __attribute__((section("privileged_functions"))) #define PRIVILEGED_DATA __attribute__((section("privileged_data")))
#define PRIVILEGED_DATA __attribute__((section("privileged_data"))) #define FREERTOS_SYSTEM_CALL
#endif /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */ #else /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
#else /* portUSING_MPU_WRAPPERS */ /* Ensure API functions go in the privileged execution section. */
#define PRIVILEGED_FUNCTION __attribute__((section("privileged_functions")))
#define PRIVILEGED_FUNCTION #define PRIVILEGED_DATA __attribute__((section("privileged_data")))
#define PRIVILEGED_DATA #define FREERTOS_SYSTEM_CALL __attribute__((section( "freertos_system_calls")))
#define portUSING_MPU_WRAPPERS 0
#endif /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
#endif /* portUSING_MPU_WRAPPERS */
#else /* portUSING_MPU_WRAPPERS */
#endif /* MPU_WRAPPERS_H */ #define PRIVILEGED_FUNCTION
#define PRIVILEGED_DATA
#define FREERTOS_SYSTEM_CALL
#define portUSING_MPU_WRAPPERS 0
#endif /* portUSING_MPU_WRAPPERS */
#endif /* MPU_WRAPPERS_H */

View file

@ -1,165 +1,199 @@
/* /*
* FreeRTOS Kernel V10.0.1 * FreeRTOS Kernel V10.3.1
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions: * subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* http://www.FreeRTOS.org * http://www.FreeRTOS.org
* http://aws.amazon.com/freertos * http://aws.amazon.com/freertos
* *
* 1 tab == 4 spaces! * 1 tab == 4 spaces!
*/ */
/*----------------------------------------------------------- /*-----------------------------------------------------------
* Portable layer API. Each function must be defined for each port. * Portable layer API. Each function must be defined for each port.
*----------------------------------------------------------*/ *----------------------------------------------------------*/
#ifndef PORTABLE_H #ifndef PORTABLE_H
#define PORTABLE_H #define PORTABLE_H
/* Each FreeRTOS port has a unique portmacro.h header file. Originally a /* Each FreeRTOS port has a unique portmacro.h header file. Originally a
pre-processor definition was used to ensure the pre-processor found the correct pre-processor definition was used to ensure the pre-processor found the correct
portmacro.h file for the port being used. That scheme was deprecated in favour portmacro.h file for the port being used. That scheme was deprecated in favour
of setting the compiler's include path such that it found the correct of setting the compiler's include path such that it found the correct
portmacro.h file - removing the need for the constant and allowing the portmacro.h file - removing the need for the constant and allowing the
portmacro.h file to be located anywhere in relation to the port being used. portmacro.h file to be located anywhere in relation to the port being used.
Purely for reasons of backward compatibility the old method is still valid, but Purely for reasons of backward compatibility the old method is still valid, but
to make it clear that new projects should not use it, support for the port to make it clear that new projects should not use it, support for the port
specific constants has been moved into the deprecated_definitions.h header specific constants has been moved into the deprecated_definitions.h header
file. */ file. */
#include "deprecated_definitions.h" #include "deprecated_definitions.h"
/* If portENTER_CRITICAL is not defined then including deprecated_definitions.h /* If portENTER_CRITICAL is not defined then including deprecated_definitions.h
did not result in a portmacro.h header file being included - and it should be did not result in a portmacro.h header file being included - and it should be
included here. In this case the path to the correct portmacro.h header file included here. In this case the path to the correct portmacro.h header file
must be set in the compiler's include path. */ must be set in the compiler's include path. */
#ifndef portENTER_CRITICAL #ifndef portENTER_CRITICAL
#include "portmacro.h" #include "portmacro.h"
#endif #endif
#if portBYTE_ALIGNMENT == 32 #if portBYTE_ALIGNMENT == 32
#define portBYTE_ALIGNMENT_MASK ( 0x001f ) #define portBYTE_ALIGNMENT_MASK ( 0x001f )
#endif #endif
#if portBYTE_ALIGNMENT == 16 #if portBYTE_ALIGNMENT == 16
#define portBYTE_ALIGNMENT_MASK ( 0x000f ) #define portBYTE_ALIGNMENT_MASK ( 0x000f )
#endif #endif
#if portBYTE_ALIGNMENT == 8 #if portBYTE_ALIGNMENT == 8
#define portBYTE_ALIGNMENT_MASK ( 0x0007 ) #define portBYTE_ALIGNMENT_MASK ( 0x0007 )
#endif #endif
#if portBYTE_ALIGNMENT == 4 #if portBYTE_ALIGNMENT == 4
#define portBYTE_ALIGNMENT_MASK ( 0x0003 ) #define portBYTE_ALIGNMENT_MASK ( 0x0003 )
#endif #endif
#if portBYTE_ALIGNMENT == 2 #if portBYTE_ALIGNMENT == 2
#define portBYTE_ALIGNMENT_MASK ( 0x0001 ) #define portBYTE_ALIGNMENT_MASK ( 0x0001 )
#endif #endif
#if portBYTE_ALIGNMENT == 1 #if portBYTE_ALIGNMENT == 1
#define portBYTE_ALIGNMENT_MASK ( 0x0000 ) #define portBYTE_ALIGNMENT_MASK ( 0x0000 )
#endif #endif
#ifndef portBYTE_ALIGNMENT_MASK #ifndef portBYTE_ALIGNMENT_MASK
#error "Invalid portBYTE_ALIGNMENT definition" #error "Invalid portBYTE_ALIGNMENT definition"
#endif #endif
#ifndef portNUM_CONFIGURABLE_REGIONS #ifndef portNUM_CONFIGURABLE_REGIONS
#define portNUM_CONFIGURABLE_REGIONS 1 #define portNUM_CONFIGURABLE_REGIONS 1
#endif #endif
#ifdef __cplusplus #ifndef portHAS_STACK_OVERFLOW_CHECKING
extern "C" { #define portHAS_STACK_OVERFLOW_CHECKING 0
#endif #endif
#include "mpu_wrappers.h" #ifndef portARCH_NAME
#define portARCH_NAME NULL
/* #endif
* Setup the stack of a new task so it is ready to be placed under the
* scheduler control. The registers have to be placed on the stack in #ifdef __cplusplus
* the order that the port expects to find them. extern "C" {
* #endif
*/
#if( portUSING_MPU_WRAPPERS == 1 ) #include "mpu_wrappers.h"
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters, BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
#else /*
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters ) PRIVILEGED_FUNCTION; * Setup the stack of a new task so it is ready to be placed under the
#endif * scheduler control. The registers have to be placed on the stack in
* the order that the port expects to find them.
/* Used by heap_5.c. */ *
typedef struct HeapRegion */
{ #if( portUSING_MPU_WRAPPERS == 1 )
uint8_t *pucStartAddress; #if( portHAS_STACK_OVERFLOW_CHECKING == 1 )
size_t xSizeInBytes; StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, StackType_t *pxEndOfStack, TaskFunction_t pxCode, void *pvParameters, BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
} HeapRegion_t; #else
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters, BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
/* #endif
* Used to define multiple heap regions for use by heap_5.c. This function #else
* must be called before any calls to pvPortMalloc() - not creating a task, #if( portHAS_STACK_OVERFLOW_CHECKING == 1 )
* queue, semaphore, mutex, software timer, event group, etc. will result in StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, StackType_t *pxEndOfStack, TaskFunction_t pxCode, void *pvParameters ) PRIVILEGED_FUNCTION;
* pvPortMalloc being called. #else
* StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters ) PRIVILEGED_FUNCTION;
* pxHeapRegions passes in an array of HeapRegion_t structures - each of which #endif
* defines a region of memory that can be used as the heap. The array is #endif
* terminated by a HeapRegions_t structure that has a size of 0. The region
* with the lowest start address must appear first in the array. /* Used by heap_5.c to define the start address and size of each memory region
*/ that together comprise the total FreeRTOS heap space. */
void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) PRIVILEGED_FUNCTION; typedef struct HeapRegion
{
uint8_t *pucStartAddress;
/* size_t xSizeInBytes;
* Map to the memory management routines required for the port. } HeapRegion_t;
*/
void *pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION; /* Used to pass information about the heap out of vPortGetHeapStats(). */
void vPortFree( void *pv ) PRIVILEGED_FUNCTION; typedef struct xHeapStats
void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION; {
size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION; size_t xAvailableHeapSpaceInBytes; /* The total heap size currently available - this is the sum of all the free blocks, not the largest block that can be allocated. */
size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION; size_t xSizeOfLargestFreeBlockInBytes; /* The maximum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
size_t xSizeOfSmallestFreeBlockInBytes; /* The minimum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
/* size_t xNumberOfFreeBlocks; /* The number of free memory blocks within the heap at the time vPortGetHeapStats() is called. */
* Setup the hardware ready for the scheduler to take control. This generally size_t xMinimumEverFreeBytesRemaining; /* The minimum amount of total free memory (sum of all free blocks) there has been in the heap since the system booted. */
* sets up a tick interrupt and sets timers for the correct tick frequency. size_t xNumberOfSuccessfulAllocations; /* The number of calls to pvPortMalloc() that have returned a valid memory block. */
*/ size_t xNumberOfSuccessfulFrees; /* The number of calls to vPortFree() that has successfully freed a block of memory. */
BaseType_t xPortStartScheduler( void ) PRIVILEGED_FUNCTION; } HeapStats_t;
/* /*
* Undo any hardware/ISR setup that was performed by xPortStartScheduler() so * Used to define multiple heap regions for use by heap_5.c. This function
* the hardware is left in its original condition after the scheduler stops * must be called before any calls to pvPortMalloc() - not creating a task,
* executing. * queue, semaphore, mutex, software timer, event group, etc. will result in
*/ * pvPortMalloc being called.
void vPortEndScheduler( void ) PRIVILEGED_FUNCTION; *
* pxHeapRegions passes in an array of HeapRegion_t structures - each of which
/* * defines a region of memory that can be used as the heap. The array is
* The structures and methods of manipulating the MPU are contained within the * terminated by a HeapRegions_t structure that has a size of 0. The region
* port layer. * with the lowest start address must appear first in the array.
* */
* Fills the xMPUSettings structure with the memory region information void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) PRIVILEGED_FUNCTION;
* contained in xRegions.
*/ /*
#if( portUSING_MPU_WRAPPERS == 1 ) * Returns a HeapStats_t structure filled with information about the current
struct xMEMORY_REGION; * heap state.
void vPortStoreTaskMPUSettings( xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION * const xRegions, StackType_t *pxBottomOfStack, uint32_t ulStackDepth ) PRIVILEGED_FUNCTION; */
#endif void vPortGetHeapStats( HeapStats_t *pxHeapStats );
#ifdef __cplusplus /*
} * Map to the memory management routines required for the port.
#endif */
void *pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
#endif /* PORTABLE_H */ void vPortFree( void *pv ) PRIVILEGED_FUNCTION;
void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
/*
* Setup the hardware ready for the scheduler to take control. This generally
* sets up a tick interrupt and sets timers for the correct tick frequency.
*/
BaseType_t xPortStartScheduler( void ) PRIVILEGED_FUNCTION;
/*
* Undo any hardware/ISR setup that was performed by xPortStartScheduler() so
* the hardware is left in its original condition after the scheduler stops
* executing.
*/
void vPortEndScheduler( void ) PRIVILEGED_FUNCTION;
/*
* The structures and methods of manipulating the MPU are contained within the
* port layer.
*
* Fills the xMPUSettings structure with the memory region information
* contained in xRegions.
*/
#if( portUSING_MPU_WRAPPERS == 1 )
struct xMEMORY_REGION;
void vPortStoreTaskMPUSettings( xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION * const xRegions, StackType_t *pxBottomOfStack, uint32_t ulStackDepth ) PRIVILEGED_FUNCTION;
#endif
#ifdef __cplusplus
}
#endif
#endif /* PORTABLE_H */

View file

@ -1,124 +1,124 @@
/* /*
* FreeRTOS Kernel V10.0.1 * FreeRTOS Kernel V10.3.1
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions: * subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* http://www.FreeRTOS.org * http://www.FreeRTOS.org
* http://aws.amazon.com/freertos * http://aws.amazon.com/freertos
* *
* 1 tab == 4 spaces! * 1 tab == 4 spaces!
*/ */
#ifndef PROJDEFS_H #ifndef PROJDEFS_H
#define PROJDEFS_H #define PROJDEFS_H
/* /*
* Defines the prototype to which task functions must conform. Defined in this * Defines the prototype to which task functions must conform. Defined in this
* file to ensure the type is known before portable.h is included. * file to ensure the type is known before portable.h is included.
*/ */
typedef void (*TaskFunction_t)( void * ); typedef void (*TaskFunction_t)( void * );
/* Converts a time in milliseconds to a time in ticks. This macro can be /* Converts a time in milliseconds to a time in ticks. This macro can be
overridden by a macro of the same name defined in FreeRTOSConfig.h in case the overridden by a macro of the same name defined in FreeRTOSConfig.h in case the
definition here is not suitable for your application. */ definition here is not suitable for your application. */
#ifndef pdMS_TO_TICKS #ifndef pdMS_TO_TICKS
#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) ) #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) )
#endif #endif
#define pdFALSE ( ( BaseType_t ) 0 ) #define pdFALSE ( ( BaseType_t ) 0 )
#define pdTRUE ( ( BaseType_t ) 1 ) #define pdTRUE ( ( BaseType_t ) 1 )
#define pdPASS ( pdTRUE ) #define pdPASS ( pdTRUE )
#define pdFAIL ( pdFALSE ) #define pdFAIL ( pdFALSE )
#define errQUEUE_EMPTY ( ( BaseType_t ) 0 ) #define errQUEUE_EMPTY ( ( BaseType_t ) 0 )
#define errQUEUE_FULL ( ( BaseType_t ) 0 ) #define errQUEUE_FULL ( ( BaseType_t ) 0 )
/* FreeRTOS error definitions. */ /* FreeRTOS error definitions. */
#define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 ) #define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 )
#define errQUEUE_BLOCKED ( -4 ) #define errQUEUE_BLOCKED ( -4 )
#define errQUEUE_YIELD ( -5 ) #define errQUEUE_YIELD ( -5 )
/* Macros used for basic data corruption checks. */ /* Macros used for basic data corruption checks. */
#ifndef configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES #ifndef configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES
#define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 0 #define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 0
#endif #endif
#if( configUSE_16_BIT_TICKS == 1 ) #if( configUSE_16_BIT_TICKS == 1 )
#define pdINTEGRITY_CHECK_VALUE 0x5a5a #define pdINTEGRITY_CHECK_VALUE 0x5a5a
#else #else
#define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL #define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL
#endif #endif
/* The following errno values are used by FreeRTOS+ components, not FreeRTOS /* The following errno values are used by FreeRTOS+ components, not FreeRTOS
itself. */ itself. */
#define pdFREERTOS_ERRNO_NONE 0 /* No errors */ #define pdFREERTOS_ERRNO_NONE 0 /* No errors */
#define pdFREERTOS_ERRNO_ENOENT 2 /* No such file or directory */ #define pdFREERTOS_ERRNO_ENOENT 2 /* No such file or directory */
#define pdFREERTOS_ERRNO_EINTR 4 /* Interrupted system call */ #define pdFREERTOS_ERRNO_EINTR 4 /* Interrupted system call */
#define pdFREERTOS_ERRNO_EIO 5 /* I/O error */ #define pdFREERTOS_ERRNO_EIO 5 /* I/O error */
#define pdFREERTOS_ERRNO_ENXIO 6 /* No such device or address */ #define pdFREERTOS_ERRNO_ENXIO 6 /* No such device or address */
#define pdFREERTOS_ERRNO_EBADF 9 /* Bad file number */ #define pdFREERTOS_ERRNO_EBADF 9 /* Bad file number */
#define pdFREERTOS_ERRNO_EAGAIN 11 /* No more processes */ #define pdFREERTOS_ERRNO_EAGAIN 11 /* No more processes */
#define pdFREERTOS_ERRNO_EWOULDBLOCK 11 /* Operation would block */ #define pdFREERTOS_ERRNO_EWOULDBLOCK 11 /* Operation would block */
#define pdFREERTOS_ERRNO_ENOMEM 12 /* Not enough memory */ #define pdFREERTOS_ERRNO_ENOMEM 12 /* Not enough memory */
#define pdFREERTOS_ERRNO_EACCES 13 /* Permission denied */ #define pdFREERTOS_ERRNO_EACCES 13 /* Permission denied */
#define pdFREERTOS_ERRNO_EFAULT 14 /* Bad address */ #define pdFREERTOS_ERRNO_EFAULT 14 /* Bad address */
#define pdFREERTOS_ERRNO_EBUSY 16 /* Mount device busy */ #define pdFREERTOS_ERRNO_EBUSY 16 /* Mount device busy */
#define pdFREERTOS_ERRNO_EEXIST 17 /* File exists */ #define pdFREERTOS_ERRNO_EEXIST 17 /* File exists */
#define pdFREERTOS_ERRNO_EXDEV 18 /* Cross-device link */ #define pdFREERTOS_ERRNO_EXDEV 18 /* Cross-device link */
#define pdFREERTOS_ERRNO_ENODEV 19 /* No such device */ #define pdFREERTOS_ERRNO_ENODEV 19 /* No such device */
#define pdFREERTOS_ERRNO_ENOTDIR 20 /* Not a directory */ #define pdFREERTOS_ERRNO_ENOTDIR 20 /* Not a directory */
#define pdFREERTOS_ERRNO_EISDIR 21 /* Is a directory */ #define pdFREERTOS_ERRNO_EISDIR 21 /* Is a directory */
#define pdFREERTOS_ERRNO_EINVAL 22 /* Invalid argument */ #define pdFREERTOS_ERRNO_EINVAL 22 /* Invalid argument */
#define pdFREERTOS_ERRNO_ENOSPC 28 /* No space left on device */ #define pdFREERTOS_ERRNO_ENOSPC 28 /* No space left on device */
#define pdFREERTOS_ERRNO_ESPIPE 29 /* Illegal seek */ #define pdFREERTOS_ERRNO_ESPIPE 29 /* Illegal seek */
#define pdFREERTOS_ERRNO_EROFS 30 /* Read only file system */ #define pdFREERTOS_ERRNO_EROFS 30 /* Read only file system */
#define pdFREERTOS_ERRNO_EUNATCH 42 /* Protocol driver not attached */ #define pdFREERTOS_ERRNO_EUNATCH 42 /* Protocol driver not attached */
#define pdFREERTOS_ERRNO_EBADE 50 /* Invalid exchange */ #define pdFREERTOS_ERRNO_EBADE 50 /* Invalid exchange */
#define pdFREERTOS_ERRNO_EFTYPE 79 /* Inappropriate file type or format */ #define pdFREERTOS_ERRNO_EFTYPE 79 /* Inappropriate file type or format */
#define pdFREERTOS_ERRNO_ENMFILE 89 /* No more files */ #define pdFREERTOS_ERRNO_ENMFILE 89 /* No more files */
#define pdFREERTOS_ERRNO_ENOTEMPTY 90 /* Directory not empty */ #define pdFREERTOS_ERRNO_ENOTEMPTY 90 /* Directory not empty */
#define pdFREERTOS_ERRNO_ENAMETOOLONG 91 /* File or path name too long */ #define pdFREERTOS_ERRNO_ENAMETOOLONG 91 /* File or path name too long */
#define pdFREERTOS_ERRNO_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ #define pdFREERTOS_ERRNO_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
#define pdFREERTOS_ERRNO_ENOBUFS 105 /* No buffer space available */ #define pdFREERTOS_ERRNO_ENOBUFS 105 /* No buffer space available */
#define pdFREERTOS_ERRNO_ENOPROTOOPT 109 /* Protocol not available */ #define pdFREERTOS_ERRNO_ENOPROTOOPT 109 /* Protocol not available */
#define pdFREERTOS_ERRNO_EADDRINUSE 112 /* Address already in use */ #define pdFREERTOS_ERRNO_EADDRINUSE 112 /* Address already in use */
#define pdFREERTOS_ERRNO_ETIMEDOUT 116 /* Connection timed out */ #define pdFREERTOS_ERRNO_ETIMEDOUT 116 /* Connection timed out */
#define pdFREERTOS_ERRNO_EINPROGRESS 119 /* Connection already in progress */ #define pdFREERTOS_ERRNO_EINPROGRESS 119 /* Connection already in progress */
#define pdFREERTOS_ERRNO_EALREADY 120 /* Socket already connected */ #define pdFREERTOS_ERRNO_EALREADY 120 /* Socket already connected */
#define pdFREERTOS_ERRNO_EADDRNOTAVAIL 125 /* Address not available */ #define pdFREERTOS_ERRNO_EADDRNOTAVAIL 125 /* Address not available */
#define pdFREERTOS_ERRNO_EISCONN 127 /* Socket is already connected */ #define pdFREERTOS_ERRNO_EISCONN 127 /* Socket is already connected */
#define pdFREERTOS_ERRNO_ENOTCONN 128 /* Socket is not connected */ #define pdFREERTOS_ERRNO_ENOTCONN 128 /* Socket is not connected */
#define pdFREERTOS_ERRNO_ENOMEDIUM 135 /* No medium inserted */ #define pdFREERTOS_ERRNO_ENOMEDIUM 135 /* No medium inserted */
#define pdFREERTOS_ERRNO_EILSEQ 138 /* An invalid UTF-16 sequence was encountered. */ #define pdFREERTOS_ERRNO_EILSEQ 138 /* An invalid UTF-16 sequence was encountered. */
#define pdFREERTOS_ERRNO_ECANCELED 140 /* Operation canceled. */ #define pdFREERTOS_ERRNO_ECANCELED 140 /* Operation canceled. */
/* The following endian values are used by FreeRTOS+ components, not FreeRTOS /* The following endian values are used by FreeRTOS+ components, not FreeRTOS
itself. */ itself. */
#define pdFREERTOS_LITTLE_ENDIAN 0 #define pdFREERTOS_LITTLE_ENDIAN 0
#define pdFREERTOS_BIG_ENDIAN 1 #define pdFREERTOS_BIG_ENDIAN 1
/* Re-defining endian values for generic naming. */ /* Re-defining endian values for generic naming. */
#define pdLITTLE_ENDIAN pdFREERTOS_LITTLE_ENDIAN #define pdLITTLE_ENDIAN pdFREERTOS_LITTLE_ENDIAN
#define pdBIG_ENDIAN pdFREERTOS_BIG_ENDIAN #define pdBIG_ENDIAN pdFREERTOS_BIG_ENDIAN
#endif /* PROJDEFS_H */ #endif /* PROJDEFS_H */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,129 +1,129 @@
/* /*
* FreeRTOS Kernel V10.0.1 * FreeRTOS Kernel V10.3.1
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions: * subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* http://www.FreeRTOS.org * http://www.FreeRTOS.org
* http://aws.amazon.com/freertos * http://aws.amazon.com/freertos
* *
* 1 tab == 4 spaces! * 1 tab == 4 spaces!
*/ */
#ifndef STACK_MACROS_H #ifndef STACK_MACROS_H
#define STACK_MACROS_H #define STACK_MACROS_H
/* /*
* Call the stack overflow hook function if the stack of the task being swapped * Call the stack overflow hook function if the stack of the task being swapped
* out is currently overflowed, or looks like it might have overflowed in the * out is currently overflowed, or looks like it might have overflowed in the
* past. * past.
* *
* Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check * Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check
* the current stack state only - comparing the current top of stack value to * the current stack state only - comparing the current top of stack value to
* the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1 * the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1
* will also cause the last few stack bytes to be checked to ensure the value * will also cause the last few stack bytes to be checked to ensure the value
* to which the bytes were set when the task was created have not been * to which the bytes were set when the task was created have not been
* overwritten. Note this second test does not guarantee that an overflowed * overwritten. Note this second test does not guarantee that an overflowed
* stack will always be recognised. * stack will always be recognised.
*/ */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) ) #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) )
/* Only the current stack state is to be checked. */ /* Only the current stack state is to be checked. */
#define taskCHECK_FOR_STACK_OVERFLOW() \ #define taskCHECK_FOR_STACK_OVERFLOW() \
{ \ { \
/* Is the currently saved stack pointer within the stack limit? */ \ /* Is the currently saved stack pointer within the stack limit? */ \
if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \ if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \
{ \ { \
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
} \ } \
} }
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) ) #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) )
/* Only the current stack state is to be checked. */ /* Only the current stack state is to be checked. */
#define taskCHECK_FOR_STACK_OVERFLOW() \ #define taskCHECK_FOR_STACK_OVERFLOW() \
{ \ { \
\ \
/* Is the currently saved stack pointer within the stack limit? */ \ /* Is the currently saved stack pointer within the stack limit? */ \
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \ if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \
{ \ { \
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
} \ } \
} }
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) ) #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) )
#define taskCHECK_FOR_STACK_OVERFLOW() \ #define taskCHECK_FOR_STACK_OVERFLOW() \
{ \ { \
const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \ const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \
const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \ const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \
\ \
if( ( pulStack[ 0 ] != ulCheckValue ) || \ if( ( pulStack[ 0 ] != ulCheckValue ) || \
( pulStack[ 1 ] != ulCheckValue ) || \ ( pulStack[ 1 ] != ulCheckValue ) || \
( pulStack[ 2 ] != ulCheckValue ) || \ ( pulStack[ 2 ] != ulCheckValue ) || \
( pulStack[ 3 ] != ulCheckValue ) ) \ ( pulStack[ 3 ] != ulCheckValue ) ) \
{ \ { \
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
} \ } \
} }
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) ) #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) )
#define taskCHECK_FOR_STACK_OVERFLOW() \ #define taskCHECK_FOR_STACK_OVERFLOW() \
{ \ { \
int8_t *pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \ int8_t *pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \
static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \
\ \
\ \
pcEndOfStack -= sizeof( ucExpectedStackBytes ); \ pcEndOfStack -= sizeof( ucExpectedStackBytes ); \
\ \
/* Has the extremity of the task stack ever been written over? */ \ /* Has the extremity of the task stack ever been written over? */ \
if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \ if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \
{ \ { \
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
} \ } \
} }
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Remove stack overflow macro if not being used. */ /* Remove stack overflow macro if not being used. */
#ifndef taskCHECK_FOR_STACK_OVERFLOW #ifndef taskCHECK_FOR_STACK_OVERFLOW
#define taskCHECK_FOR_STACK_OVERFLOW() #define taskCHECK_FOR_STACK_OVERFLOW()
#endif #endif
#endif /* STACK_MACROS_H */ #endif /* STACK_MACROS_H */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,198 +1,198 @@
/* /*
* FreeRTOS Kernel V10.0.1 * FreeRTOS Kernel V10.3.1
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions: * subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* http://www.FreeRTOS.org * http://www.FreeRTOS.org
* http://aws.amazon.com/freertos * http://aws.amazon.com/freertos
* *
* 1 tab == 4 spaces! * 1 tab == 4 spaces!
*/ */
#include <stdlib.h> #include <stdlib.h>
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "list.h" #include "list.h"
/*----------------------------------------------------------- /*-----------------------------------------------------------
* PUBLIC LIST API documented in list.h * PUBLIC LIST API documented in list.h
*----------------------------------------------------------*/ *----------------------------------------------------------*/
void vListInitialise( List_t * const pxList ) void vListInitialise( List_t * const pxList )
{ {
/* The list structure contains a list item which is used to mark the /* The list structure contains a list item which is used to mark the
end of the list. To initialise the list the list end is inserted end of the list. To initialise the list the list end is inserted
as the only list entry. */ as the only list entry. */
pxList->pxIndex = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */ pxList->pxIndex = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
/* The list end value is the highest possible value in the list to /* The list end value is the highest possible value in the list to
ensure it remains at the end of the list. */ ensure it remains at the end of the list. */
pxList->xListEnd.xItemValue = portMAX_DELAY; pxList->xListEnd.xItemValue = portMAX_DELAY;
/* The list end next and previous pointers point to itself so we know /* The list end next and previous pointers point to itself so we know
when the list is empty. */ when the list is empty. */
pxList->xListEnd.pxNext = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */ pxList->xListEnd.pxNext = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
pxList->xListEnd.pxPrevious = ( ListItem_t * ) &( pxList->xListEnd );/*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */ pxList->xListEnd.pxPrevious = ( ListItem_t * ) &( pxList->xListEnd );/*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
pxList->uxNumberOfItems = ( UBaseType_t ) 0U; pxList->uxNumberOfItems = ( UBaseType_t ) 0U;
/* Write known values into the list if /* Write known values into the list if
configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList ); listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList );
listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList ); listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList );
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vListInitialiseItem( ListItem_t * const pxItem ) void vListInitialiseItem( ListItem_t * const pxItem )
{ {
/* Make sure the list item is not recorded as being on a list. */ /* Make sure the list item is not recorded as being on a list. */
pxItem->pvContainer = NULL; pxItem->pxContainer = NULL;
/* Write known values into the list item if /* Write known values into the list item if
configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ); listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ); listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vListInsertEnd( List_t * const pxList, ListItem_t * const pxNewListItem ) void vListInsertEnd( List_t * const pxList, ListItem_t * const pxNewListItem )
{ {
ListItem_t * const pxIndex = pxList->pxIndex; ListItem_t * const pxIndex = pxList->pxIndex;
/* Only effective when configASSERT() is also defined, these tests may catch /* Only effective when configASSERT() is also defined, these tests may catch
the list data structures being overwritten in memory. They will not catch the list data structures being overwritten in memory. They will not catch
data errors caused by incorrect configuration or use of FreeRTOS. */ data errors caused by incorrect configuration or use of FreeRTOS. */
listTEST_LIST_INTEGRITY( pxList ); listTEST_LIST_INTEGRITY( pxList );
listTEST_LIST_ITEM_INTEGRITY( pxNewListItem ); listTEST_LIST_ITEM_INTEGRITY( pxNewListItem );
/* Insert a new list item into pxList, but rather than sort the list, /* Insert a new list item into pxList, but rather than sort the list,
makes the new list item the last item to be removed by a call to makes the new list item the last item to be removed by a call to
listGET_OWNER_OF_NEXT_ENTRY(). */ listGET_OWNER_OF_NEXT_ENTRY(). */
pxNewListItem->pxNext = pxIndex; pxNewListItem->pxNext = pxIndex;
pxNewListItem->pxPrevious = pxIndex->pxPrevious; pxNewListItem->pxPrevious = pxIndex->pxPrevious;
/* Only used during decision coverage testing. */ /* Only used during decision coverage testing. */
mtCOVERAGE_TEST_DELAY(); mtCOVERAGE_TEST_DELAY();
pxIndex->pxPrevious->pxNext = pxNewListItem; pxIndex->pxPrevious->pxNext = pxNewListItem;
pxIndex->pxPrevious = pxNewListItem; pxIndex->pxPrevious = pxNewListItem;
/* Remember which list the item is in. */ /* Remember which list the item is in. */
pxNewListItem->pvContainer = ( void * ) pxList; pxNewListItem->pxContainer = pxList;
( pxList->uxNumberOfItems )++; ( pxList->uxNumberOfItems )++;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vListInsert( List_t * const pxList, ListItem_t * const pxNewListItem ) void vListInsert( List_t * const pxList, ListItem_t * const pxNewListItem )
{ {
ListItem_t *pxIterator; ListItem_t *pxIterator;
const TickType_t xValueOfInsertion = pxNewListItem->xItemValue; const TickType_t xValueOfInsertion = pxNewListItem->xItemValue;
/* Only effective when configASSERT() is also defined, these tests may catch /* Only effective when configASSERT() is also defined, these tests may catch
the list data structures being overwritten in memory. They will not catch the list data structures being overwritten in memory. They will not catch
data errors caused by incorrect configuration or use of FreeRTOS. */ data errors caused by incorrect configuration or use of FreeRTOS. */
listTEST_LIST_INTEGRITY( pxList ); listTEST_LIST_INTEGRITY( pxList );
listTEST_LIST_ITEM_INTEGRITY( pxNewListItem ); listTEST_LIST_ITEM_INTEGRITY( pxNewListItem );
/* Insert the new list item into the list, sorted in xItemValue order. /* Insert the new list item into the list, sorted in xItemValue order.
If the list already contains a list item with the same item value then the If the list already contains a list item with the same item value then the
new list item should be placed after it. This ensures that TCB's which are new list item should be placed after it. This ensures that TCBs which are
stored in ready lists (all of which have the same xItemValue value) get a stored in ready lists (all of which have the same xItemValue value) get a
share of the CPU. However, if the xItemValue is the same as the back marker share of the CPU. However, if the xItemValue is the same as the back marker
the iteration loop below will not end. Therefore the value is checked the iteration loop below will not end. Therefore the value is checked
first, and the algorithm slightly modified if necessary. */ first, and the algorithm slightly modified if necessary. */
if( xValueOfInsertion == portMAX_DELAY ) if( xValueOfInsertion == portMAX_DELAY )
{ {
pxIterator = pxList->xListEnd.pxPrevious; pxIterator = pxList->xListEnd.pxPrevious;
} }
else else
{ {
/* *** NOTE *********************************************************** /* *** NOTE ***********************************************************
If you find your application is crashing here then likely causes are If you find your application is crashing here then likely causes are
listed below. In addition see http://www.freertos.org/FAQHelp.html for listed below. In addition see https://www.freertos.org/FAQHelp.html for
more tips, and ensure configASSERT() is defined! more tips, and ensure configASSERT() is defined!
http://www.freertos.org/a00110.html#configASSERT https://www.freertos.org/a00110.html#configASSERT
1) Stack overflow - 1) Stack overflow -
see http://www.freertos.org/Stacks-and-stack-overflow-checking.html see https://www.freertos.org/Stacks-and-stack-overflow-checking.html
2) Incorrect interrupt priority assignment, especially on Cortex-M 2) Incorrect interrupt priority assignment, especially on Cortex-M
parts where numerically high priority values denote low actual parts where numerically high priority values denote low actual
interrupt priorities, which can seem counter intuitive. See interrupt priorities, which can seem counter intuitive. See
http://www.freertos.org/RTOS-Cortex-M3-M4.html and the definition https://www.freertos.org/RTOS-Cortex-M3-M4.html and the definition
of configMAX_SYSCALL_INTERRUPT_PRIORITY on of configMAX_SYSCALL_INTERRUPT_PRIORITY on
http://www.freertos.org/a00110.html https://www.freertos.org/a00110.html
3) Calling an API function from within a critical section or when 3) Calling an API function from within a critical section or when
the scheduler is suspended, or calling an API function that does the scheduler is suspended, or calling an API function that does
not end in "FromISR" from an interrupt. not end in "FromISR" from an interrupt.
4) Using a queue or semaphore before it has been initialised or 4) Using a queue or semaphore before it has been initialised or
before the scheduler has been started (are interrupts firing before the scheduler has been started (are interrupts firing
before vTaskStartScheduler() has been called?). before vTaskStartScheduler() has been called?).
**********************************************************************/ **********************************************************************/
for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */ for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. *//*lint !e440 The iterator moves to a different value, not xValueOfInsertion. */
{ {
/* There is nothing to do here, just iterating to the wanted /* There is nothing to do here, just iterating to the wanted
insertion position. */ insertion position. */
} }
} }
pxNewListItem->pxNext = pxIterator->pxNext; pxNewListItem->pxNext = pxIterator->pxNext;
pxNewListItem->pxNext->pxPrevious = pxNewListItem; pxNewListItem->pxNext->pxPrevious = pxNewListItem;
pxNewListItem->pxPrevious = pxIterator; pxNewListItem->pxPrevious = pxIterator;
pxIterator->pxNext = pxNewListItem; pxIterator->pxNext = pxNewListItem;
/* Remember which list the item is in. This allows fast removal of the /* Remember which list the item is in. This allows fast removal of the
item later. */ item later. */
pxNewListItem->pvContainer = ( void * ) pxList; pxNewListItem->pxContainer = pxList;
( pxList->uxNumberOfItems )++; ( pxList->uxNumberOfItems )++;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
{ {
/* The list item knows which list it is in. Obtain the list from the list /* The list item knows which list it is in. Obtain the list from the list
item. */ item. */
List_t * const pxList = ( List_t * ) pxItemToRemove->pvContainer; List_t * const pxList = pxItemToRemove->pxContainer;
pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious; pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;
pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext; pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;
/* Only used during decision coverage testing. */ /* Only used during decision coverage testing. */
mtCOVERAGE_TEST_DELAY(); mtCOVERAGE_TEST_DELAY();
/* Make sure the index is left pointing to a valid item. */ /* Make sure the index is left pointing to a valid item. */
if( pxList->pxIndex == pxItemToRemove ) if( pxList->pxIndex == pxItemToRemove )
{ {
pxList->pxIndex = pxItemToRemove->pxPrevious; pxList->pxIndex = pxItemToRemove->pxPrevious;
} }
else else
{ {
mtCOVERAGE_TEST_MARKER(); mtCOVERAGE_TEST_MARKER();
} }
pxItemToRemove->pvContainer = NULL; pxItemToRemove->pxContainer = NULL;
( pxList->uxNumberOfItems )--; ( pxList->uxNumberOfItems )--;
return pxList->uxNumberOfItems; return pxList->uxNumberOfItems;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/

File diff suppressed because it is too large Load diff

View file

@ -1,242 +1,245 @@
/* /*
* FreeRTOS Kernel V10.0.1 * FreeRTOS Kernel V10.3.1
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions: * subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* http://www.FreeRTOS.org * http://www.FreeRTOS.org
* http://aws.amazon.com/freertos * http://aws.amazon.com/freertos
* *
* 1 tab == 4 spaces! * 1 tab == 4 spaces!
*/ */
#ifndef PORTMACRO_H #ifndef PORTMACRO_H
#define PORTMACRO_H #define PORTMACRO_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/*----------------------------------------------------------- /*-----------------------------------------------------------
* Port specific definitions. * Port specific definitions.
* *
* The settings in this file configure FreeRTOS correctly for the * The settings in this file configure FreeRTOS correctly for the
* given hardware and compiler. * given hardware and compiler.
* *
* These settings should not be altered. * These settings should not be altered.
*----------------------------------------------------------- *-----------------------------------------------------------
*/ */
/* Type definitions. */ /* Type definitions. */
#define portCHAR char #define portCHAR char
#define portFLOAT float #define portFLOAT float
#define portDOUBLE double #define portDOUBLE double
#define portLONG long #define portLONG long
#define portSHORT short #define portSHORT short
#define portSTACK_TYPE uint32_t #define portSTACK_TYPE uint32_t
#define portBASE_TYPE long #define portBASE_TYPE long
typedef portSTACK_TYPE StackType_t; typedef portSTACK_TYPE StackType_t;
typedef long BaseType_t; typedef long BaseType_t;
typedef unsigned long UBaseType_t; typedef unsigned long UBaseType_t;
#if( configUSE_16_BIT_TICKS == 1 ) #if( configUSE_16_BIT_TICKS == 1 )
typedef uint16_t TickType_t; typedef uint16_t TickType_t;
#define portMAX_DELAY ( TickType_t ) 0xffff #define portMAX_DELAY ( TickType_t ) 0xffff
#else #else
typedef uint32_t TickType_t; typedef uint32_t TickType_t;
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
/* 32-bit tick type on a 32-bit architecture, so reads of the tick count do /* 32-bit tick type on a 32-bit architecture, so reads of the tick count do
not need to be guarded with a critical section. */ not need to be guarded with a critical section. */
#define portTICK_TYPE_IS_ATOMIC 1 #define portTICK_TYPE_IS_ATOMIC 1
#endif #endif
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Architecture specifics. */ /* Architecture specifics. */
#define portSTACK_GROWTH ( -1 ) #define portSTACK_GROWTH ( -1 )
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ ) #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
#define portBYTE_ALIGNMENT 8 #define portBYTE_ALIGNMENT 8
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Scheduler utilities. */ /* Scheduler utilities. */
#define portYIELD() \ #define portYIELD() \
{ \ { \
/* Set a PendSV to request a context switch. */ \ /* Set a PendSV to request a context switch. */ \
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; \ portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; \
\ \
/* Barriers are normally not required but do ensure the code is completely \ /* Barriers are normally not required but do ensure the code is completely \
within the specified behaviour for the architecture. */ \ within the specified behaviour for the architecture. */ \
__asm volatile( "dsb" ::: "memory" ); \ __asm volatile( "dsb" ::: "memory" ); \
__asm volatile( "isb" ); \ __asm volatile( "isb" ); \
} }
#define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) ) #define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) )
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL ) #define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired != pdFALSE ) portYIELD() #define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired != pdFALSE ) portYIELD()
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x ) #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Critical section management. */ /* Critical section management. */
extern void vPortEnterCritical( void ); extern void vPortEnterCritical( void );
extern void vPortExitCritical( void ); extern void vPortExitCritical( void );
#define portSET_INTERRUPT_MASK_FROM_ISR() ulPortRaiseBASEPRI() #define portSET_INTERRUPT_MASK_FROM_ISR() ulPortRaiseBASEPRI()
#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortSetBASEPRI(x) #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortSetBASEPRI(x)
#define portDISABLE_INTERRUPTS() vPortRaiseBASEPRI() #define portDISABLE_INTERRUPTS() vPortRaiseBASEPRI()
#define portENABLE_INTERRUPTS() vPortSetBASEPRI(0) #define portENABLE_INTERRUPTS() vPortSetBASEPRI(0)
#define portENTER_CRITICAL() vPortEnterCritical() #define portENTER_CRITICAL() vPortEnterCritical()
#define portEXIT_CRITICAL() vPortExitCritical() #define portEXIT_CRITICAL() vPortExitCritical()
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Task function macros as described on the FreeRTOS.org WEB site. These are /* Task function macros as described on the FreeRTOS.org WEB site. These are
not necessary for to use this port. They are defined so the common demo files not necessary for to use this port. They are defined so the common demo files
(which build with all the ports) will build. */ (which build with all the ports) will build. */
#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters ) #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters ) #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Tickless idle/low power functionality. */ /* Tickless idle/low power functionality. */
#ifndef portSUPPRESS_TICKS_AND_SLEEP #ifndef portSUPPRESS_TICKS_AND_SLEEP
extern void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime ); extern void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime );
#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime ) #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )
#endif #endif
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Architecture specific optimisations. */ /* Architecture specific optimisations. */
#ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#endif #endif
#if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1 #if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
/* Generic helper function. */ /* Generic helper function. */
__attribute__( ( always_inline ) ) static inline uint8_t ucPortCountLeadingZeros( uint32_t ulBitmap ) __attribute__( ( always_inline ) ) static inline uint8_t ucPortCountLeadingZeros( uint32_t ulBitmap )
{ {
uint8_t ucReturn; uint8_t ucReturn;
__asm volatile ( "clz %0, %1" : "=r" ( ucReturn ) : "r" ( ulBitmap ) : "memory" ); __asm volatile ( "clz %0, %1" : "=r" ( ucReturn ) : "r" ( ulBitmap ) : "memory" );
return ucReturn; return ucReturn;
} }
/* Check the configuration. */ /* Check the configuration. */
#if( configMAX_PRIORITIES > 32 ) #if( configMAX_PRIORITIES > 32 )
#error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice. #error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice.
#endif #endif
/* Store/clear the ready priorities in a bit map. */ /* Store/clear the ready priorities in a bit map. */
#define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) ) #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )
#define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) ) #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) )
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31UL - ( uint32_t ) ucPortCountLeadingZeros( ( uxReadyPriorities ) ) ) #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31UL - ( uint32_t ) ucPortCountLeadingZeros( ( uxReadyPriorities ) ) )
#endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */ #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#ifdef configASSERT #ifdef configASSERT
void vPortValidateInterruptPriority( void ); void vPortValidateInterruptPriority( void );
#define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority() #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority()
#endif #endif
/* portNOP() is not required by this port. */ /* portNOP() is not required by this port. */
#define portNOP() #define portNOP()
#define portINLINE __inline #define portINLINE __inline
#ifndef portFORCE_INLINE #ifndef portFORCE_INLINE
#define portFORCE_INLINE inline __attribute__(( always_inline)) #define portFORCE_INLINE inline __attribute__(( always_inline))
#endif #endif
portFORCE_INLINE static BaseType_t xPortIsInsideInterrupt( void ) /*-----------------------------------------------------------*/
{
uint32_t ulCurrentInterrupt; portFORCE_INLINE static BaseType_t xPortIsInsideInterrupt( void )
BaseType_t xReturn; {
uint32_t ulCurrentInterrupt;
/* Obtain the number of the currently executing interrupt. */ BaseType_t xReturn;
__asm volatile( "mrs %0, ipsr" : "=r"( ulCurrentInterrupt ) :: "memory" );
/* Obtain the number of the currently executing interrupt. */
if( ulCurrentInterrupt == 0 ) __asm volatile( "mrs %0, ipsr" : "=r"( ulCurrentInterrupt ) :: "memory" );
{
xReturn = pdFALSE; if( ulCurrentInterrupt == 0 )
} {
else xReturn = pdFALSE;
{ }
xReturn = pdTRUE; else
} {
xReturn = pdTRUE;
return xReturn; }
}
return xReturn;
/*-----------------------------------------------------------*/ }
portFORCE_INLINE static void vPortRaiseBASEPRI( void ) /*-----------------------------------------------------------*/
{
uint32_t ulNewBASEPRI; portFORCE_INLINE static void vPortRaiseBASEPRI( void )
{
__asm volatile uint32_t ulNewBASEPRI;
(
" mov %0, %1 \n" \ __asm volatile
" msr basepri, %0 \n" \ (
" isb \n" \ " mov %0, %1 \n" \
" dsb \n" \ " msr basepri, %0 \n" \
:"=r" (ulNewBASEPRI) : "i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY ) : "memory" " isb \n" \
); " dsb \n" \
} :"=r" (ulNewBASEPRI) : "i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY ) : "memory"
);
/*-----------------------------------------------------------*/ }
portFORCE_INLINE static uint32_t ulPortRaiseBASEPRI( void ) /*-----------------------------------------------------------*/
{
uint32_t ulOriginalBASEPRI, ulNewBASEPRI; portFORCE_INLINE static uint32_t ulPortRaiseBASEPRI( void )
{
__asm volatile uint32_t ulOriginalBASEPRI, ulNewBASEPRI;
(
" mrs %0, basepri \n" \ __asm volatile
" mov %1, %2 \n" \ (
" msr basepri, %1 \n" \ " mrs %0, basepri \n" \
" isb \n" \ " mov %1, %2 \n" \
" dsb \n" \ " msr basepri, %1 \n" \
:"=r" (ulOriginalBASEPRI), "=r" (ulNewBASEPRI) : "i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY ) : "memory" " isb \n" \
); " dsb \n" \
:"=r" (ulOriginalBASEPRI), "=r" (ulNewBASEPRI) : "i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY ) : "memory"
/* This return will not be reached but is necessary to prevent compiler );
warnings. */
return ulOriginalBASEPRI; /* This return will not be reached but is necessary to prevent compiler
} warnings. */
/*-----------------------------------------------------------*/ return ulOriginalBASEPRI;
}
portFORCE_INLINE static void vPortSetBASEPRI( uint32_t ulNewMaskValue ) /*-----------------------------------------------------------*/
{
__asm volatile portFORCE_INLINE static void vPortSetBASEPRI( uint32_t ulNewMaskValue )
( {
" msr basepri, %0 " :: "r" ( ulNewMaskValue ) : "memory" __asm volatile
); (
} " msr basepri, %0 " :: "r" ( ulNewMaskValue ) : "memory"
/*-----------------------------------------------------------*/ );
}
/*-----------------------------------------------------------*/
#ifdef __cplusplus
} #define portMEMORY_BARRIER() __asm volatile( "" ::: "memory" )
#endif
#ifdef __cplusplus
#endif /* PORTMACRO_H */ }
#endif
#endif /* PORTMACRO_H */

View file

@ -1,436 +1,492 @@
/* /*
* FreeRTOS Kernel V10.0.1 * FreeRTOS Kernel V10.3.1
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to * the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so, * the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions: * subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in all * The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software. * copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* http://www.FreeRTOS.org * http://www.FreeRTOS.org
* http://aws.amazon.com/freertos * http://aws.amazon.com/freertos
* *
* 1 tab == 4 spaces! * 1 tab == 4 spaces!
*/ */
/* /*
* A sample implementation of pvPortMalloc() and vPortFree() that combines * A sample implementation of pvPortMalloc() and vPortFree() that combines
* (coalescences) adjacent memory blocks as they are freed, and in so doing * (coalescences) adjacent memory blocks as they are freed, and in so doing
* limits memory fragmentation. * limits memory fragmentation.
* *
* See heap_1.c, heap_2.c and heap_3.c for alternative implementations, and the * See heap_1.c, heap_2.c and heap_3.c for alternative implementations, and the
* memory management pages of http://www.FreeRTOS.org for more information. * memory management pages of http://www.FreeRTOS.org for more information.
*/ */
#include <stdlib.h> #include <stdlib.h>
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining /* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
all the API functions to use the MPU wrappers. That should only be done when all the API functions to use the MPU wrappers. That should only be done when
task.h is included from an application file. */ task.h is included from an application file. */
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE #define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "task.h" #include "task.h"
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE #undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#if( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) #if( configSUPPORT_DYNAMIC_ALLOCATION == 0 )
#error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0 #error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0
#endif #endif
/* Block sizes must not get too small. */ /* Block sizes must not get too small. */
#define heapMINIMUM_BLOCK_SIZE ( ( size_t ) ( xHeapStructSize << 1 ) ) #define heapMINIMUM_BLOCK_SIZE ( ( size_t ) ( xHeapStructSize << 1 ) )
/* Assumes 8bit bytes! */ /* Assumes 8bit bytes! */
#define heapBITS_PER_BYTE ( ( size_t ) 8 ) #define heapBITS_PER_BYTE ( ( size_t ) 8 )
/* Allocate the memory for the heap. */ /* Allocate the memory for the heap. */
#if( configAPPLICATION_ALLOCATED_HEAP == 1 ) #if( configAPPLICATION_ALLOCATED_HEAP == 1 )
/* The application writer has already defined the array used for the RTOS /* The application writer has already defined the array used for the RTOS
heap - probably so it can be placed in a special segment or address. */ heap - probably so it can be placed in a special segment or address. */
extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ]; extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
#else #else
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ]; static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
#endif /* configAPPLICATION_ALLOCATED_HEAP */ #endif /* configAPPLICATION_ALLOCATED_HEAP */
/* Define the linked list structure. This is used to link free blocks in order /* Define the linked list structure. This is used to link free blocks in order
of their memory address. */ of their memory address. */
typedef struct A_BLOCK_LINK typedef struct A_BLOCK_LINK
{ {
struct A_BLOCK_LINK *pxNextFreeBlock; /*<< The next free block in the list. */ struct A_BLOCK_LINK *pxNextFreeBlock; /*<< The next free block in the list. */
size_t xBlockSize; /*<< The size of the free block. */ size_t xBlockSize; /*<< The size of the free block. */
} BlockLink_t; } BlockLink_t;
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* /*
* Inserts a block of memory that is being freed into the correct position in * Inserts a block of memory that is being freed into the correct position in
* the list of free memory blocks. The block being freed will be merged with * the list of free memory blocks. The block being freed will be merged with
* the block in front it and/or the block behind it if the memory blocks are * the block in front it and/or the block behind it if the memory blocks are
* adjacent to each other. * adjacent to each other.
*/ */
static void prvInsertBlockIntoFreeList( BlockLink_t *pxBlockToInsert ); static void prvInsertBlockIntoFreeList( BlockLink_t *pxBlockToInsert );
/* /*
* Called automatically to setup the required heap structures the first time * Called automatically to setup the required heap structures the first time
* pvPortMalloc() is called. * pvPortMalloc() is called.
*/ */
static void prvHeapInit( void ); static void prvHeapInit( void );
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* The size of the structure placed at the beginning of each allocated memory /* The size of the structure placed at the beginning of each allocated memory
block must by correctly byte aligned. */ block must by correctly byte aligned. */
static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( portBYTE_ALIGNMENT - 1 ) ) ) & ~( ( size_t ) portBYTE_ALIGNMENT_MASK ); static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( portBYTE_ALIGNMENT - 1 ) ) ) & ~( ( size_t ) portBYTE_ALIGNMENT_MASK );
/* Create a couple of list links to mark the start and end of the list. */ /* Create a couple of list links to mark the start and end of the list. */
static BlockLink_t xStart, *pxEnd = NULL; static BlockLink_t xStart, *pxEnd = NULL;
/* Keeps track of the number of free bytes remaining, but says nothing about /* Keeps track of the number of calls to allocate and free memory as well as the
fragmentation. */ number of free bytes remaining, but says nothing about fragmentation. */
static size_t xFreeBytesRemaining = 0U; static size_t xFreeBytesRemaining = 0U;
static size_t xMinimumEverFreeBytesRemaining = 0U; static size_t xMinimumEverFreeBytesRemaining = 0U;
static size_t xNumberOfSuccessfulAllocations = 0;
/* Gets set to the top bit of an size_t type. When this bit in the xBlockSize static size_t xNumberOfSuccessfulFrees = 0;
member of an BlockLink_t structure is set then the block belongs to the
application. When the bit is free the block is still part of the free heap /* Gets set to the top bit of an size_t type. When this bit in the xBlockSize
space. */ member of an BlockLink_t structure is set then the block belongs to the
static size_t xBlockAllocatedBit = 0; application. When the bit is free the block is still part of the free heap
space. */
/*-----------------------------------------------------------*/ static size_t xBlockAllocatedBit = 0;
void *pvPortMalloc( size_t xWantedSize ) /*-----------------------------------------------------------*/
{
BlockLink_t *pxBlock, *pxPreviousBlock, *pxNewBlockLink; void *pvPortMalloc( size_t xWantedSize )
void *pvReturn = NULL; {
BlockLink_t *pxBlock, *pxPreviousBlock, *pxNewBlockLink;
vTaskSuspendAll(); void *pvReturn = NULL;
{
/* If this is the first call to malloc then the heap will require vTaskSuspendAll();
initialisation to setup the list of free blocks. */ {
if( pxEnd == NULL ) /* If this is the first call to malloc then the heap will require
{ initialisation to setup the list of free blocks. */
prvHeapInit(); if( pxEnd == NULL )
} {
else prvHeapInit();
{ }
mtCOVERAGE_TEST_MARKER(); else
} {
mtCOVERAGE_TEST_MARKER();
/* Check the requested block size is not so large that the top bit is }
set. The top bit of the block size member of the BlockLink_t structure
is used to determine who owns the block - the application or the /* Check the requested block size is not so large that the top bit is
kernel, so it must be free. */ set. The top bit of the block size member of the BlockLink_t structure
if( ( xWantedSize & xBlockAllocatedBit ) == 0 ) is used to determine who owns the block - the application or the
{ kernel, so it must be free. */
/* The wanted size is increased so it can contain a BlockLink_t if( ( xWantedSize & xBlockAllocatedBit ) == 0 )
structure in addition to the requested amount of bytes. */ {
if( xWantedSize > 0 ) /* The wanted size is increased so it can contain a BlockLink_t
{ structure in addition to the requested amount of bytes. */
xWantedSize += xHeapStructSize; if( xWantedSize > 0 )
{
/* Ensure that blocks are always aligned to the required number xWantedSize += xHeapStructSize;
of bytes. */
if( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) != 0x00 ) /* Ensure that blocks are always aligned to the required number
{ of bytes. */
/* Byte alignment required. */ if( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) != 0x00 )
xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) ); {
configASSERT( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) == 0 ); /* Byte alignment required. */
} xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );
else configASSERT( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) == 0 );
{ }
mtCOVERAGE_TEST_MARKER(); else
} {
} mtCOVERAGE_TEST_MARKER();
else }
{ }
mtCOVERAGE_TEST_MARKER(); else
} {
mtCOVERAGE_TEST_MARKER();
if( ( xWantedSize > 0 ) && ( xWantedSize <= xFreeBytesRemaining ) ) }
{
/* Traverse the list from the start (lowest address) block until if( ( xWantedSize > 0 ) && ( xWantedSize <= xFreeBytesRemaining ) )
one of adequate size is found. */ {
pxPreviousBlock = &xStart; /* Traverse the list from the start (lowest address) block until
pxBlock = xStart.pxNextFreeBlock; one of adequate size is found. */
while( ( pxBlock->xBlockSize < xWantedSize ) && ( pxBlock->pxNextFreeBlock != NULL ) ) pxPreviousBlock = &xStart;
{ pxBlock = xStart.pxNextFreeBlock;
pxPreviousBlock = pxBlock; while( ( pxBlock->xBlockSize < xWantedSize ) && ( pxBlock->pxNextFreeBlock != NULL ) )
pxBlock = pxBlock->pxNextFreeBlock; {
} pxPreviousBlock = pxBlock;
pxBlock = pxBlock->pxNextFreeBlock;
/* If the end marker was reached then a block of adequate size }
was not found. */
if( pxBlock != pxEnd ) /* If the end marker was reached then a block of adequate size
{ was not found. */
/* Return the memory space pointed to - jumping over the if( pxBlock != pxEnd )
BlockLink_t structure at its start. */ {
pvReturn = ( void * ) ( ( ( uint8_t * ) pxPreviousBlock->pxNextFreeBlock ) + xHeapStructSize ); /* Return the memory space pointed to - jumping over the
BlockLink_t structure at its start. */
/* This block is being returned for use so must be taken out pvReturn = ( void * ) ( ( ( uint8_t * ) pxPreviousBlock->pxNextFreeBlock ) + xHeapStructSize );
of the list of free blocks. */
pxPreviousBlock->pxNextFreeBlock = pxBlock->pxNextFreeBlock; /* This block is being returned for use so must be taken out
of the list of free blocks. */
/* If the block is larger than required it can be split into pxPreviousBlock->pxNextFreeBlock = pxBlock->pxNextFreeBlock;
two. */
if( ( pxBlock->xBlockSize - xWantedSize ) > heapMINIMUM_BLOCK_SIZE ) /* If the block is larger than required it can be split into
{ two. */
/* This block is to be split into two. Create a new if( ( pxBlock->xBlockSize - xWantedSize ) > heapMINIMUM_BLOCK_SIZE )
block following the number of bytes requested. The void {
cast is used to prevent byte alignment warnings from the /* This block is to be split into two. Create a new
compiler. */ block following the number of bytes requested. The void
pxNewBlockLink = ( void * ) ( ( ( uint8_t * ) pxBlock ) + xWantedSize ); cast is used to prevent byte alignment warnings from the
configASSERT( ( ( ( size_t ) pxNewBlockLink ) & portBYTE_ALIGNMENT_MASK ) == 0 ); compiler. */
pxNewBlockLink = ( void * ) ( ( ( uint8_t * ) pxBlock ) + xWantedSize );
/* Calculate the sizes of two blocks split from the configASSERT( ( ( ( size_t ) pxNewBlockLink ) & portBYTE_ALIGNMENT_MASK ) == 0 );
single block. */
pxNewBlockLink->xBlockSize = pxBlock->xBlockSize - xWantedSize; /* Calculate the sizes of two blocks split from the
pxBlock->xBlockSize = xWantedSize; single block. */
pxNewBlockLink->xBlockSize = pxBlock->xBlockSize - xWantedSize;
/* Insert the new block into the list of free blocks. */ pxBlock->xBlockSize = xWantedSize;
prvInsertBlockIntoFreeList( pxNewBlockLink );
} /* Insert the new block into the list of free blocks. */
else prvInsertBlockIntoFreeList( pxNewBlockLink );
{ }
mtCOVERAGE_TEST_MARKER(); else
} {
mtCOVERAGE_TEST_MARKER();
xFreeBytesRemaining -= pxBlock->xBlockSize; }
if( xFreeBytesRemaining < xMinimumEverFreeBytesRemaining ) xFreeBytesRemaining -= pxBlock->xBlockSize;
{
xMinimumEverFreeBytesRemaining = xFreeBytesRemaining; if( xFreeBytesRemaining < xMinimumEverFreeBytesRemaining )
} {
else xMinimumEverFreeBytesRemaining = xFreeBytesRemaining;
{ }
mtCOVERAGE_TEST_MARKER(); else
} {
mtCOVERAGE_TEST_MARKER();
/* The block is being returned - it is allocated and owned }
by the application and has no "next" block. */
pxBlock->xBlockSize |= xBlockAllocatedBit; /* The block is being returned - it is allocated and owned
pxBlock->pxNextFreeBlock = NULL; by the application and has no "next" block. */
} pxBlock->xBlockSize |= xBlockAllocatedBit;
else pxBlock->pxNextFreeBlock = NULL;
{ xNumberOfSuccessfulAllocations++;
mtCOVERAGE_TEST_MARKER(); }
} else
} {
else mtCOVERAGE_TEST_MARKER();
{ }
mtCOVERAGE_TEST_MARKER(); }
} else
} {
else mtCOVERAGE_TEST_MARKER();
{ }
mtCOVERAGE_TEST_MARKER(); }
} else
{
traceMALLOC( pvReturn, xWantedSize ); mtCOVERAGE_TEST_MARKER();
} }
( void ) xTaskResumeAll();
traceMALLOC( pvReturn, xWantedSize );
#if( configUSE_MALLOC_FAILED_HOOK == 1 ) }
{ ( void ) xTaskResumeAll();
if( pvReturn == NULL )
{ #if( configUSE_MALLOC_FAILED_HOOK == 1 )
extern void vApplicationMallocFailedHook( void ); {
vApplicationMallocFailedHook(); if( pvReturn == NULL )
} {
else extern void vApplicationMallocFailedHook( void );
{ vApplicationMallocFailedHook();
mtCOVERAGE_TEST_MARKER(); }
} else
} {
#endif mtCOVERAGE_TEST_MARKER();
}
configASSERT( ( ( ( size_t ) pvReturn ) & ( size_t ) portBYTE_ALIGNMENT_MASK ) == 0 ); }
return pvReturn; #endif
}
/*-----------------------------------------------------------*/ configASSERT( ( ( ( size_t ) pvReturn ) & ( size_t ) portBYTE_ALIGNMENT_MASK ) == 0 );
return pvReturn;
void vPortFree( void *pv ) }
{ /*-----------------------------------------------------------*/
uint8_t *puc = ( uint8_t * ) pv;
BlockLink_t *pxLink; void vPortFree( void *pv )
{
if( pv != NULL ) uint8_t *puc = ( uint8_t * ) pv;
{ BlockLink_t *pxLink;
/* The memory being freed will have an BlockLink_t structure immediately
before it. */ if( pv != NULL )
puc -= xHeapStructSize; {
/* The memory being freed will have an BlockLink_t structure immediately
/* This casting is to keep the compiler from issuing warnings. */ before it. */
pxLink = ( void * ) puc; puc -= xHeapStructSize;
/* Check the block is actually allocated. */ /* This casting is to keep the compiler from issuing warnings. */
configASSERT( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 ); pxLink = ( void * ) puc;
configASSERT( pxLink->pxNextFreeBlock == NULL );
/* Check the block is actually allocated. */
if( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 ) configASSERT( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 );
{ configASSERT( pxLink->pxNextFreeBlock == NULL );
if( pxLink->pxNextFreeBlock == NULL )
{ if( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 )
/* The block is being returned to the heap - it is no longer {
allocated. */ if( pxLink->pxNextFreeBlock == NULL )
pxLink->xBlockSize &= ~xBlockAllocatedBit; {
/* The block is being returned to the heap - it is no longer
vTaskSuspendAll(); allocated. */
{ pxLink->xBlockSize &= ~xBlockAllocatedBit;
/* Add this block to the list of free blocks. */
xFreeBytesRemaining += pxLink->xBlockSize; vTaskSuspendAll();
traceFREE( pv, pxLink->xBlockSize ); {
prvInsertBlockIntoFreeList( ( ( BlockLink_t * ) pxLink ) ); /* Add this block to the list of free blocks. */
} xFreeBytesRemaining += pxLink->xBlockSize;
( void ) xTaskResumeAll(); traceFREE( pv, pxLink->xBlockSize );
} prvInsertBlockIntoFreeList( ( ( BlockLink_t * ) pxLink ) );
else xNumberOfSuccessfulFrees++;
{ }
mtCOVERAGE_TEST_MARKER(); ( void ) xTaskResumeAll();
} }
} else
else {
{ mtCOVERAGE_TEST_MARKER();
mtCOVERAGE_TEST_MARKER(); }
} }
} else
} {
/*-----------------------------------------------------------*/ mtCOVERAGE_TEST_MARKER();
}
size_t xPortGetFreeHeapSize( void ) }
{ }
return xFreeBytesRemaining; /*-----------------------------------------------------------*/
}
/*-----------------------------------------------------------*/ size_t xPortGetFreeHeapSize( void )
{
size_t xPortGetMinimumEverFreeHeapSize( void ) return xFreeBytesRemaining;
{ }
return xMinimumEverFreeBytesRemaining; /*-----------------------------------------------------------*/
}
/*-----------------------------------------------------------*/ size_t xPortGetMinimumEverFreeHeapSize( void )
{
void vPortInitialiseBlocks( void ) return xMinimumEverFreeBytesRemaining;
{ }
/* This just exists to keep the linker quiet. */ /*-----------------------------------------------------------*/
}
/*-----------------------------------------------------------*/ void vPortInitialiseBlocks( void )
{
static void prvHeapInit( void ) /* This just exists to keep the linker quiet. */
{ }
BlockLink_t *pxFirstFreeBlock; /*-----------------------------------------------------------*/
uint8_t *pucAlignedHeap;
size_t uxAddress; static void prvHeapInit( void )
size_t xTotalHeapSize = configTOTAL_HEAP_SIZE; {
BlockLink_t *pxFirstFreeBlock;
/* Ensure the heap starts on a correctly aligned boundary. */ uint8_t *pucAlignedHeap;
uxAddress = ( size_t ) ucHeap; size_t uxAddress;
size_t xTotalHeapSize = configTOTAL_HEAP_SIZE;
if( ( uxAddress & portBYTE_ALIGNMENT_MASK ) != 0 )
{ /* Ensure the heap starts on a correctly aligned boundary. */
uxAddress += ( portBYTE_ALIGNMENT - 1 ); uxAddress = ( size_t ) ucHeap;
uxAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK );
xTotalHeapSize -= uxAddress - ( size_t ) ucHeap; if( ( uxAddress & portBYTE_ALIGNMENT_MASK ) != 0 )
} {
uxAddress += ( portBYTE_ALIGNMENT - 1 );
pucAlignedHeap = ( uint8_t * ) uxAddress; uxAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK );
xTotalHeapSize -= uxAddress - ( size_t ) ucHeap;
/* xStart is used to hold a pointer to the first item in the list of free }
blocks. The void cast is used to prevent compiler warnings. */
xStart.pxNextFreeBlock = ( void * ) pucAlignedHeap; pucAlignedHeap = ( uint8_t * ) uxAddress;
xStart.xBlockSize = ( size_t ) 0;
/* xStart is used to hold a pointer to the first item in the list of free
/* pxEnd is used to mark the end of the list of free blocks and is inserted blocks. The void cast is used to prevent compiler warnings. */
at the end of the heap space. */ xStart.pxNextFreeBlock = ( void * ) pucAlignedHeap;
uxAddress = ( ( size_t ) pucAlignedHeap ) + xTotalHeapSize; xStart.xBlockSize = ( size_t ) 0;
uxAddress -= xHeapStructSize;
uxAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK ); /* pxEnd is used to mark the end of the list of free blocks and is inserted
pxEnd = ( void * ) uxAddress; at the end of the heap space. */
pxEnd->xBlockSize = 0; uxAddress = ( ( size_t ) pucAlignedHeap ) + xTotalHeapSize;
pxEnd->pxNextFreeBlock = NULL; uxAddress -= xHeapStructSize;
uxAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK );
/* To start with there is a single free block that is sized to take up the pxEnd = ( void * ) uxAddress;
entire heap space, minus the space taken by pxEnd. */ pxEnd->xBlockSize = 0;
pxFirstFreeBlock = ( void * ) pucAlignedHeap; pxEnd->pxNextFreeBlock = NULL;
pxFirstFreeBlock->xBlockSize = uxAddress - ( size_t ) pxFirstFreeBlock;
pxFirstFreeBlock->pxNextFreeBlock = pxEnd; /* To start with there is a single free block that is sized to take up the
entire heap space, minus the space taken by pxEnd. */
/* Only one block exists - and it covers the entire usable heap space. */ pxFirstFreeBlock = ( void * ) pucAlignedHeap;
xMinimumEverFreeBytesRemaining = pxFirstFreeBlock->xBlockSize; pxFirstFreeBlock->xBlockSize = uxAddress - ( size_t ) pxFirstFreeBlock;
xFreeBytesRemaining = pxFirstFreeBlock->xBlockSize; pxFirstFreeBlock->pxNextFreeBlock = pxEnd;
/* Work out the position of the top bit in a size_t variable. */ /* Only one block exists - and it covers the entire usable heap space. */
xBlockAllocatedBit = ( ( size_t ) 1 ) << ( ( sizeof( size_t ) * heapBITS_PER_BYTE ) - 1 ); xMinimumEverFreeBytesRemaining = pxFirstFreeBlock->xBlockSize;
} xFreeBytesRemaining = pxFirstFreeBlock->xBlockSize;
/*-----------------------------------------------------------*/
/* Work out the position of the top bit in a size_t variable. */
static void prvInsertBlockIntoFreeList( BlockLink_t *pxBlockToInsert ) xBlockAllocatedBit = ( ( size_t ) 1 ) << ( ( sizeof( size_t ) * heapBITS_PER_BYTE ) - 1 );
{ }
BlockLink_t *pxIterator; /*-----------------------------------------------------------*/
uint8_t *puc;
static void prvInsertBlockIntoFreeList( BlockLink_t *pxBlockToInsert )
/* Iterate through the list until a block is found that has a higher address {
than the block being inserted. */ BlockLink_t *pxIterator;
for( pxIterator = &xStart; pxIterator->pxNextFreeBlock < pxBlockToInsert; pxIterator = pxIterator->pxNextFreeBlock ) uint8_t *puc;
{
/* Nothing to do here, just iterate to the right position. */ /* Iterate through the list until a block is found that has a higher address
} than the block being inserted. */
for( pxIterator = &xStart; pxIterator->pxNextFreeBlock < pxBlockToInsert; pxIterator = pxIterator->pxNextFreeBlock )
/* Do the block being inserted, and the block it is being inserted after {
make a contiguous block of memory? */ /* Nothing to do here, just iterate to the right position. */
puc = ( uint8_t * ) pxIterator; }
if( ( puc + pxIterator->xBlockSize ) == ( uint8_t * ) pxBlockToInsert )
{ /* Do the block being inserted, and the block it is being inserted after
pxIterator->xBlockSize += pxBlockToInsert->xBlockSize; make a contiguous block of memory? */
pxBlockToInsert = pxIterator; puc = ( uint8_t * ) pxIterator;
} if( ( puc + pxIterator->xBlockSize ) == ( uint8_t * ) pxBlockToInsert )
else {
{ pxIterator->xBlockSize += pxBlockToInsert->xBlockSize;
mtCOVERAGE_TEST_MARKER(); pxBlockToInsert = pxIterator;
} }
else
/* Do the block being inserted, and the block it is being inserted before {
make a contiguous block of memory? */ mtCOVERAGE_TEST_MARKER();
puc = ( uint8_t * ) pxBlockToInsert; }
if( ( puc + pxBlockToInsert->xBlockSize ) == ( uint8_t * ) pxIterator->pxNextFreeBlock )
{ /* Do the block being inserted, and the block it is being inserted before
if( pxIterator->pxNextFreeBlock != pxEnd ) make a contiguous block of memory? */
{ puc = ( uint8_t * ) pxBlockToInsert;
/* Form one big block from the two blocks. */ if( ( puc + pxBlockToInsert->xBlockSize ) == ( uint8_t * ) pxIterator->pxNextFreeBlock )
pxBlockToInsert->xBlockSize += pxIterator->pxNextFreeBlock->xBlockSize; {
pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock->pxNextFreeBlock; if( pxIterator->pxNextFreeBlock != pxEnd )
} {
else /* Form one big block from the two blocks. */
{ pxBlockToInsert->xBlockSize += pxIterator->pxNextFreeBlock->xBlockSize;
pxBlockToInsert->pxNextFreeBlock = pxEnd; pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock->pxNextFreeBlock;
} }
} else
else {
{ pxBlockToInsert->pxNextFreeBlock = pxEnd;
pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock; }
} }
else
/* If the block being inserted plugged a gab, so was merged with the block {
before and the block after, then it's pxNextFreeBlock pointer will have pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock;
already been set, and should not be set here as that would make it point }
to itself. */
if( pxIterator != pxBlockToInsert ) /* If the block being inserted plugged a gab, so was merged with the block
{ before and the block after, then it's pxNextFreeBlock pointer will have
pxIterator->pxNextFreeBlock = pxBlockToInsert; already been set, and should not be set here as that would make it point
} to itself. */
else if( pxIterator != pxBlockToInsert )
{ {
mtCOVERAGE_TEST_MARKER(); pxIterator->pxNextFreeBlock = pxBlockToInsert;
} }
} else
{
mtCOVERAGE_TEST_MARKER();
}
}
/*-----------------------------------------------------------*/
void vPortGetHeapStats( HeapStats_t *pxHeapStats )
{
BlockLink_t *pxBlock;
size_t xBlocks = 0, xMaxSize = 0, xMinSize = portMAX_DELAY; /* portMAX_DELAY used as a portable way of getting the maximum value. */
vTaskSuspendAll();
{
pxBlock = xStart.pxNextFreeBlock;
/* pxBlock will be NULL if the heap has not been initialised. The heap
is initialised automatically when the first allocation is made. */
if( pxBlock != NULL )
{
do
{
/* Increment the number of blocks and record the largest block seen
so far. */
xBlocks++;
if( pxBlock->xBlockSize > xMaxSize )
{
xMaxSize = pxBlock->xBlockSize;
}
if( pxBlock->xBlockSize < xMinSize )
{
xMinSize = pxBlock->xBlockSize;
}
/* Move to the next block in the chain until the last block is
reached. */
pxBlock = pxBlock->pxNextFreeBlock;
} while( pxBlock != pxEnd );
}
}
xTaskResumeAll();
pxHeapStats->xSizeOfLargestFreeBlockInBytes = xMaxSize;
pxHeapStats->xSizeOfSmallestFreeBlockInBytes = xMinSize;
pxHeapStats->xNumberOfFreeBlocks = xBlocks;
taskENTER_CRITICAL();
{
pxHeapStats->xAvailableHeapSpaceInBytes = xFreeBytesRemaining;
pxHeapStats->xNumberOfSuccessfulAllocations = xNumberOfSuccessfulAllocations;
pxHeapStats->xNumberOfSuccessfulFrees = xNumberOfSuccessfulFrees;
pxHeapStats->xMinimumEverFreeBytesRemaining = xMinimumEverFreeBytesRemaining;
}
taskEXIT_CRITICAL();
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -30,8 +30,8 @@ ENTRY(Reset_Handler)
/* Highest address of the user mode stack */ /* Highest address of the user mode stack */
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ _estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
_Min_Heap_Size = 0x200 ; /* required amount of heap */ _Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400 ; /* required amount of stack */ _Min_Stack_Size = 0x400; /* required amount of stack */
/* Memories definition */ /* Memories definition */
MEMORY MEMORY

View file

@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/** /**
****************************************************************************** ******************************************************************************
* @file dma.c * @file dma.c
@ -6,16 +7,16 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2020 STMicroelectronics. * Copyright (c) 2025 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under Ultimate Liberty license * This software is licensed under terms that can be found in the LICENSE file
* SLA0044, the "License"; You may not use this file except in compliance with * in the root directory of this software component.
* the License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* www.st.com/SLA0044
* *
****************************************************************************** ******************************************************************************
*/ */
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "dma.h" #include "dma.h"
@ -53,4 +54,3 @@ void MX_DMA_Init(void)
/* USER CODE END 2 */ /* USER CODE END 2 */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -155,4 +155,3 @@ __weak void App(void const * argument)
/* USER CODE END Application */ /* USER CODE END Application */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/** /**
****************************************************************************** ******************************************************************************
* @file gpio.c * @file gpio.c
@ -6,16 +7,16 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2020 STMicroelectronics. * Copyright (c) 2025 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under Ultimate Liberty license * This software is licensed under terms that can be found in the LICENSE file
* SLA0044, the "License"; You may not use this file except in compliance with * in the root directory of this software component.
* the License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* www.st.com/SLA0044
* *
****************************************************************************** ******************************************************************************
*/ */
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "gpio.h" #include "gpio.h"
@ -73,5 +74,3 @@ void MX_GPIO_Init(void)
/* USER CODE BEGIN 2 */ /* USER CODE BEGIN 2 */
/* USER CODE END 2 */ /* USER CODE END 2 */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -71,6 +71,7 @@ void App();
*/ */
int main(void) int main(void)
{ {
/* USER CODE BEGIN 1 */ /* USER CODE BEGIN 1 */
/* USER CODE END 1 */ /* USER CODE END 1 */
@ -78,13 +79,12 @@ int main(void)
/* MCU Configuration--------------------------------------------------------*/ /* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_AFIO); LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_AFIO);
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR); LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR);
/* System interrupt init*/
NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4); NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4);
/* System interrupt init*/
/* PendSV_IRQn interrupt configuration */ /* PendSV_IRQn interrupt configuration */
NVIC_SetPriority(PendSV_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),15, 0)); NVIC_SetPriority(PendSV_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),15, 0));
/* SysTick_IRQn interrupt configuration */ /* SysTick_IRQn interrupt configuration */
@ -116,12 +116,14 @@ int main(void)
/* USER CODE END 2 */ /* USER CODE END 2 */
/* Call init function for freertos objects (in freertos.c) */ /* Call init function for freertos objects (in cmsis_os2.c) */
MX_FREERTOS_Init(); MX_FREERTOS_Init();
/* Start scheduler */ /* Start scheduler */
osKernelStart(); osKernelStart();
/* We should never get here as control is now taken by the scheduler */ /* We should never get here as control is now taken by the scheduler */
/* Infinite loop */ /* Infinite loop */
/* USER CODE BEGIN WHILE */ /* USER CODE BEGIN WHILE */
while(1) { while(1) {
@ -205,5 +207,3 @@ void assert_failed(uint8_t *file, uint32_t line)
/* USER CODE END 6 */ /* USER CODE END 6 */
} }
#endif /* USE_FULL_ASSERT */ #endif /* USE_FULL_ASSERT */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/** /**
****************************************************************************** ******************************************************************************
* @file spi.c * @file spi.c
@ -6,17 +7,16 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2020 STMicroelectronics. * Copyright (c) 2025 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under Ultimate Liberty license * This software is licensed under terms that can be found in the LICENSE file
* SLA0044, the "License"; You may not use this file except in compliance with * in the root directory of this software component.
* the License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* www.st.com/SLA0044
* *
****************************************************************************** ******************************************************************************
*/ */
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "spi.h" #include "spi.h"
@ -27,6 +27,11 @@
/* SPI1 init function */ /* SPI1 init function */
void MX_SPI1_Init(void) void MX_SPI1_Init(void)
{ {
/* USER CODE BEGIN SPI1_Init 0 */
/* USER CODE END SPI1_Init 0 */
LL_SPI_InitTypeDef SPI_InitStruct = {0}; LL_SPI_InitTypeDef SPI_InitStruct = {0};
LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; LL_GPIO_InitTypeDef GPIO_InitStruct = {0};
@ -62,6 +67,9 @@ void MX_SPI1_Init(void)
LL_DMA_SetMemorySize(DMA1, LL_DMA_CHANNEL_3, LL_DMA_MDATAALIGN_BYTE); LL_DMA_SetMemorySize(DMA1, LL_DMA_CHANNEL_3, LL_DMA_MDATAALIGN_BYTE);
/* USER CODE BEGIN SPI1_Init 1 */
/* USER CODE END SPI1_Init 1 */
SPI_InitStruct.TransferDirection = LL_SPI_FULL_DUPLEX; SPI_InitStruct.TransferDirection = LL_SPI_FULL_DUPLEX;
SPI_InitStruct.Mode = LL_SPI_MODE_MASTER; SPI_InitStruct.Mode = LL_SPI_MODE_MASTER;
SPI_InitStruct.DataWidth = LL_SPI_DATAWIDTH_8BIT; SPI_InitStruct.DataWidth = LL_SPI_DATAWIDTH_8BIT;
@ -73,11 +81,12 @@ void MX_SPI1_Init(void)
SPI_InitStruct.CRCCalculation = LL_SPI_CRCCALCULATION_DISABLE; SPI_InitStruct.CRCCalculation = LL_SPI_CRCCALCULATION_DISABLE;
SPI_InitStruct.CRCPoly = 10; SPI_InitStruct.CRCPoly = 10;
LL_SPI_Init(SPI1, &SPI_InitStruct); LL_SPI_Init(SPI1, &SPI_InitStruct);
/* USER CODE BEGIN SPI1_Init 2 */
/* USER CODE END SPI1_Init 2 */
} }
/* USER CODE BEGIN 1 */ /* USER CODE BEGIN 1 */
/* USER CODE END 1 */ /* USER CODE END 1 */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -185,4 +185,3 @@ void SysTick_Handler(void)
/* USER CODE BEGIN 1 */ /* USER CODE BEGIN 1 */
/* USER CODE END 1 */ /* USER CODE END 1 */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -1,3 +1,4 @@
/* USER CODE BEGIN Header */
/** /**
****************************************************************************** ******************************************************************************
* @file usart.c * @file usart.c
@ -6,17 +7,16 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2020 STMicroelectronics. * Copyright (c) 2025 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.
* *
* This software component is licensed by ST under Ultimate Liberty license * This software is licensed under terms that can be found in the LICENSE file
* SLA0044, the "License"; You may not use this file except in compliance with * in the root directory of this software component.
* the License. You may obtain a copy of the License at: * If no LICENSE file comes with this software, it is provided AS-IS.
* www.st.com/SLA0044
* *
****************************************************************************** ******************************************************************************
*/ */
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "usart.h" #include "usart.h"
@ -28,6 +28,11 @@
void MX_USART1_UART_Init(void) void MX_USART1_UART_Init(void)
{ {
/* USER CODE BEGIN USART1_Init 0 */
/* USER CODE END USART1_Init 0 */
LL_USART_InitTypeDef USART_InitStruct = {0}; LL_USART_InitTypeDef USART_InitStruct = {0};
LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; LL_GPIO_InitTypeDef GPIO_InitStruct = {0};
@ -50,6 +55,9 @@ void MX_USART1_UART_Init(void)
GPIO_InitStruct.Mode = LL_GPIO_MODE_FLOATING; GPIO_InitStruct.Mode = LL_GPIO_MODE_FLOATING;
LL_GPIO_Init(GPIOA, &GPIO_InitStruct); LL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/* USER CODE BEGIN USART1_Init 1 */
/* USER CODE END USART1_Init 1 */
USART_InitStruct.BaudRate = 115200; USART_InitStruct.BaudRate = 115200;
USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B;
USART_InitStruct.StopBits = LL_USART_STOPBITS_1; USART_InitStruct.StopBits = LL_USART_STOPBITS_1;
@ -60,11 +68,12 @@ void MX_USART1_UART_Init(void)
LL_USART_Init(USART1, &USART_InitStruct); LL_USART_Init(USART1, &USART_InitStruct);
LL_USART_ConfigAsyncMode(USART1); LL_USART_ConfigAsyncMode(USART1);
LL_USART_Enable(USART1); LL_USART_Enable(USART1);
/* USER CODE BEGIN USART1_Init 2 */
/* USER CODE END USART1_Init 2 */
} }
/* USER CODE BEGIN 1 */ /* USER CODE BEGIN 1 */
/* USER CODE END 1 */ /* USER CODE END 1 */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View file

@ -1,4 +1,7 @@
#MicroXplorer Configuration settings - do not modify #MicroXplorer Configuration settings - do not modify
CAD.formats=
CAD.pinconfig=
CAD.provider=
Dma.Request0=SPI1_TX Dma.Request0=SPI1_TX
Dma.RequestsNb=1 Dma.RequestsNb=1
Dma.SPI1_TX.0.Direction=DMA_MEMORY_TO_PERIPH Dma.SPI1_TX.0.Direction=DMA_MEMORY_TO_PERIPH
@ -11,15 +14,17 @@ Dma.SPI1_TX.0.PeriphInc=DMA_PINC_DISABLE
Dma.SPI1_TX.0.Priority=DMA_PRIORITY_HIGH Dma.SPI1_TX.0.Priority=DMA_PRIORITY_HIGH
Dma.SPI1_TX.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority Dma.SPI1_TX.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority
FREERTOS.INCLUDE_xTaskGetCurrentTaskHandle=1 FREERTOS.INCLUDE_xTaskGetCurrentTaskHandle=1
FREERTOS.IPParameters=Tasks01,configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY,INCLUDE_xTaskGetCurrentTaskHandle,configMINIMAL_STACK_SIZE,configTIMER_TASK_STACK_DEPTH,configUSE_TIMERS FREERTOS.IPParameters=Tasks01,configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY,INCLUDE_xTaskGetCurrentTaskHandle,configMINIMAL_STACK_SIZE,configTIMER_TASK_STACK_DEPTH,configUSE_TIMERS,configUSE_NEWLIB_REENTRANT
FREERTOS.Tasks01=AppTask,0,64,App,As weak,NULL,Static,defaultTaskBuffer,defaultTaskControlBlock FREERTOS.Tasks01=AppTask,0,64,App,As weak,NULL,Static,defaultTaskBuffer,defaultTaskControlBlock
FREERTOS.configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY=1 FREERTOS.configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY=1
FREERTOS.configMINIMAL_STACK_SIZE=64 FREERTOS.configMINIMAL_STACK_SIZE=64
FREERTOS.configTIMER_TASK_STACK_DEPTH=64 FREERTOS.configTIMER_TASK_STACK_DEPTH=64
FREERTOS.configUSE_NEWLIB_REENTRANT=1
FREERTOS.configUSE_TIMERS=1 FREERTOS.configUSE_TIMERS=1
File.Version=6 File.Version=6
GPIO.groupedBy=Group By Peripherals GPIO.groupedBy=Group By Peripherals
KeepUserPlacement=false KeepUserPlacement=false
Mcu.CPN=STM32F103C8T6
Mcu.Family=STM32F1 Mcu.Family=STM32F1
Mcu.IP0=DMA Mcu.IP0=DMA
Mcu.IP1=FREERTOS Mcu.IP1=FREERTOS
@ -49,23 +54,23 @@ Mcu.PinsNb=14
Mcu.ThirdPartyNb=0 Mcu.ThirdPartyNb=0
Mcu.UserConstants= Mcu.UserConstants=
Mcu.UserName=STM32F103C8Tx Mcu.UserName=STM32F103C8Tx
MxCube.Version=6.1.0 MxCube.Version=6.13.0
MxDb.Version=DB.6.0.10 MxDb.Version=DB.6.0.130
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC.DMA1_Channel3_IRQn=true\:1\:0\:true\:false\:false\:false\:false\:false NVIC.DMA1_Channel3_IRQn=true\:1\:0\:true\:false\:false\:false\:false\:false\:true
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC.ForceEnableDMAVector=true NVIC.ForceEnableDMAVector=true
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC.PendSV_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:false NVIC.PendSV_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:false\:false
NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false\:false
NVIC.SavedPendsvIrqHandlerGenerated=true NVIC.SavedPendsvIrqHandlerGenerated=true
NVIC.SavedSvcallIrqHandlerGenerated=true NVIC.SavedSvcallIrqHandlerGenerated=true
NVIC.SavedSystickIrqHandlerGenerated=true NVIC.SavedSystickIrqHandlerGenerated=true
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:true\:false\:true NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:true\:false\:true\:false
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
PA0-WKUP.GPIOParameters=GPIO_Speed PA0-WKUP.GPIOParameters=GPIO_Speed
PA0-WKUP.GPIO_Speed=GPIO_SPEED_FREQ_MEDIUM PA0-WKUP.GPIO_Speed=GPIO_SPEED_FREQ_MEDIUM
PA0-WKUP.Locked=true PA0-WKUP.Locked=true
@ -104,7 +109,7 @@ ProjectManager.CustomerFirmwarePackage=
ProjectManager.DefaultFWLocation=true ProjectManager.DefaultFWLocation=true
ProjectManager.DeletePrevious=true ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32F103C8Tx ProjectManager.DeviceId=STM32F103C8Tx
ProjectManager.FirmwarePackage=STM32Cube FW_F1 V1.8.3 ProjectManager.FirmwarePackage=STM32Cube FW_F1 V1.8.6
ProjectManager.FreePins=false ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false ProjectManager.HalAssertFull=false
ProjectManager.HeapSize=0x200 ProjectManager.HeapSize=0x200
@ -115,12 +120,15 @@ ProjectManager.MainLocation=Src
ProjectManager.NoMain=false ProjectManager.NoMain=false
ProjectManager.PreviousToolchain=STM32CubeIDE ProjectManager.PreviousToolchain=STM32CubeIDE
ProjectManager.ProjectBuild=false ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=NeoPixelF103MVP.ioc ProjectManager.ProjectFileName=neopixel_f103_mvp.ioc
ProjectManager.ProjectName=NeoPixelF103MVP ProjectManager.ProjectName=neopixel_f103_mvp
ProjectManager.ProjectStructure=
ProjectManager.RegisterCallBack= ProjectManager.RegisterCallBack=
ProjectManager.StackSize=0x400 ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=STM32CubeIDE ProjectManager.TargetToolchain=STM32CubeIDE
ProjectManager.ToolChainLocation= ProjectManager.ToolChainLocation=
ProjectManager.UAScriptAfterPath=
ProjectManager.UAScriptBeforePath=
ProjectManager.UnderRoot=true ProjectManager.UnderRoot=true
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-LL-true,2-MX_DMA_Init-DMA-false-LL-true,3-SystemClock_Config-RCC-false-LL-false,4-MX_SPI1_Init-SPI1-false-LL-true,5-MX_USART1_UART_Init-USART1-false-LL-true ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-LL-true,2-MX_DMA_Init-DMA-false-LL-true,3-SystemClock_Config-RCC-false-LL-false,4-MX_SPI1_Init-SPI1-false-LL-true,5-MX_USART1_UART_Init-USART1-false-LL-true
RCC.ADCFreqValue=36000000 RCC.ADCFreqValue=36000000
@ -157,4 +165,4 @@ VP_FREERTOS_VS_CMSIS_V1.Signal=FREERTOS_VS_CMSIS_V1
VP_SYS_VS_Systick.Mode=SysTick VP_SYS_VS_Systick.Mode=SysTick
VP_SYS_VS_Systick.Signal=SYS_VS_Systick VP_SYS_VS_Systick.Signal=SYS_VS_Systick
board=custom board=custom
isbadioc=false rtos.0.ip=FREERTOS