summaryrefslogtreecommitdiff
path: root/hid
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2021-04-22 13:26:49 +0300
committerDevaev Maxim <[email protected]>2021-04-22 13:26:49 +0300
commita3a17440dc193ca918ee52bf78447bfd1c7a62cd (patch)
treeb094029a40dfacb05c05b5152cc4d80422fa89a8 /hid
parentfd7d17ad4acd307d674658d192bc1da0bfcabc37 (diff)
reset spi before uploading the firmware
Diffstat (limited to 'hid')
-rw-r--r--hid/Makefile10
1 files changed, 9 insertions, 1 deletions
diff --git a/hid/Makefile b/hid/Makefile
index a46a66d0..6987ef52 100644
--- a/hid/Makefile
+++ b/hid/Makefile
@@ -12,7 +12,15 @@ _build:
install: upload
upload:
- platformio run --environment $(shell cat .current) --target upload
+ $(eval $@_CURRENT := $(shell cat .current))
+ bash -ex -c " \
+ current=`cat .current`; \
+ if [ '$($@_CURRENT)' == 'spi' ] || [ '$($@_CURRENT)' == 'aum' ]; then \
+ gpio -g write 25 1; \
+ gpio -g write 25 0; \
+ fi \
+ "
+ platformio run --environment '$($@_CURRENT)' --target upload
bootloader-spi: install-bootloader-spi