#!/bin/sh

DEVICE=$1

if [ -z "$DEVICE" ]; then
  DEVICE=0
fi

./flash_write_base_fw.sh $DEVICE 1
if [ $? -ge 1 ]; then
    exit 1
fi

./flash_write_system_fw.sh $DEVICE 1
if [ $? -ge 1 ]; then
    exit 1
fi

./flash_write_mcpu_fw.sh $DEVICE 1
if [ $? -ge 1 ]; then
    exit 1
fi

./flash_write_av_codec.sh $DEVICE 1
if [ $? -ge 1 ]; then
    exit 1
fi

echo "----------------------------------------"
echo " program end (WRITE _ALL)"
echo "========================================"

echo ""
echo "<<                   Need to restart the host PC                    >>"
echo ""

exit 0
