aboutsummaryrefslogtreecommitdiffstats
path: root/tools/updater
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-05-15 10:03:32 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-05-15 10:03:32 +0000
commite0f997100f82e9ec0a8d2f08c89fc43261abae4b (patch)
tree62d86224555e5a775904cbdb0bb555d80046f72a /tools/updater
parenteb0e4d4265ff27517145786add60e0713335d4a9 (diff)
downloadChibiOS-e0f997100f82e9ec0a8d2f08c89fc43261abae4b.tar.gz
ChibiOS-e0f997100f82e9ec0a8d2f08c89fc43261abae4b.tar.bz2
ChibiOS-e0f997100f82e9ec0a8d2f08c89fc43261abae4b.zip
Added mcuconf.h generator for STM32H743xx.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12038 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'tools/updater')
-rw-r--r--tools/updater/mcuconf_stm32h743xx.fmpp11
-rw-r--r--tools/updater/update_mcuconf_stm32h743xx.sh29
2 files changed, 40 insertions, 0 deletions
diff --git a/tools/updater/mcuconf_stm32h743xx.fmpp b/tools/updater/mcuconf_stm32h743xx.fmpp
new file mode 100644
index 000000000..cc1ea7484
--- /dev/null
+++ b/tools/updater/mcuconf_stm32h743xx.fmpp
@@ -0,0 +1,11 @@
+sourceRoot: ../ftl/processors/conf/mcuconf_stm32h743xx
+outputRoot: .
+dataRoot: .
+
+freemarkerLinks: {
+ lib: ../ftl/libs
+}
+
+data : {
+ doc:properties (./values.txt)
+}
diff --git a/tools/updater/update_mcuconf_stm32h743xx.sh b/tools/updater/update_mcuconf_stm32h743xx.sh
new file mode 100644
index 000000000..9116b5e42
--- /dev/null
+++ b/tools/updater/update_mcuconf_stm32h743xx.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+if [ $# -eq 2 ]
+ then
+ if [ $1 = "rootpath" ]
+ then
+ find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32h743xx.sh "{}" \;
+ else
+ echo "Usage: update_mcuconf_stm32h743xx.sh [rootpath <root path>]"
+ fi
+elif [ $# -eq 1 ]
+then
+ declare conffile=$(<$1)
+ if egrep -q "STM32H743_MCUCONF" <<< "$conffile"
+ then
+ echo Processing: $1
+ egrep -e "\#define\s+[a-zA-Z0-9_()]*\s+[a-zA-Z0-9_]" <<< "$conffile" | sed -r 's/\#define\s+([a-zA-Z0-9_]*)(\([^)]*\))?\s+/\1=/g' > ./values.txt
+ if ! fmpp -q -C mcuconf_stm32h743xx.fmpp
+ then
+ echo
+ echo "aborted"
+ exit 1
+ fi
+ cp ./mcuconf.h $1
+ rm ./mcuconf.h ./values.txt
+ fi
+else
+ echo "Usage: update_mcuconf_stm32h743xx.sh [rootpath <root path>]"
+ echo " update_mcuconf_stm32h743xx.sh <configuration file>]"
+fi