aboutsummaryrefslogtreecommitdiffstats
path: root/tools/updater
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-03-14 12:31:59 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-03-14 12:31:59 +0000
commitac45d390638e7a54c9e6ae8b47b436fb4677780f (patch)
treecb0bffeb8ddc7562ec18fb6f83918bff8cb54125 /tools/updater
parent9bbc74119ea1b3226666b770658ce510ac3b8e96 (diff)
downloadChibiOS-ac45d390638e7a54c9e6ae8b47b436fb4677780f.tar.gz
ChibiOS-ac45d390638e7a54c9e6ae8b47b436fb4677780f.tar.bz2
ChibiOS-ac45d390638e7a54c9e6ae8b47b436fb4677780f.zip
Added tool for chconf.h automatic realignment.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11742 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'tools/updater')
-rw-r--r--tools/updater/chconf.fmpp11
-rw-r--r--tools/updater/update_chconf_rt.sh22
2 files changed, 33 insertions, 0 deletions
diff --git a/tools/updater/chconf.fmpp b/tools/updater/chconf.fmpp
new file mode 100644
index 000000000..72a206588
--- /dev/null
+++ b/tools/updater/chconf.fmpp
@@ -0,0 +1,11 @@
+sourceRoot: ../ftl/processors/conf/chconf_rt
+outputRoot: .
+dataRoot: .
+
+freemarkerLinks: {
+ lib: ../ftl/libs
+}
+
+data : {
+ doc:properties (./values.txt)
+}
diff --git a/tools/updater/update_chconf_rt.sh b/tools/updater/update_chconf_rt.sh
new file mode 100644
index 000000000..e39910449
--- /dev/null
+++ b/tools/updater/update_chconf_rt.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+if [ $# -eq 0 ]
+then
+ find ../.. -name "chconf.h" -exec bash update_chconf.sh "{}" \;
+elif [ $# -eq 1 ]
+then
+ if egrep -q "_CHIBIOS_RT_CONF_" $1
+ then
+ echo Processing: $1
+ cat $1 | egrep -e "\#define\s+[a-zA-Z0-9_]*\s+[a-zA-Z0-9_]" | cut --bytes=9- - | sed 's/ */=/g' > ./values.txt
+ if ! fmpp -q -C chconf_rt.fmpp
+ then
+ echo
+ echo "aborted"
+ exit 1
+ fi
+ cp ./chconf.h $1
+ rm ./chconf.h ./values.txt
+ fi
+else
+ echo "illegal number of arguments"
+fi