diff options
author | QMK Bot <hello@qmk.fm> | 2021-06-16 04:20:45 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2021-06-16 04:20:45 +0000 |
commit | 06971da0be4db1a1acd9e37e3d66431a21f22e45 (patch) | |
tree | 5e4451b95c09482c5d0939de1573324a96443dde /tmk_core | |
parent | 2d6fe6eed4610a64622042d63299f5101381fe43 (diff) | |
parent | ed0451bc28dc5ffcc3031bf9918a25e9fb8db2f7 (diff) | |
download | qmk_firmware-06971da0be4db1a1acd9e37e3d66431a21f22e45.tar.gz qmk_firmware-06971da0be4db1a1acd9e37e3d66431a21f22e45.zip |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/avr.mk | 18 | ||||
-rw-r--r-- | tmk_core/chibios.mk | 13 |
2 files changed, 21 insertions, 10 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 2ba193c762..b787e77ece 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -113,10 +113,16 @@ define EXEC_DFU if [ "$(1)" ]; then \ echo "Flashing '$(1)' for EE_HANDS split keyboard support." ;\ fi; \ - until $(DFU_PROGRAMMER) $(MCU) get bootloader-version; do\ - printf "$(MSG_BOOTLOADER_NOT_FOUND)" ;\ - sleep 5 ;\ - done; \ + if ! $(DFU_PROGRAMMER) $(MCU) get bootloader-version >/dev/null 2>/dev/null; then\ + printf "$(MSG_BOOTLOADER_NOT_FOUND_QUICK_RETRY)" ;\ + sleep $(BOOTLOADER_RETRY_TIME) ;\ + while ! $(DFU_PROGRAMMER) $(MCU) get bootloader-version >/dev/null 2>/dev/null; do\ + printf "." ;\ + sleep $(BOOTLOADER_RETRY_TIME) ;\ + done ;\ + printf "\n" ;\ + fi; \ + $(DFU_PROGRAMMER) $(MCU) get bootloader-version ;\ if $(DFU_PROGRAMMER) --version 2>&1 | $(GREP) -q 0.7 ; then\ $(DFU_PROGRAMMER) $(MCU) erase --force; \ if [ "$(1)" ]; then \ @@ -172,7 +178,7 @@ define EXEC_AVRDUDE TMP2=`mktemp`; \ list_devices > $$TMP1; \ while [ -z "$$USB" ]; do \ - sleep 0.5; \ + sleep $(BOOTLOADER_RETRY_TIME); \ printf "."; \ list_devices > $$TMP2; \ USB=`comm -13 $$TMP1 $$TMP2 | $(GREP) -o '/dev/tty.*'`; \ @@ -187,7 +193,7 @@ define EXEC_AVRDUDE sleep 1; \ else \ printf "Waiting for $$USB to become writable."; \ - while [ ! -w "$$USB" ]; do sleep 0.5; printf "."; done; echo ""; \ + while [ ! -w "$$USB" ]; do sleep $(BOOTLOADER_RETRY_TIME); printf "."; done; echo ""; \ fi; \ if [ -z "$(1)" ]; then \ $(AVRDUDE_PROGRAMMER) -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex; \ diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index cdf9ba6495..97299b7d32 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -341,10 +341,15 @@ ST_LINK_CLI ?= st-link_cli ST_FLASH ?= st-flash define EXEC_DFU_UTIL - until $(DFU_UTIL) -l | grep -q "Found DFU"; do\ - printf "$(MSG_BOOTLOADER_NOT_FOUND)" ;\ - sleep 5 ;\ - done + if ! $(DFU_UTIL) -l | grep -q "Found DFU"; then \ + printf "$(MSG_BOOTLOADER_NOT_FOUND_QUICK_RETRY)" ;\ + sleep $(BOOTLOADER_RETRY_TIME) ;\ + while ! $(DFU_UTIL) -l | grep -q "Found DFU"; do \ + printf "." ;\ + sleep $(BOOTLOADER_RETRY_TIME) ;\ + done ;\ + printf "\n" ;\ + fi $(DFU_UTIL) $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin endef |