Skip to content

Commit a3ac5db

Browse files
calebchalmerssalkinium
authored andcommitted
[ext] Include device.hpp in CMSIS-DSP arm_math.h
1 parent 1319de9 commit a3ac5db

File tree

5 files changed

+18
-41
lines changed

5 files changed

+18
-41
lines changed

ext/arm/arm_math.h.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ extern "C"
3131
{
3232
#endif
3333

34+
#include <modm/platform/device.hpp>
35+
36+
/* Local configuration file */
37+
#if __has_include(<arm_math_local.h>)
38+
#include <arm_math_local.h>
39+
#endif
40+
3441
#include "arm_math_types.h"
3542
#include "arm_math_memory.h"
3643

ext/arm/arm_math_types.h.in

Lines changed: 0 additions & 30 deletions
This file was deleted.

ext/arm/cmsis.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ We use only use these parts of CMSIS:
1414
via CMSIS-CORE.
1515
- The `modm:cmsis:device` module provides access to the peripherals of the
1616
`modm:target` devices via the vendor's CMSIS implementation.
17-
- The `modm:cmsis:dsp` module provides a basic digital signal processing library
18-
via CMSIS-DSP.
17+
- The `modm:cmsis:dsp` module provides an optimized compute library via
18+
CMSIS-DSP.
1919

2020
[cmsis]: https://developer.arm.com/embedded/cmsis
2121
[overview]: https://developer.arm.com/-/media/Arm%20Developer%20Community/Images/Block%20Diagrams/Cortex%20Microcontroller%20Software%20Interface%20Standard%20-%20CMSIS/CMSIS%20Diagram%20v2.png

ext/arm/dsp.lb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,12 @@ def build(env):
118118
for path in Path(localpath("cmsis-dsp/CMSIS-DSP/Include/")).iterdir():
119119
if path.is_file() and not ("_f16" in path.name and not env["with_f16"]):
120120
# We need to replace this file to include the <cmsis_dsp_local.h>
121-
if path.name in ["arm_math_types.h", "arm_math.h", "arm_math_f16.h"]: continue;
121+
if path.name in ["arm_math.h", "arm_math_f16.h"]: continue;
122122
env.copy(path, path.name)
123123

124124
env.copy("cmsis-dsp/CMSIS-DSP/Include/dsp/none.h", "dsp/none.h")
125125
env.copy("cmsis-dsp/CMSIS-DSP/Include/dsp/utils.h", "dsp/utils.h")
126126
env.copy("cmsis-dsp/CMSIS-DSP/Include/dsp/debug.h", "dsp/debug.h")
127-
env.copy("cmsis-dsp/CMSIS-DSP/Include/arm_math_types.h", "arm_math_types_internal.h")
128127

129128
core = env[":target"].get_driver("core")["type"][8:]
130129
core = core.replace("+", "PLUS").replace("f", "").replace("d", "")
@@ -134,7 +133,6 @@ def build(env):
134133
"includes": includes,
135134
"with_fpu": env.get(":platform:cortex-m:float-abi", "soft") != "soft",
136135
}
137-
env.template("arm_math_types.h.in")
138136
env.template("arm_math.h.in")
139137
if env["with_f16"]: env.template("arm_math_f16.h.in")
140138

ext/arm/dsp.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@
33
This module provides the CMSIS-DSP library.
44
Please [see the API documentation][docs] for details.
55

6-
Note that this module splits up the library into submodule to speed up
6+
Note:
7+
- The library should be accessed through the `arm_math.h` and `arm_math_f16.h`
8+
headers, as these include necessary configuration options.
9+
- This module splits up the library into submodules to speed up
710
compilation by only including the math functions you really need.
8-
You can enable 16-bit floating point support separately via option.
11+
- You can enable 16-bit floating point support via the option `with_f16`.
912

1013

1114
## Configuration
1215

1316
You can define your own configuration in the `<arm_math_local.h>` file which
14-
will automatically be included at the *beginning* of the `arm_math_types.h` file
15-
which is included by all CMSIS-DSP source files. This way changes to your
16-
CMSIS-DSP configuration will only affect its source files and not recompile your
17-
whole project.
17+
will automatically be included at the *beginning* of the `arm_math.h` and
18+
`arm_math_f16.h` files. This way changes to your CMSIS-DSP configuration will
19+
only affect its source files and not recompile your whole project.
1820

1921
Example `<arm_math_local.h>` configuration:
2022

0 commit comments

Comments
 (0)