From 48026bb824fd2d9cfb00ecd040db6ef3a416bae9 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Fri, 22 Jan 2021 21:43:36 -0500 Subject: upload initial port --- ChibiOS_20.3.2/tools/updater/update_chconf_nil.sh | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 ChibiOS_20.3.2/tools/updater/update_chconf_nil.sh (limited to 'ChibiOS_20.3.2/tools/updater/update_chconf_nil.sh') diff --git a/ChibiOS_20.3.2/tools/updater/update_chconf_nil.sh b/ChibiOS_20.3.2/tools/updater/update_chconf_nil.sh new file mode 100644 index 0000000..ec29728 --- /dev/null +++ b/ChibiOS_20.3.2/tools/updater/update_chconf_nil.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "chconf.h" -exec bash update_chconf_nil.sh "{}" \; + else + echo "Usage: update_chconf_nil.sh [rootpath ]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "_CHIBIOS_NIL_CONF_" <<< "$conffile" + then + echo Processing: $1 + egrep -e "\#define\s+[a-zA-Z0-9_]*\s+[a-zA-Z0-9_]" <<< "$conffile" | sed 's/\#define //g; s/ */=/g' > ./values.txt + if ! fmpp -q -C conf.fmpp -S ../ftl/processors/conf/chconf_nil + then + echo + echo "aborted" + exit 1 + fi + cp ./chconf.h $1 + rm ./chconf.h ./values.txt + fi +else + echo "Usage: update_chconf_nil.sh [rootpath ]" + echo " update_chconf_nil.sh ]" +fi -- cgit v1.2.3