From: tmk Date: Thu, 5 Jul 2018 14:18:56 +0000 (+0900) Subject: rule.mk: Add dfu-programmer version check again X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=dd543150b45c8dc45a5837a6ce6c7d61c8525c52;p=max%2Ftmk_keyboard.git rule.mk: Add dfu-programmer version check again - ubuntu 18.04 still uses old 0.6.1 --- diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index ca933826..978f3c06 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -427,9 +427,14 @@ dfu: $(TARGET).hex done @echo +ifeq ($(shell dfu-programmer --version 2>&1 | grep -q 0.7; echo $$?),0) dfu-programmer $(MCU) erase --force +else + dfu-programmer $(MCU) erase +endif + dfu-programmer $(MCU) flash $(TARGET).hex - dfu-programmer $(MCU) reset + dfu-programmer $(MCU) reset || true # ignore exit code dfu-start: dfu-programmer $(MCU) reset