-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
151 lines (117 loc) · 3.4 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#
# This is a project Makefile. It is assumed the directory this Makefile resides in is a
# project subdirectory.
#
PROJECT_NAME := iotex-esp32-mrubyc
include $(IDF_PATH)/make/project.mk
include sdkconfig
adc:
cd mrblib/loops; \
ln -sf ../../example/master.rb.adc master.rb
gpio:
cd mrblib/loops; \
ln -sf ../../example/master.rb.gpio-1 master.rb
gpio2:
cd mrblib/loops; \
ln -sf ../../example/master.rb.gpio-2 master.rb
gpio3:
cd mrblib/loops; \
ln -sf ../../example/master.rb.gpio-3 master.rb
gpio4:
cd mrblib/loops; \
ln -sf ../../example/master.rb.gpio-4 master.rb
i2c:
cd mrblib/loops; \
ln -sf ../../example/master.rb.i2c master.rb
pwm:
cd mrblib/loops; \
ln -sf ../../example/master.rb.pwm-1 master.rb
pwm2:
cd mrblib/loops; \
ln -sf ../../example/master.rb.pwm-2 master.rb
pwm3:
cd mrblib/loops; \
ln -sf ../../example/master.rb.pwm-3 master.rb
pwm4:
cd mrblib/loops; \
ln -sf ../../example/master.rb.pwm-4 master.rb
pwm5:
cd mrblib/loops; \
ln -sf ../../example/master.rb.pwm-5 master.rb
pwm6:
cd mrblib/loops; \
ln -sf ../../example/master.rb.pwm-6 master.rb
wifi:
cd mrblib/loops; \
ln -sf ../../example/master.rb.wifi master.rb
wifi_simple:
cd mrblib/loops; \
ln -sf ../../example/master.rb.wifi_simple master.rb
co2:
cd mrblib/loops; \
ln -sf ../../example/master.rb.co2 master.rb
http:
cd mrblib/loops; \
ln -sf ../../example/master.rb.httpclient master.rb
sdcard:
cd mrblib/loops; \
ln -sf ../../example/master.rb.sdcard master.rb
sgp30:
cd mrblib/loops; \
ln -sf ../../example/master.rb.sgp30 master.rb
mcp9808:
cd mrblib/loops; \
ln -sf ../../example/master.rb.mcp9808 master.rb
tmp007:
cd mrblib/loops; \
ln -sf ../../example/master.rb.tmp007 master.rb
rtc:
cd mrblib/loops; \
ln -sf ../../example/master.rb.rtc master.rb
sht:
cd mrblib/loops; \
ln -sf ../../example/master.rb.sht master.rb
tmg39931:
cd mrblib/loops; \
ln -sf ../../example/master.rb.tmg39931 master.rb
si7021:
cd mrblib/loops; \
ln -sf ../../example/master.rb.si7021 master.rb
veml6070:
cd mrblib/loops; \
ln -sf ../../example/master.rb.veml6070 master.rb
sleep:
cd mrblib/loops; \
ln -sf ../../example/master.rb.sleep master.rb
uart:
cd mrblib/loops; \
ln -sf ../../example/master.rb.uart master.rb
m5display:
cd mrblib/loops; \
ln -sf ../../example/master.rb.m5display master.rb
vl53l0x:
cd mrblib/loops; \
ln -sf ../../example/master.rb.vl53l0x-1 master.rb
vl53l0x2:
cd mrblib/loops; \
ln -sf ../../example/master.rb.vl53l0x-2 master.rb
env2:
cd mrblib/loops; \
ln -sf ../../example/master.rb.env2 master.rb
MRBC = mrbc
ESPTOOL = esptool.py
MAKE = make
FLASH_FIRMWARE_CMD=$(shell make print_flash_cmd)
MKSPIFFS=$(shell which mkspiffs|xargs -I@ basename @)
SPIFFS_DATA_OFFSET=$(shell awk '/spiffs/ {print $$0}' partitions.csv| cut -d , -f 4)
SPIFFS_DATA_TABLE_SIZE=$(shell awk '/spiffs/ {print $$0}' partitions.csv| cut -d , -f 5)
.PHONY: spiffs
spiffs:
$(MRBC) -o ./spiffs/mrbc/master.mrbc -E ./mrblib/loops/master.rb
ifeq ($(CONFIG_ENABLE_MULTITASK),y)
$(MRBC) -o ./spiffs/mrbc/slave.mrbc -E ./mrblib/loops/slave.rb
else
rm -f ./spiffs/mrbc/slave.mrbc
endif
$(MKSPIFFS) -c ./spiffs/mrbc -p 256 -b 4096 -s $(SPIFFS_DATA_TABLE_SIZE) ./spiffs/mrbc.spiffs.bin
$(ESPTOOL) --chip esp32 --baud 921600 --port $(CONFIG_ESPTOOLPY_PORT) --before default_reset --after hard_reset write_flash -z --flash_mode qio --flash_freq 80m --flash_size detect $(SPIFFS_DATA_OFFSET) ./spiffs/mrbc.spiffs.bin