Statistics
| Branch: | Tag: | Revision:

amiro-os / devices / flash.mk @ b4885314

History | View | Annotate | Download (1.27 KB)

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