From 8e8b515a36940d0bef8cf0f8d794a95e67fac12e Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 3 May 2021 18:02:20 +0800 Subject: [PATCH] add a script to provision audio artifacts --- precursors/upload_audiotest.sh | 59 ++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 precursors/upload_audiotest.sh diff --git a/precursors/upload_audiotest.sh b/precursors/upload_audiotest.sh new file mode 100755 index 000000000..60655c797 --- /dev/null +++ b/precursors/upload_audiotest.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +SHORT8=short_8khz.wav +SHORTCD=short_cd.wav +LONG8=long_8khz.wav + +UPDATE_SHORT_8=0 +UPDATE_SHORT_CD=0 +UPDATE_LONG_8=0 + +for arg in "$@" +do + case $arg in + --short8) + UPDATE_SHORT_8=1 + shift + ;; + --shortcd) + UPDATE_SHORT_CD=1 + shift + ;; + --long8) + UPDATE_LONG_8=1 + shift + ;; + -h|--help) + echo "$0 provisions audio samples for testing. select which region to update with --short8, --shortcd, --long8" + exit 0 + ;; + *) + OTHER_ARGUMENTS+=("$1") + shift + ;; + esac +done + +if [ $UPDATE_SHORT_8 -eq 0 ] && [ $UPDATE_SHORT_CD -eq 0 ] && [ $UPDATE_LONG_8 -eq 0 ] +then + echo "$0 requires one or more arguments of --short8, --shortcd, --long8" + exit 0 +fi + +if [ $UPDATE_SHORT_8 -eq 1 ] +then + md5sum $SHORT8 + sudo wishbone-tool --load-name $SHORT8 --load-address 0x6000000 --load-flash +fi + +if [ $UPDATE_SHORT_CD -eq 1 ] +then + md5sum $SHORTCD + sudo wishbone-tool --load-name $SHORTCD --load-address 0x6080000 --load-flash +fi + +if [ $UPDATE_LONG_8 -eq 1 ] +then + md5sum $SHORTCD + sudo wishbone-tool --load-name $LONG8 --load-address 0x6340000 --load-flash +fi