File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 > )
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def init(module):
1616 module .description = FileReader ("cmsis.md" )
1717
1818def 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
2121def build (env ):
2222 pass
Original file line number Diff line number Diff line change @@ -95,8 +95,7 @@ def init(module):
9595 module .description = FileReader ("dsp.md" )
9696
9797def 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" )
You can’t perform that action at this time.
0 commit comments