summaryrefslogtreecommitdiff
path: root/tmk_core/chibios.mk
diff options
context:
space:
mode:
authorPurdea Andrei <andrei@purdea.ro>2021-06-16 07:20:44 +0300
committerGitHub <noreply@github.com>2021-06-16 14:20:44 +1000
commited0451bc28dc5ffcc3031bf9918a25e9fb8db2f7 (patch)
tree9f9f28329413adfa7c62bfe0219a346d87880b29 /tmk_core/chibios.mk
parent22cd151fc359f48d75e361bd46a25ab6b40425fa (diff)
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.
Diffstat (limited to 'tmk_core/chibios.mk')
-rw-r--r--tmk_core/chibios.mk13
1 files changed, 9 insertions, 4 deletions
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