-
Notifications
You must be signed in to change notification settings - Fork 75
/
platformio.ini
227 lines (198 loc) · 6.38 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
; PlatformIO Project Configuration File2
; http:;docs.platformio.org/page/projectconf.html
[platformio]
include_dir = inc
;default_envs = genericSTM32F103RC
;default_envs = hoverboard
;default_envs = hoverboard_6word
;default_envs = control_softwareserial
;default_envs = control_usart2
;default_envs = control_usart3
;default_envs = control_usart3_ADC
;default_envs = control_ADC
;default_envs = control_PPM
[env:genericSTM32F103RC]
; Default environment, uses settings as specified in config.h
platform = ststm32
framework = stm32cube
debug_tool = stlink
board = genericSTM32F103RC
build_flags =
-I${PROJECT_DIR}/inc/
-I${PROJECT_DIR}/src/hbprotocol/
-DUSE_HAL_DRIVER
-DSTM32F103xE
-Wl,-T${PROJECT_DIR}/STM32F103RCTx_FLASH.ld
-Wl,-lc
-Wl,-lm
# -Wl,-lnosys
[env:hoverboard]
; this control type allows the board to be used AS a hoverboard,
; responding to sensor movements when in hoverboard mode.
;/ and uses softwareserial for serial control on B2/C9
platform = ststm32
framework = stm32cube
debug_tool = stlink
board = genericSTM32F103RC
build_flags =
-I${PROJECT_DIR}/inc/
-I${PROJECT_DIR}/src/hbprotocol/
-DUSE_HAL_DRIVER
-DSTM32F103xE
-Wl,-T${PROJECT_DIR}/STM32F103RCTx_FLASH.ld
-Wl,-lc
-Wl,-lm
-Ofast
# -Wl,-lnosys
-D CONTROL_TYPE=6 ; Use control Type 'HOVERBOARD'
[env:hoverboard_6word]
; this control type allows the board to be used AS a hoverboard,
; responding to sensor movements when in hoverboard mode.
;/ and uses softwareserial for serial control on B2/C9
platform = ststm32
framework = stm32cube
debug_tool = stlink
board = genericSTM32F103RC
build_flags =
-I${PROJECT_DIR}/inc/
-I${PROJECT_DIR}/src/hbprotocol/
-DUSE_HAL_DRIVER
-DSTM32F103xE
-Wl,-T${PROJECT_DIR}/STM32F103RCTx_FLASH.ld
-Wl,-lc
-Wl,-lm
-Og
# -Wl,-lnosys
-D CONTROL_TYPE=5 ; Use HOVERBOARD_WITH_SOFTWARE_SERIAL_B2_C9_6WORDSENSOR from config.h as base for this config
[env:control_softwareserial]
; hoverboard sensor functionality is disabled
; and uses softwareserial for serial control on A2/A3 -
; which are actually USART pins!
platform = ststm32
framework = stm32cube
debug_tool = stlink
board = genericSTM32F103RC
build_flags =
-I${PROJECT_DIR}/inc/
-I${PROJECT_DIR}/src/hbprotocol/
-DUSE_HAL_DRIVER
-DSTM32F103xE
-Wl,-T${PROJECT_DIR}/STM32F103RCTx_FLASH.ld
-Wl,-lc
-Wl,-lm
-Og
# -Wl,-lnosys
-D CONTROL_TYPE=4 ; Use SOFTWARE_SERIAL_A2_A3 from config.h as base for this config
[env:control_usart2]
; hoverboard sensor functionality is disabled
; and control is via USART2
platform = ststm32
framework = stm32cube
debug_tool = stlink
board = genericSTM32F103RC
build_flags =
-I${PROJECT_DIR}/inc/
-I${PROJECT_DIR}/src/hbprotocol/
-DUSE_HAL_DRIVER
-DSTM32F103xE
-Wl,-T${PROJECT_DIR}/STM32F103RCTx_FLASH.ld
-Wl,-lc
-Wl,-lm
-Og
# -Wl,-lnosys
-D CONTROL_TYPE=2 ; Use USART2_CONTROLLED from config.h as base for this config
[env:control_usart3]
; hoverboard sensor functionality is disabled
; and control is via USART3
platform = ststm32
framework = stm32cube
debug_tool = stlink
board = genericSTM32F103RC
build_flags =
-I${PROJECT_DIR}/inc/
-I${PROJECT_DIR}/src/hbprotocol/
-DUSE_HAL_DRIVER
-DSTM32F103xE
-Wl,-T${PROJECT_DIR}/STM32F103RCTx_FLASH.ld
-Wl,-lc
-Wl,-lm
-Og
# -Wl,-lnosys
-D CONTROL_TYPE=3 ; Use USART3_CONTROLLED from config.h as base for this config
[env:control_usart3_ADC]
; hoverboard sensor functionality is disabled
; and control is via USART2 and ADC
platform = ststm32
framework = stm32cube
debug_tool = stlink
board = genericSTM32F103RC
build_flags =
-I${PROJECT_DIR}/inc/
-I${PROJECT_DIR}/src/hbprotocol/
-DUSE_HAL_DRIVER
-DSTM32F103xE
-Wl,-T${PROJECT_DIR}/STM32F103RCTx_FLASH.ld
-Wl,-lc
-Wl,-lm
-Og
# -Wl,-lnosys
-D CONTROL_TYPE=3 ; Use USART3_CONTROLLED from config.h as base for this config
; ###### CONTROL VIA TWO POTENTIOMETERS ######
-D CONTROL_ADC ; use ADC as input. disable DEBUG_SERIAL_USART2!
-D ADC1_MIN=0 ; min ADC1-value while poti at minimum-position (0 - 4095)
-D ADC1_ZERO=1700 ; ADC1-value while poti at zero-position (0 - 4095)
-D ADC1_MAX=4095 ; max ADC1-value while poti at maximum-position (0 - 4095)
-D ADC1_MULT_NEG=1300.0f ; Use 1000.0f to calibrate from MIN to MAX
-D ADC1_MULT_POS=3000.0f ; Use 1000.0f to calibrate from MIN to MAX
-D ADC2_MIN=0 ; min ADC2-value while poti at minimum-position (0 - 4095)
-D ADC2_ZERO=2000 ; ADC2-value while poti at zero-position (0 - 4095)
-D ADC2_MAX=4095 ; max ADC2-value while poti at maximum-position (0 - 4095)
-D ADC2_MULT_NEG=330.0f ; Use 1000.0f to calibrate from MIN to MAX
-D ADC2_MULT_POS=330.0f ; Use 1000.0f to calibrate from MIN to MAX
-D ADC_OFF_START=0 ; Start Value of Area at which other inputs can be active (0 - 4095) Applies to Speed ADC
-D ADC_OFF_END=1200 ; End Value of Area at which other inputs can be active (0 - 4095) Applies to Speed ADC
-D ADC_OFF_FILTER=0.1
-D ADC_SWITCH_CHANNELS=1 ; define if ADC1 is used for Steer and ADC2 for Speed
-D ADC_REVERSE_STEER=0 ; define if ADC1 is used for Steer and ADC2 for Speed
-D INVERT_R_DIRECTION=1
-D INVERT_L_DIRECTION=1
[env:control_ADC]
; hoverboard sensor functionality is disabled
; and control is via ADC
platform = ststm32
framework = stm32cube
debug_tool = stlink
board = genericSTM32F103RC
build_flags =
-I${PROJECT_DIR}/inc/
-I${PROJECT_DIR}/src/hbprotocol/
-DUSE_HAL_DRIVER
-DSTM32F103xE
-Wl,-T${PROJECT_DIR}/STM32F103RCTx_FLASH.ld
-Wl,-lc
-Wl,-lm
-Og
# -Wl,-lnosys
-D CONTROL_TYPE=0 ; Do not use predefined control type
; ###### CONTROL VIA TWO POTENTIOMETERS ######
-D CONTROL_ADC ; use ADC as input. disable DEBUG_SERIAL_USART2!
[env:control_PPM]
; hoverboard sensor functionality is disabled
; and control is via ADC
platform = ststm32
framework = stm32cube
debug_tool = stlink
board = genericSTM32F103RC
build_flags =
-I${PROJECT_DIR}/inc/
-I${PROJECT_DIR}/src/hbprotocol/
-DUSE_HAL_DRIVER
-DSTM32F103xE
-Wl,-T${PROJECT_DIR}/STM32F103RCTx_FLASH.ld
-Wl,-lc
-Wl,-lm
-Og
# -Wl,-lnosys
-D CONTROL_TYPE=0 ; Do not use predefined control type
-D CONTROL_PPM
-D PPM_NUM_CHANNELS=6