artiq_flash.sh: some cleanup

This commit is contained in:
Yann Sionneau 2015-05-14 11:11:54 +02:00
parent e557d7e2df
commit e9b166b199

View File

@ -117,11 +117,7 @@ then
FLASH_BITSTREAM=1 FLASH_BITSTREAM=1
fi fi
check_return() { set +e
echo "Flashing failed, you may want to re-run the flashing tool."
exit
}
xc3sprog -c $CABLE -R > /dev/null 2>&1 xc3sprog -c $CABLE -R > /dev/null 2>&1
if [ "$?" != "0" ] if [ "$?" != "0" ]
then then
@ -129,10 +125,12 @@ then
echo "To fix this you might want to add a udev rule by doing:" echo "To fix this you might want to add a udev rule by doing:"
echo "$ sudo cp $ARTIQ_PREFIX/misc/$UDEV_RULES /etc/udev/rules.d" echo "$ sudo cp $ARTIQ_PREFIX/misc/$UDEV_RULES /etc/udev/rules.d"
echo "Then unplug/replug your device and try flashing again" echo "Then unplug/replug your device and try flashing again"
echo
echo "Other reason could be that you chosed the wrong target"
echo "Please make sure you used the correct -t option (currently: $BOARD)"
exit exit
fi fi
set -e
trap check_return ERR
if [ "${FLASH_BITSTREAM}" == "1" ] if [ "${FLASH_BITSTREAM}" == "1" ]
then then