forked from OPEnSLab-OSU/SapFlowMeter
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
37 lines (29 loc) · 907 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
board=adafruit:samd:adafruit_feather_m0
sketch=sapflow_protothread
#sketch=mcp3424_code
bossac=/home/marshal/.arduino15/packages/arduino/tools/bossac/1.8.0*/bossac
port=/dev/ttyACM0
read_fault=$(HOME)/Arduino/libraries/FeatherFault/tools/recover_fault/recover_fault.py
all: build flash
build:
arduino-cli compile -b $(board) $(sketch) --build-properties compiler.cpp.extra_flags=-Og
flash:
#FIXME: Open port and set baud rate to 1200 to start Arduino bootloader
$(bossac) --port=$(port) --offset=0x2000 -e -w -v -R $(sketch)/*bin
.PHONY: monitor
monitor:
screen $(port)
copy:
scp $(sketch)/*bin flip2:
ssh flip2 -t scp *bin pi:Documents/$(sketch)
# Read the latest fault from the board
.PHONY: recover
recover:
python $(read_fault) recover $(port) --bossac-path $(bossac)
.PHONY: docs
docs:
doxygen $(sketch)/Doxyfile
clean:
arduino-cli cache clean
rm $(sketch)/*.bin
rm $(sketch)/*.elf