File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1414import re
1515from pathlib import Path
1616
17+
1718# -----------------------------------------------------------------------------
1819def init (module ):
1920 module .name = ":cmsis:device"
2021
22+
2123def prepare (module , options ):
2224 device = options [":target" ]
2325 if device .identifier ["platform" ] != "nrf" :
@@ -26,7 +28,10 @@ def prepare(module, options):
2628 module .depends (":cmsis:core" )
2729 return True
2830
31+
2932pp = {}
33+
34+
3035def validate (env ):
3136 device = env [":target" ]
3237 device_name = device .identifier .string .split ("-" )[0 ]
@@ -44,7 +49,12 @@ def validate(env):
4449 raise ValidateException ("No device define found for '{}'!" .format (device .partname ))
4550
4651 family_folder = family_file .parent
47- device_header = "{}.h" .format (device_name )
52+ if device_name == "nrf51822" :
53+ device_header = "nrf51.h"
54+ elif device_name == "nrf52832" :
55+ device_header = "nrf52.h"
56+ else :
57+ device_header = "{}.h" .format (device_name )
4858
4959 global pp
5060 pp = {
@@ -53,6 +63,7 @@ def validate(env):
5363 "device_header" : device_header ,
5464 }
5565
66+
5667def build (env ):
5768 global pp
5869 env .collect (":build:path.include" , "modm/ext/cmsis/device" )
You can’t perform that action at this time.
0 commit comments