From ed0451bc28dc5ffcc3031bf9918a25e9fb8db2f7 Mon Sep 17 00:00:00 2001 From: Purdea Andrei Date: Wed, 16 Jun 2021 07:20:44 +0300 Subject: Make atmel-dfu and chibios-dfu flashing behave more like caterina flashing. (#12552) This commit makes atmel-dfu and chibios-dfu bootloaders retry to detect the bootloader every 0,5 seconds (now configurable via the BOOTLOADER_RETRY_TIME makefile variable), and a period is printed after every try. This is a much more pleasant behaviour than the 5s retry timeout. --- tmk_core/chibios.mk | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tmk_core/chibios.mk') 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 -- cgit v1.2.3