diff --git a/ext/arm/arm_math.h.in b/ext/arm/arm_math.h.in index 704f49d023..f4b5936f20 100644 --- a/ext/arm/arm_math.h.in +++ b/ext/arm/arm_math.h.in @@ -31,6 +31,13 @@ extern "C" { #endif +#include + +/* Local configuration file */ +#if __has_include() +#include +#endif + #include "arm_math_types.h" #include "arm_math_memory.h" diff --git a/ext/arm/arm_math_types.h.in b/ext/arm/arm_math_types.h.in deleted file mode 100644 index 7a00b8b4a9..0000000000 --- a/ext/arm/arm_math_types.h.in +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021, Niklas Hauser - * - * This file is part of the modm project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#ifndef _ARM_MATH_TYPES_WRAPPER_H_ -#define _ARM_MATH_TYPES_WRAPPER_H_ - -#define ARM_MATH_CM{{core}} -#define __ARM_FEATURE_MVE 0 - -%% if with_fpu -#ifndef __FPU_PRESENT -#define __FPU_PRESENT 1 -#endif -%% endif - -/* Local configuration file */ -#if __has_include() -# include -#endif - -#include "arm_math_types_internal.h" - -#endif /* ifndef _ARM_MATH_TYPES_WRAPPER_H_ */ diff --git a/ext/arm/cmsis.md b/ext/arm/cmsis.md index 46b21192a6..63c1cc4c62 100644 --- a/ext/arm/cmsis.md +++ b/ext/arm/cmsis.md @@ -14,8 +14,8 @@ We use only use these parts of CMSIS: via CMSIS-CORE. - The `modm:cmsis:device` module provides access to the peripherals of the `modm:target` devices via the vendor's CMSIS implementation. -- The `modm:cmsis:dsp` module provides a basic digital signal processing library - via CMSIS-DSP. +- The `modm:cmsis:dsp` module provides an optimized compute library via + CMSIS-DSP. [cmsis]: https://developer.arm.com/embedded/cmsis [overview]: https://developer.arm.com/-/media/Arm%20Developer%20Community/Images/Block%20Diagrams/Cortex%20Microcontroller%20Software%20Interface%20Standard%20-%20CMSIS/CMSIS%20Diagram%20v2.png diff --git a/ext/arm/dsp.lb b/ext/arm/dsp.lb index e51cc6f122..94c1425fd5 100644 --- a/ext/arm/dsp.lb +++ b/ext/arm/dsp.lb @@ -118,13 +118,12 @@ def build(env): for path in Path(localpath("cmsis-dsp/CMSIS-DSP/Include/")).iterdir(): if path.is_file() and not ("_f16" in path.name and not env["with_f16"]): # We need to replace this file to include the - if path.name in ["arm_math_types.h", "arm_math.h", "arm_math_f16.h"]: continue; + if path.name in ["arm_math.h", "arm_math_f16.h"]: continue; env.copy(path, path.name) env.copy("cmsis-dsp/CMSIS-DSP/Include/dsp/none.h", "dsp/none.h") env.copy("cmsis-dsp/CMSIS-DSP/Include/dsp/utils.h", "dsp/utils.h") env.copy("cmsis-dsp/CMSIS-DSP/Include/dsp/debug.h", "dsp/debug.h") - env.copy("cmsis-dsp/CMSIS-DSP/Include/arm_math_types.h", "arm_math_types_internal.h") core = env[":target"].get_driver("core")["type"][8:] core = core.replace("+", "PLUS").replace("f", "").replace("d", "") @@ -134,7 +133,6 @@ def build(env): "includes": includes, "with_fpu": env.get(":platform:cortex-m:float-abi", "soft") != "soft", } - env.template("arm_math_types.h.in") env.template("arm_math.h.in") if env["with_f16"]: env.template("arm_math_f16.h.in") diff --git a/ext/arm/dsp.md b/ext/arm/dsp.md index fcd5765bb6..b1c602682b 100644 --- a/ext/arm/dsp.md +++ b/ext/arm/dsp.md @@ -3,18 +3,20 @@ This module provides the CMSIS-DSP library. Please [see the API documentation][docs] for details. -Note that this module splits up the library into submodule to speed up +Note: +- The library should be accessed through the `arm_math.h` and `arm_math_f16.h` +headers, as these include necessary configuration options. +- This module splits up the library into submodules to speed up compilation by only including the math functions you really need. -You can enable 16-bit floating point support separately via option. +- You can enable 16-bit floating point support via the option `with_f16`. ## Configuration You can define your own configuration in the `` file which -will automatically be included at the *beginning* of the `arm_math_types.h` file -which is included by all CMSIS-DSP source files. This way changes to your -CMSIS-DSP configuration will only affect its source files and not recompile your -whole project. +will automatically be included at the *beginning* of the `arm_math.h` and +`arm_math_f16.h` files. This way changes to your CMSIS-DSP configuration will +only affect its source files and not recompile your whole project. Example `` configuration: