Error out if no Arduino TTY device is detected when uploading.

This commit is contained in:
Christopher Peplin 2012-04-02 11:48:56 -04:00
parent f437ea63eb
commit e92c5371ad

View file

@ -478,6 +478,9 @@ raw_upload: $(TARGET_HEX)
# stdin/out appears to work but generates a spurious error on MacOS at # stdin/out appears to work but generates a spurious error on MacOS at
# least. Perhaps it would be better to just do it in perl ? # least. Perhaps it would be better to just do it in perl ?
reset: reset:
@if [ -z "$(ARD_PORT)" ]; then \
echo "No Arduino-compatible TTY device found -- exiting"; exit 2; \
fi
for STTYF in 'stty -F' 'stty --file' 'stty -f' 'stty <' ; \ for STTYF in 'stty -F' 'stty --file' 'stty -f' 'stty <' ; \
do $$STTYF /dev/tty >/dev/null 2>/dev/null && break ; \ do $$STTYF /dev/tty >/dev/null 2>/dev/null && break ; \
done ;\ done ;\