From: Joseph Coffland Date: Sat, 14 Jan 2017 10:06:13 +0000 (-0800) Subject: Program AVR on install X-Git-Url: https://git.buildbotics.com/?a=commitdiff_plain;h=ec81878e03d773745b3f3acadab36db3a9fd513f;p=bbctrl-firmware Program AVR on install --- diff --git a/MANIFEST.in b/MANIFEST.in index 56d2aa1..0277ea2 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,3 @@ recursive-include src/py/bbctrl/http * -include package.json README.md scripts/install.sh +include package.json README.md scripts/install.sh avr/bbctrl-avr-firmware.hex +include scripts/avr109-flash.py diff --git a/Makefile b/Makefile index c5a7683..97805f7 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,8 @@ STATIC := $(shell find src/resources -type f) STATIC := $(patsubst src/resources/%,$(TARGET)/%,$(STATIC)) TEMPLS := $(wildcard src/jade/templates/*.jade) +AVR_FIRMWARE := avr/bbctrl-avr-firmware.hex + RSYNC_EXCLUDE := \*.pyc __pycache__ \*.egg-info \\\#* \*~ .\\\#\* RSYNC_EXCLUDE := $(patsubst %,--exclude %,$(RSYNC_EXCLUDE)) RSYNC_OPTS := $(RSYNC_EXCLUDE) -rv --no-g --delete --force @@ -36,9 +38,13 @@ all: html css js static copy: pkg rsync $(RSYNC_OPTS) pkg/$(PKG_NAME)/ $(DEST)/bbctrl/ -pkg: all +pkg: all $(AVR_FIRMWARE) ./setup.py sdist +.PHONY: $(AVR_FIRMWARE) +$(AVR_FIRMWARE): + $(MAKE) -C avr $(shell basename $@) + publish: pkg echo -n $(VERSION) > dist/latest.txt rsync $(RSYNC_OPTS) dist/$(PKG_NAME).tar.bz2 dist/latest.txt $(PUB_PATH)/ @@ -111,7 +117,7 @@ tidy: rm -f $(shell find "$(DIR)" -name \*~) clean: tidy - rm -rf build html pkg + rm -rf build html dist dist-clean: clean rm -rf node_modules diff --git a/package.json b/package.json index 55c598f..d3fd809 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bbctrl", - "version": "0.1.6", + "version": "0.1.7", "homepage": "https://github.com/buildbotics/rpi-firmware", "license": "GPL 3+", diff --git a/scripts/avr109-flash.py b/scripts/avr109-flash.py index f151dad..7aeb6e0 100755 --- a/scripts/avr109-flash.py +++ b/scripts/avr109-flash.py @@ -8,7 +8,7 @@ from subprocess import call dev = '/dev/ttyAMA0' -baud = 115200 +baud = 921600 boot_id = 'bbctrl ' verbose = False diff --git a/scripts/install.sh b/scripts/install.sh index d7084d0..274ce21 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,4 +1,7 @@ #!/bin/bash +sudo service bbctrl stop +sudo ./scripts/avr109-flash.py avr/bbctrl-avr-firmware.hex +sudo rm -rf /usr/local/lib/python*/dist-packages/bbctrl-* sudo ./setup.py install -sudo service bbctrl restart +sudo service bbctrl start