1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-04 23:39:21 +02:00

atusb-flash: show avrdude progress output

- Common (doit): if the environment variable LIVE is set to "true",
  run the command in "script" instead of using "eval"
- Common (LIVE): unset this variable on initialization
- atusb-flash (flash): set LIVE, to obtain progress output from avrdude
This commit is contained in:
Werner Almesberger 2011-05-31 03:30:57 -03:00
parent 8c25bc2b63
commit cbd0fe54b7
2 changed files with 12 additions and 1 deletions

View File

@ -18,6 +18,8 @@ DUT=$2
LOG=_log
>$LOG
LIVE=
if [ ${REF#net:} = $REF ]; then
REF_EXEC=
else
@ -100,7 +102,14 @@ cmd()
_doit()
{
eval "$cmd" >_out 2>&1 || { echo "exit code $?" | fail; exit 1; }
if ${LIVE:-false}; then
echo
script -c "$cmd" -q _out ||
{ echo "exit code $?" | fail; exit 1; }
else
eval "$cmd" >_out 2>&1 ||
{ echo "exit code $?" | fail; exit 1; }
fi
}

View File

@ -21,7 +21,9 @@ flash()
-U lfuse:w:0x60:m \
-U hfuse:w:0xd8:m \
-U lock:w:0x2f:m"
LIVE=true
expect "lock verified"
LIVE=false
}