--- /dev/null
+BASE_DIR=`dirname $0`
+INT_FILE=${BASE_DIR}/openocd/${PROGRAMMER_TYPE}.cfg
+CPU_FILE=${BASE_DIR}/openocd/${PROGRAMMER_CPU}.cfg
+
+if [ ! -f ${INT_FILE} ]; then
+ printf "Interface ${PROGRAMMER_TYPE} not supported\n";
+ exit 1;
+fi
+
+if [ ! -f ${CPU_FILE} ]; then
+ printf "CPU ${PROGRAMMER_CPU} not supported\n";
+ exit 1;
+fi
+
#set -x
BASE_DIR=`dirname $0`
-INT_FILE=${BASE_DIR}/openocd/${PROGRAMMER_TYPE}.cfg
-CPU_FILE=${BASE_DIR}/openocd/${PROGRAMMER_CPU}.cfg
-OUT_FILE="openocd.tmp"
-
-if [ ! -f ${INT_FILE} ]; then
- printf "Interface ${PROGRAMMER_TYPE} not supported\n";
- exit 1;
-fi
+. ${BASE_DIR}/common.sh
-if [ ! -f ${CPU_FILE} ]; then
- printf "CPU ${PROGRAMMER_CPU} not supported\n";
- exit 1;
-fi
+OUT_FILE="openocd.tmp"
sed -e "s#PROGRAMMER_TYPE#${INT_FILE}#" ${BASE_DIR}/openocd/flash.cfg | sed -e "s#PROGRAMMER_CPU#${CPU_FILE}#" \
| sed -e "s#IMAGE_FILE#${IMAGE_FILE}#" > ${OUT_FILE}