Skip to content

Commit 63c5f41

Browse files
hshosesalkinium
authored andcommitted
[fix] allow cmsis dsp on hosted linux
1 parent d652392 commit 63c5f41

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

ext/arm/arm_math.h.in

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

34+
%% if is_cortex_m
3435
#include <modm/platform/device.hpp>
36+
%% endif
3537

3638
/* Local configuration file */
3739
#if __has_include(<arm_math_local.h>)

ext/arm/cmsis.lb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def init(module):
1616
module.description = FileReader("cmsis.md")
1717

1818
def prepare(module, options):
19-
return options[":target"].has_driver("core:cortex-m*")
19+
return (options[":target"].has_driver("core:cortex-m*")) or (options[":target"].identifier.string == "hosted-linux")
2020

2121
def build(env):
2222
pass

ext/arm/dsp.lb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ def init(module):
9595
module.description = FileReader("dsp.md")
9696

9797
def prepare(module, options):
98-
device = options[":target"]
99-
if not device.has_driver("core:cortex-m*"):
98+
if not (options[":target"].has_driver("core:cortex-m*") or options[":target"].identifier.string == "hosted-linux"):
10099
return False
101100

102101
module.add_option(
@@ -115,6 +114,9 @@ def build(env):
115114
env.collect(":build:path.include", "modm/ext/cmsis/dsp/")
116115
env.outbasepath = "modm/ext/cmsis/dsp"
117116

117+
if env[":target"].identifier.string == "hosted-linux":
118+
env.collect(":build:cppdefines", "__GNUC_PYTHON__")
119+
118120
for path in Path(localpath("cmsis-dsp/CMSIS-DSP/Include/")).iterdir():
119121
if path.is_file() and not ("_f16" in path.name and not env["with_f16"]):
120122
# We need to replace this file to include the <cmsis_dsp_local.h>
@@ -131,6 +133,7 @@ def build(env):
131133
"core": core,
132134
"includes": includes,
133135
"with_fpu": env.get(":platform:cortex-m:float-abi", "soft") != "soft",
136+
"is_cortex_m": env[":target"].has_driver("core:cortex-m*")
134137
}
135138
env.template("arm_math.h.in")
136139
if env["with_f16"]: env.template("arm_math_f16.h.in")

0 commit comments

Comments
 (0)