Statistics
| Branch: | Tag: | Revision:

amiro-os / devices / flash.mk @ 58fe0e0b

History | View | Annotate | Download (1.16 KB)

1
DEVICES := DiWheelDrive LightRing PowerManagement
2

    
3
DiWheelDrive := 1
4
PowerManagement := 2
5
LightRing := 3
6

    
7
SERIALBOOT ?= SerialBoot
8
ifeq ($(OS),Windows_NT)
9
	SERIALBOOT_PORT ?= COM4
10
else
11
	SERIALBOOT_PORT ?= /dev/ttyUSB0
12
#	SERIALBOOT_PORT ?= /dev/rfcomm0
13
endif
14
SERIALBOOT_BAUDRATE ?= 115200
15
#SERIALBOOT_BAUDRATE ?= 921600
16

    
17
#SERIALBOOT_BT_ADDR ?= 00:00:00:00:00:00
18
SERIALBOOT_BT_ADDR ?= 00:07:80:44:23:F9
19

    
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