amiro-os / devices / flash.mk @ ba75ee1d
History | View | Annotate | Download (1.246 KB)
1 |
DEVICES := DiWheelDrive PowerManagement LightRing |
---|---|
2 |
|
3 |
DiWheelDrive := 1 |
4 |
PowerManagement := 2 |
5 |
LightRing := 3 |
6 |
|
7 |
SERIALBOOT ?= $(dir $(abspath $(lastword $(MAKEFILE_LIST))))../../amiro-blt/Host/Source/SerialBoot/build/SerialBoot |
8 |
|
9 |
ifeq ($(OS),Windows_NT) |
10 |
SERIALBOOT_PORT ?= COM4 |
11 |
else |
12 |
SERIALBOOT_PORT ?= /dev/ttyUSB0 |
13 |
# SERIALBOOT_PORT ?= /dev/rfcomm0 |
14 |
endif |
15 |
SERIALBOOT_BAUDRATE ?= 115200 |
16 |
#SERIALBOOT_BAUDRATE ?= 921600 |
17 |
|
18 |
#SERIALBOOT_BT_ADDR ?= 00:00:00:00:00:00 |
19 |
SERIALBOOT_BT_ADDR ?= 00:07:80:44:23:F9 |
20 |
|
21 |
ifdef PROJECT |
22 |
DEVICES := |
23 |
FLASHFILE = build/$(PROJECT).srec |
24 |
FLASHTRGS = $(FLASHFILE) |
25 |
FLASHARGS = -T$($(PROJECT)) $(FLASHFILE) |
26 |
FLASHARGSDIRECT = $(FLASHFILE) |
27 |
else |
28 |
FLASHTRGS = $(foreach dev,$(DEVICES),$(dev)/build/$(dev).srec) |
29 |
FLASHARGS = $(foreach dev,$(DEVICES),-T$($(dev)) $(dev)/build/$(dev).srec) |
30 |
FLASHARGSDIRECT = $(foreach dev,$(DEVICES),$(dev)/build/$(dev).srec) |
31 |
endif |
32 |
|
33 |
flash: $(DEVICES) $(FLASHTRGS) |
34 |
@echo Flashing |
35 |
$(SERIALBOOT) -d$(SERIALBOOT_PORT) -b$(SERIALBOOT_BAUDRATE) $(FLASHARGS) |
36 |
|
37 |
flashdirect: $(DEVICES) $(FLASHTRGS) |
38 |
@echo Flashing |
39 |
$(SERIALBOOT) -d$(SERIALBOOT_PORT) -b$(SERIALBOOT_BAUDRATE) $(FLASHARGSDIRECT) |
40 |
|
41 |
flashbt: $(DEVICES) $(FLASHTRGS) |
42 |
@echo Flashing over Bluetooth to $(SERIALBOOT_BT_ADDR) |
43 |
$(SERIALBOOT) -a$(SERIALBOOT_BT_ADDR) $(FLASHARGS) |
44 |
|