aboutsummaryrefslogtreecommitdiffstats
path: root/tools/mx2board.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mx2board.py')
-rwxr-xr-xtools/mx2board.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/mx2board.py b/tools/mx2board.py
index 1727b12..6e09d39 100755
--- a/tools/mx2board.py
+++ b/tools/mx2board.py
@@ -240,6 +240,11 @@ def read_project(gpio, filename):
elif 'GPIO_Input' == prop_value:
pads[pad_port][pad_num]["MODER"] = PIN_MODE_INPUT
else:
+ # workaround for different names in project and gpio defs
+ if "FSMC" in prop_value:
+ prop_value = re.sub(r"FSMC_D([0-9]+)_DA[0-9]+",
+ r"FSMC_D\1", prop_value)
+
pads[pad_port][pad_num]["SIGNAL"] = prop_value
pads[pad_port][pad_num]["MODER"] = PIN_MODE_ALTERNATE
pads[pad_port][pad_num]["OSPEEDR"] = PIN_OSPEED_MEDIUM
@@ -316,6 +321,11 @@ def gen_defines(project):
defines['I2C_' + label] = match.group(1)
continue
+ match = re.search(r"SPI(\d)_(MOSI|MISO|SCK|NSS)", signal)
+ if match:
+ defines['SPI_' + label] = match.group(1)
+ continue
+
match = re.search(r"CAN(\d*)_[RT]X", signal)
if match:
can = match.group(1)