reset spi before uploading the firmware

This commit is contained in:
Devaev Maxim 2021-04-22 13:26:49 +03:00
parent fd7d17ad4a
commit a3a17440dc
2 changed files with 10 additions and 1 deletions

View File

@ -63,6 +63,7 @@ depends=(
openssl
platformio
avrdude-svn
wiringpi
make
patch
sudo

View File

@ -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