summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/scons_tools/tool_selectmcu.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/build/scons_tools/tool_selectmcu.py b/build/scons_tools/tool_selectmcu.py
index f73caa1..38b154d 100644
--- a/build/scons_tools/tool_selectmcu.py
+++ b/build/scons_tools/tool_selectmcu.py
@@ -1,6 +1,14 @@
from SCons.Script import *
-def SelectMCU(env, mcu, variant_dir = None):
+def do_patch(target, source):
+ for k, v in source.items():
+ if k in target and isinstance(v, dict):
+ do_patch(target[k], v)
+
+ else:
+ target[k] = v
+
+def SelectMCU(env, mcu, variant_dir = None, patch = None):
spec = env.PlatformSpec(mcu = mcu)
@@ -8,6 +16,9 @@ def SelectMCU(env, mcu, variant_dir = None):
print('Unknown MCU: %s' % mcu)
Exit(1)
+ if patch:
+ do_patch(spec, patch)
+
detected_gcc = env.Detect([f'{toolchain}-gcc' for toolchain in spec['toolchains']])
if detected_gcc is None:
print('Couldn\'t find a suitable toolchain.')