forked from cnlohr/ch32v003fun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
platformio.ini
279 lines (217 loc) · 8.03 KB
/
platformio.ini
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
; see https://docs.platformio.org/en/latest/projectconf/index.html
[platformio]
src_dir = .
include_dir = .
[env]
platform = https://github.com/Community-PIO-CH32V/platform-ch32v.git
monitor_speed = 115200
; default upload and debug protocol is "wch-link", using OpenOCD and
; expecting a WCH-LinkE programming adapter.
; To use minichlink, uncomment this
;upload_protocol = minichlink
; additionally uncomment this to use ardulink on a specific COM port
;upload_flags =
; -c
; COM3
; for examples that use ch32v003fun as their base
[fun_base]
build_flags = -flto -Ich32v003fun -I/usr/include/newlib -lgcc -Iextralibs
; dynamically add "examples/$PIOENV" to the include path
; generate linkerscript on the fly
extra_scripts =
.github/add_include.py
pre:.github/gen_ldscript.py
build_src_filter = +<ch32v003fun>
[fun_base_003]
extends = fun_base
; or genericCH32V003A4M6 or whatever, see platform link
board = ch32v003f4p6_evt_r0
[fun_base_103]
extends = fun_base
build_flags = ${fun_base.build_flags} -DCH32V10x
board = genericCH32V103C8T6
[fun_base_203]
extends = fun_base
build_flags = ${fun_base.build_flags} -DCH32V20x
board = genericCH32V203C8T6
[fun_base_307]
extends = fun_base
build_flags = ${fun_base.build_flags} -DCH32V30x
board = ch32v307_evt
[fun_base_x035]
extends = fun_base
build_flags = ${fun_base.build_flags} -DCH32X03x -std=gnu11
build_unflags = -std=gnu99
board = genericCH32X035C8T6
; If creating a new example:
; 1. Add new [env:name]
; 2. Set the extends to the fun_base_{003, 103, 203, 307, x035} as needed
; 3. Add build_src_filter with fun base files + example folder (+ extra libraries if used) for source files
; 4. Add additional build flags as needed (see uartdemo)
; 5. Switch to new environment in VSCode bottom taskbar (https://docs.platformio.org/en/latest/integration/ide/vscode.html#project-tasks)
[env:adc_dma_opamp]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/adc_dma_opamp>
[env:adc_fixed_fs]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/adc_fixed_fs>
[env:adc_polled]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/adc_polled>
[env:blink]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/blink>
[env:blink_raw]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/blink_raw>
[env:bootload]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/bootload>
[env:cap_touch_adc]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/cap_touch_adc>
[env:cap_touch_exti]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/cap_touch_exti>
[env:color_lcd]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/color_lcd>
[env:cpp_virtual_methods]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/cpp_virtual_methods>
[env:debugprintfdemo]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/debugprintfdemo>
[env:direct_gpio]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/direct_gpio>
[env:dma_gpio]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/dma_gpio>
[env:external_crystal]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/external_crystal>
[env:exti_pin_change_isr]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/exti_pin_change_isr>
[env:flashtest]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/flashtest>
[env:GPIO]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/GPIO>
[env:hsitrim]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/hsitrim>
[env:i2c_oled]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/i2c_oled>
[env:i2c_slave]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/i2c_slave>
[env:input_capture]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/input_capture>
[env:iwdg]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/iwdg>
[env:MCOtest]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/MCOtest>
[env:optionbytes]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/optionbytes>
[env:optiondata]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/optiondata>
[env:run_from_ram]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/run_from_ram>
[env:self_modify_code]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/self_modify_code>
[env:spi_24L01_rx]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/spi_24L01_rx>
[env:spi_24L01_tx]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/spi_24L01_tx>
[env:spi_dac]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/spi_dac>
[env:spi_max7219]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/spi_max7219>
[env:spi_oled]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/spi_oled>
[env:standby_autowake]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/standby_autowake>
[env:standby_btn]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/standby_btn>
[env:struct_direct_gpio]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/struct_direct_gpio>
[env:struct_gpio]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/struct_gpio>
[env:sysclk_config]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/sysclk_config>
[env:systick_irq]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/systick_irq>
[env:template]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/template>
[env:tim1_pwm]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/tim1_pwm>
[env:tim2_encoder]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/tim2_encoder>
[env:tim2_pwm]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/tim2_pwm>
[env:tim2_pwm_remap]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/tim2_pwm_remap>
[env:uartdemo]
extends = fun_base_003
build_flags = ${fun_base.build_flags} -DSTDOUT_UART
build_src_filter = ${fun_base.build_src_filter} +<examples/uartdemo>
[env:ws2812bdemo]
extends = fun_base_003
build_src_filter = ${fun_base.build_src_filter} +<examples/ws2812bdemo>
[env:v10x_blink]
extends = fun_base_103
build_src_filter = ${fun_base.build_src_filter} +<examples_v10x/blink>
[env:v20x_blink]
extends = fun_base_203
build_src_filter = ${fun_base.build_src_filter} +<examples_v20x/blink>
[env:v20x_debugprintfdemo]
extends = fun_base_203
build_src_filter = ${fun_base.build_src_filter} +<examples_v20x/debugprintfdemo>
[env:v20x_mcotest]
extends = fun_base_203
build_src_filter = ${fun_base.build_src_filter} +<examples_v20x/mcotest>
[env:v20x_spidmatest]
extends = fun_base_203
build_src_filter = ${fun_base.build_src_filter} +<examples_v20x/spidmatest>
[env:v30x_blink]
extends = fun_base_307
build_src_filter = ${fun_base.build_src_filter} +<examples_v30x/blink>
[env:x035_blink]
extends = fun_base_x035
build_src_filter = ${fun_base.build_src_filter} +<examples_x035/blink>
[env:x035_debugprintfdemo]
extends = fun_base_x035
build_src_filter = ${fun_base.build_src_filter} +<examples_x035/debugprintfdemo>
[env:x035_sandbox]
extends = fun_base_x035
build_src_filter = ${fun_base.build_src_filter} +<examples_x035/sandbox>
[env:x035_usbdevice]
extends = fun_base_x035
build_src_filter = ${fun_base.build_src_filter} +<examples_x035/usbdevice/usbdevice.c>