-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathCargo.toml
294 lines (251 loc) Β· 8.23 KB
/
Cargo.toml
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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
[package]
name = "firmware"
version = "0.0.0"
license.workspace = true
authors.workspace = true
repository.workspace = true
categories.workspace = true
description = "Rust firmware for SlimeVR full-body-tracking"
keywords = ["slimevr", "full-body-tracking", "vr", "imu", "embassy"]
edition.workspace = true
rust-version.workspace = true
[features]
default = [
"mcu-esp32c3",
"imu-stubbed",
"log-rtt",
"net-wifi",
"fusion-stubbed",
]
# default = [
# "mcu-nrf52840",
# "imu-stubbed",
# "log-rtt",
# "net-stubbed",
# "fusion-stubbed",
# "nrf-boot-s140",
# ]
# default = ["mcu-esp32", "imu-stubbed", "log-uart", "net-stubbed", "fusion-stubbed"]
# Supported microcontrollers
mcu-esp32 = [
"_mcu-f-esp32",
"dep:esp32-hal",
"defmt_esp_println/esp32",
"esp-backtrace/esp32",
"xtensa-lx/esp32",
"esp-wifi/esp32",
]
mcu-esp32c3 = [
"_mcu-f-esp32",
"dep:esp32c3-hal",
"defmt_esp_println/esp32c3",
"esp-backtrace/esp32c3",
"dep:riscv",
"esp-wifi/esp32c3",
]
mcu-nrf52840 = [
"_mcu-f-nrf52",
"embassy-nrf/nrf52840",
"dep:embassy-usb",
"nrf-softdevice/nrf52840",
"dep:nrf52840-pac",
]
mcu-nrf52832 = [
"_mcu-f-nrf52",
"embassy-nrf/nrf52832",
"nrf-softdevice/nrf52832",
"dep:nrf52832-pac",
]
# Wi-fi dependencies
net-wifi = ["esp-wifi?/wifi"] # use wifi
net-ble = ["esp-wifi?/ble"]
net-stubbed = [] # Stubs out network
# Supported IMUs
imu-bmi160 = []
imu-mpu6050 = []
imu-stubbed = [] # Stubs out the IMU
# Supported defmt loggers
log-rtt = ["dep:defmt-rtt"]
log-usb-serial = ["defmt_esp_println?/jtag_serial"]
log-uart = ["defmt_esp_println?/uart"]
# Fusion algorithms for unfused imus
fusion-stubbed = [] # Stubs out fusion so it returns the same pose every time
fusion-dcm = []
# Enable to flash without needing `espflash`
direct-boot = ["esp32c3-hal?/direct-boot"]
# nrf-specific bootloader choice
nrf-boot-none = ["cortex-m?/critical-section-single-core"]
nrf-boot-mbr = ["cortex-m?/critical-section-single-core"]
nrf-boot-s132 = ["nrf-softdevice/s132"] # use softdevice 132
nrf-boot-s140 = ["nrf-softdevice/s140"] # use softdevice 140
# All features with underscores are internal only, should not be used by other crates,
# and are not covered under semver guarantees.
# nrf52 family
_mcu-f-nrf52 = [
"dep:cortex-m",
"dep:cortex-m-rt",
"dep:alloc-cortex-m",
"embassy-nrf/time-driver-rtc1",
"embassy-executor/integrated-timers",
"dep:defmt-bbq",
]
_mcu-f-esp32 = [
"dep:esp-alloc",
"dep:embedded-svc",
"dep:embassy-net",
"dep:smoltcp",
"dep:bleps",
"dep:bleps-macros",
]
[dependencies]
# mcu-esp32 stuff
esp32-hal = { version = "0.10", optional = true, features = [
"embassy",
"embassy-time-timg0",
"async",
] }
# mcu-esp32c3 stuff
esp32c3-hal = { version = "0.7", optional = true, features = [
"embassy",
"embassy-time-timg0",
"async",
#"direct-boot",
] }
riscv = { version = "0.10", optional = true }
# mcu-f-nrf52 stuff
embassy-nrf = { version = "*", optional = true, default-features = false, features = [
"nightly", # For usb
"time",
"time-driver-rtc1",
] }
alloc-cortex-m = { version = "0.4", optional = true }
cortex-m = { version = "0.7", optional = true }
cortex-m-rt = { version = "0.7", optional = true }
nrf52840-pac = { version = "0.12", optional = true }
nrf52832-pac = { version = "0.12", optional = true }
# Async stuff
embassy-futures = "0.1.0"
embassy-executor = { version = "*", features = [
"integrated-timers",
"nightly", # Needed for .spawn()
] }
embassy-time = { version = "*", features = [
# "unstable-traits",
] }
embassy-usb = { version = "*", optional = true }
embassy-sync = { version = "*" }
futures-util = { version = "0.3", default-features = false }
# esp-xtensa stuff
xtensa-lx = { version = "0.8", optional = true, default-features = false }
# esp-generic stuff
esp-backtrace = { version = "0.4", default-features = false, optional = true }
esp-alloc = { version = "0.2", optional = true }
defmt_esp_println = { path = "crates/defmt_esp_println", optional = true }
# Wi-Fi
esp-wifi = { git = "https://github.com/esp-rs/esp-wifi.git", rev = "76ba312", features = [
"embedded-svc",
"wifi",
"embassy-net",
], optional = true }
smoltcp = { version = "0.9", default-features = false, features = [
], optional = true }
embassy-net = { version = "*", optional = true, features = [
"nightly", "tcp", "udp", "dhcpv4", "medium-ethernet"
] }
# Generic BLE
bleps = { git = "https://github.com/bjoernQ/bleps", rev = "33fde67", optional = true }
bleps-macros = { git = "https://github.com/bjoernQ/bleps", rev = "33fde67", optional = true }
# nrf ble
nrf-softdevice = { version = "*", default-features = false, features = [
"defmt",
"ble-peripheral",
"ble-central",
"critical-section-impl",
], optional = true }
# Platform independent traits
embedded-hal = "0.2"
embedded-svc = { version = "0.23", default-features = false, optional = true, features = [
# "defmt"
# "nightly",
] }
# Logging
defmt = "0.3"
defmt-rtt = { version = "0.4", optional = true }
panic_defmt = { path = "crates/panic_defmt" }
defmt-bbq = { version = "0.1", optional = true }
# Peripheral drivers
mpu6050-dmp = "0.3"
bmi160 = "0.1"
# Sensor fusion
dcmimu = "0.2"
# Other crates
static_cell = "1"
nb = "1"
nalgebra = { version = "0.31", default-features = false, features = [
"macros",
"libm",
] }
fugit = "0.3"
firmware_protocol = { path = "../networking/firmware_protocol", features = [
"nalgebra031",
] }
paste = "1.0"
load-dotenv = "0.1"
[build-dependencies]
feature_utils = "0.0.0"
cfg_aliases = "0.1.1"
serde = { version = "1", features = ["derive"] }
toml = "0.5"
eyre = "0.6"
color-eyre = "0.6"
dotenvy = "0.15"
[patch.crates-io]
bmi160 = { git = "https://github.com/TheButlah/bmi160-rs", rev = "e99802b" }
# Fix xtensa not compiling because bitvec used to use a build.rs for detecting atomic
# width
# https://github.com/ferrilab/ferrilab/issues/1
bitvec = { git = "https://github.com/arctic-alpaca/ferrilab.git", rev = "e13261a" }
# Ensure we use the git version of all of the embassy stuff. Specify it here instead of
# in [dependencies] because this ensures that we don't duplicate any dependencies like
# `embassy-time`. This avoids bugs like this one:
# https://github.com/embassy-rs/embassy/issues/1115
embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "26474ce6eb759e5add1c137f3417845e0797df3a" }
embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "26474ce6eb759e5add1c137f3417845e0797df3a" }
embassy-nrf = { git = "https://github.com/embassy-rs/embassy", rev = "26474ce6eb759e5add1c137f3417845e0797df3a" }
embassy-usb = { git = "https://github.com/embassy-rs/embassy", rev = "26474ce6eb759e5add1c137f3417845e0797df3a" }
embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "26474ce6eb759e5add1c137f3417845e0797df3a" }
embassy-net = { git = "https://github.com/embassy-rs/embassy", rev = "26474ce6eb759e5add1c137f3417845e0797df3a" }
nrf-softdevice = { git = "https://github.com/embassy-rs/nrf-softdevice", rev = "8a3dbb7" }
[profile.dev]
# lto doesnt work for esp-wifi
lto = false
# opt-level = "s"
# Necessary for esp-wifi to not be bugged
# https://github.com/esp-rs/esp-wifi/blob/9b644387a54a5ace93d4280f29075ad2a9e9a8ed/README.md#important
# https://github.com/esp-rs/esp-wifi/issues/88#issuecomment-1332363697
[profile.dev.package.esp-wifi]
opt-level = 3
# Recommended by the dependency itself
# https://github.com/esp-rs/xtensa-lx-rt/blob/455d2b77b8a5724d36db0ea66c88467a4515f376/README.md#i-get-linker-errors-when-i-build-for-debug
[profile.dev.package.xtensa-lx-rt]
opt-level = 'z'
[profile.release]
debug = true # Symbols get stripped when flashing anyway
lto = false # LTO doesn't work for esp-wifi
###################
# Workspace stuff #
###################
[workspace]
resolver = "2"
members = ["crates/panic_defmt", "crates/defmt_esp_println"]
[workspace.package]
license = "MIT OR Apache-2.0"
authors = ["Ryan Butler <[email protected]>"]
repository = "https://github.com/SlimeVR/SlimeVR-Rust"
categories = ["no-std", "embedded"]
edition = "2021"
rust-version = "1.65"
[workspace.dependencies]
esp-println = { version = "0.3", default-features = false, features = [
"critical-section", # Necessary because otherwise I'm very sus of the soundness
] }