aboutsummaryrefslogtreecommitdiffstats
path: root/tools/updater
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-05-15 09:38:48 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-05-15 09:38:48 +0000
commiteb0e4d4265ff27517145786add60e0713335d4a9 (patch)
tree4b8369d3338150af52160bbb3b2a2e1a17d4f193 /tools/updater
parent9084b56be9e94b8bfe2c3cfb602d0404943a60d0 (diff)
downloadChibiOS-eb0e4d4265ff27517145786add60e0713335d4a9.tar.gz
ChibiOS-eb0e4d4265ff27517145786add60e0713335d4a9.tar.bz2
ChibiOS-eb0e4d4265ff27517145786add60e0713335d4a9.zip
Added mcuconf.h generator tool for STM32F413xx.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12037 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'tools/updater')
-rw-r--r--tools/updater/mcuconf_stm32f413xx.fmpp11
-rw-r--r--tools/updater/update_mcuconf_stm32f413xx.sh29
2 files changed, 40 insertions, 0 deletions
diff --git a/tools/updater/mcuconf_stm32f413xx.fmpp b/tools/updater/mcuconf_stm32f413xx.fmpp
new file mode 100644
index 000000000..7c0710001
--- /dev/null
+++ b/tools/updater/mcuconf_stm32f413xx.fmpp
@@ -0,0 +1,11 @@
+sourceRoot: ../ftl/processors/conf/mcuconf_stm32f413xx
+outputRoot: .
+dataRoot: .
+
+freemarkerLinks: {
+ lib: ../ftl/libs
+}
+
+data : {
+ doc:properties (./values.txt)
+}
diff --git a/tools/updater/update_mcuconf_stm32f413xx.sh b/tools/updater/update_mcuconf_stm32f413xx.sh
new file mode 100644
index 000000000..0e8867889
--- /dev/null
+++ b/tools/updater/update_mcuconf_stm32f413xx.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+if [ $# -eq 2 ]
+ then
+ if [ $1 = "rootpath" ]
+ then
+ find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32f413xx.sh "{}" \;
+ else
+ echo "Usage: update_mcuconf_stm32f413xx.sh [rootpath <root path>]"
+ fi
+elif [ $# -eq 1 ]
+then
+ declare conffile=$(<$1)
+ if egrep -q "STM32F413_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_stm32f413xx.fmpp
+ then
+ echo
+ echo "aborted"
+ exit 1
+ fi
+ cp ./mcuconf.h $1
+ rm ./mcuconf.h ./values.txt
+ fi
+else
+ echo "Usage: update_mcuconf_stm32f413xx.sh [rootpath <root path>]"
+ echo " update_mcuconf_stm32f413xx.sh <configuration file>]"
+fi