-
Notifications
You must be signed in to change notification settings - Fork 3
/
makefile
67 lines (60 loc) · 2.27 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
clean:
rm -rf $(CURDIR)/build
rm -f prj.conf
rm -f prj.conf.template
rm -f boards/stm32f401_mini.overlay
dw1000:
cp $(CURDIR)/boards/stm32f401_mini_dw1000.overlay $(CURDIR)/boards/stm32f401_mini.overlay
cp $(CURDIR)/prj.conf.dw1000 $(CURDIR)/prj.conf.template
dw3000:
cp $(CURDIR)/boards/stm32f401_mini_dw3000.overlay $(CURDIR)/boards/stm32f401_mini.overlay
cp $(CURDIR)/prj.conf.dw3000 $(CURDIR)/prj.conf.template
tag:
cp $(CURDIR)/prj.conf.template $(CURDIR)/prj.conf
echo "CONFIG_DEVICE_TYPE_TAG=y" >> $(CURDIR)/prj.conf
echo "CONFIG_DEVICE_ADDRESS=1" >> $(CURDIR)/prj.conf
west build
anchor:
cp $(CURDIR)/prj.conf.template $(CURDIR)/prj.conf
echo "CONFIG_DEVICE_TYPE_ANCHOR=y" >> $(CURDIR)/prj.conf
echo "CONFIG_DEVICE_ADDRESS=4097" >> $(CURDIR)/prj.conf
west build
node:
cp $(CURDIR)/prj.conf.template $(CURDIR)/prj.conf
echo "CONFIG_DEVICE_TYPE_NODE=y" >> $(CURDIR)/prj.conf
echo "CONFIG_DEVICE_ADDRESS=1" >> $(CURDIR)/prj.conf
west build
ds_twr:
if grep -q 'CONFIG_SS_TWR=y' $(CURDIR)/prj.conf.template; then \
sed -i 's/CONFIG_SS_TWR=y/CONFIG_DS_TWR=y/g' $(CURDIR)/prj.conf.template; \
fi
ss_twr:
if grep -q 'CONFIG_DS_TWR=y' $(CURDIR)/prj.conf.template; then \
sed -i 's/CONFIG_DS_TWR=y/CONFIG_SS_TWR=y/g' $(CURDIR)/prj.conf.template; \
fi
test:
cp $(CURDIR)/prj.conf.template $(CURDIR)/prj.conf
echo "CONFIG_DEVICE_TYPE_ANCHOR=y" >> $(CURDIR)/prj.conf
echo "CONFIG_DEVICE_ADDRESS=4097" >> $(CURDIR)/prj.conf
west build
west flash -r openocd --config boards/stlink.cfg
cp $(CURDIR)/prj.conf.template $(CURDIR)/prj.conf
echo "CONFIG_DEVICE_TYPE_TAG=y" >> $(CURDIR)/prj.conf
echo "CONFIG_DEVICE_ADDRESS=1" >> $(CURDIR)/prj.conf
west build
west flash -r openocd --config boards/daplink.cfg
test_node:
cp $(CURDIR)/prj.conf.template $(CURDIR)/prj.conf
echo "CONFIG_DEVICE_TYPE_NODE=y" >> $(CURDIR)/prj.conf
echo "CONFIG_DEVICE_ADDRESS=1" >> $(CURDIR)/prj.conf
west build
west flash -r openocd --config boards/stlink.cfg
cp $(CURDIR)/prj.conf.template $(CURDIR)/prj.conf
echo "CONFIG_DEVICE_TYPE_NODE=y" >> $(CURDIR)/prj.conf
echo "CONFIG_DEVICE_ADDRESS=2" >> $(CURDIR)/prj.conf
west build
west flash -r openocd --config boards/daplink.cfg
flash_stlink:
west flash -r openocd --config boards/stlink.cfg
flash_daplink:
west flash -r openocd --config boards/daplink.cfg