diff options
author | Michael F. Lamb <mike@datagrok.org> | 2019-03-13 14:00:09 -0700 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-03-13 14:00:09 -0700 |
commit | f34244a871310fac4ab27f3fd75dc44626ed4eb9 (patch) | |
tree | 800f5e1533674ab6fa4b1c30be548e6cb755e9f4 /tmk_core | |
parent | 5a12b054aeff59ce47d0bd233206249d56352b64 (diff) | |
download | qmk_firmware-f34244a871310fac4ab27f3fd75dc44626ed4eb9.tar.gz |
Sleep until USB port becomes writable before running avrdude (#5393)
* sleep until usb port becomes writable before running avrdude
* only wait for a writable USB port when not on MSYS
using MINGW or MSYS: sleep for one second, as before.
otherwise: wait for the port to become writable.
* typo
* typo
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/avr.mk | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index d22c3bbca..79fdf4de5 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -214,12 +214,15 @@ define EXEC_AVRDUDE mv /tmp/2 /tmp/1; \ done; \ echo ""; \ - echo "Detected controller on USB port at $$USB"; \ + echo "Device $$USB has appeared; assuming it is the controller."; \ if $(GREP) -q -s 'MINGW\|MSYS' /proc/version; then \ USB=`echo "$$USB" | perl -pne 's/\/dev\/ttyS(\d+)/COM.($$1+1)/e'`; \ echo "Remapped MSYS2 USB port to $$USB"; \ + sleep 1; \ + else \ + printf "Waiting for $$USB to become writable."; \ + while [ ! -w "$$USB" ]; do sleep 0.5; printf "."; done; echo ""; \ fi; \ - sleep 1; \ avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex; \ fi endef |