From 9b62a3a6e9af1d53dd4cc0fdb02ee1bf7b45137a Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 6 Oct 2018 07:27:25 +0000 Subject: More generators. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12333 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- tools/updater/update_mcuconf_stm32f767xx.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tools/updater/update_mcuconf_stm32f767xx.sh (limited to 'tools/updater/update_mcuconf_stm32f767xx.sh') diff --git a/tools/updater/update_mcuconf_stm32f767xx.sh b/tools/updater/update_mcuconf_stm32f767xx.sh new file mode 100644 index 000000000..6fb28199b --- /dev/null +++ b/tools/updater/update_mcuconf_stm32f767xx.sh @@ -0,0 +1,29 @@ +#!/bin/bash +if [ $# -eq 2 ] + then + if [ $1 = "rootpath" ] + then + find $2 -name "mcuconf.h" -exec bash update_mcuconf_stm32f767xx.sh "{}" \; + else + echo "Usage: update_mcuconf_stm32f767xx.sh [rootpath ]" + fi +elif [ $# -eq 1 ] +then + declare conffile=$(<$1) + if egrep -q "STM32F767_MCUCONF" <<< "$conffile" || egrep -q "STM32F777_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 conf.fmpp -S ../ftl/processors/conf/mcuconf_stm32f767xx + then + echo + echo "aborted" + exit 1 + fi + cp ./mcuconf.h $1 + rm ./mcuconf.h ./values.txt + fi +else + echo "Usage: update_mcuconf_stm32f767xx.sh [rootpath ]" + echo " update_mcuconf_stm32f767xx.sh ]" +fi -- cgit v1.2.3