-6
.github/workflows/build-demos-nostd.yml
-6
.github/workflows/build-demos-nostd.yml
assets/eurorust-2025-ergot.pdf
assets/eurorust-2025-ergot.pdf
This is a binary file and will not be displayed.
-1
checkall.sh
-1
checkall.sh
···
13
13
cargo check --all --target=thumbv7em-none-eabi --manifest-path=./demos/microbit/Cargo.toml
14
14
cargo check --all --target=thumbv7em-none-eabi --manifest-path=./demos/nrf52840/Cargo.toml
15
15
cargo check --all --target=thumbv6m-none-eabi --manifest-path=./demos/rp2040/Cargo.toml
16
-
cargo check --all --target=riscv32imc-unknown-none-elf --manifest-path=./demos/esp32c3/Cargo.toml
17
16
cargo check --all --target=riscv32imac-unknown-none-elf --manifest-path=./demos/esp32c6/Cargo.toml
18
17
cargo check --all --target=thumbv8m.main-none-eabihf --manifest-path=./demos/rp2350/Cargo.toml
19
18
cargo check --all --target=thumbv7em-none-eabi --manifest-path=./demos/stm32f303vc/Cargo.toml
+7
-7
crates/cobs-acc/src/lib.rs
+7
-7
crates/cobs-acc/src/lib.rs
···
256
256
got_data += 1;
257
257
ch = remaining;
258
258
}
259
-
e => panic!("{:?}", e),
259
+
e => panic!("{e:?}"),
260
260
}
261
261
}
262
262
}
···
316
316
bad_data += 1;
317
317
ch = remaining;
318
318
}
319
-
e => panic!("{:?}", e),
319
+
e => panic!("{e:?}"),
320
320
}
321
321
}
322
322
}
···
368
368
let mut fed = 0;
369
369
for mut ch in sandwich.chunks_mut(chsz) {
370
370
fed += ch.len();
371
-
println!("CH: {:?}", ch);
371
+
println!("CH: {ch:?}");
372
372
'feed: loop {
373
-
println!("{:?} <- {:?}", acc.contents(), ch);
373
+
println!("{:?} <- {ch:?}", acc.contents());
374
374
match acc.feed_raw(ch) {
375
375
FeedResult::Consumed => break 'feed,
376
376
FeedResult::Success { data, remaining } => {
···
386
386
FeedResult::OverFull(remaining) => {
387
387
ch = remaining;
388
388
}
389
-
e => panic!("{:?}", e),
389
+
e => panic!("{e:?}"),
390
390
}
391
391
}
392
392
}
···
473
473
let mut fed = 0;
474
474
for mut ch in input_stream.chunks_mut(chsz) {
475
475
fed += ch.len();
476
-
println!("CH: {:?}", ch);
476
+
println!("CH: {ch:?}");
477
477
'feed: loop {
478
-
println!("{:?} <- {:?}", acc.contents(), ch);
478
+
println!("{:?} <- {ch:?}", acc.contents());
479
479
match acc.feed_raw(ch) {
480
480
FeedResult::Consumed => break 'feed,
481
481
FeedResult::Success { data, remaining } => {
+122
-88
crates/ergot/Cargo.lock
+122
-88
crates/ergot/Cargo.lock
···
262
262
checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b"
263
263
264
264
[[package]]
265
-
name = "defmt"
266
-
version = "0.3.100"
265
+
name = "darling"
266
+
version = "0.20.11"
267
+
source = "registry+https://github.com/rust-lang/crates.io-index"
268
+
checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee"
269
+
dependencies = [
270
+
"darling_core",
271
+
"darling_macro",
272
+
]
273
+
274
+
[[package]]
275
+
name = "darling_core"
276
+
version = "0.20.11"
277
+
source = "registry+https://github.com/rust-lang/crates.io-index"
278
+
checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e"
279
+
dependencies = [
280
+
"fnv",
281
+
"ident_case",
282
+
"proc-macro2",
283
+
"quote",
284
+
"strsim",
285
+
"syn 2.0.101",
286
+
]
287
+
288
+
[[package]]
289
+
name = "darling_macro"
290
+
version = "0.20.11"
267
291
source = "registry+https://github.com/rust-lang/crates.io-index"
268
-
checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad"
292
+
checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead"
269
293
dependencies = [
270
-
"defmt 1.0.1",
294
+
"darling_core",
295
+
"quote",
296
+
"syn 2.0.101",
271
297
]
272
298
273
299
[[package]]
···
312
338
]
313
339
314
340
[[package]]
315
-
name = "embassy-executor-timer-queue"
316
-
version = "0.1.0"
341
+
name = "embassy-executor"
342
+
version = "0.7.0"
343
+
source = "registry+https://github.com/rust-lang/crates.io-index"
344
+
checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6"
345
+
dependencies = [
346
+
"critical-section",
347
+
"document-features",
348
+
"embassy-executor-macros",
349
+
]
350
+
351
+
[[package]]
352
+
name = "embassy-executor-macros"
353
+
version = "0.6.2"
317
354
source = "registry+https://github.com/rust-lang/crates.io-index"
318
-
checksum = "2fc328bf943af66b80b98755db9106bf7e7471b0cf47dc8559cd9a6be504cc9c"
355
+
checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf"
356
+
dependencies = [
357
+
"darling",
358
+
"proc-macro2",
359
+
"quote",
360
+
"syn 2.0.101",
361
+
]
319
362
320
363
[[package]]
321
364
name = "embassy-futures"
···
324
367
checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067"
325
368
326
369
[[package]]
327
-
name = "embassy-net"
328
-
version = "0.7.1"
329
-
source = "registry+https://github.com/rust-lang/crates.io-index"
330
-
checksum = "0558a231a47e7d4a06a28b5278c92e860f1200f24821d2f365a2f40fe3f3c7b2"
331
-
dependencies = [
332
-
"defmt 1.0.1",
333
-
"document-features",
334
-
"embassy-net-driver",
335
-
"embassy-sync",
336
-
"embassy-time",
337
-
"embedded-io-async",
338
-
"embedded-nal-async",
339
-
"heapless 0.8.0",
340
-
"managed",
341
-
"smoltcp",
342
-
]
343
-
344
-
[[package]]
345
370
name = "embassy-net-driver"
346
371
version = "0.2.0"
347
372
source = "registry+https://github.com/rust-lang/crates.io-index"
348
373
checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d"
349
-
dependencies = [
350
-
"defmt 0.3.100",
351
-
]
352
374
353
375
[[package]]
354
376
name = "embassy-net-driver-channel"
···
358
380
dependencies = [
359
381
"embassy-futures",
360
382
"embassy-net-driver",
361
-
"embassy-sync",
383
+
"embassy-sync 0.7.0",
362
384
]
363
385
364
386
[[package]]
365
387
name = "embassy-sync"
366
-
version = "0.7.2"
388
+
version = "0.6.2"
367
389
source = "registry+https://github.com/rust-lang/crates.io-index"
368
-
checksum = "73974a3edbd0bd286759b3d483540f0ebef705919a5f56f4fc7709066f71689b"
390
+
checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049"
369
391
dependencies = [
370
392
"cfg-if",
371
393
"critical-section",
372
394
"embedded-io-async",
373
-
"futures-core",
374
395
"futures-sink",
396
+
"futures-util",
397
+
"heapless 0.8.0",
398
+
]
399
+
400
+
[[package]]
401
+
name = "embassy-sync"
402
+
version = "0.7.0"
403
+
source = "registry+https://github.com/rust-lang/crates.io-index"
404
+
checksum = "cef1a8a1ea892f9b656de0295532ac5d8067e9830d49ec75076291fd6066b136"
405
+
dependencies = [
406
+
"cfg-if",
407
+
"critical-section",
408
+
"embedded-io-async",
409
+
"futures-sink",
410
+
"futures-util",
375
411
"heapless 0.8.0",
376
412
]
377
413
378
414
[[package]]
379
415
name = "embassy-time"
380
-
version = "0.5.0"
416
+
version = "0.4.0"
381
417
source = "registry+https://github.com/rust-lang/crates.io-index"
382
-
checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65"
418
+
checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8"
383
419
dependencies = [
384
420
"cfg-if",
385
421
"critical-section",
386
-
"defmt 1.0.1",
387
422
"document-features",
388
423
"embassy-time-driver",
389
424
"embassy-time-queue-utils",
390
425
"embedded-hal 0.2.7",
391
426
"embedded-hal 1.0.0",
392
427
"embedded-hal-async",
393
-
"futures-core",
428
+
"futures-util",
394
429
]
395
430
396
431
[[package]]
397
432
name = "embassy-time-driver"
398
-
version = "0.2.1"
433
+
version = "0.2.0"
399
434
source = "registry+https://github.com/rust-lang/crates.io-index"
400
-
checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6"
435
+
checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba"
401
436
dependencies = [
402
437
"document-features",
403
438
]
404
439
405
440
[[package]]
406
441
name = "embassy-time-queue-utils"
407
-
version = "0.3.0"
442
+
version = "0.1.0"
443
+
source = "registry+https://github.com/rust-lang/crates.io-index"
444
+
checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83"
445
+
dependencies = [
446
+
"embassy-executor",
447
+
"heapless 0.8.0",
448
+
]
449
+
450
+
[[package]]
451
+
name = "embassy-usb"
452
+
version = "0.4.0"
408
453
source = "registry+https://github.com/rust-lang/crates.io-index"
409
-
checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454"
454
+
checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386"
410
455
dependencies = [
411
-
"embassy-executor-timer-queue",
456
+
"embassy-futures",
457
+
"embassy-net-driver-channel",
458
+
"embassy-sync 0.6.2",
459
+
"embassy-usb-driver 0.1.0",
412
460
"heapless 0.8.0",
461
+
"ssmarshal",
462
+
"usbd-hid",
413
463
]
414
464
415
465
[[package]]
···
420
470
dependencies = [
421
471
"embassy-futures",
422
472
"embassy-net-driver-channel",
423
-
"embassy-sync",
424
-
"embassy-usb-driver",
473
+
"embassy-sync 0.7.0",
474
+
"embassy-usb-driver 0.2.0",
425
475
"embedded-io-async",
426
476
"heapless 0.8.0",
427
477
"ssmarshal",
428
478
"usbd-hid",
429
479
]
480
+
481
+
[[package]]
482
+
name = "embassy-usb-driver"
483
+
version = "0.1.0"
484
+
source = "registry+https://github.com/rust-lang/crates.io-index"
485
+
checksum = "4fc247028eae04174b6635104a35b1ed336aabef4654f5e87a8f32327d231970"
430
486
431
487
[[package]]
432
488
name = "embassy-usb-driver"
···
484
540
]
485
541
486
542
[[package]]
487
-
name = "embedded-nal"
488
-
version = "0.9.0"
489
-
source = "registry+https://github.com/rust-lang/crates.io-index"
490
-
checksum = "c56a28be191a992f28f178ec338a0bf02f63d7803244add736d026a471e6ed77"
491
-
dependencies = [
492
-
"nb 1.1.0",
493
-
]
494
-
495
-
[[package]]
496
-
name = "embedded-nal-async"
497
-
version = "0.8.0"
498
-
source = "registry+https://github.com/rust-lang/crates.io-index"
499
-
checksum = "76959917cd2b86f40a98c28dd5624eddd1fa69d746241c8257eac428d83cb211"
500
-
dependencies = [
501
-
"embedded-io-async",
502
-
"embedded-nal",
503
-
]
504
-
505
-
[[package]]
506
543
name = "encode_unicode"
507
544
version = "0.3.6"
508
545
source = "registry+https://github.com/rust-lang/crates.io-index"
···
533
570
534
571
[[package]]
535
572
name = "ergot"
536
-
version = "0.12.0"
573
+
version = "0.11.0"
537
574
dependencies = [
538
575
"bbq2",
539
576
"cobs 0.3.0",
···
541
578
"const-fnv1a-hash",
542
579
"cordyceps",
543
580
"critical-section",
544
-
"defmt 1.0.1",
581
+
"defmt",
545
582
"embassy-futures",
546
-
"embassy-net",
547
583
"embassy-time",
548
-
"embassy-usb",
584
+
"embassy-usb 0.4.0",
585
+
"embassy-usb 0.5.0",
549
586
"embedded-io-async",
550
587
"env_logger",
551
588
"heapless 0.9.1",
···
576
613
]
577
614
578
615
[[package]]
616
+
name = "fnv"
617
+
version = "1.0.7"
618
+
source = "registry+https://github.com/rust-lang/crates.io-index"
619
+
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
620
+
621
+
[[package]]
579
622
name = "futures"
580
623
version = "0.3.31"
581
624
source = "registry+https://github.com/rust-lang/crates.io-index"
···
742
785
source = "registry+https://github.com/rust-lang/crates.io-index"
743
786
checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad"
744
787
dependencies = [
745
-
"defmt 0.3.100",
746
788
"hash32 0.3.1",
747
789
"stable_deref_trait",
748
790
]
···
753
795
source = "registry+https://github.com/rust-lang/crates.io-index"
754
796
checksum = "b1edcd5a338e64688fbdcb7531a846cfd3476a54784dcb918a0844682bc7ada5"
755
797
dependencies = [
756
-
"defmt 1.0.1",
798
+
"defmt",
757
799
"hash32 0.3.1",
758
800
"serde",
759
801
"stable_deref_trait",
760
802
]
803
+
804
+
[[package]]
805
+
name = "ident_case"
806
+
version = "1.0.1"
807
+
source = "registry+https://github.com/rust-lang/crates.io-index"
808
+
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
761
809
762
810
[[package]]
763
811
name = "io-kit-sys"
···
875
923
"portable-atomic",
876
924
"tracing",
877
925
]
878
-
879
-
[[package]]
880
-
name = "managed"
881
-
version = "0.8.0"
882
-
source = "registry+https://github.com/rust-lang/crates.io-index"
883
-
checksum = "0ca88d725a0a943b096803bd34e73a4437208b6077654cc4ecb2947a5f91618d"
884
926
885
927
[[package]]
886
928
name = "matchers"
···
1369
1411
checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9"
1370
1412
1371
1413
[[package]]
1372
-
name = "smoltcp"
1373
-
version = "0.12.0"
1374
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1375
-
checksum = "dad095989c1533c1c266d9b1e8d70a1329dd3723c3edac6d03bbd67e7bf6f4bb"
1376
-
dependencies = [
1377
-
"bitflags 1.3.2",
1378
-
"byteorder",
1379
-
"cfg-if",
1380
-
"defmt 0.3.100",
1381
-
"heapless 0.8.0",
1382
-
"managed",
1383
-
]
1384
-
1385
-
[[package]]
1386
1414
name = "socket2"
1387
1415
version = "0.5.10"
1388
1416
source = "registry+https://github.com/rust-lang/crates.io-index"
···
1425
1453
dependencies = [
1426
1454
"portable-atomic",
1427
1455
]
1456
+
1457
+
[[package]]
1458
+
name = "strsim"
1459
+
version = "0.11.1"
1460
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1461
+
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
1428
1462
1429
1463
[[package]]
1430
1464
name = "syn"
+9
-13
crates/ergot/Cargo.toml
+9
-13
crates/ergot/Cargo.toml
···
1
1
[package]
2
2
name = "ergot"
3
-
version = "0.12.0"
3
+
version = "0.11.0"
4
4
authors = ["James Munns <james@onevariable.com>"]
5
5
edition = "2024"
6
6
readme = "README.md"
···
42
42
"tokio",
43
43
"std",
44
44
]
45
-
embassy-usb-v0_5 = [
45
+
embassy-usb-v0_4 = [
46
46
"defmt-v1",
47
-
"dep:embassy-usb-0_5",
47
+
"dep:embassy-usb-0_4",
48
48
"dep:static_cell",
49
-
"dep:embassy-time"
50
49
]
51
-
embassy-net-v0_7 = [
50
+
embassy-usb-v0_5 = [
52
51
"defmt-v1",
53
-
"dep:embassy-net-0_7",
52
+
"dep:embassy-usb-0_5",
54
53
"dep:static_cell",
55
54
]
56
55
embedded-io-async-v0_6 = [
···
75
74
_all-features-hack = [
76
75
"ssmarshal/std",
77
76
]
78
-
alloc = [
79
-
"postcard-schema/alloc"
80
-
]
81
77
82
78
[dependencies]
83
79
const-fnv1a-hash = "1.1.0"
···
91
87
bbq2 = { version = "0.4.2", default-features = false, features = ["maitake-sync-0_2"] }
92
88
cobs = { version = "0.3.0", default-features = false }
93
89
cordyceps = { version = "0.3.4", default-features = false }
94
-
embassy-time = { version = "0.5.0", optional = true }
90
+
embassy-time = { version = "0.4.0" }
95
91
maitake-sync = { version = "0.2.2", default-features = false }
96
92
mutex = { version = "1.0.0", features = ["impl-critical-section"] }
97
93
serde = { version = "1.0", default-features = false, features = ["derive"] }
···
109
105
defmt = { version = "1.0.0", optional = true }
110
106
static_cell = { version = "2.1", optional = true }
111
107
108
+
# embassy-usb-v0_4
109
+
embassy-usb-0_4 = { version = "0.4", optional = true, package = "embassy-usb" }
110
+
112
111
# embassy-usb-v0_5
113
112
embassy-usb-0_5 = { version = "0.5", optional = true, package = "embassy-usb" }
114
-
115
-
# embassy-usb-v0_7
116
-
embassy-net-0_7 = { version = "0.7", optional = true, package = "embassy-net", features = ["defmt", "tcp", "udp", "dhcpv4", "medium-ethernet", "dns", "proto-ipv4", "proto-ipv6"] }
117
113
118
114
# embedded-io-async
119
115
embedded-io-async-0_6 = { version = "0.6", optional = true, package = "embedded-io-async" }
+2
-2
crates/ergot/src/book/_03_feature_overview.rs
+2
-2
crates/ergot/src/book/_03_feature_overview.rs
···
119
119
//! **For examples, see:**
120
120
//!
121
121
//! * [`ergot-router`] for the "Server" application shown above
122
-
//! * [`ergot-client-tcp`] for the "Process" application shown above
122
+
//! * [`ergot-client`] for the "Process" application shown above
123
123
//!
124
124
//! [`ergot-router`]: https://github.com/jamesmunns/ergot/tree/main/demos/std/ergot-router
125
-
//! [`ergot-client-tcp`]: https://github.com/jamesmunns/ergot/tree/main/demos/std/ergot-client
125
+
//! [`ergot-client`]: https://github.com/jamesmunns/ergot/tree/main/demos/std/ergot-client
126
126
//!
127
127
//! ### Direct connection, MCU to MCU
128
128
//!
+1
-1
crates/ergot/src/conformance/net_stack.rs
+1
-1
crates/ergot/src/conformance/net_stack.rs
···
167
167
data: &T,
168
168
) -> Result<(), InterfaceSendError> {
169
169
let data = postcard::to_stdvec(data).expect("Serializing send failed");
170
-
log::trace!("{}: Sending data:{:02X?}", hdr, data);
170
+
log::trace!("{hdr}: Sending data:{data:02X?}");
171
171
let now = self.expected_sends.pop_front().expect("Unexpected send");
172
172
assert_eq!(&now.hdr, hdr, "Send header mismatch");
173
173
assert_eq!(&now.data, &data, "Send data mismatch");
-27
crates/ergot/src/interface_manager/interface_impls/embassy_net_udp.rs
-27
crates/ergot/src/interface_manager/interface_impls/embassy_net_udp.rs
···
1
-
use core::marker::PhantomData;
2
-
3
-
use bbq2::queue::BBQueue;
4
-
use bbq2::traits::bbqhdl::BbqHandle;
5
-
use bbq2::traits::notifier::maitake::MaiNotSpsc;
6
-
use bbq2::traits::storage::Inline;
7
-
8
-
use crate::interface_manager::Interface;
9
-
use crate::interface_manager::utils::framed_stream;
10
-
11
-
/// A type alias for the outgoing packet queue typically used by the [`EmbassyInterface`]
12
-
pub type Queue<const N: usize, C> = BBQueue<Inline<N>, C, MaiNotSpsc>;
13
-
/// A type alias for the InterfaceSink typically used by the [`EmbassyInterface`]
14
-
pub type EmbassySink<Q> = framed_stream::Sink<Q>;
15
-
16
-
/// An Embassy-USB interface implementation
17
-
pub struct EmbassyNetInterface<Q: BbqHandle + 'static> {
18
-
_pd: PhantomData<Q>,
19
-
}
20
-
21
-
/// Interface Implementation
22
-
impl<Q: BbqHandle + 'static> Interface for EmbassyNetInterface<Q> {
23
-
type Sink = EmbassySink<Q>;
24
-
}
25
-
26
-
#[cfg(feature = "embassy-net-v0_7")]
27
-
pub mod enet_0_7 {}
+296
-2
crates/ergot/src/interface_manager/interface_impls/embassy_usb.rs
+296
-2
crates/ergot/src/interface_manager/interface_impls/embassy_usb.rs
···
108
108
pub mod eusb_0_5 {
109
109
use core::sync::atomic::Ordering;
110
110
111
-
use crate::logging::{info, warn};
112
111
use bbq2::{
113
112
prod_cons::framed::FramedConsumer,
114
113
queue::BBQueue,
115
114
traits::{coordination::Coord, notifier::maitake::MaiNotSpsc, storage::Inline},
116
115
};
116
+
use defmt::{debug, info, warn};
117
117
use embassy_futures::select::{Either, select};
118
118
use embassy_time::Timer;
119
119
use embassy_usb_0_5::{
···
161
161
// Wait for an outgoing frame
162
162
let frame = rx.wait_read().await;
163
163
164
-
defmt::debug!("Got frame to send len {=usize}", frame.len());
164
+
debug!("Got frame to send len {=usize}", frame.len());
165
165
166
166
// Attempt to send it
167
167
let res = send_all::<D>(
···
403
403
}
404
404
}
405
405
}
406
+
407
+
#[cfg(feature = "embassy-usb-v0_4")]
408
+
pub mod eusb_0_4 {
409
+
use core::sync::atomic::Ordering;
410
+
411
+
use bbq2::{
412
+
prod_cons::framed::FramedConsumer,
413
+
queue::BBQueue,
414
+
traits::{coordination::Coord, notifier::maitake::MaiNotSpsc, storage::Inline},
415
+
};
416
+
use defmt::{debug, info, warn};
417
+
use embassy_futures::select::{Either, select};
418
+
use embassy_time::Timer;
419
+
use embassy_usb_0_4::{
420
+
Builder, UsbDevice,
421
+
driver::{Driver, Endpoint, EndpointIn},
422
+
msos::{self, windows_version},
423
+
};
424
+
use static_cell::ConstStaticCell;
425
+
426
+
use crate::interface_manager::interface_impls::embassy_usb::TransmitError;
427
+
428
+
use super::{DEVICE_INTERFACE_GUIDS, ErgotHandler, HDLR, STINDX, UsbDeviceBuffers};
429
+
430
+
/// A helper type for `static` storage of buffers and driver components
431
+
pub struct WireStorage<
432
+
const CONFIG: usize = 256,
433
+
const BOS: usize = 256,
434
+
const CONTROL: usize = 64,
435
+
const MSOS: usize = 256,
436
+
> {
437
+
/// Usb buffer storage
438
+
pub bufs_usb: ConstStaticCell<UsbDeviceBuffers<CONFIG, BOS, CONTROL, MSOS>>,
439
+
}
440
+
441
+
/// Transmitter worker task
442
+
///
443
+
/// Takes a bbqueue from the NetStack of packets to send. While sending,
444
+
/// we will timeout if
445
+
pub async fn tx_worker<'a, D: Driver<'a>, const N: usize, C: Coord>(
446
+
ep_in: &mut D::EndpointIn,
447
+
rx: FramedConsumer<&'static BBQueue<Inline<N>, C, MaiNotSpsc>>,
448
+
timeout_ms_per_frame: usize,
449
+
max_usb_frame_size: usize,
450
+
) {
451
+
assert!(max_usb_frame_size.is_power_of_two());
452
+
info!("Started tx_worker");
453
+
let mut pending = false;
454
+
loop {
455
+
// Wait for the endpoint to be connected...
456
+
ep_in.wait_enabled().await;
457
+
458
+
info!("Endpoint marked connected");
459
+
460
+
'connection: loop {
461
+
// Wait for an outgoing frame
462
+
let frame = rx.wait_read().await;
463
+
464
+
debug!("Got frame to send len {=usize}", frame.len());
465
+
466
+
// Attempt to send it
467
+
let res = send_all::<D>(
468
+
ep_in,
469
+
&frame,
470
+
&mut pending,
471
+
timeout_ms_per_frame,
472
+
max_usb_frame_size,
473
+
)
474
+
.await;
475
+
476
+
// Done with this frame, free the buffer space
477
+
frame.release();
478
+
479
+
match res {
480
+
Ok(()) => {}
481
+
Err(TransmitError::Timeout) => {
482
+
// TODO: treat enough timeouts like a connection closed?
483
+
warn!("Transmit timeout!");
484
+
}
485
+
Err(TransmitError::ConnectionClosed) => break 'connection,
486
+
}
487
+
}
488
+
489
+
// Drain any pending frames - the connection was lost.
490
+
while let Ok(frame) = rx.read() {
491
+
frame.release();
492
+
}
493
+
}
494
+
}
495
+
496
+
#[inline]
497
+
async fn send_all<'a, D>(
498
+
ep_in: &mut D::EndpointIn,
499
+
out: &[u8],
500
+
pending_frame: &mut bool,
501
+
timeout_ms_per_frame: usize,
502
+
max_usb_frame_size: usize,
503
+
) -> Result<(), TransmitError>
504
+
where
505
+
D: Driver<'a>,
506
+
{
507
+
if out.is_empty() {
508
+
return Ok(());
509
+
}
510
+
511
+
// Calculate an estimated timeout based on the number of frames we need to send
512
+
// For now, we use 2ms/frame by default, rounded UP
513
+
let frames = out.len().div_ceil(max_usb_frame_size);
514
+
let timeout_ms = frames * timeout_ms_per_frame;
515
+
516
+
let send_fut = async {
517
+
// If we left off a pending frame, send one now so we don't leave an unterminated
518
+
// message
519
+
if *pending_frame && ep_in.write(&[]).await.is_err() {
520
+
return Err(TransmitError::ConnectionClosed);
521
+
}
522
+
*pending_frame = true;
523
+
524
+
// write in segments of max_usb_frame_size. The last chunk may
525
+
// be 0 < len <= max_usb_frame_size.
526
+
for ch in out.chunks(max_usb_frame_size) {
527
+
if ep_in.write(ch).await.is_err() {
528
+
return Err(TransmitError::ConnectionClosed);
529
+
}
530
+
}
531
+
// If the total we sent was a multiple of max_usb_frame_size, send an
532
+
// empty message to "flush" the transaction. We already checked
533
+
// above that the len != 0.
534
+
if (out.len() & (max_usb_frame_size - 1)) == 0 && ep_in.write(&[]).await.is_err() {
535
+
return Err(TransmitError::ConnectionClosed);
536
+
}
537
+
538
+
*pending_frame = false;
539
+
Ok(())
540
+
};
541
+
542
+
match select(send_fut, Timer::after_millis(timeout_ms as u64)).await {
543
+
Either::First(res) => res,
544
+
Either::Second(()) => Err(TransmitError::Timeout),
545
+
}
546
+
}
547
+
548
+
// impl WireStorage
549
+
550
+
impl<const CONFIG: usize, const BOS: usize, const CONTROL: usize, const MSOS: usize>
551
+
WireStorage<CONFIG, BOS, CONTROL, MSOS>
552
+
{
553
+
/// Create a new, uninitialized static set of buffers
554
+
pub const fn new() -> Self {
555
+
Self {
556
+
bufs_usb: ConstStaticCell::new(UsbDeviceBuffers::new()),
557
+
}
558
+
}
559
+
560
+
/// Initialize the static storage, reporting as ergot compatible
561
+
///
562
+
/// This must only be called once.
563
+
pub fn init_ergot<D: Driver<'static> + 'static>(
564
+
&'static self,
565
+
driver: D,
566
+
config: embassy_usb_0_4::Config<'static>,
567
+
) -> (UsbDevice<'static, D>, D::EndpointIn, D::EndpointOut) {
568
+
let bufs = self.bufs_usb.take();
569
+
570
+
let mut builder = Builder::new(
571
+
driver,
572
+
config,
573
+
&mut bufs.config_descriptor,
574
+
&mut bufs.bos_descriptor,
575
+
&mut bufs.msos_descriptor,
576
+
&mut bufs.control_buf,
577
+
);
578
+
579
+
// Register a ergot-compatible string handler
580
+
let hdlr = HDLR.take();
581
+
builder.handler(hdlr);
582
+
583
+
// Add the Microsoft OS Descriptor (MSOS/MOD) descriptor.
584
+
// We tell Windows that this entire device is compatible with the "WINUSB" feature,
585
+
// which causes it to use the built-in WinUSB driver automatically, which in turn
586
+
// can be used by libusb/rusb software without needing a custom driver or INF file.
587
+
// In principle you might want to call msos_feature() just on a specific function,
588
+
// if your device also has other functions that still use standard class drivers.
589
+
builder.msos_descriptor(windows_version::WIN8_1, 0);
590
+
builder.msos_feature(msos::CompatibleIdFeatureDescriptor::new("WINUSB", ""));
591
+
builder.msos_feature(msos::RegistryPropertyFeatureDescriptor::new(
592
+
"DeviceInterfaceGUIDs",
593
+
msos::PropertyData::RegMultiSz(DEVICE_INTERFACE_GUIDS),
594
+
));
595
+
596
+
// Add a vendor-specific function (class 0xFF), and corresponding interface,
597
+
// that uses our custom handler.
598
+
let mut function = builder.function(0xFF, 0, 0);
599
+
let mut interface = function.interface();
600
+
let stindx = interface.string();
601
+
STINDX.store(stindx.0, Ordering::Relaxed);
602
+
let mut alt = interface.alt_setting(0xFF, 0xCA, 0x7D, Some(stindx));
603
+
let ep_out = alt.endpoint_bulk_out(64);
604
+
let ep_in = alt.endpoint_bulk_in(64);
605
+
drop(function);
606
+
607
+
// Build the builder.
608
+
let usb = builder.build();
609
+
610
+
(usb, ep_in, ep_out)
611
+
}
612
+
613
+
/// Initialize the static storage.
614
+
///
615
+
/// This must only be called once.
616
+
pub fn init<D: Driver<'static> + 'static>(
617
+
&'static self,
618
+
driver: D,
619
+
config: embassy_usb_0_4::Config<'static>,
620
+
) -> (UsbDevice<'static, D>, D::EndpointIn, D::EndpointOut) {
621
+
let (builder, wtx, wrx) = self.init_without_build(driver, config);
622
+
let usb = builder.build();
623
+
(usb, wtx, wrx)
624
+
}
625
+
/// Initialize the static storage, without building `Builder`
626
+
///
627
+
/// This must only be called once.
628
+
pub fn init_without_build<D: Driver<'static> + 'static>(
629
+
&'static self,
630
+
driver: D,
631
+
config: embassy_usb_0_4::Config<'static>,
632
+
) -> (Builder<'static, D>, D::EndpointIn, D::EndpointOut) {
633
+
let bufs = self.bufs_usb.take();
634
+
635
+
let mut builder = Builder::new(
636
+
driver,
637
+
config,
638
+
&mut bufs.config_descriptor,
639
+
&mut bufs.bos_descriptor,
640
+
&mut bufs.msos_descriptor,
641
+
&mut bufs.control_buf,
642
+
);
643
+
644
+
// Add the Microsoft OS Descriptor (MSOS/MOD) descriptor.
645
+
// We tell Windows that this entire device is compatible with the "WINUSB" feature,
646
+
// which causes it to use the built-in WinUSB driver automatically, which in turn
647
+
// can be used by libusb/rusb software without needing a custom driver or INF file.
648
+
// In principle you might want to call msos_feature() just on a specific function,
649
+
// if your device also has other functions that still use standard class drivers.
650
+
builder.msos_descriptor(windows_version::WIN8_1, 0);
651
+
builder.msos_feature(msos::CompatibleIdFeatureDescriptor::new("WINUSB", ""));
652
+
builder.msos_feature(msos::RegistryPropertyFeatureDescriptor::new(
653
+
"DeviceInterfaceGUIDs",
654
+
msos::PropertyData::RegMultiSz(DEVICE_INTERFACE_GUIDS),
655
+
));
656
+
657
+
// Add a vendor-specific function (class 0xFF), and corresponding interface,
658
+
// that uses our custom handler.
659
+
let mut function = builder.function(0xFF, 0, 0);
660
+
let mut interface = function.interface();
661
+
let mut alt = interface.alt_setting(0xFF, 0, 0, None);
662
+
let ep_out = alt.endpoint_bulk_out(64);
663
+
let ep_in = alt.endpoint_bulk_in(64);
664
+
drop(function);
665
+
666
+
(builder, ep_in, ep_out)
667
+
}
668
+
}
669
+
670
+
impl<const CONFIG: usize, const BOS: usize, const CONTROL: usize, const MSOS: usize> Default
671
+
for WireStorage<CONFIG, BOS, CONTROL, MSOS>
672
+
{
673
+
fn default() -> Self {
674
+
Self::new()
675
+
}
676
+
}
677
+
678
+
// impl ErgotHandler
679
+
680
+
impl embassy_usb_0_4::Handler for ErgotHandler {
681
+
fn get_string(
682
+
&mut self,
683
+
index: embassy_usb_0_4::types::StringIndex,
684
+
lang_id: u16,
685
+
) -> Option<&str> {
686
+
use embassy_usb_0_4::descriptor::lang_id;
687
+
688
+
let stindx = STINDX.load(Ordering::Relaxed);
689
+
if stindx == 0xFF {
690
+
return None;
691
+
}
692
+
if lang_id == lang_id::ENGLISH_US && index.0 == stindx {
693
+
Some("ergot")
694
+
} else {
695
+
None
696
+
}
697
+
}
698
+
}
699
+
}
+1
-1
crates/ergot/src/interface_manager/interface_impls/embedded_io.rs
+1
-1
crates/ergot/src/interface_manager/interface_impls/embedded_io.rs
+1
-6
crates/ergot/src/interface_manager/interface_impls/mod.rs
+1
-6
crates/ergot/src/interface_manager/interface_impls/mod.rs
···
5
5
6
6
#[cfg(feature = "tokio-std")]
7
7
pub mod tokio_tcp;
8
-
#[cfg(feature = "tokio-std")]
9
-
pub mod tokio_udp;
10
8
11
9
#[cfg(feature = "tokio-serial-v5")]
12
10
pub mod tokio_serial_cobs;
13
11
14
-
#[cfg(feature = "embassy-usb-v0_5")]
12
+
#[cfg(any(feature = "embassy-usb-v0_4", feature = "embassy-usb-v0_5"))]
15
13
pub mod embassy_usb;
16
-
17
-
#[cfg(feature = "embassy-net-v0_7")]
18
-
pub mod embassy_net_udp;
19
14
20
15
#[cfg(feature = "nusb-v0_1")]
21
16
pub mod nusb_bulk;
+7
-7
crates/ergot/src/interface_manager/interface_impls/nusb_bulk.rs
+7
-7
crates/ergot/src/interface_manager/interface_impls/nusb_bulk.rs
···
12
12
Interface,
13
13
utils::{framed_stream, std::StdQueue},
14
14
};
15
-
use crate::logging::{debug, info, trace, warn};
15
+
use log::{debug, info, trace, warn};
16
16
17
17
/// Interface impl using Nusb Bulk packets
18
18
pub struct NusbBulk {}
···
71
71
let mut devices = match nusb::list_devices() {
72
72
Ok(d) => d,
73
73
Err(e) => {
74
-
warn!("Error listing devices: {:?}", e);
74
+
warn!("Error listing devices: {e:?}");
75
75
return vec![];
76
76
}
77
77
};
···
94
94
let dev = match found.open() {
95
95
Ok(d) => d,
96
96
Err(e) => {
97
-
warn!("Failed opening device: {:?}", e);
97
+
warn!("Failed opening device: {e:?}");
98
98
continue;
99
99
}
100
100
};
101
101
let interface = match dev.claim_interface(interface_id as u8) {
102
102
Ok(i) => i,
103
103
Err(e) => {
104
-
warn!("Failed claiming interface: {:?}", e);
104
+
warn!("Failed claiming interface: {e:?}");
105
105
continue;
106
106
}
107
107
};
···
128
128
}
129
129
130
130
if let Some(max_packet_size) = &mps {
131
-
debug!("Detected max packet size: {}", max_packet_size);
131
+
debug!("Detected max packet size: {max_packet_size}");
132
132
} else {
133
133
warn!("Unable to detect Max Packet Size!");
134
134
};
···
137
137
warn!("Failed to find OUT EP");
138
138
continue;
139
139
};
140
-
debug!("OUT EP: {}", ep_out);
140
+
debug!("OUT EP: {ep_out}");
141
141
142
142
let Some(ep_in) = ep_in else {
143
143
warn!("Failed to find IN EP");
144
144
continue;
145
145
};
146
-
debug!("IN EP: {}", ep_in);
146
+
debug!("IN EP: {ep_in}");
147
147
148
148
let boq = interface.bulk_out_queue(ep_out);
149
149
let biq = interface.bulk_in_queue(ep_in);
-13
crates/ergot/src/interface_manager/interface_impls/tokio_udp.rs
-13
crates/ergot/src/interface_manager/interface_impls/tokio_udp.rs
···
1
-
//! std udp interface impl
2
-
3
-
use crate::interface_manager::{
4
-
Interface,
5
-
utils::{framed_stream, std::StdQueue},
6
-
};
7
-
8
-
/// An interface implementation for UDP using tokio
9
-
pub struct TokioUdpInterface {}
10
-
11
-
impl Interface for TokioUdpInterface {
12
-
type Sink = framed_stream::Sink<StdQueue>;
13
-
}
-7
crates/ergot/src/interface_manager/mod.rs
-7
crates/ergot/src/interface_manager/mod.rs
···
101
101
/// The kind of type that is used to identify a single interface.
102
102
/// If a Profile only supports a single interface, this is often the `()` type.
103
103
/// If a Profile supports many interfaces, this could be an enum or integer type.
104
-
#[cfg(feature = "defmt-v1")]
105
-
type InterfaceIdent: Clone + core::fmt::Debug + defmt::Format;
106
-
#[cfg(not(feature = "defmt-v1"))]
107
104
type InterfaceIdent: Clone + core::fmt::Debug;
108
105
109
106
/// Send a serializable message to the Profile.
···
211
208
}
212
209
213
210
/// An error when deregistering an interface
214
-
#[cfg_attr(feature = "defmt-v1", derive(defmt::Format))]
215
211
#[derive(Debug, PartialEq, Eq)]
216
212
#[non_exhaustive]
217
213
pub enum DeregisterError {
218
214
NoSuchInterface,
219
215
}
220
216
221
-
#[cfg_attr(feature = "defmt-v1", derive(defmt::Format))]
222
217
#[derive(Clone, Copy, Debug, PartialEq)]
223
218
pub enum InterfaceState {
224
219
// Missing sink, no net id
···
231
226
Active { net_id: u16, node_id: u8 },
232
227
}
233
228
234
-
#[cfg_attr(feature = "defmt-v1", derive(defmt::Format))]
235
229
#[derive(Clone, Copy, Debug, PartialEq)]
236
230
#[non_exhaustive]
237
231
pub enum RegisterSinkError {
238
232
AlreadyActive,
239
233
}
240
234
241
-
#[cfg_attr(feature = "defmt-v1", derive(defmt::Format))]
242
235
#[derive(Clone, Copy, Debug, PartialEq)]
243
236
#[non_exhaustive]
244
237
pub enum SetStateError {
-181
crates/ergot/src/interface_manager/profiles/direct_edge/embassy_net_udp_0_7.rs
-181
crates/ergot/src/interface_manager/profiles/direct_edge/embassy_net_udp_0_7.rs
···
1
-
use crate::interface_manager::profiles::direct_edge::{
2
-
CENTRAL_NODE_ID, EDGE_NODE_ID, process_frame,
3
-
};
4
-
use crate::interface_manager::{InterfaceState, Profile};
5
-
use crate::net_stack::NetStackHandle;
6
-
use crate::wire_frames::MAX_HDR_ENCODED_SIZE;
7
-
use bbq2::prod_cons::framed::FramedConsumer;
8
-
use bbq2::queue::BBQueue;
9
-
use bbq2::traits::coordination::Coord;
10
-
use bbq2::traits::notifier::maitake::MaiNotSpsc;
11
-
use bbq2::traits::storage::Inline;
12
-
use defmt::{error, trace};
13
-
use embassy_futures::select::{Either, select};
14
-
use embassy_net_0_7::udp::{RecvError, SendError, UdpMetadata, UdpSocket};
15
-
16
-
pub const UDP_OVER_ETH_ERGOT_FRAME_SIZE_MAX: usize = 1500 - 8 - 20;
17
-
pub const UDP_OVER_ETH_ERGOT_PAYLOAD_SIZE_MAX: usize =
18
-
UDP_OVER_ETH_ERGOT_FRAME_SIZE_MAX - MAX_HDR_ENCODED_SIZE;
19
-
#[derive(Debug, PartialEq)]
20
-
pub struct SocketAlreadyActive;
21
-
22
-
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
23
-
pub enum RxTxError {
24
-
TxError(SendError),
25
-
RxError(RecvError),
26
-
}
27
-
28
-
pub struct RxTxWorker<const NN: usize, N, C>
29
-
where
30
-
N: NetStackHandle,
31
-
C: Coord + 'static,
32
-
{
33
-
nsh: N,
34
-
socket: UdpSocket<'static>,
35
-
net_id: Option<u16>,
36
-
ident: <<N as NetStackHandle>::Profile as Profile>::InterfaceIdent,
37
-
is_controller: bool,
38
-
consumer: FramedConsumer<&'static BBQueue<Inline<NN>, C, MaiNotSpsc>>,
39
-
remote_endpoint: UdpMetadata,
40
-
}
41
-
42
-
impl<const NN: usize, N, C> RxTxWorker<NN, N, C>
43
-
where
44
-
N: NetStackHandle,
45
-
C: Coord,
46
-
{
47
-
pub fn new_target<EP>(
48
-
net: N,
49
-
socket: UdpSocket<'static>,
50
-
ident: <<N as NetStackHandle>::Profile as Profile>::InterfaceIdent,
51
-
consumer: FramedConsumer<&'static BBQueue<Inline<NN>, C, MaiNotSpsc>>,
52
-
remote_endpoint: EP,
53
-
) -> Self
54
-
where
55
-
EP: Into<UdpMetadata>,
56
-
{
57
-
Self {
58
-
nsh: net,
59
-
socket,
60
-
net_id: None,
61
-
ident,
62
-
is_controller: false,
63
-
consumer,
64
-
remote_endpoint: remote_endpoint.into(),
65
-
}
66
-
}
67
-
68
-
pub fn new_controller<EP>(
69
-
net: N,
70
-
socket: UdpSocket<'static>,
71
-
ident: <<N as NetStackHandle>::Profile as Profile>::InterfaceIdent,
72
-
consumer: FramedConsumer<&'static BBQueue<Inline<NN>, C, MaiNotSpsc>>,
73
-
remote_endpoint: EP,
74
-
) -> Self
75
-
where
76
-
EP: Into<UdpMetadata>,
77
-
{
78
-
Self {
79
-
nsh: net,
80
-
socket,
81
-
net_id: None,
82
-
ident,
83
-
is_controller: true,
84
-
consumer,
85
-
remote_endpoint: remote_endpoint.into(),
86
-
}
87
-
}
88
-
89
-
pub async fn run(&mut self, scratch: &mut [u8]) -> Result<(), RxTxError> {
90
-
// Mark the interface as established
91
-
_ = self
92
-
.nsh
93
-
.stack()
94
-
.manage_profile(|im| {
95
-
if self.is_controller {
96
-
trace!("UDP controller is active");
97
-
self.net_id = Some(1);
98
-
im.set_interface_state(
99
-
self.ident.clone(),
100
-
InterfaceState::Active {
101
-
net_id: 1,
102
-
node_id: CENTRAL_NODE_ID,
103
-
},
104
-
)
105
-
} else {
106
-
trace!("UDP target is active");
107
-
self.net_id = Some(1);
108
-
im.set_interface_state(
109
-
self.ident.clone(),
110
-
InterfaceState::Active {
111
-
net_id: 1,
112
-
node_id: EDGE_NODE_ID,
113
-
},
114
-
)
115
-
}
116
-
})
117
-
.inspect_err(|err| error!("Error setting interface state: {:?}", err));
118
-
119
-
let res = self.run_inner(scratch).await;
120
-
_ = self
121
-
.nsh
122
-
.stack()
123
-
.manage_profile(|im| im.set_interface_state(self.ident.clone(), InterfaceState::Down));
124
-
res
125
-
}
126
-
127
-
pub async fn run_inner(&mut self, scratch: &mut [u8]) -> Result<(), RxTxError> {
128
-
let Self {
129
-
nsh,
130
-
socket,
131
-
net_id,
132
-
ident,
133
-
is_controller: _,
134
-
consumer: rx,
135
-
remote_endpoint,
136
-
} = self;
137
-
loop {
138
-
trace!("Waiting for data from socket or tx queue");
139
-
let a = socket.recv_from(scratch);
140
-
let b = rx.wait_read();
141
-
142
-
match select(a, b).await {
143
-
Either::First(recv_result) => {
144
-
trace!("Socket future");
145
-
// TODO compare the metadata.endpoint to self.remote_endpoint and possibly reject
146
-
let (used, metadata) = recv_result.map_err(RxTxError::RxError)?;
147
-
trace!(
148
-
"Received data from socket. used: {}, metadata: {:?}",
149
-
used, metadata
150
-
);
151
-
152
-
let data = &scratch[..used];
153
-
154
-
process_frame(net_id, data, nsh, ident.clone());
155
-
}
156
-
Either::Second(data) => {
157
-
trace!("Tx queue future");
158
-
socket
159
-
.send_to(&data, *remote_endpoint)
160
-
.await
161
-
.map_err(RxTxError::TxError)?;
162
-
trace!("Sent data to socket");
163
-
data.release();
164
-
}
165
-
}
166
-
}
167
-
}
168
-
}
169
-
170
-
impl<const NN: usize, N, C> Drop for RxTxWorker<NN, N, C>
171
-
where
172
-
N: NetStackHandle,
173
-
C: Coord,
174
-
{
175
-
fn drop(&mut self) {
176
-
// No receiver? Drop the interface.
177
-
self.nsh.stack().manage_profile(|im| {
178
-
_ = im.set_interface_state(self.ident.clone(), InterfaceState::Down);
179
-
})
180
-
}
181
-
}
+171
crates/ergot/src/interface_manager/profiles/direct_edge/eusb_0_4.rs
+171
crates/ergot/src/interface_manager/profiles/direct_edge/eusb_0_4.rs
···
1
+
//! A point to point "Edge" profile using USB bulk packets
2
+
//!
3
+
//! This is useful for devices that are directly connected to a PC via USB with
4
+
//! no additional interfaces.
5
+
6
+
use crate::{
7
+
interface_manager::{
8
+
InterfaceState, Profile,
9
+
interface_impls::embassy_usb::EmbassyInterface,
10
+
profiles::direct_edge::{DirectEdge, process_frame},
11
+
},
12
+
net_stack::NetStackHandle,
13
+
};
14
+
use bbq2::traits::bbqhdl::BbqHandle;
15
+
use defmt::info;
16
+
use embassy_usb_0_4::driver::{Driver, Endpoint, EndpointError, EndpointOut};
17
+
18
+
pub type EmbassyUsbManager<Q> = DirectEdge<EmbassyInterface<Q>>;
19
+
20
+
/// The Receive Worker
21
+
///
22
+
/// This manages the receiver operations, as well as manages the connection state.
23
+
///
24
+
/// The `N` const generic buffer is the size of the outgoing buffer.
25
+
pub struct RxWorker<Q, N, D>
26
+
where
27
+
N: NetStackHandle<Profile = EmbassyUsbManager<Q>>,
28
+
Q: BbqHandle + 'static,
29
+
D: Driver<'static>,
30
+
{
31
+
nsh: N,
32
+
rx: D::EndpointOut,
33
+
net_id: Option<u16>,
34
+
}
35
+
36
+
/// Errors observable by the receiver
37
+
enum ReceiverError {
38
+
ReceivedMessageTooLarge,
39
+
ConnectionClosed,
40
+
}
41
+
42
+
// ---- impls ----
43
+
44
+
impl<Q, N, D> RxWorker<Q, N, D>
45
+
where
46
+
N: NetStackHandle<Profile = EmbassyUsbManager<Q>>,
47
+
Q: BbqHandle + 'static,
48
+
D: Driver<'static>,
49
+
{
50
+
/// Create a new receiver object
51
+
pub fn new(stack: N, rx: D::EndpointOut) -> Self {
52
+
Self {
53
+
nsh: stack,
54
+
rx,
55
+
net_id: None,
56
+
}
57
+
}
58
+
59
+
/// Runs forever, processing incoming frames.
60
+
///
61
+
/// The provided slice is used for receiving a frame via USB. It is used as the MTU
62
+
/// for the entire connections.
63
+
///
64
+
/// `max_usb_frame_size` is the largest size of USB frame we can receive. For example,
65
+
/// it would be 64. This is NOT the largest message we can receive. It MUST be a power
66
+
/// of two.
67
+
pub async fn run(mut self, frame: &mut [u8], max_usb_frame_size: usize) -> ! {
68
+
assert!(max_usb_frame_size.is_power_of_two());
69
+
loop {
70
+
self.rx.wait_enabled().await;
71
+
info!("Connection established");
72
+
73
+
// Mark the interface as established
74
+
_ = self
75
+
.nsh
76
+
.stack()
77
+
.manage_profile(|im| im.set_interface_state((), InterfaceState::Inactive));
78
+
79
+
// Handle all frames for the connection
80
+
self.one_conn(frame, max_usb_frame_size).await;
81
+
82
+
// Mark the connection as lost
83
+
info!("Connection lost");
84
+
self.nsh.stack().manage_profile(|im| {
85
+
_ = im.set_interface_state((), InterfaceState::Down);
86
+
});
87
+
}
88
+
}
89
+
90
+
/// Handle all frames, returning when a connection error occurs
91
+
async fn one_conn(&mut self, frame: &mut [u8], max_usb_frame_size: usize) {
92
+
loop {
93
+
match self.one_frame(frame, max_usb_frame_size).await {
94
+
Ok(f) => {
95
+
// NOTE: this is BLOCKING, but does NOT wait for the request to
96
+
// be processed, we just copy the frame into its destination
97
+
// buffers.
98
+
//
99
+
// We COULD potentially gain some throughput by having another
100
+
// buffer here, so we can immediately begin receiving the next
101
+
// frame, at the cost of extra buffer space and copies.
102
+
process_frame(&mut self.net_id, f, &self.nsh, ());
103
+
}
104
+
Err(ReceiverError::ConnectionClosed) => break,
105
+
Err(_e) => {
106
+
continue;
107
+
}
108
+
}
109
+
}
110
+
}
111
+
112
+
/// Receive a single ergot frame, which might be across multiple reads of the endpoint
113
+
///
114
+
/// No checking of the frame is done, only that the bulk endpoint gave us a frame.
115
+
async fn one_frame<'a>(
116
+
&mut self,
117
+
frame: &'a mut [u8],
118
+
max_frame_len: usize,
119
+
) -> Result<&'a mut [u8], ReceiverError> {
120
+
let buflen = frame.len();
121
+
let mut window = &mut frame[..];
122
+
123
+
while !window.is_empty() {
124
+
let n = match self.rx.read(window).await {
125
+
Ok(n) => n,
126
+
Err(EndpointError::BufferOverflow) => {
127
+
return Err(ReceiverError::ReceivedMessageTooLarge);
128
+
}
129
+
Err(EndpointError::Disabled) => return Err(ReceiverError::ConnectionClosed),
130
+
};
131
+
132
+
let (_now, later) = window.split_at_mut(n);
133
+
window = later;
134
+
if n != max_frame_len {
135
+
// We now have a full frame! Great!
136
+
let wlen = window.len();
137
+
let len = buflen - wlen;
138
+
let frame = &mut frame[..len];
139
+
140
+
return Ok(frame);
141
+
}
142
+
}
143
+
144
+
// If we got here, we've run out of space. That's disappointing. Accumulate to the
145
+
// end of this packet
146
+
loop {
147
+
match self.rx.read(frame).await {
148
+
Ok(n) if n == max_frame_len => {}
149
+
Ok(_) => return Err(ReceiverError::ReceivedMessageTooLarge),
150
+
Err(EndpointError::BufferOverflow) => {
151
+
return Err(ReceiverError::ReceivedMessageTooLarge);
152
+
}
153
+
Err(EndpointError::Disabled) => return Err(ReceiverError::ConnectionClosed),
154
+
};
155
+
}
156
+
}
157
+
}
158
+
159
+
impl<Q, N, D> Drop for RxWorker<Q, N, D>
160
+
where
161
+
N: NetStackHandle<Profile = EmbassyUsbManager<Q>>,
162
+
Q: BbqHandle + 'static,
163
+
D: Driver<'static>,
164
+
{
165
+
fn drop(&mut self) {
166
+
// No receiver? Drop the interface.
167
+
self.nsh.stack().manage_profile(|im| {
168
+
_ = im.set_interface_state((), InterfaceState::Down);
169
+
})
170
+
}
171
+
}
+1
-1
crates/ergot/src/interface_manager/profiles/direct_edge/eusb_0_5.rs
+1
-1
crates/ergot/src/interface_manager/profiles/direct_edge/eusb_0_5.rs
···
3
3
//! This is useful for devices that are directly connected to a PC via USB with
4
4
//! no additional interfaces.
5
5
6
-
use crate::logging::info;
7
6
use crate::{
8
7
interface_manager::{
9
8
InterfaceState, Profile,
···
13
12
net_stack::NetStackHandle,
14
13
};
15
14
use bbq2::traits::bbqhdl::BbqHandle;
15
+
use defmt::info;
16
16
use embassy_usb_0_5::driver::{Driver, Endpoint, EndpointError, EndpointOut};
17
17
18
18
pub type EmbassyUsbManager<Q> = DirectEdge<EmbassyInterface<Q>>;
+8
-12
crates/ergot/src/interface_manager/profiles/direct_edge/mod.rs
+8
-12
crates/ergot/src/interface_manager/profiles/direct_edge/mod.rs
···
10
10
//! any outgoing packets, rather than trying to determine whether that packet is
11
11
//! actually routable to a node on the network.
12
12
13
-
use crate::logging::{debug, trace, warn};
14
-
13
+
use log::{debug, trace, warn};
15
14
use serde::Serialize;
16
15
17
16
#[cfg(feature = "embedded-io-async-v0_6")]
18
17
pub mod eio_0_6;
18
+
19
+
#[cfg(feature = "embassy-usb-v0_4")]
20
+
pub mod eusb_0_4;
19
21
20
22
#[cfg(feature = "embassy-usb-v0_5")]
21
23
pub mod eusb_0_5;
22
24
23
25
#[cfg(feature = "tokio-std")]
24
26
pub mod tokio_tcp;
25
-
26
-
#[cfg(feature = "tokio-std")]
27
-
pub mod tokio_udp;
28
-
29
-
#[cfg(feature = "embassy-net-v0_7")]
30
-
pub mod embassy_net_udp_0_7;
31
27
32
28
use crate::{
33
29
Header, HeaderSeq, ProtocolError,
···
84
80
) -> Result<(&'b mut I::Sink, HeaderSeq), InterfaceSendError> {
85
81
let net_id = match &self.state {
86
82
InterfaceState::Down => {
87
-
trace!("{}: ignoring send, interface down", hdr);
83
+
trace!("{hdr}: ignoring send, interface down");
88
84
return Err(InterfaceSendError::NoRouteToDest);
89
85
}
90
86
InterfaceState::Inactive => {
91
-
trace!("{}: ignoring send, interface inactive", hdr);
87
+
trace!("{hdr}: ignoring send, interface inactive");
92
88
return Err(InterfaceSendError::NoRouteToDest);
93
89
}
94
90
InterfaceState::ActiveLocal { .. } => {
95
91
// TODO: maybe also handle this?
96
-
trace!("{}: ignoring send, interface local only", hdr);
92
+
trace!("{hdr}: ignoring send, interface local only");
97
93
return Err(InterfaceSendError::NoRouteToDest);
98
94
}
99
95
InterfaceState::Active { net_id, node_id: _ } => *net_id,
100
96
};
101
97
102
-
trace!("{}: common_send", hdr);
98
+
trace!("{hdr}: common_send");
103
99
104
100
if net_id == 0 {
105
101
debug!("Attempted to send via interface before we have been assigned a net ID");
+2
-2
crates/ergot/src/interface_manager/profiles/direct_edge/tokio_tcp.rs
+2
-2
crates/ergot/src/interface_manager/profiles/direct_edge/tokio_tcp.rs
···
18
18
net_stack::NetStackHandle,
19
19
};
20
20
21
-
use crate::logging::{error, info, trace, warn};
22
21
use bbq2::{prod_cons::stream::StreamConsumer, traits::bbqhdl::BbqHandle};
22
+
use log::{error, info, trace, warn};
23
23
use maitake_sync::WaitQueue;
24
24
use tokio::{
25
25
io::{AsyncReadExt, AsyncWriteExt},
···
158
158
let res = tx.write_all(&frame).await;
159
159
frame.release(len);
160
160
if let Err(e) = res {
161
-
error!("Err: {:?}", e);
161
+
error!("Err: {e:?}");
162
162
break;
163
163
}
164
164
}
-190
crates/ergot/src/interface_manager/profiles/direct_edge/tokio_udp.rs
-190
crates/ergot/src/interface_manager/profiles/direct_edge/tokio_udp.rs
···
1
-
//! A std+udp edge device profile
2
-
//!
3
-
//! This is useful for std based devices/applications that can directly connect to a DirectRouter
4
-
//! using a udp connection.
5
-
6
-
use std::sync::Arc;
7
-
8
-
use crate::{
9
-
interface_manager::{
10
-
InterfaceState, Profile,
11
-
interface_impls::tokio_udp::TokioUdpInterface,
12
-
profiles::direct_edge::{DirectEdge, process_frame},
13
-
utils::std::{ReceiverError, StdQueue},
14
-
},
15
-
net_stack::NetStackHandle,
16
-
};
17
-
18
-
use crate::interface_manager::profiles::direct_edge::{CENTRAL_NODE_ID, EDGE_NODE_ID};
19
-
use crate::logging::{error, info, trace, warn};
20
-
use bbq2::prod_cons::framed::FramedConsumer;
21
-
use bbq2::traits::bbqhdl::BbqHandle;
22
-
use maitake_sync::WaitQueue;
23
-
use tokio::{net::UdpSocket, select};
24
-
25
-
pub type StdUdpClientIm = DirectEdge<TokioUdpInterface>;
26
-
27
-
pub struct RxWorker<N: NetStackHandle> {
28
-
stack: N,
29
-
skt: Arc<UdpSocket>,
30
-
closer: Arc<WaitQueue>,
31
-
net_id: u16,
32
-
}
33
-
34
-
// ---- impls ----
35
-
36
-
impl<N> RxWorker<N>
37
-
where
38
-
N: NetStackHandle<Profile = DirectEdge<TokioUdpInterface>>,
39
-
{
40
-
pub async fn run(mut self) -> Result<(), ReceiverError> {
41
-
info!("Started rx_worker");
42
-
43
-
let res = self.run_inner().await;
44
-
45
-
info!("Finished rx_worker");
46
-
47
-
self.stack.stack().manage_profile(|im| {
48
-
_ = im.set_interface_state((), InterfaceState::Down);
49
-
});
50
-
res
51
-
}
52
-
53
-
pub async fn run_inner(&mut self) -> Result<(), ReceiverError> {
54
-
let mut raw_buf = [0u8; 4096];
55
-
let mut net_id = Some(self.net_id);
56
-
57
-
loop {
58
-
let rd = self.skt.recv_from(&mut raw_buf);
59
-
let close = self.closer.wait();
60
-
61
-
let ct = select! {
62
-
r = rd => {
63
-
match r {
64
-
Ok((0, _)) => {
65
-
warn!("received nothing, retrying");
66
-
continue
67
-
},
68
-
Err(e) => {
69
-
warn!("receiver error, retrying. error: {}", e);
70
-
continue
71
-
//return Err(ReceiverError::SocketClosed)
72
-
},
73
-
Ok((ct, remote_address)) => {
74
-
// TODO ensure the remote address is allowed to connect to this edge
75
-
// this implementation blindly accepts all connections
76
-
trace!("received {} bytes from {}", ct, remote_address);
77
-
ct
78
-
},
79
-
}
80
-
}
81
-
_c = close => {
82
-
return Err(ReceiverError::SocketClosed);
83
-
}
84
-
};
85
-
86
-
let buf = &mut raw_buf[..ct];
87
-
process_frame(&mut net_id, buf, &self.stack, ());
88
-
}
89
-
}
90
-
}
91
-
92
-
#[derive(Debug, PartialEq)]
93
-
pub struct SocketAlreadyActive;
94
-
95
-
// Helper functions
96
-
97
-
pub enum InterfaceKind {
98
-
Target,
99
-
Controller,
100
-
}
101
-
102
-
pub async fn register_interface<N>(
103
-
stack: N,
104
-
socket: UdpSocket,
105
-
queue: StdQueue,
106
-
interface_kind: InterfaceKind,
107
-
ident: <<N as NetStackHandle>::Profile as Profile>::InterfaceIdent,
108
-
) -> Result<(), SocketAlreadyActive>
109
-
where
110
-
N: NetStackHandle<Profile = DirectEdge<TokioUdpInterface>>,
111
-
N: Send + 'static,
112
-
{
113
-
let arc_socket = Arc::new(socket);
114
-
let (rx, tx) = (arc_socket.clone(), arc_socket);
115
-
116
-
let net_id = 1_u16;
117
-
118
-
let closer = Arc::new(WaitQueue::new());
119
-
stack.stack().manage_profile(|im| {
120
-
match im.interface_state(()) {
121
-
Some(InterfaceState::Down) => {}
122
-
Some(InterfaceState::Inactive) => return Err(SocketAlreadyActive),
123
-
Some(InterfaceState::ActiveLocal { .. }) => return Err(SocketAlreadyActive),
124
-
Some(InterfaceState::Active { .. }) => return Err(SocketAlreadyActive),
125
-
None => {}
126
-
}
127
-
128
-
match interface_kind {
129
-
InterfaceKind::Controller => {
130
-
trace!("UDP controller is active");
131
-
im.set_interface_state(
132
-
ident,
133
-
InterfaceState::Active {
134
-
net_id,
135
-
node_id: CENTRAL_NODE_ID,
136
-
},
137
-
)
138
-
}
139
-
InterfaceKind::Target => {
140
-
trace!("UDP target is active");
141
-
im.set_interface_state(
142
-
ident,
143
-
InterfaceState::Active {
144
-
net_id,
145
-
node_id: EDGE_NODE_ID,
146
-
},
147
-
)
148
-
}
149
-
}
150
-
.map_err(|_| SocketAlreadyActive)?;
151
-
152
-
Ok(())
153
-
})?;
154
-
let rx_worker = RxWorker {
155
-
stack,
156
-
skt: rx,
157
-
closer: closer.clone(),
158
-
net_id,
159
-
};
160
-
// TODO: spawning in a non-async context!
161
-
tokio::task::spawn(tx_worker(tx, queue.framed_consumer(), closer.clone()));
162
-
tokio::task::spawn(rx_worker.run());
163
-
Ok(())
164
-
}
165
-
166
-
async fn tx_worker(tx: Arc<UdpSocket>, rx: FramedConsumer<StdQueue>, closer: Arc<WaitQueue>) {
167
-
info!("Started tx_worker");
168
-
loop {
169
-
let rxf = rx.wait_read();
170
-
let clf = closer.wait();
171
-
172
-
let frame = select! {
173
-
r = rxf => r,
174
-
_c = clf => {
175
-
break;
176
-
}
177
-
};
178
-
179
-
let len = frame.len();
180
-
trace!("sending pkt len:{}", len);
181
-
let res = tx.send(&frame).await;
182
-
frame.release();
183
-
if let Err(e) = res {
184
-
error!("Err: {e:?}");
185
-
break;
186
-
}
187
-
}
188
-
// TODO: GC waker?
189
-
warn!("Closing interface");
190
-
}
+24
-46
crates/ergot/src/interface_manager/profiles/direct_router/mod.rs
+24
-46
crates/ergot/src/interface_manager/profiles/direct_router/mod.rs
···
5
5
//! as well as messages to/from itself and an edge device. It does not currently handle
6
6
//! multi-hop routing.
7
7
8
-
#[cfg(all(feature = "embassy-net-v0_7", not(feature = "_all-features-hack")))]
9
-
use embassy_time::Duration;
10
-
#[cfg(all(feature = "embassy-net-v0_7", not(feature = "_all-features-hack")))]
11
-
use embassy_time::Instant;
12
-
#[cfg(any(feature = "std", feature = "_all-features-hack"))]
13
-
use std::time::{Duration, Instant};
14
-
15
-
#[cfg(feature = "std")]
16
-
use std::collections::{BTreeMap, HashMap};
8
+
use core::time::Duration;
9
+
use std::{
10
+
collections::{BTreeMap, HashMap},
11
+
time::Instant,
12
+
};
17
13
18
-
use crate::logging::{debug, info, trace, warn};
19
-
#[cfg(feature = "std")]
14
+
use log::{debug, info, trace, warn};
20
15
use rand::Rng;
21
16
22
17
use crate::{
···
32
27
33
28
use super::direct_edge::EDGE_NODE_ID;
34
29
35
-
#[cfg(feature = "tokio-std")]
36
30
pub mod tokio_tcp;
37
-
#[cfg(feature = "tokio-std")]
38
-
pub mod tokio_udp;
39
31
40
32
#[cfg(feature = "nusb-v0_1")]
41
33
pub mod nusb_0_1;
···
164
156
if hdr.any_all.is_none() {
165
157
return Err(InterfaceSendError::AnyPortMissingKey);
166
158
}
167
-
if self.direct_links.is_empty() {
168
-
return Err(InterfaceSendError::NoRouteToDest);
169
-
}
170
-
171
-
// use this error until we find a non-origin destination
172
-
let mut default_error = InterfaceSendError::RoutingLoop;
173
-
174
159
let mut any_good = false;
175
160
for (_ident, p) in self.direct_links.iter_mut() {
176
161
// Don't send back to the origin
177
162
if source == p.ident {
178
163
continue;
179
164
}
180
-
// if there's a non-origin destination, and we can't send to it, then use this error
181
-
default_error = InterfaceSendError::NoRouteToDest;
182
165
183
166
// For broadcast messages, rewrite the destination address
184
167
// to the address of the next hop.
···
186
169
hdr.dst.node_id = EDGE_NODE_ID;
187
170
any_good |= p.edge.send_raw(&hdr, data).is_ok();
188
171
}
189
-
if any_good { Ok(()) } else { Err(default_error) }
172
+
if any_good {
173
+
Ok(())
174
+
} else {
175
+
Err(InterfaceSendError::NoRouteToDest)
176
+
}
190
177
} else {
191
178
let nshdr = hdr.clone().into();
192
179
let intfc = self.find(&nshdr, Some(source))?;
···
277
264
let now = Instant::now();
278
265
// Are we ALREADY expired?
279
266
if *expiration_time <= now {
280
-
warn!("Tombstoning net_id: {}", req_refresh_net);
267
+
warn!("Tombstoning net_id: {req_refresh_net}");
281
268
rte.kind = RouteKind::Tombstone {
282
269
clear_time: now + Duration::from_secs(30),
283
270
};
···
418
405
} => {
419
406
// If a route has expired, mark it tombstoned to avoid re-using it for a bit
420
407
if expiration_time <= now {
421
-
warn!("Tombstoning net_id: {}", net_id);
408
+
warn!("Tombstoning net_id: {net_id}");
422
409
rte.kind = RouteKind::Tombstone {
423
410
clear_time: now + Duration::from_secs(30),
424
411
};
···
427
414
RouteKind::Tombstone { clear_time } => {
428
415
// If we've cleared the tombstone time, then re-use this net id
429
416
if clear_time <= now {
430
-
info!("Reclaiming tombstoned net_id: {}", net_id);
417
+
info!("Reclaiming tombstoned net_id: {net_id}");
431
418
to_evict = Some(*net_id);
432
419
break;
433
420
}
434
421
}
435
422
}
436
423
if *net_id > new_net_id {
437
-
trace!("Found gap: {}", net_id);
424
+
trace!("Found gap: {net_id}");
438
425
break;
439
426
}
440
427
debug_assert!(*net_id == new_net_id);
···
489
476
};
490
477
if let Some(rte) = self.routes.remove(&node.net_id) {
491
478
debug!(
492
-
"removing interface with net_id: {}, ident: {:?}",
493
-
node.net_id, ident,
479
+
"removing interface with net_id: {}, ident: {ident:?}",
480
+
node.net_id
494
481
);
495
482
assert!(matches!(rte.kind, RouteKind::DirectAssigned));
496
483
} else {
···
500
487
self.routes.retain(|net_id, rte| {
501
488
let keep = rte.ident != ident;
502
489
if !keep {
503
-
debug!(
504
-
"removing indirect route with net_id: {}, ident: {:?}",
505
-
net_id, ident
506
-
)
490
+
debug!("removing indirect route with net_id: {net_id}, ident: {ident:?}")
507
491
}
508
492
keep
509
493
});
···
540
524
// Successfully received a packet, now we need to
541
525
// do something with it.
542
526
if let Some(mut frame) = de_frame(data) {
543
-
trace!("{} got frame from {:?}", frame.hdr, ident);
527
+
trace!("{} got frame from {ident:?}", frame.hdr);
544
528
// If the message comes in and has a src net_id of zero,
545
529
// we should rewrite it so it isn't later understood as a
546
530
// local packet.
547
531
if frame.hdr.src.network_id == 0 {
548
532
match frame.hdr.src.node_id {
549
533
0 => {
550
-
log::warn!(
551
-
"{}: device is sending us frames without a node id, ignoring",
552
-
frame.hdr
553
-
);
534
+
log::warn!("{}: device is sending us frames without a node id, ignoring", frame.hdr);
554
535
return;
555
536
}
556
537
CENTRAL_NODE_ID => {
···
559
540
}
560
541
EDGE_NODE_ID => {}
561
542
_ => {
562
-
log::warn!(
563
-
"{}: device is sending us frames with a bad node id, ignoring",
564
-
frame.hdr
565
-
);
543
+
log::warn!("{}: device is sending us frames with a bad node id, ignoring", frame.hdr);
566
544
return;
567
545
}
568
546
}
···
585
563
Ok(()) => {}
586
564
Err(e) => {
587
565
// TODO: match on error, potentially try to send NAK?
588
-
warn!("{} recv->send error: {:?}", frame.hdr, e);
566
+
warn!("{} recv->send error: {e:?}", frame.hdr);
589
567
}
590
568
}
591
569
} else {
···
594
572
}
595
573
596
574
mod edge_interface_plus {
597
-
use crate::logging::trace;
575
+
use log::trace;
598
576
use serde::Serialize;
599
577
600
578
use crate::{
···
642
620
InterfaceState::Active { net_id, node_id: _ } => *net_id,
643
621
};
644
622
645
-
trace!("{} common_send", hdr);
623
+
trace!("{hdr} common_send");
646
624
647
625
// TODO: when this WAS a real Profile, we did a lot of these things, but
648
626
// now they should be done by the router. For now, we just have asserts,
+9
-9
crates/ergot/src/interface_manager/profiles/direct_router/nusb_0_1.rs
+9
-9
crates/ergot/src/interface_manager/profiles/direct_router/nusb_0_1.rs
···
2
2
//!
3
3
//! This implementation can be used to connect to a number of direct edge USB devices.
4
4
5
-
use crate::logging::{debug, error, info, trace, warn};
6
5
use bbq2::{prod_cons::framed::FramedConsumer, traits::bbqhdl::BbqHandle};
6
+
use log::{debug, error, info, trace, warn};
7
7
use maitake_sync::WaitQueue;
8
8
use nusb::transfer::{Queue, RequestBuffer, TransferError};
9
9
use std::sync::Arc;
···
92
92
93
93
let send_res = self.boq.next_complete().await;
94
94
if let Err(e) = send_res.status {
95
-
error!("Output Queue Error: {:?}", e);
95
+
error!("Output Queue Error: {e:?}");
96
96
return;
97
97
}
98
98
99
99
if needs_zlp {
100
100
let send_res = self.boq.next_complete().await;
101
101
if let Err(e) = send_res.status {
102
-
error!("Output Queue Error: {:?}", e);
102
+
error!("Output Queue Error: {e:?}");
103
103
return;
104
104
}
105
105
}
···
123
123
run = self.run_inner() => {
124
124
// Halt the TX worker
125
125
self.closer.close();
126
-
error!("Receive Error: {:?}", run);
126
+
error!("Receive Error: {run:?}");
127
127
},
128
128
_clf = close.wait() => {},
129
129
}
···
148
148
self.consecutive_errs += 1;
149
149
150
150
error!(
151
-
"In Worker error: {:?}, consecutive: {}",
152
-
e, self.consecutive_errs,
151
+
"In Worker error: {e:?}, consecutive: {}",
152
+
self.consecutive_errs
153
153
);
154
154
155
155
// Docs only recommend this for Stall, but it seems to work with
···
187
187
match self.biq.clear_halt() {
188
188
Ok(()) => false,
189
189
Err(e) => {
190
-
error!("Failed to clear stall: {:?}, Fatal.", e);
190
+
error!("Failed to clear stall: {e:?}, Fatal.");
191
191
true
192
192
}
193
193
}
194
194
} else {
195
195
error!(
196
-
"Giving up after {} errors in a row, final error: {:?}",
197
-
e, self.consecutive_errs,
196
+
"Giving up after {} errors in a row, final error: {e:?}",
197
+
self.consecutive_errs
198
198
);
199
199
true
200
200
};
+4
-4
crates/ergot/src/interface_manager/profiles/direct_router/tokio_serial_5.rs
+4
-4
crates/ergot/src/interface_manager/profiles/direct_router/tokio_serial_5.rs
···
2
2
//!
3
3
//! This implementation can be used to connect to a number of direct edge serial devices.
4
4
5
-
use crate::logging::{debug, error, info, warn};
6
5
use crate::{
7
6
interface_manager::{
8
7
InterfaceState, Profile,
···
21
20
};
22
21
use bbq2::{prod_cons::stream::StreamConsumer, traits::bbqhdl::BbqHandle};
23
22
use cobs::max_encoding_overhead;
23
+
use log::{debug, error, info, warn};
24
24
use maitake_sync::WaitQueue;
25
25
use std::sync::Arc;
26
26
use tokio::{
···
80
80
let res = self.tx.write_all(&frame).await;
81
81
frame.release(len);
82
82
if let Err(e) = res {
83
-
error!("Err: {:?}", e);
83
+
error!("Err: {e:?}");
84
84
break;
85
85
}
86
86
}
···
101
101
run = self.run_inner() => {
102
102
// Halt the TX worker
103
103
self.closer.close();
104
-
error!("Receive Error: {:?}", run);
104
+
error!("Receive Error: {run:?}");
105
105
},
106
106
_clf = close.wait() => {},
107
107
}
···
168
168
{
169
169
let port = tokio_serial_v5::new(serial_path, baud)
170
170
.open_native_async()
171
-
.map_err(|e| Error::Serial(format!("Open Error: {:?}", e)))?;
171
+
.map_err(|e| Error::Serial(format!("Open Error: {e:?}")))?;
172
172
let (rx, tx) = tokio::io::split(port);
173
173
let q: StdQueue = new_std_queue(outgoing_buffer_size);
174
174
let res = stack.stack().manage_profile(|im| {
+3
-3
crates/ergot/src/interface_manager/profiles/direct_router/tokio_tcp.rs
+3
-3
crates/ergot/src/interface_manager/profiles/direct_router/tokio_tcp.rs
···
2
2
//!
3
3
//! This implementation can be used to connect to a number of direct edge TCP devices.
4
4
5
-
use crate::logging::{debug, error, info, warn};
6
5
use bbq2::{prod_cons::stream::StreamConsumer, traits::bbqhdl::BbqHandle};
7
6
use cobs::max_encoding_overhead;
7
+
use log::{debug, error, info, warn};
8
8
use maitake_sync::WaitQueue;
9
9
use std::sync::Arc;
10
10
use tokio::{
···
83
83
let res = self.tx.write_all(&frame).await;
84
84
frame.release(len);
85
85
if let Err(e) = res {
86
-
error!("Err: {:?}", e);
86
+
error!("Err: {e:?}");
87
87
break;
88
88
}
89
89
}
···
104
104
run = self.run_inner() => {
105
105
// Halt the TX worker
106
106
self.closer.close();
107
-
error!("Receive Error: {:?}", run);
107
+
error!("Receive Error: {run:?}");
108
108
},
109
109
_clf = close.wait() => {},
110
110
}
-190
crates/ergot/src/interface_manager/profiles/direct_router/tokio_udp.rs
-190
crates/ergot/src/interface_manager/profiles/direct_router/tokio_udp.rs
···
1
-
//! A UDP based DirectRouter
2
-
//!
3
-
//! This implementation can be used to connect to a number of direct edge UDP devices.
4
-
5
-
use crate::logging::{debug, error, info, trace, warn};
6
-
use bbq2::{prod_cons::framed::FramedConsumer, traits::bbqhdl::BbqHandle};
7
-
use maitake_sync::WaitQueue;
8
-
use std::sync::Arc;
9
-
use tokio::{net::UdpSocket, select};
10
-
11
-
use crate::{
12
-
interface_manager::{
13
-
InterfaceState, Profile,
14
-
interface_impls::tokio_udp::TokioUdpInterface,
15
-
profiles::direct_router::{DirectRouter, process_frame},
16
-
utils::{
17
-
framed_stream::Sink,
18
-
std::{ReceiverError, StdQueue, new_std_queue},
19
-
},
20
-
},
21
-
net_stack::NetStackHandle,
22
-
};
23
-
24
-
#[derive(Debug, PartialEq)]
25
-
pub enum Error {
26
-
OutOfNetIds,
27
-
}
28
-
29
-
struct TxWorker {
30
-
net_id: u16,
31
-
tx: Arc<UdpSocket>,
32
-
rx: FramedConsumer<StdQueue>,
33
-
closer: Arc<WaitQueue>,
34
-
}
35
-
36
-
struct RxWorker<N>
37
-
where
38
-
N: NetStackHandle<Profile = DirectRouter<TokioUdpInterface>>,
39
-
N: Send + 'static,
40
-
{
41
-
interface_id: u64,
42
-
net_id: u16,
43
-
nsh: N,
44
-
skt: Arc<UdpSocket>,
45
-
closer: Arc<WaitQueue>,
46
-
}
47
-
48
-
impl TxWorker {
49
-
async fn run(mut self) {
50
-
self.run_inner().await;
51
-
warn!("Closing interface {}", self.net_id);
52
-
self.closer.close();
53
-
}
54
-
55
-
async fn run_inner(&mut self) {
56
-
info!("Started tx_worker for net_id {}", self.net_id);
57
-
loop {
58
-
let rxf = self.rx.wait_read();
59
-
let clf = self.closer.wait();
60
-
61
-
let frame = select! {
62
-
r = rxf => r,
63
-
_c = clf => {
64
-
break;
65
-
}
66
-
};
67
-
68
-
let len = frame.len();
69
-
debug!("sending pkt len:{} on net_id {}", len, self.net_id);
70
-
let res = self.tx.send(&frame).await;
71
-
frame.release();
72
-
if let Err(e) = res {
73
-
error!("Err: {e:?}");
74
-
break;
75
-
}
76
-
}
77
-
}
78
-
}
79
-
80
-
impl<N> RxWorker<N>
81
-
where
82
-
N: NetStackHandle<Profile = DirectRouter<TokioUdpInterface>>,
83
-
N: Send + 'static,
84
-
{
85
-
async fn run(mut self) {
86
-
let close = self.closer.clone();
87
-
88
-
// Wait for the receiver to encounter an error, or wait for
89
-
// the transmitter to signal that it observed an error
90
-
select! {
91
-
run = self.run_inner() => {
92
-
// Halt the TX worker
93
-
self.closer.close();
94
-
error!("Receive Error: {run:?}");
95
-
},
96
-
_clf = close.wait() => {},
97
-
}
98
-
99
-
// Remove this interface from the list
100
-
self.nsh.stack().manage_profile(|im| {
101
-
_ = im.deregister_interface(self.interface_id);
102
-
});
103
-
}
104
-
105
-
pub async fn run_inner(&mut self) -> ReceiverError {
106
-
let mut raw_buf = vec![0u8; 4096].into_boxed_slice();
107
-
108
-
loop {
109
-
let rd = self.skt.recv_from(&mut raw_buf);
110
-
let close = self.closer.wait();
111
-
112
-
let ct = select! {
113
-
r = rd => {
114
-
match r {
115
-
Ok((0, _)) => {
116
-
warn!("received nothing, retrying");
117
-
continue
118
-
},
119
-
Err(e) => {
120
-
warn!("receiver error, retrying. error: {}, kind: {}", e, e.kind());
121
-
continue
122
-
},
123
-
Ok((ct, remote_address)) => {
124
-
// TODO ensure the remote address is allowed to connect to this router
125
-
// this implementation blindly accepts all connections
126
-
trace!("received {} bytes from {}", ct, remote_address);
127
-
ct
128
-
},
129
-
}
130
-
}
131
-
_c = close => {
132
-
return ReceiverError::SocketClosed;
133
-
}
134
-
};
135
-
136
-
let buf = &mut raw_buf[..ct];
137
-
process_frame(self.net_id, buf, &self.nsh, self.interface_id);
138
-
}
139
-
}
140
-
}
141
-
142
-
pub async fn register_interface<N>(
143
-
stack: N,
144
-
socket: UdpSocket,
145
-
max_ergot_packet_size: u16,
146
-
outgoing_buffer_size: usize,
147
-
) -> Result<u64, Error>
148
-
where
149
-
N: NetStackHandle<Profile = DirectRouter<TokioUdpInterface>>,
150
-
N: Send + 'static,
151
-
{
152
-
let arc_socket = Arc::new(socket);
153
-
let (rx, tx) = (arc_socket.clone(), arc_socket);
154
-
155
-
let q: StdQueue = new_std_queue(outgoing_buffer_size);
156
-
let res = stack.stack().manage_profile(|im| {
157
-
let ident =
158
-
im.register_interface(Sink::new_from_handle(q.clone(), max_ergot_packet_size))?;
159
-
let state = im.interface_state(ident)?;
160
-
match state {
161
-
InterfaceState::Active { net_id, node_id: _ } => Some((ident, net_id)),
162
-
_ => {
163
-
_ = im.deregister_interface(ident);
164
-
None
165
-
}
166
-
}
167
-
});
168
-
let Some((ident, net_id)) = res else {
169
-
return Err(Error::OutOfNetIds);
170
-
};
171
-
let closer = Arc::new(WaitQueue::new());
172
-
let rx_worker = RxWorker {
173
-
nsh: stack.clone(),
174
-
skt: rx,
175
-
closer: closer.clone(),
176
-
interface_id: ident,
177
-
net_id,
178
-
};
179
-
let tx_worker = TxWorker {
180
-
net_id,
181
-
tx,
182
-
rx: <StdQueue as BbqHandle>::framed_consumer(&q),
183
-
closer,
184
-
};
185
-
186
-
tokio::task::spawn(rx_worker.run());
187
-
tokio::task::spawn(tx_worker.run());
188
-
189
-
Ok(ident)
190
-
}
+5
-6
crates/ergot/src/lib.rs
+5
-6
crates/ergot/src/lib.rs
···
20
20
// Compat hack, remove on next breaking change
21
21
pub use logging::fmtlog;
22
22
23
-
use crate::logging::warn;
24
23
pub use address::Address;
25
24
use interface_manager::InterfaceSendError;
25
+
use log::warn;
26
26
use nash::NameHash;
27
27
pub use net_stack::{NetStack, NetStackSendError};
28
28
use serde::{Deserialize, Serialize};
29
29
30
30
#[cfg_attr(feature = "defmt-v1", derive(defmt::Format))]
31
-
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Eq)]
31
+
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
32
32
pub struct FrameKind(pub u8);
33
33
34
34
#[cfg_attr(feature = "defmt-v1", derive(defmt::Format))]
···
56
56
pub ttl: u8,
57
57
}
58
58
59
-
#[cfg_attr(feature = "defmt-v1", derive(defmt::Format))]
60
59
#[derive(Debug, Clone)]
61
60
pub struct HeaderSeq {
62
61
pub src: Address,
···
75
74
self.src, self.dst, self.kind.0,
76
75
)?;
77
76
if let Some(seq) = self.seq_no {
78
-
write!(f, "{:04X}", seq)?;
77
+
write!(f, "{seq:04X}")?;
79
78
} else {
80
79
f.write_str("----")?;
81
80
}
···
179
178
#[inline]
180
179
pub fn decrement_ttl(&mut self) -> Result<(), InterfaceSendError> {
181
180
self.ttl = self.ttl.checked_sub(1).ok_or_else(|| {
182
-
warn!("Header TTL expired: {:?}", self);
181
+
warn!("Header TTL expired: {self:?}");
183
182
InterfaceSendError::TtlExpired
184
183
})?;
185
184
Ok(())
···
190
189
#[inline]
191
190
pub fn decrement_ttl(&mut self) -> Result<(), InterfaceSendError> {
192
191
self.ttl = self.ttl.checked_sub(1).ok_or_else(|| {
193
-
warn!("Header TTL expired: {:?}", self);
192
+
warn!("Header TTL expired: {self:?}");
194
193
InterfaceSendError::TtlExpired
195
194
})?;
196
195
Ok(())
+1
-1
crates/ergot/src/logging/fmtlog.rs
+1
-1
crates/ergot/src/logging/fmtlog.rs
-83
crates/ergot/src/logging/mod.rs
-83
crates/ergot/src/logging/mod.rs
···
1
-
//! Here we make logging macros available.
2
-
//! Based on features we either export defmt macros or log wrapper macros.
3
-
4
1
pub mod fmtlog;
5
2
pub mod log_v0_4;
6
-
7
-
// conditional logging re-exports
8
-
9
-
#[allow(unused_imports)]
10
-
#[cfg(all(feature = "defmt-v1", not(feature = "std")))]
11
-
pub(crate) use defmt::{debug, error, info, trace, warn};
12
-
13
-
/// Wrapper macro for log::debug that uses the internal ergot logger.
14
-
#[clippy::format_args]
15
-
#[cfg(not(all(feature = "defmt-v1", not(feature = "std"))))]
16
-
macro_rules! debug {
17
-
// debug!(target: "my_target", key1 = 42, key2 = true; "a {} event", "log")
18
-
// debug!(target: "my_target", "a {} event", "log")
19
-
(target: $target:expr, $($arg:tt)+) => ({
20
-
log::debug!(logger: $crate::logging::log_v0_4::internal::geil(), target: $target, $($arg)+)
21
-
});
22
-
23
-
// debug!("a {} event", "log")
24
-
($($arg:tt)+) => (log::debug!(logger: $crate::logging::log_v0_4::internal::geil(), $($arg)+))
25
-
}
26
-
27
-
/// Wrapper macro for log::error that uses the internal ergot logger.
28
-
#[clippy::format_args]
29
-
#[cfg(not(all(feature = "defmt-v1", not(feature = "std"))))]
30
-
macro_rules! error {
31
-
// error!(target: "my_target", key1 = 42, key2 = true; "a {} event", "log")
32
-
// error!(target: "my_target", "a {} event", "log")
33
-
(target: $target:expr, $($arg:tt)+) => ({
34
-
log::error!(logger: $crate::logging::log_v0_4::internal::geil(), target: $target, $($arg)+)
35
-
});
36
-
37
-
// error!("a {} event", "log")
38
-
($($arg:tt)+) => (log::error!(logger: $crate::logging::log_v0_4::internal::geil(), $($arg)+))
39
-
}
40
-
41
-
/// Wrapper macro for log::info that uses the internal ergot logger.
42
-
#[clippy::format_args]
43
-
#[cfg(not(all(feature = "defmt-v1", not(feature = "std"))))]
44
-
macro_rules! info {
45
-
// info!(target: "my_target", key1 = 42, key2 = true; "a {} event", "log")
46
-
// info!(target: "my_target", "a {} event", "log")
47
-
(target: $target:expr, $($arg:tt)+) => ({
48
-
log::info!(logger: $crate::logging::log_v0_4::internal::geil(), target: $target, $($arg)+)
49
-
});
50
-
51
-
// info!("a {} event", "log")
52
-
($($arg:tt)+) => (log::info!(logger: $crate::logging::log_v0_4::internal::geil(), $($arg)+))
53
-
}
54
-
55
-
/// Wrapper macro for log::trace that uses the internal ergot logger.
56
-
#[clippy::format_args]
57
-
#[cfg(not(all(feature = "defmt-v1", not(feature = "std"))))]
58
-
macro_rules! trace {
59
-
// trace!(target: "my_target", key1 = 42, key2 = true; "a {} event", "log")
60
-
// trace!(target: "my_target", "a {} event", "log")
61
-
(target: $target:expr, $($arg:tt)+) => ({
62
-
log::trace!(logger: $crate::logging::log_v0_4::internal::geil(), target: $target, $($arg)+)
63
-
});
64
-
65
-
// trace!("a {} event", "log")
66
-
($($arg:tt)+) => (log::trace!(logger: $crate::logging::log_v0_4::internal::geil(), $($arg)+))
67
-
}
68
-
69
-
/// Wrapper macro for log::warn that uses the internal ergot logger.
70
-
#[clippy::format_args]
71
-
#[cfg(not(all(feature = "defmt-v1", not(feature = "std"))))]
72
-
macro_rules! warni {
73
-
// warn!(target: "my_target", key1 = 42, key2 = true; "a {} event", "log")
74
-
// warn!(target: "my_target", "a {} event", "log")
75
-
(target: $target:expr, $($arg:tt)+) => ({
76
-
log::warn!(logger: $crate::logging::log_v0_4::internal::geil(), target: $target, $($arg)+)
77
-
});
78
-
79
-
// warn!("a {} event", "log")
80
-
($($arg:tt)+) => (log::warn!(logger: $crate::logging::log_v0_4::internal::geil(), $($arg)+))
81
-
}
82
-
83
-
#[allow(unused_imports)]
84
-
#[cfg(not(all(feature = "defmt-v1", not(feature = "std"))))]
85
-
pub(crate) use {debug, error, info, trace, warni as warn};
+36
-76
crates/ergot/src/net_stack/inner.rs
+36
-76
crates/ergot/src/net_stack/inner.rs
···
1
1
use core::{any::TypeId, ptr::NonNull};
2
2
3
3
use cordyceps::List;
4
+
use log::{debug, trace};
4
5
use serde::Serialize;
5
-
6
-
use crate::logging::{debug, error, trace};
7
6
8
7
use crate::{
9
8
FrameKind, Header, HeaderSeq, ProtocolError,
···
66
65
smgr: SendProfile,
67
66
) -> Result<(), NetStackSendError>
68
67
where
69
-
SendSockets: FnMut(NonNull<SocketHeader>) -> Result<(), NetStackSendError>,
70
-
SendProfile: FnOnce() -> Result<(), InterfaceSendError>,
68
+
SendSockets: FnMut(NonNull<SocketHeader>) -> bool,
69
+
SendProfile: FnOnce() -> bool,
71
70
{
72
-
trace!("{}: Sending msg broadcast", hdr);
71
+
trace!("{hdr}: Sending msg broadcast");
73
72
let res_lcl = {
74
73
let bcast_iter = Self::find_all_local(sockets, hdr)?;
75
74
let mut any_found = false;
76
75
for dst in bcast_iter {
77
76
let res = sskt(dst);
78
-
match res {
79
-
Ok(_) => {
80
-
debug!("{}: delivered broadcast message locally", hdr);
81
-
any_found |= true;
82
-
}
83
-
Err(NetStackSendError::InterfaceSend(InterfaceSendError::RoutingLoop)) => {
84
-
debug!("{}: No local interest in msg broadcast", hdr);
85
-
// no need to report /errors/ on routing loops
86
-
continue;
87
-
}
88
-
Err(e) => {
89
-
error!(
90
-
"{}: failed to deliver broadcast message locally, error: {:?}",
91
-
hdr, e
92
-
);
93
-
}
77
+
if res {
78
+
debug!("{hdr}: delivered broadcast message locally");
94
79
}
80
+
any_found |= res;
95
81
}
96
82
any_found
97
83
};
98
84
99
-
let res_rmt = match smgr() {
100
-
Ok(_) => {
101
-
debug!("{}: delivered broadcast message remotely", hdr);
102
-
true
103
-
}
104
-
Err(InterfaceSendError::RoutingLoop) => {
105
-
// no need to report /errors/ on routing loops
106
-
debug!("{}: No external interest in msg broadcast", hdr);
107
-
true
108
-
}
109
-
Err(e) => {
110
-
error!(
111
-
"{}: failed to deliver broadcast message remotely, error: {:?}",
112
-
hdr, e
113
-
);
114
-
false
115
-
}
116
-
};
85
+
let res_rmt = smgr();
86
+
if res_rmt {
87
+
debug!("{hdr}: delivered broadcast message remotely");
88
+
}
117
89
118
90
if res_lcl || res_rmt {
119
91
Ok(())
···
136
108
SendSockets: FnOnce(NonNull<SocketHeader>) -> Result<(), NetStackSendError>,
137
109
SendProfile: FnOnce() -> Result<(), InterfaceSendError>,
138
110
{
139
-
trace!("{}: Sending msg unicast", hdr);
111
+
trace!("{hdr}: Sending msg unicast");
140
112
// Can we assume the destination is local?
141
113
let local_bypass = hdr.src.net_node_any() && hdr.dst.net_node_any();
142
114
143
115
let res = if !local_bypass {
144
116
// Not local: offer to the interface manager to send
145
-
debug!("{}: Offering msg externally unicast", hdr);
117
+
debug!("{hdr}: Offering msg externally unicast");
146
118
smgr()
147
119
} else {
148
120
// just skip to local sending
···
151
123
152
124
match res {
153
125
Ok(()) => {
154
-
debug!("{}: Externally routed msg unicast", hdr);
126
+
debug!("{hdr}: Externally routed msg unicast");
155
127
return Ok(());
156
128
}
157
129
// "Destination Local" and "Routing Loop" can both be returned when there is no
158
130
// interface interest, but are non-fatal.
159
131
Err(InterfaceSendError::DestinationLocal) | Err(InterfaceSendError::RoutingLoop) => {
160
-
debug!("{}: No external interest in msg unicast", hdr);
132
+
debug!("{hdr}: No external interest in msg unicast");
161
133
}
162
134
Err(e) => return Err(NetStackSendError::InterfaceSend(e)),
163
135
}
164
136
165
137
// It was a destination local error, try to honor that
166
138
let socket = if hdr.dst.port_id == 0 {
167
-
debug!("{}: Sending ANY unicast msg locally", hdr);
139
+
debug!("{hdr}: Sending ANY unicast msg locally");
168
140
Self::find_any_local(sockets, hdr)
169
141
} else {
170
-
debug!("{}: Sending ONE unicast msg locally", hdr);
142
+
debug!("{hdr}: Sending ONE unicast msg locally");
171
143
Self::find_one_local(sockets, hdr)
172
144
}?;
173
145
···
188
160
SendSockets: FnOnce(NonNull<SocketHeader>) -> Result<(), NetStackSendError>,
189
161
SendProfile: FnOnce() -> Result<(), InterfaceSendError>,
190
162
{
191
-
trace!("{}: Sending err unicast", hdr);
163
+
trace!("{hdr}: Sending err unicast");
192
164
// Can we assume the destination is local?
193
165
let local_bypass = hdr.src.net_node_any() && hdr.dst.net_node_any();
194
166
195
167
let res = if !local_bypass {
196
168
// Not local: offer to the interface manager to send
197
-
debug!("{}: Offering err externally unicast", hdr);
169
+
debug!("{hdr}: Offering err externally unicast");
198
170
smgr()
199
171
} else {
200
172
// just skip to local sending
···
203
175
204
176
match res {
205
177
Ok(()) => {
206
-
debug!("{}: Externally routed err unicast", hdr);
178
+
debug!("{hdr}: Externally routed err unicast");
207
179
return Ok(());
208
180
}
209
181
Err(InterfaceSendError::DestinationLocal) => {
210
-
debug!("{}: No external interest in err unicast", hdr);
182
+
debug!("{hdr}: No external interest in err unicast");
211
183
}
212
184
Err(e) => return Err(NetStackSendError::InterfaceSend(e)),
213
185
}
···
231
203
profile: manager,
232
204
..
233
205
} = self;
234
-
trace!("{}: Sending msg raw from {:?}", hdr, source);
206
+
trace!("{hdr}: Sending msg raw from {source:?}");
235
207
236
208
if hdr.kind == FrameKind::PROTOCOL_ERROR {
237
-
todo!("{}: Don't do that", hdr);
209
+
todo!("{hdr}: Don't do that");
238
210
}
239
211
240
212
let nshdr: Header = hdr.clone().into();
···
244
216
Self::broadcast(
245
217
sockets,
246
218
&nshdr,
247
-
|skt| Self::send_raw_to_socket(skt, body, &nshdr, seq_no),
248
-
|| manager.send_raw(hdr, body, source),
219
+
|skt| Self::send_raw_to_socket(skt, body, &nshdr, seq_no).is_ok(),
220
+
|| manager.send_raw(hdr, body, source).is_ok(),
249
221
)
250
222
} else {
251
223
Self::unicast(
···
255
227
|| manager.send_raw(hdr, body, source),
256
228
)
257
229
}
258
-
.inspect_err(|e| {
259
-
error!("{}: Error sending raw: {:?}", hdr, e);
260
-
})
261
230
}
262
231
263
232
/// Handle sending of a typed message
···
272
241
profile: manager,
273
242
..
274
243
} = self;
275
-
trace!("{}: Sending msg ty", hdr);
244
+
trace!("{hdr}: Sending msg ty");
276
245
277
246
if hdr.kind == FrameKind::PROTOCOL_ERROR {
278
-
todo!("{}: Don't do that", hdr);
247
+
todo!("{hdr}: Don't do that");
279
248
}
280
249
281
250
// Is this a broadcast message?
···
283
252
Self::broadcast(
284
253
sockets,
285
254
hdr,
286
-
|skt| Self::send_ty_to_socket(skt, t, hdr, seq_no),
287
-
|| manager.send(hdr, t),
255
+
|skt| Self::send_ty_to_socket(skt, t, hdr, seq_no).is_ok(),
256
+
|| manager.send(hdr, t).is_ok(),
288
257
)
289
258
} else {
290
259
Self::unicast(
···
294
263
|| manager.send(hdr, t),
295
264
)
296
265
}
297
-
.inspect_err(|e| {
298
-
error!("{}: Error sending ty: {:?}", hdr, e);
299
-
})
300
266
}
301
267
302
268
/// Handle sending a borrowed message
···
311
277
profile: manager,
312
278
..
313
279
} = self;
314
-
trace!("{}: Sending msg bor", hdr);
280
+
trace!("{hdr}: Sending msg bor");
315
281
316
282
if hdr.kind == FrameKind::PROTOCOL_ERROR {
317
-
todo!("{}: Don't do that", hdr);
283
+
todo!("{hdr}: Don't do that");
318
284
}
319
285
320
286
// Is this a broadcast message?
···
322
288
Self::broadcast(
323
289
sockets,
324
290
hdr,
325
-
|skt| Self::send_bor_to_socket(skt, t, hdr, seq_no),
326
-
|| manager.send(hdr, t),
291
+
|skt| Self::send_bor_to_socket(skt, t, hdr, seq_no).is_ok(),
292
+
|| manager.send(hdr, t).is_ok(),
327
293
)
328
294
} else {
329
295
Self::unicast(
···
333
299
|| manager.send(hdr, t),
334
300
)
335
301
}
336
-
.inspect_err(|e| {
337
-
error!("{}: Error sending bor: {:?}", hdr, e);
338
-
})
339
302
}
340
303
341
304
/// Handle sending of a typed message
···
351
314
profile: manager,
352
315
..
353
316
} = self;
354
-
trace!("{}: Sending msg err", hdr);
317
+
trace!("{hdr}: Sending msg err");
355
318
356
319
if hdr.dst.port_id == 255 {
357
-
todo!("{}: Don't do that", hdr);
320
+
todo!("{hdr}: Don't do that");
358
321
}
359
322
360
323
Self::unicast_err(
···
392
355
continue;
393
356
}
394
357
if skt_ref.attrs.kind != hdr.kind {
395
-
return Err(NetStackSendError::WrongPortKind {
396
-
expected: skt_ref.attrs.kind,
397
-
actual: hdr.kind,
398
-
});
358
+
return Err(NetStackSendError::WrongPortKind);
399
359
}
400
360
break skt;
401
361
};
+3
-9
crates/ergot/src/net_stack/mod.rs
+3
-9
crates/ergot/src/net_stack/mod.rs
···
27
27
use topics::Topics;
28
28
29
29
use crate::{
30
-
FrameKind, Header, HeaderSeq, ProtocolError,
30
+
Header, HeaderSeq, ProtocolError,
31
31
fmtlog::{ErgotFmtTx, Level},
32
32
interface_manager::{self, InterfaceSendError, Profile},
33
33
socket::{SocketHeader, SocketSendError},
···
71
71
InterfaceSend(InterfaceSendError),
72
72
NoRoute,
73
73
AnyPortMissingKey,
74
-
/// The message and the socket don't agree on the port kind
75
-
/// This can happen if you send a message to the wrong port as a result of using hard-coded
76
-
/// port numbers or as a result of a device restarting and having different port allocations.
77
-
WrongPortKind {
78
-
expected: FrameKind,
79
-
actual: FrameKind,
80
-
},
74
+
WrongPortKind,
81
75
AnyPortNotUnique,
82
76
AllPortMissingKey,
83
77
WouldDeadlock,
···
424
418
}
425
419
NetStackSendError::NoRoute => ProtocolError::NSSE_NO_ROUTE,
426
420
NetStackSendError::AnyPortMissingKey => ProtocolError::NSSE_ANY_PORT_MISSING_KEY,
427
-
NetStackSendError::WrongPortKind { .. } => ProtocolError::NSSE_WRONG_PORT_KIND,
421
+
NetStackSendError::WrongPortKind => ProtocolError::NSSE_WRONG_PORT_KIND,
428
422
NetStackSendError::AnyPortNotUnique => ProtocolError::NSSE_ANY_PORT_NOT_UNIQUE,
429
423
NetStackSendError::AllPortMissingKey => ProtocolError::NSSE_ALL_PORT_MISSING_KEY,
430
424
NetStackSendError::WouldDeadlock => ProtocolError::NSSE_WOULD_DEADLOCK,
-49
crates/ergot/src/socket/endpoint.rs
-49
crates/ergot/src/socket/endpoint.rs
···
6
6
use pin_project::pin_project;
7
7
use serde::{Serialize, de::DeserializeOwned};
8
8
9
-
use crate::socket::HeaderMessage;
10
9
use crate::{self as base, socket::Response};
11
10
12
11
macro_rules! endpoint_server {
···
76
75
self.hdl.serve(f).await
77
76
}
78
77
79
-
/// Wait for an incoming packet, and respond using the given async closure
80
-
pub async fn serve_full<F: AsyncFnOnce(&HeaderMessage<E::Request>) -> E::Response>(
81
-
&mut self,
82
-
f: F,
83
-
) -> Result<(), base::net_stack::NetStackSendError>
84
-
where
85
-
E::Response: Serialize + Clone + DeserializeOwned + 'static,
86
-
{
87
-
self.hdl.serve_full(f).await
88
-
}
89
-
90
78
/// Wait for an incoming packet, and respond using the given blocking closure
91
79
pub async fn serve_blocking<F: FnOnce(&E::Request) -> E::Response>(
92
80
&mut self,
···
161
149
/// A raw Client/Server, generic over the [`Storage`](base::socket::raw_owned::Storage) impl.
162
150
pub mod raw {
163
151
use super::*;
164
-
use crate::socket::HeaderMessage;
165
152
use crate::{
166
153
FrameKind,
167
154
net_stack::NetStackHandle,
···
276
263
};
277
264
let base::socket::HeaderMessage { hdr, t } = msg;
278
265
let resp = f(&t).await;
279
-
280
-
// NOTE: We swap src/dst, AND we go from req -> resp (both in kind and key)
281
-
let hdr: base::Header = base::Header {
282
-
src: {
283
-
// modify the port to match our specific port, in case the dst was port 0
284
-
let mut src = hdr.dst;
285
-
src.port_id = self.port();
286
-
src
287
-
},
288
-
dst: hdr.src,
289
-
// TODO: we never reply to an any/all, so don't include that info
290
-
any_all: None,
291
-
seq_no: Some(hdr.seq_no),
292
-
kind: base::FrameKind::ENDPOINT_RESP,
293
-
ttl: base::DEFAULT_TTL,
294
-
};
295
-
self.hdl.stack().send_ty::<E::Response>(&hdr, &resp)
296
-
}
297
-
298
-
pub async fn serve_full<F: AsyncFnOnce(&HeaderMessage<E::Request>) -> E::Response>(
299
-
&mut self,
300
-
f: F,
301
-
) -> Result<(), base::net_stack::NetStackSendError>
302
-
where
303
-
E::Response: Serialize + Clone + DeserializeOwned + 'static,
304
-
{
305
-
let msg = loop {
306
-
let res = self.hdl.recv().await;
307
-
match res {
308
-
Ok(req) => break req,
309
-
// TODO: Anything with errs? If not, change vtable
310
-
Err(_) => continue,
311
-
}
312
-
};
313
-
let resp = f(&msg).await;
314
-
let base::socket::HeaderMessage { hdr, .. } = msg;
315
266
316
267
// NOTE: We swap src/dst, AND we go from req -> resp (both in kind and key)
317
268
let hdr: base::Header = base::Header {
-1
crates/ergot/src/socket/mod.rs
-1
crates/ergot/src/socket/mod.rs
+2
-3
crates/ergot/src/socket/raw_owned.rs
+2
-3
crates/ergot/src/socket/raw_owned.rs
···
20
20
use cordyceps::list::Links;
21
21
use serde::de::DeserializeOwned;
22
22
23
-
use super::{Attributes, HeaderMessage, Response, SocketHeader, SocketSendError, SocketVTable};
24
-
use crate::logging::trace;
25
23
use crate::{HeaderSeq, Key, ProtocolError, nash::NameHash, net_stack::NetStackHandle};
24
+
25
+
use super::{Attributes, HeaderMessage, Response, SocketHeader, SocketSendError, SocketVTable};
26
26
27
27
#[derive(Debug, PartialEq)]
28
28
pub struct StorageFull;
···
302
302
let mutitem: &mut StoreBox<S, Response<T>> = unsafe { &mut *this.inner.get() };
303
303
304
304
if mutitem.sto.is_full() {
305
-
trace!("{}: recv_raw: StorageFull", hdr);
306
305
return Err(SocketSendError::NoSpace);
307
306
}
308
307
-111
crates/ergot/src/toolkits/mod.rs
-111
crates/ergot/src/toolkits/mod.rs
···
98
98
}
99
99
}
100
100
101
-
#[cfg(feature = "embassy-net-v0_7")]
102
-
pub mod embassy_net_v0_7 {
103
-
use crate::NetStack;
104
-
use crate::interface_manager::InterfaceState;
105
-
use crate::interface_manager::interface_impls::embassy_net_udp::EmbassyNetInterface;
106
-
use crate::interface_manager::profiles::direct_edge::DirectEdge;
107
-
use crate::interface_manager::utils::framed_stream::Sink;
108
-
use bbq2::prod_cons::framed::FramedProducer;
109
-
use bbq2::queue::BBQueue;
110
-
use bbq2::traits::bbqhdl::BbqHandle;
111
-
use bbq2::traits::notifier::maitake::MaiNotSpsc;
112
-
use bbq2::traits::storage::Inline;
113
-
use maitake_sync::blocking::{ConstInit, ScopedRawMutex};
114
-
115
-
pub type Queue<const N: usize, C> = BBQueue<Inline<N>, C, MaiNotSpsc>;
116
-
117
-
pub type EdgeStack<Q, R> = NetStack<R, DirectEdge<EmbassyNetInterface<Q>>>;
118
-
119
-
pub const fn new_target_stack<Q, R>(producer: FramedProducer<Q>, mtu: u16) -> EdgeStack<Q, R>
120
-
where
121
-
Q: BbqHandle,
122
-
R: ScopedRawMutex + ConstInit + 'static,
123
-
{
124
-
NetStack::new_with_profile(DirectEdge::new_target(Sink::new(producer, mtu)))
125
-
}
126
-
127
-
pub const fn new_controller_stack<Q, R>(
128
-
producer: FramedProducer<Q>,
129
-
mtu: u16,
130
-
) -> EdgeStack<Q, R>
131
-
where
132
-
Q: BbqHandle,
133
-
R: ScopedRawMutex + ConstInit + 'static,
134
-
{
135
-
NetStack::new_with_profile(DirectEdge::new_controller(
136
-
Sink::new(producer, mtu),
137
-
InterfaceState::Down,
138
-
))
139
-
}
140
-
}
141
-
142
101
#[cfg(feature = "tokio-std")]
143
102
pub mod tokio_tcp {
144
103
use crate::interface_manager::{
···
188
147
queue.clone(),
189
148
mtu,
190
149
)))
191
-
}
192
-
}
193
-
194
-
#[cfg(feature = "tokio-std")]
195
-
pub mod tokio_udp {
196
-
use crate::interface_manager::profiles::direct_edge::tokio_udp::InterfaceKind;
197
-
use crate::interface_manager::profiles::direct_router;
198
-
use crate::interface_manager::profiles::direct_router::DirectRouter;
199
-
use crate::interface_manager::profiles::direct_router::tokio_udp::Error;
200
-
use crate::interface_manager::utils::framed_stream;
201
-
pub use crate::interface_manager::utils::std::new_std_queue;
202
-
use crate::interface_manager::{
203
-
InterfaceState,
204
-
interface_impls::tokio_udp::TokioUdpInterface,
205
-
profiles::direct_edge::{self, DirectEdge, tokio_udp::SocketAlreadyActive},
206
-
utils::std::StdQueue,
207
-
};
208
-
use mutex::raw_impls::cs::CriticalSectionRawMutex;
209
-
use tokio::net::UdpSocket;
210
-
211
-
use crate::net_stack::ArcNetStack;
212
-
213
-
pub type RouterStack = ArcNetStack<CriticalSectionRawMutex, DirectRouter<TokioUdpInterface>>;
214
-
pub type EdgeStack = ArcNetStack<CriticalSectionRawMutex, DirectEdge<TokioUdpInterface>>;
215
-
216
-
pub async fn register_router_interface(
217
-
stack: &RouterStack,
218
-
socket: UdpSocket,
219
-
max_ergot_packet_size: u16,
220
-
outgoing_buffer_size: usize,
221
-
) -> Result<u64, Error> {
222
-
direct_router::tokio_udp::register_interface(
223
-
stack.clone(),
224
-
socket,
225
-
max_ergot_packet_size,
226
-
outgoing_buffer_size,
227
-
)
228
-
.await
229
-
}
230
-
231
-
pub async fn register_edge_interface(
232
-
stack: &EdgeStack,
233
-
socket: UdpSocket,
234
-
queue: &StdQueue,
235
-
interface_kind: InterfaceKind,
236
-
) -> Result<(), SocketAlreadyActive> {
237
-
direct_edge::tokio_udp::register_interface(
238
-
stack.clone(),
239
-
socket,
240
-
queue.clone(),
241
-
interface_kind,
242
-
(),
243
-
)
244
-
.await
245
-
}
246
-
247
-
pub fn new_target_stack(queue: &StdQueue, mtu: u16) -> crate::toolkits::tokio_udp::EdgeStack {
248
-
crate::toolkits::tokio_udp::EdgeStack::new_with_profile(DirectEdge::new_target(
249
-
framed_stream::Sink::new_from_handle(queue.clone(), mtu),
250
-
))
251
-
}
252
-
253
-
pub fn new_controller_stack(
254
-
queue: &StdQueue,
255
-
mtu: u16,
256
-
) -> crate::toolkits::tokio_udp::EdgeStack {
257
-
crate::toolkits::tokio_udp::EdgeStack::new_with_profile(DirectEdge::new_controller(
258
-
framed_stream::Sink::new_from_handle(queue.clone(), mtu),
259
-
InterfaceState::Down,
260
-
))
261
150
}
262
151
}
263
152
+1
-1
crates/ergot/src/wire_frames.rs
+1
-1
crates/ergot/src/wire_frames.rs
+5
-5
crates/ergot/tests/log_fmt.rs
+5
-5
crates/ergot/tests/log_fmt.rs
···
30
30
let x = 10;
31
31
let msg = "world";
32
32
33
-
STACK.trace_fmt(fmt!("1 hello ({}), {}", x, msg));
34
-
STACK.debug_fmt(fmt!("2 hello ({}), {}", x, msg));
35
-
STACK.info_fmt(fmt!("3 hello ({}), {}", x, msg));
36
-
STACK.warn_fmt(fmt!("4 hello ({}), {}", x, msg));
37
-
STACK.error_fmt(fmt!("5 hello ({}), {}", x, msg));
33
+
STACK.trace_fmt(fmt!("1 hello ({x}), {}", msg));
34
+
STACK.debug_fmt(fmt!("2 hello ({x}), {}", msg));
35
+
STACK.info_fmt(fmt!("3 hello ({x}), {}", msg));
36
+
STACK.warn_fmt(fmt!("4 hello ({x}), {}", msg));
37
+
STACK.error_fmt(fmt!("5 hello ({x}), {}", msg));
38
38
39
39
let levels = &[
40
40
Level::Trace,
+4
-4
crates/ergot/tests/smoke2.rs
+4
-4
crates/ergot/tests/smoke2.rs
···
220
220
.await
221
221
.unwrap();
222
222
223
-
println!("RESP: {:?}", resp);
223
+
println!("RESP: {resp:?}");
224
224
}
225
225
});
226
226
···
234
234
}),
235
235
)
236
236
.await;
237
-
println!("SERV: {:?}", srv);
237
+
println!("SERV: {srv:?}");
238
238
}
239
239
240
240
reqqr.await.unwrap();
···
273
273
.await
274
274
.unwrap();
275
275
276
-
println!("RESP: {:?}", resp);
276
+
println!("RESP: {resp:?}");
277
277
}
278
278
});
279
279
···
287
287
}),
288
288
)
289
289
.await;
290
-
println!("SERV: {:?}", srv);
290
+
println!("SERV: {srv:?}");
291
291
}
292
292
293
293
reqqr.await.unwrap();
+4
-5
demos/esp32c3/Cargo.lock
+4
-5
demos/esp32c3/Cargo.lock
···
404
404
405
405
[[package]]
406
406
name = "embassy-time-driver"
407
-
version = "0.2.1"
407
+
version = "0.2.0"
408
408
source = "registry+https://github.com/rust-lang/crates.io-index"
409
-
checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6"
409
+
checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba"
410
410
dependencies = [
411
411
"document-features",
412
412
]
···
522
522
523
523
[[package]]
524
524
name = "ergot"
525
-
version = "0.12.0"
525
+
version = "0.10.0"
526
526
dependencies = [
527
527
"bbq2",
528
528
"cobs 0.3.0",
···
531
531
"cordyceps",
532
532
"critical-section",
533
533
"defmt 1.0.1",
534
-
"embassy-futures",
534
+
"embassy-time",
535
535
"embedded-io-async",
536
536
"heapless 0.9.1",
537
537
"log",
538
538
"maitake-sync",
539
539
"mutex",
540
540
"pin-project",
541
-
"portable-atomic",
542
541
"postcard",
543
542
"postcard-schema",
544
543
"serde",
+2
-2
demos/esp32c3/esp32c3-serial/src/main.rs
+2
-2
demos/esp32c3/esp32c3-serial/src/main.rs
···
52
52
53
53
// Create our USB-Serial interface, which implements the embedded-io-async traits
54
54
let (rx, tx) = UsbSerialJtag::new(p.USB_DEVICE).into_async().split();
55
-
let rx = RxWorker::new_target(&STACK, rx, ());
55
+
let rx = RxWorker::new(&STACK, rx, ());
56
56
57
57
// Spawn I/O worker tasks
58
58
spawner.must_spawn(run_rx(rx, RECV_BUF.take(), SCRATCH_BUF.take()));
···
86
86
let mut ct = 0;
87
87
loop {
88
88
tckr.next().await;
89
-
STACK.info_fmt(fmt!("log # {}", ct));
89
+
STACK.info_fmt(fmt!("log # {ct}"));
90
90
ct += 1;
91
91
}
92
92
}
+4
-3
demos/esp32c6/Cargo.lock
+4
-3
demos/esp32c6/Cargo.lock
···
403
403
404
404
[[package]]
405
405
name = "embassy-time-driver"
406
-
version = "0.2.1"
406
+
version = "0.2.0"
407
407
source = "registry+https://github.com/rust-lang/crates.io-index"
408
-
checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6"
408
+
checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba"
409
409
dependencies = [
410
410
"document-features",
411
411
]
···
521
521
522
522
[[package]]
523
523
name = "ergot"
524
-
version = "0.12.0"
524
+
version = "0.11.0"
525
525
dependencies = [
526
526
"bbq2",
527
527
"cobs 0.3.0",
···
531
531
"critical-section",
532
532
"defmt 1.0.1",
533
533
"embassy-futures",
534
+
"embassy-time",
534
535
"embedded-io-async",
535
536
"heapless 0.9.1",
536
537
"log",
+1
-1
demos/esp32c6/esp32c6-serial/src/main.rs
+1
-1
demos/esp32c6/esp32c6-serial/src/main.rs
+98
-41
demos/microbit/Cargo.lock
+98
-41
demos/microbit/Cargo.lock
···
245
245
246
246
[[package]]
247
247
name = "defmt"
248
+
version = "0.3.100"
249
+
source = "registry+https://github.com/rust-lang/crates.io-index"
250
+
checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad"
251
+
dependencies = [
252
+
"defmt 1.0.1",
253
+
]
254
+
255
+
[[package]]
256
+
name = "defmt"
248
257
version = "1.0.1"
249
258
source = "registry+https://github.com/rust-lang/crates.io-index"
250
259
checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78"
···
282
291
checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1"
283
292
dependencies = [
284
293
"critical-section",
285
-
"defmt",
294
+
"defmt 1.0.1",
286
295
]
287
296
288
297
[[package]]
···
296
305
297
306
[[package]]
298
307
name = "embassy-embedded-hal"
299
-
version = "0.5.0"
308
+
version = "0.3.2"
300
309
source = "registry+https://github.com/rust-lang/crates.io-index"
301
-
checksum = "554e3e840696f54b4c9afcf28a0f24da431c927f4151040020416e7393d6d0d8"
310
+
checksum = "8c62a3bf127e03832fb97d8b01a058775e617653bc89e2a12c256485a7fb54c1"
302
311
dependencies = [
303
-
"defmt",
312
+
"defmt 0.3.100",
313
+
"embassy-embedded-hal 0.4.0",
304
314
"embassy-futures",
305
-
"embassy-hal-internal",
306
-
"embassy-sync",
315
+
"embassy-sync 0.6.2",
307
316
"embassy-time",
308
317
"embedded-hal 0.2.7",
309
318
"embedded-hal 1.0.0",
···
314
323
]
315
324
316
325
[[package]]
326
+
name = "embassy-embedded-hal"
327
+
version = "0.4.0"
328
+
source = "registry+https://github.com/rust-lang/crates.io-index"
329
+
checksum = "d1611b7a7ab5d1fbed84c338df26d56fd9bded58006ebb029075112ed2c5e039"
330
+
dependencies = [
331
+
"embassy-futures",
332
+
"embassy-hal-internal",
333
+
"embassy-sync 0.7.2",
334
+
"embedded-hal 0.2.7",
335
+
"embedded-hal 1.0.0",
336
+
"embedded-hal-async",
337
+
"embedded-storage",
338
+
"embedded-storage-async",
339
+
"nb 1.1.0",
340
+
]
341
+
342
+
[[package]]
317
343
name = "embassy-executor"
318
-
version = "0.9.1"
344
+
version = "0.7.0"
319
345
source = "registry+https://github.com/rust-lang/crates.io-index"
320
-
checksum = "06070468370195e0e86f241c8e5004356d696590a678d47d6676795b2e439c6b"
346
+
checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6"
321
347
dependencies = [
322
348
"cortex-m",
323
349
"critical-section",
324
-
"defmt",
350
+
"defmt 0.3.100",
325
351
"document-features",
326
352
"embassy-executor-macros",
327
-
"embassy-executor-timer-queue",
328
353
]
329
354
330
355
[[package]]
331
356
name = "embassy-executor-macros"
332
-
version = "0.7.0"
357
+
version = "0.6.2"
333
358
source = "registry+https://github.com/rust-lang/crates.io-index"
334
-
checksum = "dfdddc3a04226828316bf31393b6903ee162238576b1584ee2669af215d55472"
359
+
checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf"
335
360
dependencies = [
336
361
"darling",
337
362
"proc-macro2",
···
340
365
]
341
366
342
367
[[package]]
343
-
name = "embassy-executor-timer-queue"
344
-
version = "0.1.0"
345
-
source = "registry+https://github.com/rust-lang/crates.io-index"
346
-
checksum = "2fc328bf943af66b80b98755db9106bf7e7471b0cf47dc8559cd9a6be504cc9c"
347
-
348
-
[[package]]
349
368
name = "embassy-futures"
350
369
version = "0.1.2"
351
370
source = "registry+https://github.com/rust-lang/crates.io-index"
···
359
378
dependencies = [
360
379
"cortex-m",
361
380
"critical-section",
362
-
"defmt",
381
+
"defmt 1.0.1",
363
382
"num-traits",
364
383
]
365
384
···
377
396
dependencies = [
378
397
"embassy-futures",
379
398
"embassy-net-driver",
380
-
"embassy-sync",
399
+
"embassy-sync 0.7.2",
381
400
]
382
401
383
402
[[package]]
384
403
name = "embassy-nrf"
385
-
version = "0.8.0"
404
+
version = "0.5.0"
386
405
source = "registry+https://github.com/rust-lang/crates.io-index"
387
-
checksum = "a8d63429d74ab5786cde7c9dc9a0338ea162a4da95e204ac5345c5ae36831fdb"
406
+
checksum = "6ae20388606f23184ab567537b9c7758eef5ac20cf5f94db3d936a641b9f4b9e"
388
407
dependencies = [
389
408
"bitflags 2.9.4",
390
409
"cfg-if",
391
410
"cortex-m",
392
411
"cortex-m-rt",
393
412
"critical-section",
394
-
"defmt",
413
+
"defmt 1.0.1",
395
414
"document-features",
396
-
"embassy-embedded-hal",
415
+
"embassy-embedded-hal 0.3.2",
397
416
"embassy-hal-internal",
398
-
"embassy-sync",
417
+
"embassy-sync 0.7.2",
399
418
"embassy-time",
400
419
"embassy-time-driver",
401
420
"embassy-time-queue-utils",
···
415
434
416
435
[[package]]
417
436
name = "embassy-sync"
437
+
version = "0.6.2"
438
+
source = "registry+https://github.com/rust-lang/crates.io-index"
439
+
checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049"
440
+
dependencies = [
441
+
"cfg-if",
442
+
"critical-section",
443
+
"embedded-io-async",
444
+
"futures-sink",
445
+
"futures-util",
446
+
"heapless 0.8.0",
447
+
]
448
+
449
+
[[package]]
450
+
name = "embassy-sync"
418
451
version = "0.7.2"
419
452
source = "registry+https://github.com/rust-lang/crates.io-index"
420
453
checksum = "73974a3edbd0bd286759b3d483540f0ebef705919a5f56f4fc7709066f71689b"
421
454
dependencies = [
422
455
"cfg-if",
423
456
"critical-section",
424
-
"defmt",
457
+
"defmt 1.0.1",
425
458
"embedded-io-async",
426
459
"futures-core",
427
460
"futures-sink",
···
430
463
431
464
[[package]]
432
465
name = "embassy-time"
433
-
version = "0.5.0"
466
+
version = "0.4.0"
434
467
source = "registry+https://github.com/rust-lang/crates.io-index"
435
-
checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65"
468
+
checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8"
436
469
dependencies = [
437
470
"cfg-if",
438
471
"critical-section",
439
-
"defmt",
472
+
"defmt 0.3.100",
440
473
"document-features",
441
474
"embassy-time-driver",
442
475
"embedded-hal 0.2.7",
443
476
"embedded-hal 1.0.0",
444
477
"embedded-hal-async",
445
-
"futures-core",
478
+
"futures-util",
446
479
]
447
480
448
481
[[package]]
···
456
489
457
490
[[package]]
458
491
name = "embassy-time-queue-utils"
459
-
version = "0.3.0"
492
+
version = "0.1.0"
460
493
source = "registry+https://github.com/rust-lang/crates.io-index"
461
-
checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454"
494
+
checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83"
462
495
dependencies = [
463
-
"embassy-executor-timer-queue",
496
+
"embassy-executor",
464
497
"heapless 0.8.0",
465
498
]
466
499
···
472
505
dependencies = [
473
506
"embassy-futures",
474
507
"embassy-net-driver-channel",
475
-
"embassy-sync",
508
+
"embassy-sync 0.7.2",
476
509
"embassy-usb-driver",
477
510
"embedded-io-async",
478
511
"heapless 0.8.0",
···
486
519
source = "registry+https://github.com/rust-lang/crates.io-index"
487
520
checksum = "17119855ccc2d1f7470a39756b12068454ae27a3eabb037d940b5c03d9c77b7a"
488
521
dependencies = [
489
-
"defmt",
522
+
"defmt 1.0.1",
490
523
"embedded-io-async",
491
524
]
492
525
···
553
586
554
587
[[package]]
555
588
name = "ergot"
556
-
version = "0.12.0"
589
+
version = "0.11.0"
557
590
dependencies = [
558
591
"bbq2",
559
592
"cobs 0.3.0",
···
561
594
"const-fnv1a-hash",
562
595
"cordyceps",
563
596
"critical-section",
564
-
"defmt",
597
+
"defmt 1.0.1",
565
598
"embassy-futures",
566
599
"embassy-time",
567
600
"embassy-usb",
···
614
647
checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
615
648
616
649
[[package]]
650
+
name = "futures-task"
651
+
version = "0.3.31"
652
+
source = "registry+https://github.com/rust-lang/crates.io-index"
653
+
checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
654
+
655
+
[[package]]
656
+
name = "futures-util"
657
+
version = "0.3.31"
658
+
source = "registry+https://github.com/rust-lang/crates.io-index"
659
+
checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
660
+
dependencies = [
661
+
"futures-core",
662
+
"futures-task",
663
+
"pin-project-lite",
664
+
"pin-utils",
665
+
]
666
+
667
+
[[package]]
617
668
name = "generator"
618
669
version = "0.8.7"
619
670
source = "registry+https://github.com/rust-lang/crates.io-index"
···
694
745
source = "registry+https://github.com/rust-lang/crates.io-index"
695
746
checksum = "b1edcd5a338e64688fbdcb7531a846cfd3476a54784dcb918a0844682bc7ada5"
696
747
dependencies = [
697
-
"defmt",
748
+
"defmt 1.0.1",
698
749
"hash32 0.3.1",
699
750
"serde",
700
751
"stable_deref_trait",
···
790
841
"bbq2",
791
842
"cortex-m",
792
843
"cortex-m-rt",
793
-
"defmt",
844
+
"defmt 1.0.1",
794
845
"defmt-rtt",
795
846
"embassy-executor",
796
847
"embassy-nrf",
797
-
"embassy-sync",
848
+
"embassy-sync 0.7.2",
798
849
"embassy-time",
799
850
"embassy-usb",
800
851
"ergot",
···
881
932
checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a"
882
933
dependencies = [
883
934
"cortex-m",
884
-
"defmt",
935
+
"defmt 1.0.1",
885
936
]
886
937
887
938
[[package]]
···
909
960
version = "0.2.16"
910
961
source = "registry+https://github.com/rust-lang/crates.io-index"
911
962
checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
963
+
964
+
[[package]]
965
+
name = "pin-utils"
966
+
version = "0.1.0"
967
+
source = "registry+https://github.com/rust-lang/crates.io-index"
968
+
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
912
969
913
970
[[package]]
914
971
name = "portable-atomic"
+3
-3
demos/microbit/Cargo.toml
+3
-3
demos/microbit/Cargo.toml
···
9
9
10
10
bbq2 = { version = "0.4.1", default-features = false, features = ["critical-section", "maitake-sync-0_2"] }
11
11
cortex-m = { version = "0.7.7", features = ["inline-asm", "critical-section-single-core"] }
12
-
embassy-executor = { version = "0.9.1", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] }
13
-
embassy-nrf = { version = "0.8.0", features = ["defmt", "nrf52833", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] }
14
-
embassy-time = { version = "0.5.0", features = ["defmt", "defmt-timestamp-uptime"] }
12
+
embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] }
13
+
embassy-nrf = { version = "0.5.0", features = ["defmt", "nrf52833", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] }
14
+
embassy-time = { version = "0.4.0", features = ["defmt", "defmt-timestamp-uptime"] }
15
15
mutex = { version = "1.0.2", features = ["impl-unsafe-cortex-m-single-core"] }
16
16
panic-probe = { version = "1.0.0", features = ["print-defmt"] }
17
17
+68
-42
demos/nrf52840/Cargo.lock
+68
-42
demos/nrf52840/Cargo.lock
···
244
244
245
245
[[package]]
246
246
name = "defmt"
247
+
version = "0.3.100"
248
+
source = "registry+https://github.com/rust-lang/crates.io-index"
249
+
checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad"
250
+
dependencies = [
251
+
"defmt 1.0.1",
252
+
]
253
+
254
+
[[package]]
255
+
name = "defmt"
247
256
version = "1.0.1"
248
257
source = "registry+https://github.com/rust-lang/crates.io-index"
249
258
checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78"
···
281
290
checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1"
282
291
dependencies = [
283
292
"critical-section",
284
-
"defmt",
293
+
"defmt 1.0.1",
285
294
]
286
295
287
296
[[package]]
···
295
304
296
305
[[package]]
297
306
name = "embassy-embedded-hal"
298
-
version = "0.5.0"
307
+
version = "0.3.1"
299
308
source = "registry+https://github.com/rust-lang/crates.io-index"
300
-
checksum = "554e3e840696f54b4c9afcf28a0f24da431c927f4151040020416e7393d6d0d8"
309
+
checksum = "8578db196d74db92efdd5ebc546736dac1685499ee245b22eff92fa5e4b57945"
301
310
dependencies = [
302
-
"defmt",
311
+
"defmt 1.0.1",
303
312
"embassy-futures",
304
313
"embassy-hal-internal",
305
314
"embassy-sync",
···
314
323
315
324
[[package]]
316
325
name = "embassy-executor"
317
-
version = "0.9.1"
326
+
version = "0.7.0"
318
327
source = "registry+https://github.com/rust-lang/crates.io-index"
319
-
checksum = "06070468370195e0e86f241c8e5004356d696590a678d47d6676795b2e439c6b"
328
+
checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6"
320
329
dependencies = [
321
330
"cortex-m",
322
331
"critical-section",
323
-
"defmt",
332
+
"defmt 0.3.100",
324
333
"document-features",
325
334
"embassy-executor-macros",
326
-
"embassy-executor-timer-queue",
327
335
]
328
336
329
337
[[package]]
330
338
name = "embassy-executor-macros"
331
-
version = "0.7.0"
339
+
version = "0.6.2"
332
340
source = "registry+https://github.com/rust-lang/crates.io-index"
333
-
checksum = "dfdddc3a04226828316bf31393b6903ee162238576b1584ee2669af215d55472"
341
+
checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf"
334
342
dependencies = [
335
343
"darling",
336
344
"proc-macro2",
···
339
347
]
340
348
341
349
[[package]]
342
-
name = "embassy-executor-timer-queue"
343
-
version = "0.1.0"
344
-
source = "registry+https://github.com/rust-lang/crates.io-index"
345
-
checksum = "2fc328bf943af66b80b98755db9106bf7e7471b0cf47dc8559cd9a6be504cc9c"
346
-
347
-
[[package]]
348
350
name = "embassy-futures"
349
-
version = "0.1.2"
351
+
version = "0.1.1"
350
352
source = "registry+https://github.com/rust-lang/crates.io-index"
351
-
checksum = "dc2d050bdc5c21e0862a89256ed8029ae6c290a93aecefc73084b3002cdebb01"
353
+
checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067"
352
354
353
355
[[package]]
354
356
name = "embassy-hal-internal"
···
358
360
dependencies = [
359
361
"cortex-m",
360
362
"critical-section",
361
-
"defmt",
363
+
"defmt 1.0.1",
362
364
"num-traits",
363
365
]
364
366
···
381
383
382
384
[[package]]
383
385
name = "embassy-nrf"
384
-
version = "0.8.0"
386
+
version = "0.5.0"
385
387
source = "registry+https://github.com/rust-lang/crates.io-index"
386
-
checksum = "a8d63429d74ab5786cde7c9dc9a0338ea162a4da95e204ac5345c5ae36831fdb"
388
+
checksum = "6ae20388606f23184ab567537b9c7758eef5ac20cf5f94db3d936a641b9f4b9e"
387
389
dependencies = [
388
390
"bitflags 2.9.1",
389
391
"cfg-if",
390
392
"cortex-m",
391
393
"cortex-m-rt",
392
394
"critical-section",
393
-
"defmt",
395
+
"defmt 1.0.1",
394
396
"document-features",
395
397
"embassy-embedded-hal",
396
398
"embassy-hal-internal",
···
414
416
415
417
[[package]]
416
418
name = "embassy-sync"
417
-
version = "0.7.2"
419
+
version = "0.7.0"
418
420
source = "registry+https://github.com/rust-lang/crates.io-index"
419
-
checksum = "73974a3edbd0bd286759b3d483540f0ebef705919a5f56f4fc7709066f71689b"
421
+
checksum = "cef1a8a1ea892f9b656de0295532ac5d8067e9830d49ec75076291fd6066b136"
420
422
dependencies = [
421
423
"cfg-if",
422
424
"critical-section",
423
-
"defmt",
425
+
"defmt 1.0.1",
424
426
"embedded-io-async",
425
-
"futures-core",
426
427
"futures-sink",
428
+
"futures-util",
427
429
"heapless 0.8.0",
428
430
]
429
431
430
432
[[package]]
431
433
name = "embassy-time"
432
-
version = "0.5.0"
434
+
version = "0.4.0"
433
435
source = "registry+https://github.com/rust-lang/crates.io-index"
434
-
checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65"
436
+
checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8"
435
437
dependencies = [
436
438
"cfg-if",
437
439
"critical-section",
438
-
"defmt",
440
+
"defmt 0.3.100",
439
441
"document-features",
440
442
"embassy-time-driver",
441
443
"embedded-hal 0.2.7",
442
444
"embedded-hal 1.0.0",
443
445
"embedded-hal-async",
444
-
"futures-core",
446
+
"futures-util",
445
447
]
446
448
447
449
[[package]]
448
450
name = "embassy-time-driver"
449
-
version = "0.2.1"
451
+
version = "0.2.0"
450
452
source = "registry+https://github.com/rust-lang/crates.io-index"
451
-
checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6"
453
+
checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba"
452
454
dependencies = [
453
455
"document-features",
454
456
]
455
457
456
458
[[package]]
457
459
name = "embassy-time-queue-utils"
458
-
version = "0.3.0"
460
+
version = "0.1.0"
459
461
source = "registry+https://github.com/rust-lang/crates.io-index"
460
-
checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454"
462
+
checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83"
461
463
dependencies = [
462
-
"embassy-executor-timer-queue",
464
+
"embassy-executor",
463
465
"heapless 0.8.0",
464
466
]
465
467
···
485
487
source = "registry+https://github.com/rust-lang/crates.io-index"
486
488
checksum = "17119855ccc2d1f7470a39756b12068454ae27a3eabb037d940b5c03d9c77b7a"
487
489
dependencies = [
488
-
"defmt",
490
+
"defmt 1.0.1",
489
491
"embedded-io-async",
490
492
]
491
493
···
552
554
553
555
[[package]]
554
556
name = "ergot"
555
-
version = "0.12.0"
557
+
version = "0.11.0"
556
558
dependencies = [
557
559
"bbq2",
558
560
"cobs 0.3.0",
···
560
562
"const-fnv1a-hash",
561
563
"cordyceps",
562
564
"critical-section",
563
-
"defmt",
565
+
"defmt 1.0.1",
564
566
"embassy-futures",
565
567
"embassy-time",
566
568
"embassy-usb",
···
607
609
checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
608
610
609
611
[[package]]
612
+
name = "futures-task"
613
+
version = "0.3.31"
614
+
source = "registry+https://github.com/rust-lang/crates.io-index"
615
+
checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
616
+
617
+
[[package]]
618
+
name = "futures-util"
619
+
version = "0.3.31"
620
+
source = "registry+https://github.com/rust-lang/crates.io-index"
621
+
checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
622
+
dependencies = [
623
+
"futures-core",
624
+
"futures-task",
625
+
"pin-project-lite",
626
+
"pin-utils",
627
+
]
628
+
629
+
[[package]]
610
630
name = "generator"
611
631
version = "0.8.5"
612
632
source = "registry+https://github.com/rust-lang/crates.io-index"
···
687
707
source = "registry+https://github.com/rust-lang/crates.io-index"
688
708
checksum = "b1edcd5a338e64688fbdcb7531a846cfd3476a54784dcb918a0844682bc7ada5"
689
709
dependencies = [
690
-
"defmt",
710
+
"defmt 1.0.1",
691
711
"hash32 0.3.1",
692
712
"serde",
693
713
"stable_deref_trait",
···
830
850
"bbq2",
831
851
"cortex-m",
832
852
"cortex-m-rt",
833
-
"defmt",
853
+
"defmt 1.0.1",
834
854
"defmt-rtt",
835
855
"embassy-executor",
836
856
"embassy-nrf",
···
849
869
dependencies = [
850
870
"cortex-m",
851
871
"cortex-m-rt",
852
-
"defmt",
872
+
"defmt 1.0.1",
853
873
"defmt-rtt",
854
874
"embassy-executor",
855
875
"embassy-nrf",
···
897
917
checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a"
898
918
dependencies = [
899
919
"cortex-m",
900
-
"defmt",
920
+
"defmt 1.0.1",
901
921
]
902
922
903
923
[[package]]
···
925
945
version = "0.2.16"
926
946
source = "registry+https://github.com/rust-lang/crates.io-index"
927
947
checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
948
+
949
+
[[package]]
950
+
name = "pin-utils"
951
+
version = "0.1.0"
952
+
source = "registry+https://github.com/rust-lang/crates.io-index"
953
+
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
928
954
929
955
[[package]]
930
956
name = "portable-atomic"
+3
-3
demos/nrf52840/Cargo.toml
+3
-3
demos/nrf52840/Cargo.toml
···
10
10
11
11
bbq2 = { version = "0.4.1", default-features = false, features = ["critical-section", "maitake-sync-0_2"] }
12
12
cortex-m = { version = "0.7.7", features = ["inline-asm", "critical-section-single-core"] }
13
-
embassy-executor = { version = "0.9.1", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] }
14
-
embassy-nrf = { version = "0.8.0", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] }
15
-
embassy-time = { version = "0.5.0", features = ["defmt", "defmt-timestamp-uptime"] }
13
+
embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] }
14
+
embassy-nrf = { version = "0.5.0", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] }
15
+
embassy-time = { version = "0.4.0", features = ["defmt", "defmt-timestamp-uptime"] }
16
16
mutex = { version = "1.0.2", features = ["impl-unsafe-cortex-m-single-core"] }
17
17
panic-probe = { version = "1.0.0", features = ["print-defmt"] }
18
18
+1
-1
demos/nrf52840/nrf52840-eusb/src/main.rs
+1
-1
demos/nrf52840/nrf52840-eusb/src/main.rs
···
32
32
const MAX_PACKET_SIZE: usize = 1024;
33
33
34
34
// Our nrf52840-specific USB driver
35
-
type AppDriver = usb::Driver<'static, HardwareVbusDetect>;
35
+
type AppDriver = usb::Driver<'static, USBD, HardwareVbusDetect>;
36
36
// The type of our RX Worker
37
37
type RxWorker = kit::RxWorker<&'static Queue, ThreadModeRawMutex, AppDriver>;
38
38
// The type of our netstack
+49
-31
demos/rp2040/Cargo.lock
+49
-31
demos/rp2040/Cargo.lock
···
402
402
403
403
[[package]]
404
404
name = "embassy-embedded-hal"
405
-
version = "0.5.0"
405
+
version = "0.3.1"
406
406
source = "registry+https://github.com/rust-lang/crates.io-index"
407
-
checksum = "554e3e840696f54b4c9afcf28a0f24da431c927f4151040020416e7393d6d0d8"
407
+
checksum = "8578db196d74db92efdd5ebc546736dac1685499ee245b22eff92fa5e4b57945"
408
408
dependencies = [
409
409
"embassy-futures",
410
410
"embassy-hal-internal",
411
411
"embassy-sync",
412
+
"embassy-time",
412
413
"embedded-hal 0.2.7",
413
414
"embedded-hal 1.0.0",
414
415
"embedded-hal-async",
···
419
420
420
421
[[package]]
421
422
name = "embassy-executor"
422
-
version = "0.9.1"
423
+
version = "0.7.0"
423
424
source = "registry+https://github.com/rust-lang/crates.io-index"
424
-
checksum = "06070468370195e0e86f241c8e5004356d696590a678d47d6676795b2e439c6b"
425
+
checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6"
425
426
dependencies = [
426
427
"cortex-m",
427
428
"critical-section",
428
-
"defmt 1.0.1",
429
+
"defmt 0.3.100",
429
430
"document-features",
430
431
"embassy-executor-macros",
431
-
"embassy-executor-timer-queue",
432
432
]
433
433
434
434
[[package]]
435
435
name = "embassy-executor-macros"
436
-
version = "0.7.0"
436
+
version = "0.6.2"
437
437
source = "registry+https://github.com/rust-lang/crates.io-index"
438
-
checksum = "dfdddc3a04226828316bf31393b6903ee162238576b1584ee2669af215d55472"
438
+
checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf"
439
439
dependencies = [
440
440
"darling",
441
441
"proc-macro2",
···
444
444
]
445
445
446
446
[[package]]
447
-
name = "embassy-executor-timer-queue"
448
-
version = "0.1.0"
449
-
source = "registry+https://github.com/rust-lang/crates.io-index"
450
-
checksum = "2fc328bf943af66b80b98755db9106bf7e7471b0cf47dc8559cd9a6be504cc9c"
451
-
452
-
[[package]]
453
447
name = "embassy-futures"
454
-
version = "0.1.2"
448
+
version = "0.1.1"
455
449
source = "registry+https://github.com/rust-lang/crates.io-index"
456
-
checksum = "dc2d050bdc5c21e0862a89256ed8029ae6c290a93aecefc73084b3002cdebb01"
450
+
checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067"
457
451
458
452
[[package]]
459
453
name = "embassy-hal-internal"
···
486
480
487
481
[[package]]
488
482
name = "embassy-rp"
489
-
version = "0.8.0"
483
+
version = "0.6.0"
490
484
source = "registry+https://github.com/rust-lang/crates.io-index"
491
-
checksum = "1a284935af0a869de3fa14af74b5f932389dd66d7048012f1083b06f38d05399"
485
+
checksum = "d298ea0ae8797fbbc835d7ef321b1762916879b9df49695826f54d31c487f5de"
492
486
dependencies = [
493
487
"atomic-polyfill",
494
488
"cfg-if",
···
526
520
527
521
[[package]]
528
522
name = "embassy-sync"
529
-
version = "0.7.2"
523
+
version = "0.7.0"
530
524
source = "registry+https://github.com/rust-lang/crates.io-index"
531
-
checksum = "73974a3edbd0bd286759b3d483540f0ebef705919a5f56f4fc7709066f71689b"
525
+
checksum = "cef1a8a1ea892f9b656de0295532ac5d8067e9830d49ec75076291fd6066b136"
532
526
dependencies = [
533
527
"cfg-if",
534
528
"critical-section",
535
529
"embedded-io-async",
536
-
"futures-core",
537
530
"futures-sink",
531
+
"futures-util",
538
532
"heapless 0.8.0",
539
533
]
540
534
541
535
[[package]]
542
536
name = "embassy-time"
543
-
version = "0.5.0"
537
+
version = "0.4.0"
544
538
source = "registry+https://github.com/rust-lang/crates.io-index"
545
-
checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65"
539
+
checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8"
546
540
dependencies = [
547
541
"cfg-if",
548
542
"critical-section",
549
-
"defmt 1.0.1",
543
+
"defmt 0.3.100",
550
544
"document-features",
551
545
"embassy-time-driver",
552
546
"embedded-hal 0.2.7",
553
547
"embedded-hal 1.0.0",
554
548
"embedded-hal-async",
555
-
"futures-core",
549
+
"futures-util",
556
550
]
557
551
558
552
[[package]]
559
553
name = "embassy-time-driver"
560
-
version = "0.2.1"
554
+
version = "0.2.0"
561
555
source = "registry+https://github.com/rust-lang/crates.io-index"
562
-
checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6"
556
+
checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba"
563
557
dependencies = [
564
558
"document-features",
565
559
]
566
560
567
561
[[package]]
568
562
name = "embassy-time-queue-utils"
569
-
version = "0.3.0"
563
+
version = "0.1.0"
570
564
source = "registry+https://github.com/rust-lang/crates.io-index"
571
-
checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454"
565
+
checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83"
572
566
dependencies = [
573
-
"embassy-executor-timer-queue",
567
+
"embassy-executor",
574
568
"heapless 0.8.0",
575
569
]
576
570
···
688
682
689
683
[[package]]
690
684
name = "ergot"
691
-
version = "0.12.0"
685
+
version = "0.11.0"
692
686
dependencies = [
693
687
"bbq2",
694
688
"cobs 0.3.0",
···
747
741
version = "0.3.31"
748
742
source = "registry+https://github.com/rust-lang/crates.io-index"
749
743
checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
744
+
745
+
[[package]]
746
+
name = "futures-task"
747
+
version = "0.3.31"
748
+
source = "registry+https://github.com/rust-lang/crates.io-index"
749
+
checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
750
+
751
+
[[package]]
752
+
name = "futures-util"
753
+
version = "0.3.31"
754
+
source = "registry+https://github.com/rust-lang/crates.io-index"
755
+
checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
756
+
dependencies = [
757
+
"futures-core",
758
+
"futures-task",
759
+
"pin-project-lite",
760
+
"pin-utils",
761
+
]
750
762
751
763
[[package]]
752
764
name = "generator"
···
1178
1190
version = "0.2.16"
1179
1191
source = "registry+https://github.com/rust-lang/crates.io-index"
1180
1192
checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
1193
+
1194
+
[[package]]
1195
+
name = "pin-utils"
1196
+
version = "0.1.0"
1197
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1198
+
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
1181
1199
1182
1200
[[package]]
1183
1201
name = "pio"
+4
-4
demos/rp2040/Cargo.toml
+4
-4
demos/rp2040/Cargo.toml
···
9
9
[workspace.dependencies]
10
10
bbq2 = { version = "0.4.1", default-features = false, features = ["critical-section", "maitake-sync-0_2"] }
11
11
cortex-m = { version = "0.7.6", features = ["inline-asm"] }
12
-
embassy-executor = { version = "0.9.1", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] }
13
-
embassy-rp = { version = "0.8.0", features = ["rp2040", "defmt", "unstable-pac", "time-driver", "critical-section-impl"] }
14
-
embassy-time = { version = "0.5.0", features = ["defmt", "defmt-timestamp-uptime"] }
12
+
embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] }
13
+
embassy-rp = { version = "0.6.0", features = ["rp2040", "defmt", "unstable-pac", "time-driver", "critical-section-impl"] }
14
+
embassy-time = { version = "0.4.0", features = ["defmt", "defmt-timestamp-uptime"] }
15
15
ergot = { path = "../../crates/ergot", features = ["embassy-usb-v0_5"] }
16
16
maitake-sync = { version = "0.2.2", default-features = false }
17
17
panic-probe = { version = "0.3", features = ["print-defmt"] }
18
18
portable-atomic = { version = "1.6.0", features = ["critical-section"] }
19
19
serde = { version = "1.0", default-features = false, features = ["derive"] }
20
-
embassy-futures = "0.1.2"
20
+
embassy-futures = "0.1.1"
21
21
cortex-m-rt = "0.7.5"
22
22
defmt = "1.0.1"
23
23
defmt-rtt = "1.0.0"
+49
-31
demos/rp2350/Cargo.lock
+49
-31
demos/rp2350/Cargo.lock
···
402
402
403
403
[[package]]
404
404
name = "embassy-embedded-hal"
405
-
version = "0.5.0"
405
+
version = "0.3.1"
406
406
source = "registry+https://github.com/rust-lang/crates.io-index"
407
-
checksum = "554e3e840696f54b4c9afcf28a0f24da431c927f4151040020416e7393d6d0d8"
407
+
checksum = "8578db196d74db92efdd5ebc546736dac1685499ee245b22eff92fa5e4b57945"
408
408
dependencies = [
409
409
"embassy-futures",
410
410
"embassy-hal-internal",
411
411
"embassy-sync",
412
+
"embassy-time",
412
413
"embedded-hal 0.2.7",
413
414
"embedded-hal 1.0.0",
414
415
"embedded-hal-async",
···
419
420
420
421
[[package]]
421
422
name = "embassy-executor"
422
-
version = "0.9.1"
423
+
version = "0.7.0"
423
424
source = "registry+https://github.com/rust-lang/crates.io-index"
424
-
checksum = "06070468370195e0e86f241c8e5004356d696590a678d47d6676795b2e439c6b"
425
+
checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6"
425
426
dependencies = [
426
427
"cortex-m",
427
428
"critical-section",
428
-
"defmt 1.0.1",
429
+
"defmt 0.3.100",
429
430
"document-features",
430
431
"embassy-executor-macros",
431
-
"embassy-executor-timer-queue",
432
432
]
433
433
434
434
[[package]]
435
435
name = "embassy-executor-macros"
436
-
version = "0.7.0"
436
+
version = "0.6.2"
437
437
source = "registry+https://github.com/rust-lang/crates.io-index"
438
-
checksum = "dfdddc3a04226828316bf31393b6903ee162238576b1584ee2669af215d55472"
438
+
checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf"
439
439
dependencies = [
440
440
"darling",
441
441
"proc-macro2",
···
444
444
]
445
445
446
446
[[package]]
447
-
name = "embassy-executor-timer-queue"
448
-
version = "0.1.0"
449
-
source = "registry+https://github.com/rust-lang/crates.io-index"
450
-
checksum = "2fc328bf943af66b80b98755db9106bf7e7471b0cf47dc8559cd9a6be504cc9c"
451
-
452
-
[[package]]
453
447
name = "embassy-futures"
454
-
version = "0.1.2"
448
+
version = "0.1.1"
455
449
source = "registry+https://github.com/rust-lang/crates.io-index"
456
-
checksum = "dc2d050bdc5c21e0862a89256ed8029ae6c290a93aecefc73084b3002cdebb01"
450
+
checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067"
457
451
458
452
[[package]]
459
453
name = "embassy-hal-internal"
···
486
480
487
481
[[package]]
488
482
name = "embassy-rp"
489
-
version = "0.8.0"
483
+
version = "0.6.0"
490
484
source = "registry+https://github.com/rust-lang/crates.io-index"
491
-
checksum = "1a284935af0a869de3fa14af74b5f932389dd66d7048012f1083b06f38d05399"
485
+
checksum = "d298ea0ae8797fbbc835d7ef321b1762916879b9df49695826f54d31c487f5de"
492
486
dependencies = [
493
487
"atomic-polyfill",
494
488
"cfg-if",
···
526
520
527
521
[[package]]
528
522
name = "embassy-sync"
529
-
version = "0.7.2"
523
+
version = "0.7.0"
530
524
source = "registry+https://github.com/rust-lang/crates.io-index"
531
-
checksum = "73974a3edbd0bd286759b3d483540f0ebef705919a5f56f4fc7709066f71689b"
525
+
checksum = "cef1a8a1ea892f9b656de0295532ac5d8067e9830d49ec75076291fd6066b136"
532
526
dependencies = [
533
527
"cfg-if",
534
528
"critical-section",
535
529
"embedded-io-async",
536
-
"futures-core",
537
530
"futures-sink",
531
+
"futures-util",
538
532
"heapless 0.8.0",
539
533
]
540
534
541
535
[[package]]
542
536
name = "embassy-time"
543
-
version = "0.5.0"
537
+
version = "0.4.0"
544
538
source = "registry+https://github.com/rust-lang/crates.io-index"
545
-
checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65"
539
+
checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8"
546
540
dependencies = [
547
541
"cfg-if",
548
542
"critical-section",
549
-
"defmt 1.0.1",
543
+
"defmt 0.3.100",
550
544
"document-features",
551
545
"embassy-time-driver",
552
546
"embedded-hal 0.2.7",
553
547
"embedded-hal 1.0.0",
554
548
"embedded-hal-async",
555
-
"futures-core",
549
+
"futures-util",
556
550
]
557
551
558
552
[[package]]
559
553
name = "embassy-time-driver"
560
-
version = "0.2.1"
554
+
version = "0.2.0"
561
555
source = "registry+https://github.com/rust-lang/crates.io-index"
562
-
checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6"
556
+
checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba"
563
557
dependencies = [
564
558
"document-features",
565
559
]
566
560
567
561
[[package]]
568
562
name = "embassy-time-queue-utils"
569
-
version = "0.3.0"
563
+
version = "0.1.0"
570
564
source = "registry+https://github.com/rust-lang/crates.io-index"
571
-
checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454"
565
+
checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83"
572
566
dependencies = [
573
-
"embassy-executor-timer-queue",
567
+
"embassy-executor",
574
568
"heapless 0.8.0",
575
569
]
576
570
···
699
693
700
694
[[package]]
701
695
name = "ergot"
702
-
version = "0.12.0"
696
+
version = "0.11.0"
703
697
dependencies = [
704
698
"bbq2",
705
699
"cobs 0.3.0",
···
758
752
version = "0.3.31"
759
753
source = "registry+https://github.com/rust-lang/crates.io-index"
760
754
checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
755
+
756
+
[[package]]
757
+
name = "futures-task"
758
+
version = "0.3.31"
759
+
source = "registry+https://github.com/rust-lang/crates.io-index"
760
+
checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
761
+
762
+
[[package]]
763
+
name = "futures-util"
764
+
version = "0.3.31"
765
+
source = "registry+https://github.com/rust-lang/crates.io-index"
766
+
checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
767
+
dependencies = [
768
+
"futures-core",
769
+
"futures-task",
770
+
"pin-project-lite",
771
+
"pin-utils",
772
+
]
761
773
762
774
[[package]]
763
775
name = "generator"
···
1189
1201
version = "0.2.16"
1190
1202
source = "registry+https://github.com/rust-lang/crates.io-index"
1191
1203
checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
1204
+
1205
+
[[package]]
1206
+
name = "pin-utils"
1207
+
version = "0.1.0"
1208
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1209
+
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
1192
1210
1193
1211
[[package]]
1194
1212
name = "pio"
+4
-4
demos/rp2350/Cargo.toml
+4
-4
demos/rp2350/Cargo.toml
···
9
9
[workspace.dependencies]
10
10
bbq2 = { version = "0.4.1", default-features = false, features = ["critical-section", "maitake-sync-0_2"] }
11
11
cortex-m = { version = "0.7.6", features = ["inline-asm"] }
12
-
embassy-executor = { version = "0.9.1", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] }
13
-
embassy-rp = { version = "0.8.0", features = ["rp235xa", "defmt", "unstable-pac", "time-driver", "critical-section-impl"] }
14
-
embassy-time = { version = "0.5.0", features = ["defmt", "defmt-timestamp-uptime"] }
12
+
embassy-executor = { version = "0.7.0", features = ["task-arena-size-32768", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] }
13
+
embassy-rp = { version = "0.6.0", features = ["rp235xa", "defmt", "unstable-pac", "time-driver", "critical-section-impl"] }
14
+
embassy-time = { version = "0.4.0", features = ["defmt", "defmt-timestamp-uptime"] }
15
15
ergot = { path = "../../crates/ergot", features = ["embassy-usb-v0_5"] }
16
16
maitake-sync = { version = "0.2.2", default-features = false }
17
17
panic-probe = { version = "0.3", features = ["print-defmt"] }
···
20
20
embedded-hal-bus = { version = "0.3.0", features = ["async"] }
21
21
embedded-hal = "1.0.0"
22
22
embedded-hal-async = "1.0.0"
23
-
embassy-futures = "0.1.2"
23
+
embassy-futures = "0.1.1"
24
24
cortex-m-rt = "0.7.5"
25
25
defmt = "1.0.1"
26
26
defmt-rtt = "1.0.0"
+2
-2
demos/rp2350/rp2350-tilt/src/lsm6ds3tr.rs
+2
-2
demos/rp2350/rp2350-tilt/src/lsm6ds3tr.rs
···
176
176
let res = self.read8(regs::WHO_AM_I);
177
177
match res {
178
178
Ok(g) => {
179
-
STACK.info_fmt(fmt!("Ok: {:02X}", g));
179
+
STACK.info_fmt(fmt!("Ok: {g:02X}"));
180
180
break;
181
181
}
182
182
Err(_e) => {
···
234
234
];
235
235
236
236
for (addr, val) in steps.iter().copied() {
237
-
STACK.info_fmt(fmt!("Writing to addr {:02X}, value {:02X}", addr, val));
237
+
STACK.info_fmt(fmt!("Writing to addr {addr:02X}, value {val:02X}"));
238
238
self.write8(addr, val)?;
239
239
Timer::after_millis(10).await;
240
240
}
+87
-29
demos/std/Cargo.lock
+87
-29
demos/std/Cargo.lock
···
847
847
checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f"
848
848
849
849
[[package]]
850
+
name = "darling"
851
+
version = "0.20.11"
852
+
source = "registry+https://github.com/rust-lang/crates.io-index"
853
+
checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee"
854
+
dependencies = [
855
+
"darling_core",
856
+
"darling_macro",
857
+
]
858
+
859
+
[[package]]
860
+
name = "darling_core"
861
+
version = "0.20.11"
862
+
source = "registry+https://github.com/rust-lang/crates.io-index"
863
+
checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e"
864
+
dependencies = [
865
+
"fnv",
866
+
"ident_case",
867
+
"proc-macro2",
868
+
"quote",
869
+
"strsim",
870
+
"syn",
871
+
]
872
+
873
+
[[package]]
874
+
name = "darling_macro"
875
+
version = "0.20.11"
876
+
source = "registry+https://github.com/rust-lang/crates.io-index"
877
+
checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead"
878
+
dependencies = [
879
+
"darling_core",
880
+
"quote",
881
+
"syn",
882
+
]
883
+
884
+
[[package]]
850
885
name = "dispatch"
851
886
version = "0.2.0"
852
887
source = "registry+https://github.com/rust-lang/crates.io-index"
···
1046
1081
]
1047
1082
1048
1083
[[package]]
1049
-
name = "embassy-executor-timer-queue"
1050
-
version = "0.1.0"
1084
+
name = "embassy-executor"
1085
+
version = "0.7.0"
1051
1086
source = "registry+https://github.com/rust-lang/crates.io-index"
1052
-
checksum = "2fc328bf943af66b80b98755db9106bf7e7471b0cf47dc8559cd9a6be504cc9c"
1087
+
checksum = "90327bcc66333a507f89ecc4e2d911b265c45f5c9bc241f98eee076752d35ac6"
1088
+
dependencies = [
1089
+
"critical-section",
1090
+
"document-features",
1091
+
"embassy-executor-macros",
1092
+
]
1093
+
1094
+
[[package]]
1095
+
name = "embassy-executor-macros"
1096
+
version = "0.6.2"
1097
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1098
+
checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf"
1099
+
dependencies = [
1100
+
"darling",
1101
+
"proc-macro2",
1102
+
"quote",
1103
+
"syn",
1104
+
]
1053
1105
1054
1106
[[package]]
1055
1107
name = "embassy-futures"
···
1059
1111
1060
1112
[[package]]
1061
1113
name = "embassy-time"
1062
-
version = "0.5.0"
1114
+
version = "0.4.0"
1063
1115
source = "registry+https://github.com/rust-lang/crates.io-index"
1064
-
checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65"
1116
+
checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8"
1065
1117
dependencies = [
1066
1118
"cfg-if",
1067
1119
"critical-section",
···
1071
1123
"embedded-hal 0.2.7",
1072
1124
"embedded-hal 1.0.0",
1073
1125
"embedded-hal-async",
1074
-
"futures-core",
1126
+
"futures-util",
1075
1127
]
1076
1128
1077
1129
[[package]]
1078
1130
name = "embassy-time-driver"
1079
-
version = "0.2.1"
1131
+
version = "0.2.0"
1080
1132
source = "registry+https://github.com/rust-lang/crates.io-index"
1081
-
checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6"
1133
+
checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba"
1082
1134
dependencies = [
1083
1135
"document-features",
1084
1136
]
1085
1137
1086
1138
[[package]]
1087
1139
name = "embassy-time-queue-utils"
1088
-
version = "0.3.0"
1140
+
version = "0.1.0"
1089
1141
source = "registry+https://github.com/rust-lang/crates.io-index"
1090
-
checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454"
1142
+
checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83"
1091
1143
dependencies = [
1092
-
"embassy-executor-timer-queue",
1144
+
"embassy-executor",
1093
1145
"heapless 0.8.0",
1094
1146
]
1095
1147
···
1212
1264
1213
1265
[[package]]
1214
1266
name = "ergot"
1215
-
version = "0.12.0"
1267
+
version = "0.11.0"
1216
1268
dependencies = [
1217
1269
"bbq2",
1218
1270
"cobs 0.3.0",
···
1238
1290
]
1239
1291
1240
1292
[[package]]
1241
-
name = "ergot-bridge-client-tcp"
1293
+
name = "ergot-bridge-client"
1242
1294
version = "0.1.0"
1243
1295
dependencies = [
1244
1296
"cordyceps",
···
1250
1302
]
1251
1303
1252
1304
[[package]]
1253
-
name = "ergot-bridge-pair-udp"
1254
-
version = "0.1.0"
1255
-
dependencies = [
1256
-
"cordyceps",
1257
-
"env_logger",
1258
-
"ergot",
1259
-
"log",
1260
-
"mutex",
1261
-
"tokio",
1262
-
]
1263
-
1264
-
[[package]]
1265
-
name = "ergot-client-tcp"
1305
+
name = "ergot-client"
1266
1306
version = "0.1.0"
1267
1307
dependencies = [
1268
1308
"cordyceps",
···
1370
1410
"crc32fast",
1371
1411
"miniz_oxide",
1372
1412
]
1413
+
1414
+
[[package]]
1415
+
name = "fnv"
1416
+
version = "1.0.7"
1417
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1418
+
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
1373
1419
1374
1420
[[package]]
1375
1421
name = "foldhash"
···
1881
1927
]
1882
1928
1883
1929
[[package]]
1930
+
name = "ident_case"
1931
+
version = "1.0.1"
1932
+
source = "registry+https://github.com/rust-lang/crates.io-index"
1933
+
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
1934
+
1935
+
[[package]]
1884
1936
name = "idna"
1885
1937
version = "1.1.0"
1886
1938
source = "registry+https://github.com/rust-lang/crates.io-index"
···
2120
2172
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
2121
2173
2122
2174
[[package]]
2123
-
name = "log-client-tcp"
2175
+
name = "log-client"
2124
2176
version = "0.1.0"
2125
2177
dependencies = [
2126
2178
"cordyceps",
···
2132
2184
]
2133
2185
2134
2186
[[package]]
2135
-
name = "log-router-serial"
2187
+
name = "log-router"
2136
2188
version = "0.1.0"
2137
2189
dependencies = [
2138
2190
"cordyceps",
···
2144
2196
]
2145
2197
2146
2198
[[package]]
2147
-
name = "log-router-tcp"
2199
+
name = "log-router-serial"
2148
2200
version = "0.1.0"
2149
2201
dependencies = [
2150
2202
"cordyceps",
···
3501
3553
version = "0.1.1"
3502
3554
source = "registry+https://github.com/rust-lang/crates.io-index"
3503
3555
checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731"
3556
+
3557
+
[[package]]
3558
+
name = "strsim"
3559
+
version = "0.11.1"
3560
+
source = "registry+https://github.com/rust-lang/crates.io-index"
3561
+
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
3504
3562
3505
3563
[[package]]
3506
3564
name = "strum"
+5
-5
demos/std/Cargo.toml
+5
-5
demos/std/Cargo.toml
···
1
1
[workspace]
2
2
members = [
3
-
"ergot-client-tcp",
4
-
"ergot-bridge-client-tcp",
3
+
"ergot-client",
4
+
"ergot-bridge-client",
5
5
"ergot-nusb-router",
6
6
"ergot-router",
7
7
"ergot-seed-router",
8
-
"log-client-tcp",
9
-
"log-router-tcp",
8
+
"log-client",
9
+
"log-router",
10
10
"log-router-serial",
11
11
"stream-plotting",
12
-
"tilt-app", "ergot-bridge-pair-udp",
12
+
"tilt-app",
13
13
]
14
14
resolver = "2"
15
15
+12
demos/std/ergot-bridge-client/Cargo.toml
+12
demos/std/ergot-bridge-client/Cargo.toml
···
1
+
[package]
2
+
name = "ergot-bridge-client"
3
+
version = "0.1.0"
4
+
edition = "2024"
5
+
6
+
[dependencies]
7
+
cordyceps = { workspace = true }
8
+
env_logger = { workspace = true }
9
+
log = { workspace = true }
10
+
ergot = { workspace = true }
11
+
mutex = { workspace = true }
12
+
tokio = { workspace = true }
+106
demos/std/ergot-bridge-client/src/main.rs
+106
demos/std/ergot-bridge-client/src/main.rs
···
1
+
use ergot::{
2
+
FrameKind,
3
+
logging::log_v0_4::LogSink,
4
+
toolkits::tokio_tcp::{EdgeStack, new_std_queue, new_target_stack, register_edge_interface},
5
+
topic,
6
+
traits::Endpoint,
7
+
well_known::{DeviceInfo, ErgotSeedRouterAssignmentEndpoint, NameRequirement, SocketQuery},
8
+
};
9
+
use log::{info, warn};
10
+
use tokio::{net::TcpStream, select, time::sleep};
11
+
12
+
use std::{io, pin::pin, time::Duration};
13
+
14
+
topic!(YeetTopic, u64, "topic/yeet");
15
+
16
+
#[tokio::main]
17
+
async fn main() -> io::Result<()> {
18
+
let queue = new_std_queue(4096);
19
+
let stack: EdgeStack = new_target_stack(&queue, 1024);
20
+
let socket = TcpStream::connect("127.0.0.1:2025").await.unwrap();
21
+
let port = socket.local_addr().unwrap().port();
22
+
// let logger = Box::new(LogSink::new(stack.clone()));
23
+
// let logger = Box::leak(logger);
24
+
// logger.register_static(log::LevelFilter::Info);
25
+
env_logger::init();
26
+
27
+
tokio::task::spawn(basic_services(stack.clone(), port));
28
+
// tokio::task::spawn(yeeter(stack.clone()));
29
+
// for i in 1..4 {
30
+
// tokio::task::spawn(yeet_listener(stack.clone(), i));
31
+
// }
32
+
33
+
register_edge_interface(&stack, socket, &queue)
34
+
.await
35
+
.unwrap();
36
+
loop {
37
+
info!("Hello :)");
38
+
// tokio::time::sleep(Duration::from_secs(1)).await;
39
+
let query = SocketQuery {
40
+
key: ErgotSeedRouterAssignmentEndpoint::REQ_KEY.to_bytes(),
41
+
nash_req: NameRequirement::Any,
42
+
frame_kind: FrameKind::ENDPOINT_REQ,
43
+
broadcast: false,
44
+
};
45
+
log::error!("Do Disco!");
46
+
let res = stack
47
+
.discovery()
48
+
.discover_sockets(4, Duration::from_secs(1), &query)
49
+
.await;
50
+
if res.is_empty() {
51
+
log::warn!("No Disco");
52
+
sleep(Duration::from_secs(1)).await;
53
+
continue;
54
+
}
55
+
56
+
log::warn!("DISCO SAID: {res:?}");
57
+
let resp = stack
58
+
.endpoints()
59
+
.request::<ErgotSeedRouterAssignmentEndpoint>(res[0].address, &(), None)
60
+
.await;
61
+
log::warn!("GOT: {resp:?}");
62
+
break;
63
+
}
64
+
65
+
loop {
66
+
info!("Done :)");
67
+
sleep(Duration::from_secs(1)).await;
68
+
}
69
+
}
70
+
71
+
async fn basic_services(stack: EdgeStack, port: u16) {
72
+
let info = DeviceInfo {
73
+
name: Some("Ergot client".try_into().unwrap()),
74
+
description: Some("An Ergot Client Device".try_into().unwrap()),
75
+
unique_id: port.into(),
76
+
};
77
+
let do_pings = stack.services().ping_handler::<4>();
78
+
let do_info = stack.services().device_info_handler::<4>(&info);
79
+
80
+
select! {
81
+
_ = do_pings => {}
82
+
_ = do_info => {}
83
+
}
84
+
}
85
+
86
+
async fn yeeter(stack: EdgeStack) {
87
+
let mut ctr = 0;
88
+
tokio::time::sleep(Duration::from_secs(3)).await;
89
+
loop {
90
+
tokio::time::sleep(Duration::from_secs(5)).await;
91
+
warn!("Sending broadcast message");
92
+
stack.topics().broadcast::<YeetTopic>(&ctr, None).unwrap();
93
+
ctr += 1;
94
+
}
95
+
}
96
+
97
+
async fn yeet_listener(stack: EdgeStack, id: u8) {
98
+
let subber = stack.topics().heap_bounded_receiver::<YeetTopic>(64, None);
99
+
let subber = pin!(subber);
100
+
let mut hdl = subber.subscribe();
101
+
102
+
loop {
103
+
let msg = hdl.recv().await;
104
+
info!("{}: Listener id:{id} got {}", msg.hdr, msg.t);
105
+
}
106
+
}
-12
demos/std/ergot-bridge-client-tcp/Cargo.toml
-12
demos/std/ergot-bridge-client-tcp/Cargo.toml
···
1
-
[package]
2
-
name = "ergot-bridge-client-tcp"
3
-
version = "0.1.0"
4
-
edition = "2024"
5
-
6
-
[dependencies]
7
-
cordyceps = { workspace = true }
8
-
env_logger = { workspace = true }
9
-
log = { workspace = true }
10
-
ergot = { workspace = true }
11
-
mutex = { workspace = true }
12
-
tokio = { workspace = true }
-106
demos/std/ergot-bridge-client-tcp/src/main.rs
-106
demos/std/ergot-bridge-client-tcp/src/main.rs
···
1
-
use ergot::{
2
-
FrameKind,
3
-
logging::log_v0_4::LogSink,
4
-
toolkits::tokio_tcp::{EdgeStack, new_std_queue, new_target_stack, register_edge_interface},
5
-
topic,
6
-
traits::Endpoint,
7
-
well_known::{DeviceInfo, ErgotSeedRouterAssignmentEndpoint, NameRequirement, SocketQuery},
8
-
};
9
-
use log::{info, warn};
10
-
use tokio::{net::TcpStream, select, time::sleep};
11
-
12
-
use std::{io, pin::pin, time::Duration};
13
-
14
-
topic!(YeetTopic, u64, "topic/yeet");
15
-
16
-
#[tokio::main]
17
-
async fn main() -> io::Result<()> {
18
-
let queue = new_std_queue(4096);
19
-
let stack: EdgeStack = new_target_stack(&queue, 1024);
20
-
let socket = TcpStream::connect("127.0.0.1:2025").await.unwrap();
21
-
let port = socket.local_addr().unwrap().port();
22
-
// let logger = Box::new(LogSink::new(stack.clone()));
23
-
// let logger = Box::leak(logger);
24
-
// logger.register_static(log::LevelFilter::Info);
25
-
env_logger::init();
26
-
27
-
tokio::task::spawn(basic_services(stack.clone(), port));
28
-
// tokio::task::spawn(yeeter(stack.clone()));
29
-
// for i in 1..4 {
30
-
// tokio::task::spawn(yeet_listener(stack.clone(), i));
31
-
// }
32
-
33
-
register_edge_interface(&stack, socket, &queue)
34
-
.await
35
-
.unwrap();
36
-
loop {
37
-
info!("Hello :)");
38
-
// tokio::time::sleep(Duration::from_secs(1)).await;
39
-
let query = SocketQuery {
40
-
key: ErgotSeedRouterAssignmentEndpoint::REQ_KEY.to_bytes(),
41
-
nash_req: NameRequirement::Any,
42
-
frame_kind: FrameKind::ENDPOINT_REQ,
43
-
broadcast: false,
44
-
};
45
-
log::error!("Do Disco!");
46
-
let res = stack
47
-
.discovery()
48
-
.discover_sockets(4, Duration::from_secs(1), &query)
49
-
.await;
50
-
if res.is_empty() {
51
-
log::warn!("No Disco");
52
-
sleep(Duration::from_secs(1)).await;
53
-
continue;
54
-
}
55
-
56
-
log::warn!("DISCO SAID: {:?}", res);
57
-
let resp = stack
58
-
.endpoints()
59
-
.request::<ErgotSeedRouterAssignmentEndpoint>(res[0].address, &(), None)
60
-
.await;
61
-
log::warn!("GOT: {:?}", resp);
62
-
break;
63
-
}
64
-
65
-
loop {
66
-
info!("Done :)");
67
-
sleep(Duration::from_secs(1)).await;
68
-
}
69
-
}
70
-
71
-
async fn basic_services(stack: EdgeStack, port: u16) {
72
-
let info = DeviceInfo {
73
-
name: Some("Ergot client".try_into().unwrap()),
74
-
description: Some("An Ergot Client Device".try_into().unwrap()),
75
-
unique_id: port.into(),
76
-
};
77
-
let do_pings = stack.services().ping_handler::<4>();
78
-
let do_info = stack.services().device_info_handler::<4>(&info);
79
-
80
-
select! {
81
-
_ = do_pings => {}
82
-
_ = do_info => {}
83
-
}
84
-
}
85
-
86
-
async fn yeeter(stack: EdgeStack) {
87
-
let mut ctr = 0;
88
-
tokio::time::sleep(Duration::from_secs(3)).await;
89
-
loop {
90
-
tokio::time::sleep(Duration::from_secs(5)).await;
91
-
warn!("Sending broadcast message");
92
-
stack.topics().broadcast::<YeetTopic>(&ctr, None).unwrap();
93
-
ctr += 1;
94
-
}
95
-
}
96
-
97
-
async fn yeet_listener(stack: EdgeStack, id: u8) {
98
-
let subber = stack.topics().heap_bounded_receiver::<YeetTopic>(64, None);
99
-
let subber = pin!(subber);
100
-
let mut hdl = subber.subscribe();
101
-
102
-
loop {
103
-
let msg = hdl.recv().await;
104
-
info!("{}: Listener id:{} got {}", msg.hdr, id, msg.t);
105
-
}
106
-
}
-18
demos/std/ergot-bridge-pair-udp/Cargo.toml
-18
demos/std/ergot-bridge-pair-udp/Cargo.toml
···
1
-
[package]
2
-
name = "ergot-bridge-pair-udp"
3
-
version = "0.1.0"
4
-
edition = "2024"
5
-
6
-
[dependencies]
7
-
cordyceps = { workspace = true }
8
-
env_logger = { workspace = true }
9
-
log = { workspace = true }
10
-
ergot = { workspace = true }
11
-
mutex = { workspace = true }
12
-
tokio = { workspace = true }
13
-
14
-
[[bin]]
15
-
name = "controller"
16
-
17
-
[[bin]]
18
-
name = "target"
-125
demos/std/ergot-bridge-pair-udp/src/bin/controller.rs
-125
demos/std/ergot-bridge-pair-udp/src/bin/controller.rs
···
1
-
use ergot::{
2
-
toolkits::tokio_udp::{
3
-
EdgeStack, new_controller_stack, new_std_queue, register_edge_interface,
4
-
},
5
-
topic,
6
-
well_known::DeviceInfo,
7
-
};
8
-
use log::{debug, info, warn};
9
-
use tokio::{net::UdpSocket, select, time, time::sleep};
10
-
11
-
use ergot::interface_manager::profiles::direct_edge::tokio_udp::InterfaceKind;
12
-
use std::collections::HashSet;
13
-
use std::convert::TryInto;
14
-
use std::{io, pin::pin, time::Duration};
15
-
use tokio::time::interval;
16
-
17
-
topic!(YeetTopic, u64, "topic/yeet");
18
-
19
-
#[tokio::main]
20
-
async fn main() -> io::Result<()> {
21
-
let queue = new_std_queue(4096);
22
-
let stack: EdgeStack = new_controller_stack(&queue, 1024);
23
-
24
-
env_logger::init();
25
-
26
-
let udp_socket = UdpSocket::bind("127.0.0.1:8000").await.unwrap();
27
-
let remote_addr = "127.0.0.1:8001";
28
-
29
-
udp_socket.connect(remote_addr).await?;
30
-
31
-
let port = udp_socket.local_addr().unwrap().port();
32
-
33
-
tokio::task::spawn(basic_services(stack.clone(), port));
34
-
tokio::task::spawn(yeeter(stack.clone()));
35
-
tokio::task::spawn(yeet_listener(stack.clone(), 0));
36
-
37
-
register_edge_interface(&stack, udp_socket, &queue, InterfaceKind::Controller)
38
-
.await
39
-
.unwrap();
40
-
41
-
loop {
42
-
println!("Waiting for messages...");
43
-
sleep(Duration::from_secs(1)).await;
44
-
}
45
-
}
46
-
47
-
async fn basic_services(stack: EdgeStack, port: u16) {
48
-
let info = DeviceInfo {
49
-
name: Some("Ergot client".try_into().unwrap()),
50
-
description: Some("An Ergot Client Device".try_into().unwrap()),
51
-
unique_id: port.into(),
52
-
};
53
-
let do_pings = stack.services().ping_handler::<4>();
54
-
let do_info = stack.services().device_info_handler::<4>(&info);
55
-
// custom service for doing discovery on a set interval, in parallel
56
-
let disco_req = tokio::spawn(do_discovery(stack.clone()));
57
-
// forward log messages to the log crate output
58
-
let log_handler = stack.services().log_handler(16);
59
-
60
-
select! {
61
-
_ = do_pings => {}
62
-
_ = do_info => {}
63
-
_ = disco_req => {},
64
-
_ = log_handler => {},
65
-
}
66
-
}
67
-
68
-
async fn do_discovery(stack: EdgeStack) {
69
-
let mut max = 16;
70
-
let mut seen = HashSet::new();
71
-
let mut ticker = interval(Duration::from_millis(5000));
72
-
loop {
73
-
ticker.tick().await;
74
-
let new_seen = stack
75
-
.discovery()
76
-
.discover(max, Duration::from_millis(2500))
77
-
.await;
78
-
max = max.max(seen.len() * 2);
79
-
let new_seen = HashSet::from_iter(new_seen);
80
-
let added = new_seen.difference(&seen);
81
-
for add in added {
82
-
info!("Added: {:?}", add);
83
-
}
84
-
let removed = seen.difference(&new_seen);
85
-
for rem in removed {
86
-
info!("Removed: {:?}", rem);
87
-
}
88
-
seen = new_seen;
89
-
90
-
ticker.tick().await;
91
-
}
92
-
}
93
-
94
-
async fn yeeter(stack: EdgeStack) {
95
-
let mut ctr = 0;
96
-
tokio::time::sleep(Duration::from_secs(1)).await;
97
-
loop {
98
-
tokio::time::sleep(Duration::from_secs(5)).await;
99
-
info!("Sending broadcast message from controller");
100
-
stack.topics().broadcast::<YeetTopic>(&ctr, None).unwrap();
101
-
ctr += 1;
102
-
}
103
-
}
104
-
105
-
async fn yeet_listener(stack: EdgeStack, id: u8) {
106
-
let subber = stack.topics().heap_bounded_receiver::<YeetTopic>(64, None);
107
-
let subber = pin!(subber);
108
-
let mut hdl = subber.subscribe();
109
-
110
-
let mut packets_this_interval = 0;
111
-
let interval = Duration::from_secs(1);
112
-
let mut ticker = time::interval(interval);
113
-
loop {
114
-
select! {
115
-
_ = ticker.tick() => {
116
-
info!("packet rate: {}/{:?}", packets_this_interval, interval);
117
-
packets_this_interval = 0;
118
-
}
119
-
msg = hdl.recv() => {
120
-
packets_this_interval += 1;
121
-
debug!("{}: Listener id:{} got {}", msg.hdr, id, msg.t);
122
-
}
123
-
}
124
-
}
125
-
}
-94
demos/std/ergot-bridge-pair-udp/src/bin/target.rs
-94
demos/std/ergot-bridge-pair-udp/src/bin/target.rs
···
1
-
use ergot::{
2
-
toolkits::tokio_udp::{EdgeStack, new_std_queue, new_target_stack, register_edge_interface},
3
-
topic,
4
-
well_known::DeviceInfo,
5
-
};
6
-
use log::{debug, info};
7
-
use tokio::{net::UdpSocket, select, time, time::sleep};
8
-
9
-
use ergot::interface_manager::profiles::direct_edge::tokio_udp::InterfaceKind;
10
-
use ergot::logging::log_v0_4::LogSink;
11
-
use std::convert::TryInto;
12
-
use std::{io, pin::pin, time::Duration};
13
-
14
-
topic!(YeetTopic, u64, "topic/yeet");
15
-
16
-
#[tokio::main]
17
-
async fn main() -> io::Result<()> {
18
-
//env_logger::init();
19
-
20
-
let queue = new_std_queue(4096);
21
-
let stack: EdgeStack = new_target_stack(&queue, 1024);
22
-
23
-
let logger = Box::new(LogSink::new(stack.clone()));
24
-
let logger = Box::leak(logger);
25
-
logger.register_static(log::LevelFilter::Info);
26
-
27
-
let udp_socket = UdpSocket::bind("127.0.0.1:8001").await.unwrap();
28
-
let remote_addr = "127.0.0.1:8000";
29
-
30
-
udp_socket.connect(remote_addr).await?;
31
-
32
-
let port = udp_socket.local_addr().unwrap().port();
33
-
34
-
tokio::task::spawn(basic_services(stack.clone(), port));
35
-
tokio::task::spawn(yeeter(stack.clone()));
36
-
tokio::task::spawn(yeet_listener(stack.clone(), 0));
37
-
38
-
register_edge_interface(&stack, udp_socket, &queue, InterfaceKind::Target)
39
-
.await
40
-
.unwrap();
41
-
42
-
loop {
43
-
println!("Waiting for messages...");
44
-
sleep(Duration::from_secs(1)).await;
45
-
}
46
-
}
47
-
48
-
async fn basic_services(stack: EdgeStack, port: u16) {
49
-
let info = DeviceInfo {
50
-
name: Some("Ergot client".try_into().unwrap()),
51
-
description: Some("An Ergot Client Device".try_into().unwrap()),
52
-
unique_id: port.into(),
53
-
};
54
-
let do_pings = stack.services().ping_handler::<4>();
55
-
let do_info = stack.services().device_info_handler::<4>(&info);
56
-
57
-
select! {
58
-
_ = do_pings => {}
59
-
_ = do_info => {}
60
-
}
61
-
}
62
-
63
-
async fn yeeter(stack: EdgeStack) {
64
-
let mut ctr = 0;
65
-
tokio::time::sleep(Duration::from_secs(1)).await;
66
-
loop {
67
-
tokio::time::sleep(Duration::from_secs(5)).await;
68
-
info!("Sending broadcast message from target");
69
-
stack.topics().broadcast::<YeetTopic>(&ctr, None).unwrap();
70
-
ctr += 1;
71
-
}
72
-
}
73
-
74
-
async fn yeet_listener(stack: EdgeStack, id: u8) {
75
-
let subber = stack.topics().heap_bounded_receiver::<YeetTopic>(64, None);
76
-
let subber = pin!(subber);
77
-
let mut hdl = subber.subscribe();
78
-
79
-
let mut packets_this_interval = 0;
80
-
let interval = Duration::from_secs(1);
81
-
let mut ticker = time::interval(interval);
82
-
loop {
83
-
select! {
84
-
_ = ticker.tick() => {
85
-
info!("packet rate: {}/{:?}", packets_this_interval, interval);
86
-
packets_this_interval = 0;
87
-
}
88
-
msg = hdl.recv() => {
89
-
packets_this_interval += 1;
90
-
debug!("{}: Listener id:{} got {}", msg.hdr, id, msg.t);
91
-
}
92
-
}
93
-
}
94
-
}
+12
demos/std/ergot-client/Cargo.toml
+12
demos/std/ergot-client/Cargo.toml
···
1
+
[package]
2
+
name = "ergot-client"
3
+
version = "0.1.0"
4
+
edition = "2024"
5
+
6
+
[dependencies]
7
+
cordyceps = { workspace = true }
8
+
env_logger = { workspace = true }
9
+
log = { workspace = true }
10
+
ergot = { workspace = true }
11
+
mutex = { workspace = true }
12
+
tokio = { workspace = true }
+74
demos/std/ergot-client/src/main.rs
+74
demos/std/ergot-client/src/main.rs
···
1
+
use ergot::{
2
+
logging::log_v0_4::LogSink,
3
+
toolkits::tokio_tcp::{EdgeStack, new_std_queue, new_target_stack, register_edge_interface},
4
+
topic,
5
+
well_known::DeviceInfo,
6
+
};
7
+
use log::{info, warn};
8
+
use tokio::{net::TcpStream, select};
9
+
10
+
use std::{io, pin::pin, time::Duration};
11
+
12
+
topic!(YeetTopic, u64, "topic/yeet");
13
+
14
+
#[tokio::main]
15
+
async fn main() -> io::Result<()> {
16
+
let queue = new_std_queue(4096);
17
+
let stack: EdgeStack = new_target_stack(&queue, 1024);
18
+
let socket = TcpStream::connect("127.0.0.1:2025").await.unwrap();
19
+
let port = socket.local_addr().unwrap().port();
20
+
let logger = Box::new(LogSink::new(stack.clone()));
21
+
let logger = Box::leak(logger);
22
+
logger.register_static(log::LevelFilter::Info);
23
+
24
+
tokio::task::spawn(basic_services(stack.clone(), port));
25
+
tokio::task::spawn(yeeter(stack.clone()));
26
+
for i in 1..4 {
27
+
tokio::task::spawn(yeet_listener(stack.clone(), i));
28
+
}
29
+
30
+
register_edge_interface(&stack, socket, &queue)
31
+
.await
32
+
.unwrap();
33
+
loop {
34
+
info!("Hello :)");
35
+
tokio::time::sleep(Duration::from_secs(1)).await;
36
+
}
37
+
}
38
+
39
+
async fn basic_services(stack: EdgeStack, port: u16) {
40
+
let info = DeviceInfo {
41
+
name: Some("Ergot client".try_into().unwrap()),
42
+
description: Some("An Ergot Client Device".try_into().unwrap()),
43
+
unique_id: port.into(),
44
+
};
45
+
let do_pings = stack.services().ping_handler::<4>();
46
+
let do_info = stack.services().device_info_handler::<4>(&info);
47
+
48
+
select! {
49
+
_ = do_pings => {}
50
+
_ = do_info => {}
51
+
}
52
+
}
53
+
54
+
async fn yeeter(stack: EdgeStack) {
55
+
let mut ctr = 0;
56
+
tokio::time::sleep(Duration::from_secs(3)).await;
57
+
loop {
58
+
tokio::time::sleep(Duration::from_secs(5)).await;
59
+
warn!("Sending broadcast message");
60
+
stack.topics().broadcast::<YeetTopic>(&ctr, None).unwrap();
61
+
ctr += 1;
62
+
}
63
+
}
64
+
65
+
async fn yeet_listener(stack: EdgeStack, id: u8) {
66
+
let subber = stack.topics().heap_bounded_receiver::<YeetTopic>(64, None);
67
+
let subber = pin!(subber);
68
+
let mut hdl = subber.subscribe();
69
+
70
+
loop {
71
+
let msg = hdl.recv().await;
72
+
info!("{}: Listener id:{id} got {}", msg.hdr, msg.t);
73
+
}
74
+
}
-12
demos/std/ergot-client-tcp/Cargo.toml
-12
demos/std/ergot-client-tcp/Cargo.toml
···
1
-
[package]
2
-
name = "ergot-client-tcp"
3
-
version = "0.1.0"
4
-
edition = "2024"
5
-
6
-
[dependencies]
7
-
cordyceps = { workspace = true }
8
-
env_logger = { workspace = true }
9
-
log = { workspace = true }
10
-
ergot = { workspace = true }
11
-
mutex = { workspace = true }
12
-
tokio = { workspace = true }
-74
demos/std/ergot-client-tcp/src/main.rs
-74
demos/std/ergot-client-tcp/src/main.rs
···
1
-
use ergot::{
2
-
logging::log_v0_4::LogSink,
3
-
toolkits::tokio_tcp::{EdgeStack, new_std_queue, new_target_stack, register_edge_interface},
4
-
topic,
5
-
well_known::DeviceInfo,
6
-
};
7
-
use log::{info, warn};
8
-
use tokio::{net::TcpStream, select};
9
-
10
-
use std::{io, pin::pin, time::Duration};
11
-
12
-
topic!(YeetTopic, u64, "topic/yeet");
13
-
14
-
#[tokio::main]
15
-
async fn main() -> io::Result<()> {
16
-
let queue = new_std_queue(4096);
17
-
let stack: EdgeStack = new_target_stack(&queue, 1024);
18
-
let socket = TcpStream::connect("127.0.0.1:2025").await.unwrap();
19
-
let port = socket.local_addr().unwrap().port();
20
-
let logger = Box::new(LogSink::new(stack.clone()));
21
-
let logger = Box::leak(logger);
22
-
logger.register_static(log::LevelFilter::Info);
23
-
24
-
tokio::task::spawn(basic_services(stack.clone(), port));
25
-
tokio::task::spawn(yeeter(stack.clone()));
26
-
for i in 1..4 {
27
-
tokio::task::spawn(yeet_listener(stack.clone(), i));
28
-
}
29
-
30
-
register_edge_interface(&stack, socket, &queue)
31
-
.await
32
-
.unwrap();
33
-
loop {
34
-
info!("Hello :)");
35
-
tokio::time::sleep(Duration::from_secs(1)).await;
36
-
}
37
-
}
38
-
39
-
async fn basic_services(stack: EdgeStack, port: u16) {
40
-
let info = DeviceInfo {
41
-
name: Some("Ergot client".try_into().unwrap()),
42
-
description: Some("An Ergot Client Device".try_into().unwrap()),
43
-
unique_id: port.into(),
44
-
};
45
-
let do_pings = stack.services().ping_handler::<4>();
46
-
let do_info = stack.services().device_info_handler::<4>(&info);
47
-
48
-
select! {
49
-
_ = do_pings => {}
50
-
_ = do_info => {}
51
-
}
52
-
}
53
-
54
-
async fn yeeter(stack: EdgeStack) {
55
-
let mut ctr = 0;
56
-
tokio::time::sleep(Duration::from_secs(3)).await;
57
-
loop {
58
-
tokio::time::sleep(Duration::from_secs(5)).await;
59
-
warn!("Sending broadcast message");
60
-
stack.topics().broadcast::<YeetTopic>(&ctr, None).unwrap();
61
-
ctr += 1;
62
-
}
63
-
}
64
-
65
-
async fn yeet_listener(stack: EdgeStack, id: u8) {
66
-
let subber = stack.topics().heap_bounded_receiver::<YeetTopic>(64, None);
67
-
let subber = pin!(subber);
68
-
let mut hdl = subber.subscribe();
69
-
70
-
loop {
71
-
let msg = hdl.recv().await;
72
-
info!("{}: Listener id:{} got {}", msg.hdr, id, msg.t);
73
-
}
74
-
}
+4
-4
demos/std/ergot-nusb-router/src/main.rs
+4
-4
demos/std/ergot-nusb-router/src/main.rs
···
39
39
40
40
for dev in devices {
41
41
let info = dev.info.clone();
42
-
info!("Found {:?}, registering", info);
42
+
info!("Found {info:?}, registering");
43
43
let _hdl = register_router_interface(&stack, dev, MTU, OUT_BUFFER_SIZE)
44
44
.await
45
45
.unwrap();
···
59
59
loop {
60
60
ival.tick().await;
61
61
let nets = stack.manage_profile(|im| im.get_nets());
62
-
info!("Nets to ping: {:?}", nets);
62
+
info!("Nets to ping: {nets:?}");
63
63
for net in nets {
64
64
let pg = ctr;
65
65
ctr = ctr.wrapping_add(1);
···
85
85
let fut = timeout(Duration::from_millis(100), rr);
86
86
let res = fut.await;
87
87
let elapsed = start.elapsed();
88
-
warn!("ping {}.2 w/ {}: {:?}, took: {:?}", net, pg, res, elapsed);
88
+
warn!("ping {net}.2 w/ {pg}: {res:?}, took: {elapsed:?}");
89
89
if let Ok(Ok(msg)) = res {
90
90
assert_eq!(msg.t, pg);
91
91
portmap.insert(net, msg.hdr.src.port_id);
···
103
103
104
104
loop {
105
105
let msg = hdl.recv().await;
106
-
info!("{}: Listener id:{} got {}", msg.hdr, id, msg.t);
106
+
info!("{}: Listener id:{id} got {}", msg.hdr, msg.t);
107
107
}
108
108
}
+8
-10
demos/std/ergot-router/src/main.rs
+8
-10
demos/std/ergot-router/src/main.rs
···
29
29
// TODO: Should the library just do this for us? something like
30
30
loop {
31
31
let (socket, addr) = listener.accept().await?;
32
-
info!("Connect {:?}", addr);
32
+
info!("Connect {addr:?}");
33
33
register_router_interface(&stack, socket, MAX_ERGOT_PACKET_SIZE, TX_BUFFER_SIZE)
34
34
.await
35
35
.unwrap();
···
46
46
let disco_answer = stack.services().device_info_handler::<4>(&info);
47
47
// handle incoming ping requests
48
48
let ping_answer = stack.services().ping_handler::<4>();
49
-
// custom service for doing discovery on a set interval, in parallel
50
-
let disco_req = tokio::spawn(do_discovery(stack.clone()));
49
+
// custom service for doing discovery regularly
50
+
let disco_req = do_discovery(stack.clone());
51
51
// forward log messages to the log crate output
52
52
let log_handler = stack.services().log_handler(16);
53
53
···
63
63
async fn do_discovery(stack: RouterStack) {
64
64
let mut max = 16;
65
65
let mut seen = HashSet::new();
66
-
let mut ticker = interval(Duration::from_millis(5000));
66
+
let mut ticker = interval(Duration::from_millis(500));
67
67
loop {
68
68
ticker.tick().await;
69
69
let new_seen = stack
70
70
.discovery()
71
-
.discover(max, Duration::from_millis(2500))
71
+
.discover(max, Duration::from_millis(250))
72
72
.await;
73
73
max = max.max(seen.len() * 2);
74
74
let new_seen = HashSet::from_iter(new_seen);
75
75
let added = new_seen.difference(&seen);
76
76
for add in added {
77
-
warn!("Added: {:?}", add);
77
+
warn!("Added: {add:?}");
78
78
}
79
79
let removed = seen.difference(&new_seen);
80
80
for rem in removed {
81
-
warn!("Removed: {:?}", rem);
81
+
warn!("Removed: {rem:?}");
82
82
}
83
83
seen = new_seen;
84
-
85
-
ticker.tick().await;
86
84
}
87
85
}
88
86
···
93
91
94
92
loop {
95
93
let msg = hdl.recv().await;
96
-
info!("{}: Listener id:{} got {}", msg.hdr, id, msg.t);
94
+
info!("{}: Listener id:{id} got {}", msg.hdr, msg.t);
97
95
}
98
96
}
+7
-8
demos/std/ergot-seed-router/src/main.rs
+7
-8
demos/std/ergot-seed-router/src/main.rs
···
29
29
// TODO: Should the library just do this for us? something like
30
30
loop {
31
31
let (socket, addr) = listener.accept().await?;
32
-
info!("Connect {:?}", addr);
32
+
info!("Connect {addr:?}");
33
33
register_router_interface(&stack, socket, MAX_ERGOT_PACKET_SIZE, TX_BUFFER_SIZE)
34
34
.await
35
35
.unwrap();
···
46
46
let disco_answer = stack.services().device_info_handler::<4>(&info);
47
47
// handle incoming ping requests
48
48
let ping_answer = stack.services().ping_handler::<4>();
49
-
// custom service for doing discovery on a set interval, in parallel
50
-
let disco_req = tokio::spawn(do_discovery(stack.clone()));
49
+
// custom service for doing discovery regularly
50
+
let disco_req = do_discovery(stack.clone());
51
51
// forward log messages to the log crate output
52
52
let log_handler = stack.services().log_handler(16);
53
53
// Seed router
···
71
71
let mut seen = HashSet::new();
72
72
let mut ticker = interval(Duration::from_millis(5000));
73
73
loop {
74
+
ticker.tick().await;
74
75
let new_seen = stack
75
76
.discovery()
76
77
.discover(max, Duration::from_millis(2500))
···
79
80
let new_seen = HashSet::from_iter(new_seen);
80
81
let added = new_seen.difference(&seen);
81
82
for add in added {
82
-
warn!("Added: {:?}", add);
83
+
warn!("Added: {add:?}");
83
84
}
84
85
let removed = seen.difference(&new_seen);
85
86
for rem in removed {
86
-
warn!("Removed: {:?}", rem);
87
+
warn!("Removed: {rem:?}");
87
88
}
88
89
seen = new_seen;
89
-
90
-
ticker.tick().await;
91
90
}
92
91
}
93
92
···
98
97
99
98
loop {
100
99
let msg = hdl.recv().await;
101
-
info!("Listener id:{} got {:?}", id, msg);
100
+
info!("Listener id:{id} got {msg:?}");
102
101
}
103
102
}
+12
demos/std/log-client/Cargo.toml
+12
demos/std/log-client/Cargo.toml
···
1
+
[package]
2
+
name = "log-client"
3
+
version = "0.1.0"
4
+
edition = "2024"
5
+
6
+
[dependencies]
7
+
cordyceps = { workspace = true }
8
+
env_logger = { workspace = true }
9
+
log = { workspace = true }
10
+
ergot = { workspace = true }
11
+
mutex = { workspace = true }
12
+
tokio = { workspace = true }
+29
demos/std/log-client/src/main.rs
+29
demos/std/log-client/src/main.rs
···
1
+
use ergot::{
2
+
fmt,
3
+
toolkits::tokio_tcp::{EdgeStack, new_std_queue, new_target_stack, register_edge_interface},
4
+
};
5
+
use tokio::net::TcpStream;
6
+
7
+
use std::{io, time::Duration};
8
+
9
+
#[tokio::main]
10
+
async fn main() -> io::Result<()> {
11
+
let queue = new_std_queue(4096);
12
+
let stack: EdgeStack = new_target_stack(&queue, 1024);
13
+
14
+
env_logger::init();
15
+
let socket = TcpStream::connect("127.0.0.1:2025").await.unwrap();
16
+
17
+
register_edge_interface(&stack, socket, &queue)
18
+
.await
19
+
.unwrap();
20
+
21
+
let mut ctr = 0usize;
22
+
let msg = "world";
23
+
24
+
loop {
25
+
stack.info_fmt(fmt!("Hello, {msg} - {ctr}"));
26
+
ctr += 1;
27
+
tokio::time::sleep(Duration::from_secs(1)).await;
28
+
}
29
+
}
-12
demos/std/log-client-tcp/Cargo.toml
-12
demos/std/log-client-tcp/Cargo.toml
···
1
-
[package]
2
-
name = "log-client-tcp"
3
-
version = "0.1.0"
4
-
edition = "2024"
5
-
6
-
[dependencies]
7
-
cordyceps = { workspace = true }
8
-
env_logger = { workspace = true }
9
-
log = { workspace = true }
10
-
ergot = { workspace = true }
11
-
mutex = { workspace = true }
12
-
tokio = { workspace = true }
-29
demos/std/log-client-tcp/src/main.rs
-29
demos/std/log-client-tcp/src/main.rs
···
1
-
use ergot::{
2
-
fmt,
3
-
toolkits::tokio_tcp::{EdgeStack, new_std_queue, new_target_stack, register_edge_interface},
4
-
};
5
-
use tokio::net::TcpStream;
6
-
7
-
use std::{io, time::Duration};
8
-
9
-
#[tokio::main]
10
-
async fn main() -> io::Result<()> {
11
-
let queue = new_std_queue(4096);
12
-
let stack: EdgeStack = new_target_stack(&queue, 1024);
13
-
14
-
env_logger::init();
15
-
let socket = TcpStream::connect("127.0.0.1:2025").await.unwrap();
16
-
17
-
register_edge_interface(&stack, socket, &queue)
18
-
.await
19
-
.unwrap();
20
-
21
-
let mut ctr = 0usize;
22
-
let msg = "world";
23
-
24
-
loop {
25
-
stack.info_fmt(fmt!("Hello, {} - {}", msg, ctr));
26
-
ctr += 1;
27
-
tokio::time::sleep(Duration::from_secs(1)).await;
28
-
}
29
-
}
+12
demos/std/log-router/Cargo.toml
+12
demos/std/log-router/Cargo.toml
···
1
+
[package]
2
+
name = "log-router"
3
+
version = "0.1.0"
4
+
edition = "2024"
5
+
6
+
[dependencies]
7
+
cordyceps = { workspace = true }
8
+
env_logger = { workspace = true }
9
+
log = { workspace = true }
10
+
ergot = { workspace = true }
11
+
mutex = { workspace = true }
12
+
tokio = { workspace = true }
+70
demos/std/log-router/src/main.rs
+70
demos/std/log-router/src/main.rs
···
1
+
use ergot::{
2
+
Address,
3
+
toolkits::tokio_tcp::{RouterStack, register_router_interface},
4
+
well_known::ErgotPingEndpoint,
5
+
};
6
+
use log::info;
7
+
use tokio::{
8
+
net::TcpListener,
9
+
time::{interval, timeout},
10
+
};
11
+
12
+
use std::{io, time::Duration};
13
+
14
+
// Server
15
+
const MAX_ERGOT_PACKET_SIZE: u16 = 1024;
16
+
const TX_BUFFER_SIZE: usize = 4096;
17
+
18
+
#[tokio::main]
19
+
async fn main() -> io::Result<()> {
20
+
env_logger::init();
21
+
let listener = TcpListener::bind("127.0.0.1:2025").await?;
22
+
let stack: RouterStack = RouterStack::new();
23
+
24
+
// TODO: We still need pinging because edge router doesn't have any
25
+
// other way to be assigned a net
26
+
tokio::task::spawn(ping_all(stack.clone()));
27
+
tokio::task::spawn(log_collect(stack.clone()));
28
+
29
+
// TODO: Should the library just do this for us? something like
30
+
loop {
31
+
let (socket, addr) = listener.accept().await?;
32
+
info!("Connect {addr:?}");
33
+
register_router_interface(&stack, socket, MAX_ERGOT_PACKET_SIZE, TX_BUFFER_SIZE)
34
+
.await
35
+
.unwrap();
36
+
}
37
+
}
38
+
39
+
async fn ping_all(stack: RouterStack) {
40
+
let mut ival = interval(Duration::from_secs(3));
41
+
let mut ctr = 0u32;
42
+
loop {
43
+
ival.tick().await;
44
+
let nets = stack.manage_profile(|im| im.get_nets());
45
+
info!("Nets to ping: {nets:?}");
46
+
for net in nets {
47
+
let pg = ctr;
48
+
ctr = ctr.wrapping_add(1);
49
+
let rr = stack.endpoints().request::<ErgotPingEndpoint>(
50
+
Address {
51
+
network_id: net,
52
+
node_id: 2,
53
+
port_id: 0,
54
+
},
55
+
&pg,
56
+
None,
57
+
);
58
+
let fut = timeout(Duration::from_millis(100), rr);
59
+
let res = fut.await;
60
+
info!("ping {net}.2 w/ {pg}: {res:?}");
61
+
if let Ok(Ok(msg)) = res {
62
+
assert_eq!(msg, pg);
63
+
}
64
+
}
65
+
}
66
+
}
67
+
68
+
async fn log_collect(stack: RouterStack) {
69
+
stack.services().default_stdout_log_handler(64).await
70
+
}
+2
-2
demos/std/log-router-serial/src/main.rs
+2
-2
demos/std/log-router-serial/src/main.rs
···
44
44
loop {
45
45
ival.tick().await;
46
46
let nets = stack.manage_profile(|im| im.get_nets());
47
-
info!("Nets to ping: {:?}", nets);
47
+
info!("Nets to ping: {nets:?}");
48
48
for net in nets {
49
49
let pg = ctr;
50
50
ctr = ctr.wrapping_add(1);
···
59
59
);
60
60
let fut = timeout(Duration::from_millis(100), rr);
61
61
let res = fut.await;
62
-
info!("ping {}.2 w/ {}: {:?}", net, pg, res);
62
+
info!("ping {net}.2 w/ {pg}: {res:?}");
63
63
if let Ok(Ok(msg)) = res {
64
64
assert_eq!(msg, pg);
65
65
}
-12
demos/std/log-router-tcp/Cargo.toml
-12
demos/std/log-router-tcp/Cargo.toml
···
1
-
[package]
2
-
name = "log-router-tcp"
3
-
version = "0.1.0"
4
-
edition = "2024"
5
-
6
-
[dependencies]
7
-
cordyceps = { workspace = true }
8
-
env_logger = { workspace = true }
9
-
log = { workspace = true }
10
-
ergot = { workspace = true }
11
-
mutex = { workspace = true }
12
-
tokio = { workspace = true }
-70
demos/std/log-router-tcp/src/main.rs
-70
demos/std/log-router-tcp/src/main.rs
···
1
-
use ergot::{
2
-
Address,
3
-
toolkits::tokio_tcp::{RouterStack, register_router_interface},
4
-
well_known::ErgotPingEndpoint,
5
-
};
6
-
use log::info;
7
-
use tokio::{
8
-
net::TcpListener,
9
-
time::{interval, timeout},
10
-
};
11
-
12
-
use std::{io, time::Duration};
13
-
14
-
// Server
15
-
const MAX_ERGOT_PACKET_SIZE: u16 = 1024;
16
-
const TX_BUFFER_SIZE: usize = 4096;
17
-
18
-
#[tokio::main]
19
-
async fn main() -> io::Result<()> {
20
-
env_logger::init();
21
-
let listener = TcpListener::bind("127.0.0.1:2025").await?;
22
-
let stack: RouterStack = RouterStack::new();
23
-
24
-
// TODO: We still need pinging because edge router doesn't have any
25
-
// other way to be assigned a net
26
-
tokio::task::spawn(ping_all(stack.clone()));
27
-
tokio::task::spawn(log_collect(stack.clone()));
28
-
29
-
// TODO: Should the library just do this for us? something like
30
-
loop {
31
-
let (socket, addr) = listener.accept().await?;
32
-
info!("Connect {:?}", addr);
33
-
register_router_interface(&stack, socket, MAX_ERGOT_PACKET_SIZE, TX_BUFFER_SIZE)
34
-
.await
35
-
.unwrap();
36
-
}
37
-
}
38
-
39
-
async fn ping_all(stack: RouterStack) {
40
-
let mut ival = interval(Duration::from_secs(3));
41
-
let mut ctr = 0u32;
42
-
loop {
43
-
ival.tick().await;
44
-
let nets = stack.manage_profile(|im| im.get_nets());
45
-
info!("Nets to ping: {:?}", nets);
46
-
for net in nets {
47
-
let pg = ctr;
48
-
ctr = ctr.wrapping_add(1);
49
-
let rr = stack.endpoints().request::<ErgotPingEndpoint>(
50
-
Address {
51
-
network_id: net,
52
-
node_id: 2,
53
-
port_id: 0,
54
-
},
55
-
&pg,
56
-
None,
57
-
);
58
-
let fut = timeout(Duration::from_millis(100), rr);
59
-
let res = fut.await;
60
-
info!("ping {}.2 w/ {}: {:?}", net, pg, res);
61
-
if let Ok(Ok(msg)) = res {
62
-
assert_eq!(msg, pg);
63
-
}
64
-
}
65
-
}
66
-
}
67
-
68
-
async fn log_collect(stack: RouterStack) {
69
-
stack.services().default_stdout_log_handler(64).await
70
-
}
+3
-3
demos/std/stream-plotting/src/main.rs
+3
-3
demos/std/stream-plotting/src/main.rs
···
43
43
44
44
for dev in devices {
45
45
let info = dev.info.clone();
46
-
info!("Found {:?}, registering", info);
46
+
info!("Found {info:?}, registering");
47
47
let _hdl = register_router_interface(&stack, dev, MTU, OUT_BUFFER_SIZE)
48
48
.await
49
49
.unwrap();
···
63
63
loop {
64
64
ival.tick().await;
65
65
let nets = stack.manage_profile(|im| im.get_nets());
66
-
info!("Nets to ping: {:?}", nets);
66
+
info!("Nets to ping: {nets:?}");
67
67
for net in nets {
68
68
let pg = ctr;
69
69
ctr = ctr.wrapping_add(1);
···
89
89
let fut = timeout(Duration::from_millis(100), rr);
90
90
let res = fut.await;
91
91
let elapsed = start.elapsed();
92
-
warn!("ping {}.2 w/ {}: {:?}, took: {:?}", net, pg, res, elapsed);
92
+
warn!("ping {net}.2 w/ {pg}: {res:?}, took: {elapsed:?}");
93
93
if let Ok(Ok(msg)) = res {
94
94
assert_eq!(msg.t, pg);
95
95
portmap.insert(net, msg.hdr.src.port_id);
+4
-4
demos/std/tilt-app/src/main.rs
+4
-4
demos/std/tilt-app/src/main.rs
···
42
42
43
43
for dev in devices {
44
44
let info = dev.info.clone();
45
-
info!("Found {:?}, registering", info);
45
+
info!("Found {info:?}, registering");
46
46
let _hdl = register_router_interface(&stack, dev, MTU, OUT_BUFFER_SIZE)
47
47
.await
48
48
.unwrap();
···
62
62
loop {
63
63
ival.tick().await;
64
64
let nets = stack.manage_profile(|im| im.get_nets());
65
-
info!("Nets to ping: {:?}", nets);
65
+
info!("Nets to ping: {nets:?}");
66
66
for net in nets {
67
67
let pg = ctr;
68
68
ctr = ctr.wrapping_add(1);
···
88
88
let fut = timeout(Duration::from_millis(100), rr);
89
89
let res = fut.await;
90
90
let elapsed = start.elapsed();
91
-
warn!("ping {}.2 w/ {}: {:?}, took: {:?}", net, pg, res, elapsed);
91
+
warn!("ping {net}.2 w/ {pg}: {res:?}, took: {elapsed:?}");
92
92
if let Ok(Ok(msg)) = res {
93
93
assert_eq!(msg.t, pg);
94
94
portmap.insert(net, msg.hdr.src.port_id);
···
218
218
219
219
loop {
220
220
let msg = hdl.recv().await;
221
-
info!("Listener id:{} got {:?}", id, msg);
221
+
info!("Listener id:{id} got {msg:?}");
222
222
}
223
223
}
224
224
+24
-31
demos/stm32f303vc/Cargo.lock
+24
-31
demos/stm32f303vc/Cargo.lock
···
318
318
319
319
[[package]]
320
320
name = "embassy-embedded-hal"
321
-
version = "0.5.0"
321
+
version = "0.4.0"
322
322
source = "registry+https://github.com/rust-lang/crates.io-index"
323
-
checksum = "554e3e840696f54b4c9afcf28a0f24da431c927f4151040020416e7393d6d0d8"
323
+
checksum = "d1611b7a7ab5d1fbed84c338df26d56fd9bded58006ebb029075112ed2c5e039"
324
324
dependencies = [
325
325
"defmt 1.0.1",
326
326
"embassy-futures",
···
337
337
338
338
[[package]]
339
339
name = "embassy-executor"
340
-
version = "0.9.1"
340
+
version = "0.8.0"
341
341
source = "registry+https://github.com/rust-lang/crates.io-index"
342
-
checksum = "06070468370195e0e86f241c8e5004356d696590a678d47d6676795b2e439c6b"
342
+
checksum = "f102d5e04befe3ea74b6f41a0e26218740124636eb2f59e1cc215b5839b96df2"
343
343
dependencies = [
344
344
"cortex-m",
345
345
"critical-section",
346
346
"defmt 1.0.1",
347
347
"document-features",
348
348
"embassy-executor-macros",
349
-
"embassy-executor-timer-queue",
350
349
]
351
350
352
351
[[package]]
···
362
361
]
363
362
364
363
[[package]]
365
-
name = "embassy-executor-timer-queue"
366
-
version = "0.1.0"
367
-
source = "registry+https://github.com/rust-lang/crates.io-index"
368
-
checksum = "2fc328bf943af66b80b98755db9106bf7e7471b0cf47dc8559cd9a6be504cc9c"
369
-
370
-
[[package]]
371
364
name = "embassy-futures"
372
-
version = "0.1.2"
365
+
version = "0.1.1"
373
366
source = "registry+https://github.com/rust-lang/crates.io-index"
374
-
checksum = "dc2d050bdc5c21e0862a89256ed8029ae6c290a93aecefc73084b3002cdebb01"
367
+
checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067"
375
368
376
369
[[package]]
377
370
name = "embassy-hal-internal"
···
407
400
408
401
[[package]]
409
402
name = "embassy-stm32"
410
-
version = "0.4.0"
403
+
version = "0.3.0"
411
404
source = "registry+https://github.com/rust-lang/crates.io-index"
412
-
checksum = "0d972eab325cc96afee98f80a91ca6b00249b6356dc0fdbff68b70c200df9fae"
405
+
checksum = "e2eb597acf7ecf8f8f6427ee29ce863d1ab7430e3a76e605957b7ca19e5bf8ef"
413
406
dependencies = [
414
407
"aligned",
415
408
"bit_field",
···
456
449
457
450
[[package]]
458
451
name = "embassy-sync"
459
-
version = "0.7.2"
452
+
version = "0.7.1"
460
453
source = "registry+https://github.com/rust-lang/crates.io-index"
461
-
checksum = "73974a3edbd0bd286759b3d483540f0ebef705919a5f56f4fc7709066f71689b"
454
+
checksum = "03c372c90d3525a648684fa1c131decaf7d9ff181030db09c876fad6043443b9"
462
455
dependencies = [
463
456
"cfg-if",
464
457
"critical-section",
···
471
464
472
465
[[package]]
473
466
name = "embassy-time"
474
-
version = "0.5.0"
467
+
version = "0.4.0"
475
468
source = "registry+https://github.com/rust-lang/crates.io-index"
476
-
checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65"
469
+
checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8"
477
470
dependencies = [
478
471
"cfg-if",
479
472
"critical-section",
480
-
"defmt 1.0.1",
473
+
"defmt 0.3.100",
481
474
"document-features",
482
475
"embassy-time-driver",
483
476
"embedded-hal 0.2.7",
484
477
"embedded-hal 1.0.0",
485
478
"embedded-hal-async",
486
-
"futures-core",
479
+
"futures-util",
487
480
]
488
481
489
482
[[package]]
490
483
name = "embassy-time-driver"
491
-
version = "0.2.1"
484
+
version = "0.2.0"
492
485
source = "registry+https://github.com/rust-lang/crates.io-index"
493
-
checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6"
486
+
checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba"
494
487
dependencies = [
495
488
"document-features",
496
489
]
497
490
498
491
[[package]]
499
492
name = "embassy-time-queue-utils"
500
-
version = "0.3.0"
493
+
version = "0.2.0"
501
494
source = "registry+https://github.com/rust-lang/crates.io-index"
502
-
checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454"
495
+
checksum = "59b742d6fec7afcfa77c91b476520627151da3735fca6373b287c4c94b69e171"
503
496
dependencies = [
504
-
"embassy-executor-timer-queue",
497
+
"embassy-executor",
505
498
"heapless 0.8.0",
506
499
]
507
500
···
533
526
534
527
[[package]]
535
528
name = "embassy-usb-synopsys-otg"
536
-
version = "0.3.1"
529
+
version = "0.3.0"
537
530
source = "registry+https://github.com/rust-lang/crates.io-index"
538
-
checksum = "288751f8eaa44a5cf2613f13cee0ca8e06e6638cb96e897e6834702c79084b23"
531
+
checksum = "79841982f857f113946b8cc0d46a69d124c523d5e4077282a608c8084ff655d9"
539
532
dependencies = [
540
533
"critical-section",
541
534
"defmt 1.0.1",
···
629
622
630
623
[[package]]
631
624
name = "ergot"
632
-
version = "0.12.0"
625
+
version = "0.11.0"
633
626
dependencies = [
634
627
"bbq2",
635
628
"cobs 0.3.0",
···
1249
1242
1250
1243
[[package]]
1251
1244
name = "stm32-metapac"
1252
-
version = "18.0.0"
1245
+
version = "17.0.0"
1253
1246
source = "registry+https://github.com/rust-lang/crates.io-index"
1254
-
checksum = "6fd8ec3a292a0d9fc4798416a61b21da5ae50341b2e7b8d12e662bf305366097"
1247
+
checksum = "5b44329ff285800f88ccc1666218808c6ed0e6dc570383b5f661caadb8101133"
1255
1248
dependencies = [
1256
1249
"cortex-m",
1257
1250
"cortex-m-rt",
+3
-3
demos/stm32f303vc/Cargo.toml
+3
-3
demos/stm32f303vc/Cargo.toml
···
15
15
mutex = "1.0.2"
16
16
17
17
cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
18
-
embassy-executor = { version = "0.9.1", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] }
19
-
embassy-stm32 = { version = "0.4.0", features = [ "defmt", "stm32f303vc", "unstable-pac", "memory-x", "time-driver-tim2", "exti"] }
20
-
embassy-time = { version = "0.5.0", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
18
+
embassy-executor = { version = "0.8.0", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] }
19
+
embassy-stm32 = { version = "0.3.0", features = [ "defmt", "stm32f303vc", "unstable-pac", "memory-x", "time-driver-tim2", "exti"] }
20
+
embassy-time = { version = "0.4.0", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
21
21
heapless = { version = "0.9", default-features = false }
22
22
panic-probe = { version = "1.0.0", features = ["print-defmt"] }
23
23
postcard-schema = { version = "0.2.5", features = ["derive"] }
-8
demos/stm32h723zg/.cargo/config.toml
-8
demos/stm32h723zg/.cargo/config.toml
-1638
demos/stm32h723zg/Cargo.lock
-1638
demos/stm32h723zg/Cargo.lock
···
1
-
# This file is automatically @generated by Cargo.
2
-
# It is not intended for manual editing.
3
-
version = 4
4
-
5
-
[[package]]
6
-
name = "aho-corasick"
7
-
version = "1.1.3"
8
-
source = "registry+https://github.com/rust-lang/crates.io-index"
9
-
checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
10
-
dependencies = [
11
-
"memchr",
12
-
]
13
-
14
-
[[package]]
15
-
name = "aligned"
16
-
version = "0.4.2"
17
-
source = "registry+https://github.com/rust-lang/crates.io-index"
18
-
checksum = "377e4c0ba83e4431b10df45c1d4666f178ea9c552cac93e60c3a88bf32785923"
19
-
dependencies = [
20
-
"as-slice",
21
-
]
22
-
23
-
[[package]]
24
-
name = "as-slice"
25
-
version = "0.2.1"
26
-
source = "registry+https://github.com/rust-lang/crates.io-index"
27
-
checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516"
28
-
dependencies = [
29
-
"stable_deref_trait",
30
-
]
31
-
32
-
[[package]]
33
-
name = "atomic-polyfill"
34
-
version = "1.0.3"
35
-
source = "registry+https://github.com/rust-lang/crates.io-index"
36
-
checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4"
37
-
dependencies = [
38
-
"critical-section",
39
-
]
40
-
41
-
[[package]]
42
-
name = "autocfg"
43
-
version = "1.5.0"
44
-
source = "registry+https://github.com/rust-lang/crates.io-index"
45
-
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
46
-
47
-
[[package]]
48
-
name = "bare-metal"
49
-
version = "0.2.5"
50
-
source = "registry+https://github.com/rust-lang/crates.io-index"
51
-
checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3"
52
-
dependencies = [
53
-
"rustc_version 0.2.3",
54
-
]
55
-
56
-
[[package]]
57
-
name = "base64"
58
-
version = "0.13.1"
59
-
source = "registry+https://github.com/rust-lang/crates.io-index"
60
-
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
61
-
62
-
[[package]]
63
-
name = "bbq2"
64
-
version = "0.4.2"
65
-
source = "registry+https://github.com/rust-lang/crates.io-index"
66
-
checksum = "25d3e5fd78b60ce3a60e21e9a92b1d5e741328264de8e609193e2bf7616747bd"
67
-
dependencies = [
68
-
"const-init",
69
-
"critical-section",
70
-
"maitake-sync",
71
-
]
72
-
73
-
[[package]]
74
-
name = "bit_field"
75
-
version = "0.10.2"
76
-
source = "registry+https://github.com/rust-lang/crates.io-index"
77
-
checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61"
78
-
79
-
[[package]]
80
-
name = "bitfield"
81
-
version = "0.13.2"
82
-
source = "registry+https://github.com/rust-lang/crates.io-index"
83
-
checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719"
84
-
85
-
[[package]]
86
-
name = "bitflags"
87
-
version = "1.3.2"
88
-
source = "registry+https://github.com/rust-lang/crates.io-index"
89
-
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
90
-
91
-
[[package]]
92
-
name = "bitflags"
93
-
version = "2.9.3"
94
-
source = "registry+https://github.com/rust-lang/crates.io-index"
95
-
checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d"
96
-
97
-
[[package]]
98
-
name = "block-device-driver"
99
-
version = "0.2.0"
100
-
source = "registry+https://github.com/rust-lang/crates.io-index"
101
-
checksum = "44c051592f59fe68053524b4c4935249b806f72c1f544cfb7abe4f57c3be258e"
102
-
dependencies = [
103
-
"aligned",
104
-
]
105
-
106
-
[[package]]
107
-
name = "byteorder"
108
-
version = "1.5.0"
109
-
source = "registry+https://github.com/rust-lang/crates.io-index"
110
-
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
111
-
112
-
[[package]]
113
-
name = "cc"
114
-
version = "1.2.34"
115
-
source = "registry+https://github.com/rust-lang/crates.io-index"
116
-
checksum = "42bc4aea80032b7bf409b0bc7ccad88853858911b7713a8062fdc0623867bedc"
117
-
dependencies = [
118
-
"shlex",
119
-
]
120
-
121
-
[[package]]
122
-
name = "cfg-if"
123
-
version = "1.0.3"
124
-
source = "registry+https://github.com/rust-lang/crates.io-index"
125
-
checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9"
126
-
127
-
[[package]]
128
-
name = "cobs"
129
-
version = "0.3.0"
130
-
source = "registry+https://github.com/rust-lang/crates.io-index"
131
-
checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1"
132
-
dependencies = [
133
-
"thiserror",
134
-
]
135
-
136
-
[[package]]
137
-
name = "cobs"
138
-
version = "0.4.0"
139
-
source = "registry+https://github.com/rust-lang/crates.io-index"
140
-
checksum = "fea6d1b751c55bd9c0dda7d4ff752074e98f4765ae969664648bd193bb326d15"
141
-
dependencies = [
142
-
"thiserror",
143
-
]
144
-
145
-
[[package]]
146
-
name = "cobs-acc"
147
-
version = "0.1.0"
148
-
dependencies = [
149
-
"cobs 0.4.0",
150
-
]
151
-
152
-
[[package]]
153
-
name = "const-default"
154
-
version = "1.0.0"
155
-
source = "registry+https://github.com/rust-lang/crates.io-index"
156
-
checksum = "0b396d1f76d455557e1218ec8066ae14bba60b4b36ecd55577ba979f5db7ecaa"
157
-
158
-
[[package]]
159
-
name = "const-fnv1a-hash"
160
-
version = "1.1.0"
161
-
source = "registry+https://github.com/rust-lang/crates.io-index"
162
-
checksum = "32b13ea120a812beba79e34316b3942a857c86ec1593cb34f27bb28272ce2cca"
163
-
164
-
[[package]]
165
-
name = "const-init"
166
-
version = "1.0.0"
167
-
source = "registry+https://github.com/rust-lang/crates.io-index"
168
-
checksum = "4bd422bfb4f24a97243f60b6a4443e63d810c925d8da4bb2d8fde26a7c1d57ec"
169
-
170
-
[[package]]
171
-
name = "cordyceps"
172
-
version = "0.3.4"
173
-
source = "registry+https://github.com/rust-lang/crates.io-index"
174
-
checksum = "688d7fbb8092b8de775ef2536f36c8c31f2bc4006ece2e8d8ad2d17d00ce0a2a"
175
-
dependencies = [
176
-
"loom",
177
-
"tracing",
178
-
]
179
-
180
-
[[package]]
181
-
name = "cortex-m"
182
-
version = "0.7.7"
183
-
source = "registry+https://github.com/rust-lang/crates.io-index"
184
-
checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9"
185
-
dependencies = [
186
-
"bare-metal",
187
-
"bitfield",
188
-
"critical-section",
189
-
"embedded-hal 0.2.7",
190
-
"volatile-register",
191
-
]
192
-
193
-
[[package]]
194
-
name = "cortex-m-rt"
195
-
version = "0.7.5"
196
-
source = "registry+https://github.com/rust-lang/crates.io-index"
197
-
checksum = "801d4dec46b34c299ccf6b036717ae0fce602faa4f4fe816d9013b9a7c9f5ba6"
198
-
dependencies = [
199
-
"cortex-m-rt-macros",
200
-
]
201
-
202
-
[[package]]
203
-
name = "cortex-m-rt-macros"
204
-
version = "0.7.5"
205
-
source = "registry+https://github.com/rust-lang/crates.io-index"
206
-
checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472"
207
-
dependencies = [
208
-
"proc-macro2",
209
-
"quote",
210
-
"syn 2.0.106",
211
-
]
212
-
213
-
[[package]]
214
-
name = "critical-section"
215
-
version = "1.2.0"
216
-
source = "registry+https://github.com/rust-lang/crates.io-index"
217
-
checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b"
218
-
219
-
[[package]]
220
-
name = "darling"
221
-
version = "0.20.11"
222
-
source = "registry+https://github.com/rust-lang/crates.io-index"
223
-
checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee"
224
-
dependencies = [
225
-
"darling_core",
226
-
"darling_macro",
227
-
]
228
-
229
-
[[package]]
230
-
name = "darling_core"
231
-
version = "0.20.11"
232
-
source = "registry+https://github.com/rust-lang/crates.io-index"
233
-
checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e"
234
-
dependencies = [
235
-
"fnv",
236
-
"ident_case",
237
-
"proc-macro2",
238
-
"quote",
239
-
"strsim",
240
-
"syn 2.0.106",
241
-
]
242
-
243
-
[[package]]
244
-
name = "darling_macro"
245
-
version = "0.20.11"
246
-
source = "registry+https://github.com/rust-lang/crates.io-index"
247
-
checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead"
248
-
dependencies = [
249
-
"darling_core",
250
-
"quote",
251
-
"syn 2.0.106",
252
-
]
253
-
254
-
[[package]]
255
-
name = "defmt"
256
-
version = "0.3.100"
257
-
source = "registry+https://github.com/rust-lang/crates.io-index"
258
-
checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad"
259
-
dependencies = [
260
-
"defmt 1.0.1",
261
-
]
262
-
263
-
[[package]]
264
-
name = "defmt"
265
-
version = "1.0.1"
266
-
source = "registry+https://github.com/rust-lang/crates.io-index"
267
-
checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78"
268
-
dependencies = [
269
-
"bitflags 1.3.2",
270
-
"defmt-macros",
271
-
]
272
-
273
-
[[package]]
274
-
name = "defmt-macros"
275
-
version = "1.0.1"
276
-
source = "registry+https://github.com/rust-lang/crates.io-index"
277
-
checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e"
278
-
dependencies = [
279
-
"defmt-parser",
280
-
"proc-macro-error2",
281
-
"proc-macro2",
282
-
"quote",
283
-
"syn 2.0.106",
284
-
]
285
-
286
-
[[package]]
287
-
name = "defmt-parser"
288
-
version = "1.0.0"
289
-
source = "registry+https://github.com/rust-lang/crates.io-index"
290
-
checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e"
291
-
dependencies = [
292
-
"thiserror",
293
-
]
294
-
295
-
[[package]]
296
-
name = "defmt-rtt"
297
-
version = "1.0.0"
298
-
source = "registry+https://github.com/rust-lang/crates.io-index"
299
-
checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1"
300
-
dependencies = [
301
-
"critical-section",
302
-
"defmt 1.0.1",
303
-
]
304
-
305
-
[[package]]
306
-
name = "document-features"
307
-
version = "0.2.11"
308
-
source = "registry+https://github.com/rust-lang/crates.io-index"
309
-
checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d"
310
-
dependencies = [
311
-
"litrs",
312
-
]
313
-
314
-
[[package]]
315
-
name = "embassy-embedded-hal"
316
-
version = "0.5.0"
317
-
source = "registry+https://github.com/rust-lang/crates.io-index"
318
-
checksum = "554e3e840696f54b4c9afcf28a0f24da431c927f4151040020416e7393d6d0d8"
319
-
dependencies = [
320
-
"defmt 1.0.1",
321
-
"embassy-futures",
322
-
"embassy-hal-internal",
323
-
"embassy-sync",
324
-
"embassy-time",
325
-
"embedded-hal 0.2.7",
326
-
"embedded-hal 1.0.0",
327
-
"embedded-hal-async",
328
-
"embedded-storage",
329
-
"embedded-storage-async",
330
-
"nb 1.1.0",
331
-
]
332
-
333
-
[[package]]
334
-
name = "embassy-executor"
335
-
version = "0.9.1"
336
-
source = "registry+https://github.com/rust-lang/crates.io-index"
337
-
checksum = "06070468370195e0e86f241c8e5004356d696590a678d47d6676795b2e439c6b"
338
-
dependencies = [
339
-
"cortex-m",
340
-
"critical-section",
341
-
"defmt 1.0.1",
342
-
"document-features",
343
-
"embassy-executor-macros",
344
-
"embassy-executor-timer-queue",
345
-
]
346
-
347
-
[[package]]
348
-
name = "embassy-executor-macros"
349
-
version = "0.7.0"
350
-
source = "registry+https://github.com/rust-lang/crates.io-index"
351
-
checksum = "dfdddc3a04226828316bf31393b6903ee162238576b1584ee2669af215d55472"
352
-
dependencies = [
353
-
"darling",
354
-
"proc-macro2",
355
-
"quote",
356
-
"syn 2.0.106",
357
-
]
358
-
359
-
[[package]]
360
-
name = "embassy-executor-timer-queue"
361
-
version = "0.1.0"
362
-
source = "registry+https://github.com/rust-lang/crates.io-index"
363
-
checksum = "2fc328bf943af66b80b98755db9106bf7e7471b0cf47dc8559cd9a6be504cc9c"
364
-
365
-
[[package]]
366
-
name = "embassy-futures"
367
-
version = "0.1.2"
368
-
source = "registry+https://github.com/rust-lang/crates.io-index"
369
-
checksum = "dc2d050bdc5c21e0862a89256ed8029ae6c290a93aecefc73084b3002cdebb01"
370
-
dependencies = [
371
-
"defmt 1.0.1",
372
-
]
373
-
374
-
[[package]]
375
-
name = "embassy-hal-internal"
376
-
version = "0.3.0"
377
-
source = "registry+https://github.com/rust-lang/crates.io-index"
378
-
checksum = "95285007a91b619dc9f26ea8f55452aa6c60f7115a4edc05085cd2bd3127cd7a"
379
-
dependencies = [
380
-
"cortex-m",
381
-
"critical-section",
382
-
"defmt 1.0.1",
383
-
"num-traits",
384
-
]
385
-
386
-
[[package]]
387
-
name = "embassy-net"
388
-
version = "0.7.1"
389
-
source = "registry+https://github.com/rust-lang/crates.io-index"
390
-
checksum = "0558a231a47e7d4a06a28b5278c92e860f1200f24821d2f365a2f40fe3f3c7b2"
391
-
dependencies = [
392
-
"defmt 1.0.1",
393
-
"document-features",
394
-
"embassy-net-driver",
395
-
"embassy-sync",
396
-
"embassy-time",
397
-
"embedded-io-async",
398
-
"embedded-nal-async",
399
-
"heapless 0.8.0",
400
-
"managed",
401
-
"smoltcp",
402
-
]
403
-
404
-
[[package]]
405
-
name = "embassy-net-driver"
406
-
version = "0.2.0"
407
-
source = "registry+https://github.com/rust-lang/crates.io-index"
408
-
checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d"
409
-
dependencies = [
410
-
"defmt 0.3.100",
411
-
]
412
-
413
-
[[package]]
414
-
name = "embassy-stm32"
415
-
version = "0.4.0"
416
-
source = "registry+https://github.com/rust-lang/crates.io-index"
417
-
checksum = "0d972eab325cc96afee98f80a91ca6b00249b6356dc0fdbff68b70c200df9fae"
418
-
dependencies = [
419
-
"aligned",
420
-
"bit_field",
421
-
"bitflags 2.9.3",
422
-
"block-device-driver",
423
-
"cfg-if",
424
-
"cortex-m",
425
-
"cortex-m-rt",
426
-
"critical-section",
427
-
"defmt 1.0.1",
428
-
"document-features",
429
-
"embassy-embedded-hal",
430
-
"embassy-futures",
431
-
"embassy-hal-internal",
432
-
"embassy-net-driver",
433
-
"embassy-sync",
434
-
"embassy-time",
435
-
"embassy-time-driver",
436
-
"embassy-time-queue-utils",
437
-
"embassy-usb-driver",
438
-
"embassy-usb-synopsys-otg",
439
-
"embedded-can",
440
-
"embedded-hal 0.2.7",
441
-
"embedded-hal 1.0.0",
442
-
"embedded-hal-async",
443
-
"embedded-hal-nb",
444
-
"embedded-io",
445
-
"embedded-io-async",
446
-
"embedded-storage",
447
-
"embedded-storage-async",
448
-
"futures-util",
449
-
"nb 1.1.0",
450
-
"proc-macro2",
451
-
"quote",
452
-
"rand_core 0.6.4",
453
-
"rand_core 0.9.3",
454
-
"sdio-host",
455
-
"static_assertions",
456
-
"stm32-fmc",
457
-
"stm32-metapac",
458
-
"vcell",
459
-
"volatile-register",
460
-
]
461
-
462
-
[[package]]
463
-
name = "embassy-sync"
464
-
version = "0.7.2"
465
-
source = "registry+https://github.com/rust-lang/crates.io-index"
466
-
checksum = "73974a3edbd0bd286759b3d483540f0ebef705919a5f56f4fc7709066f71689b"
467
-
dependencies = [
468
-
"cfg-if",
469
-
"critical-section",
470
-
"defmt 1.0.1",
471
-
"embedded-io-async",
472
-
"futures-core",
473
-
"futures-sink",
474
-
"heapless 0.8.0",
475
-
]
476
-
477
-
[[package]]
478
-
name = "embassy-time"
479
-
version = "0.5.0"
480
-
source = "registry+https://github.com/rust-lang/crates.io-index"
481
-
checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65"
482
-
dependencies = [
483
-
"cfg-if",
484
-
"critical-section",
485
-
"defmt 1.0.1",
486
-
"document-features",
487
-
"embassy-time-driver",
488
-
"embedded-hal 0.2.7",
489
-
"embedded-hal 1.0.0",
490
-
"embedded-hal-async",
491
-
"futures-core",
492
-
]
493
-
494
-
[[package]]
495
-
name = "embassy-time-driver"
496
-
version = "0.2.1"
497
-
source = "registry+https://github.com/rust-lang/crates.io-index"
498
-
checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6"
499
-
dependencies = [
500
-
"document-features",
501
-
]
502
-
503
-
[[package]]
504
-
name = "embassy-time-queue-utils"
505
-
version = "0.3.0"
506
-
source = "registry+https://github.com/rust-lang/crates.io-index"
507
-
checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454"
508
-
dependencies = [
509
-
"embassy-executor-timer-queue",
510
-
"heapless 0.8.0",
511
-
]
512
-
513
-
[[package]]
514
-
name = "embassy-usb-driver"
515
-
version = "0.2.0"
516
-
source = "registry+https://github.com/rust-lang/crates.io-index"
517
-
checksum = "17119855ccc2d1f7470a39756b12068454ae27a3eabb037d940b5c03d9c77b7a"
518
-
dependencies = [
519
-
"defmt 1.0.1",
520
-
"embedded-io-async",
521
-
]
522
-
523
-
[[package]]
524
-
name = "embassy-usb-synopsys-otg"
525
-
version = "0.3.1"
526
-
source = "registry+https://github.com/rust-lang/crates.io-index"
527
-
checksum = "288751f8eaa44a5cf2613f13cee0ca8e06e6638cb96e897e6834702c79084b23"
528
-
dependencies = [
529
-
"critical-section",
530
-
"defmt 1.0.1",
531
-
"embassy-sync",
532
-
"embassy-usb-driver",
533
-
]
534
-
535
-
[[package]]
536
-
name = "embedded-alloc"
537
-
version = "0.6.0"
538
-
source = "registry+https://github.com/rust-lang/crates.io-index"
539
-
checksum = "8f2de9133f68db0d4627ad69db767726c99ff8585272716708227008d3f1bddd"
540
-
dependencies = [
541
-
"const-default",
542
-
"critical-section",
543
-
"linked_list_allocator",
544
-
"rlsf",
545
-
]
546
-
547
-
[[package]]
548
-
name = "embedded-can"
549
-
version = "0.4.1"
550
-
source = "registry+https://github.com/rust-lang/crates.io-index"
551
-
checksum = "e9d2e857f87ac832df68fa498d18ddc679175cf3d2e4aa893988e5601baf9438"
552
-
dependencies = [
553
-
"nb 1.1.0",
554
-
]
555
-
556
-
[[package]]
557
-
name = "embedded-hal"
558
-
version = "0.2.7"
559
-
source = "registry+https://github.com/rust-lang/crates.io-index"
560
-
checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff"
561
-
dependencies = [
562
-
"nb 0.1.3",
563
-
"void",
564
-
]
565
-
566
-
[[package]]
567
-
name = "embedded-hal"
568
-
version = "1.0.0"
569
-
source = "registry+https://github.com/rust-lang/crates.io-index"
570
-
checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89"
571
-
572
-
[[package]]
573
-
name = "embedded-hal-async"
574
-
version = "1.0.0"
575
-
source = "registry+https://github.com/rust-lang/crates.io-index"
576
-
checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884"
577
-
dependencies = [
578
-
"embedded-hal 1.0.0",
579
-
]
580
-
581
-
[[package]]
582
-
name = "embedded-hal-nb"
583
-
version = "1.0.0"
584
-
source = "registry+https://github.com/rust-lang/crates.io-index"
585
-
checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605"
586
-
dependencies = [
587
-
"embedded-hal 1.0.0",
588
-
"nb 1.1.0",
589
-
]
590
-
591
-
[[package]]
592
-
name = "embedded-io"
593
-
version = "0.6.1"
594
-
source = "registry+https://github.com/rust-lang/crates.io-index"
595
-
checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d"
596
-
dependencies = [
597
-
"defmt 0.3.100",
598
-
]
599
-
600
-
[[package]]
601
-
name = "embedded-io-async"
602
-
version = "0.6.1"
603
-
source = "registry+https://github.com/rust-lang/crates.io-index"
604
-
checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f"
605
-
dependencies = [
606
-
"defmt 0.3.100",
607
-
"embedded-io",
608
-
]
609
-
610
-
[[package]]
611
-
name = "embedded-nal"
612
-
version = "0.9.0"
613
-
source = "registry+https://github.com/rust-lang/crates.io-index"
614
-
checksum = "c56a28be191a992f28f178ec338a0bf02f63d7803244add736d026a471e6ed77"
615
-
dependencies = [
616
-
"nb 1.1.0",
617
-
]
618
-
619
-
[[package]]
620
-
name = "embedded-nal-async"
621
-
version = "0.8.0"
622
-
source = "registry+https://github.com/rust-lang/crates.io-index"
623
-
checksum = "76959917cd2b86f40a98c28dd5624eddd1fa69d746241c8257eac428d83cb211"
624
-
dependencies = [
625
-
"embedded-io-async",
626
-
"embedded-nal",
627
-
]
628
-
629
-
[[package]]
630
-
name = "embedded-storage"
631
-
version = "0.3.1"
632
-
source = "registry+https://github.com/rust-lang/crates.io-index"
633
-
checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032"
634
-
635
-
[[package]]
636
-
name = "embedded-storage-async"
637
-
version = "0.4.1"
638
-
source = "registry+https://github.com/rust-lang/crates.io-index"
639
-
checksum = "1763775e2323b7d5f0aa6090657f5e21cfa02ede71f5dc40eead06d64dcd15cc"
640
-
dependencies = [
641
-
"embedded-storage",
642
-
]
643
-
644
-
[[package]]
645
-
name = "ergot"
646
-
version = "0.11.0"
647
-
dependencies = [
648
-
"bbq2",
649
-
"cobs 0.3.0",
650
-
"cobs-acc",
651
-
"const-fnv1a-hash",
652
-
"cordyceps",
653
-
"critical-section",
654
-
"defmt 1.0.1",
655
-
"embassy-futures",
656
-
"embassy-net",
657
-
"heapless 0.9.1",
658
-
"log",
659
-
"maitake-sync",
660
-
"mutex",
661
-
"pin-project",
662
-
"portable-atomic",
663
-
"postcard",
664
-
"postcard-schema",
665
-
"serde",
666
-
"static_cell",
667
-
]
668
-
669
-
[[package]]
670
-
name = "fnv"
671
-
version = "1.0.7"
672
-
source = "registry+https://github.com/rust-lang/crates.io-index"
673
-
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
674
-
675
-
[[package]]
676
-
name = "futures-core"
677
-
version = "0.3.31"
678
-
source = "registry+https://github.com/rust-lang/crates.io-index"
679
-
checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
680
-
681
-
[[package]]
682
-
name = "futures-sink"
683
-
version = "0.3.31"
684
-
source = "registry+https://github.com/rust-lang/crates.io-index"
685
-
checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
686
-
687
-
[[package]]
688
-
name = "futures-task"
689
-
version = "0.3.31"
690
-
source = "registry+https://github.com/rust-lang/crates.io-index"
691
-
checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
692
-
693
-
[[package]]
694
-
name = "futures-util"
695
-
version = "0.3.31"
696
-
source = "registry+https://github.com/rust-lang/crates.io-index"
697
-
checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
698
-
dependencies = [
699
-
"futures-core",
700
-
"futures-task",
701
-
"pin-project-lite",
702
-
"pin-utils",
703
-
]
704
-
705
-
[[package]]
706
-
name = "generator"
707
-
version = "0.8.7"
708
-
source = "registry+https://github.com/rust-lang/crates.io-index"
709
-
checksum = "605183a538e3e2a9c1038635cc5c2d194e2ee8fd0d1b66b8349fad7dbacce5a2"
710
-
dependencies = [
711
-
"cc",
712
-
"cfg-if",
713
-
"libc",
714
-
"log",
715
-
"rustversion",
716
-
"windows",
717
-
]
718
-
719
-
[[package]]
720
-
name = "hash32"
721
-
version = "0.2.1"
722
-
source = "registry+https://github.com/rust-lang/crates.io-index"
723
-
checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67"
724
-
dependencies = [
725
-
"byteorder",
726
-
]
727
-
728
-
[[package]]
729
-
name = "hash32"
730
-
version = "0.3.1"
731
-
source = "registry+https://github.com/rust-lang/crates.io-index"
732
-
checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606"
733
-
dependencies = [
734
-
"byteorder",
735
-
]
736
-
737
-
[[package]]
738
-
name = "heapless"
739
-
version = "0.7.17"
740
-
source = "registry+https://github.com/rust-lang/crates.io-index"
741
-
checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f"
742
-
dependencies = [
743
-
"atomic-polyfill",
744
-
"hash32 0.2.1",
745
-
"rustc_version 0.4.1",
746
-
"serde",
747
-
"spin",
748
-
"stable_deref_trait",
749
-
]
750
-
751
-
[[package]]
752
-
name = "heapless"
753
-
version = "0.8.0"
754
-
source = "registry+https://github.com/rust-lang/crates.io-index"
755
-
checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad"
756
-
dependencies = [
757
-
"defmt 0.3.100",
758
-
"hash32 0.3.1",
759
-
"stable_deref_trait",
760
-
]
761
-
762
-
[[package]]
763
-
name = "heapless"
764
-
version = "0.9.1"
765
-
source = "registry+https://github.com/rust-lang/crates.io-index"
766
-
checksum = "b1edcd5a338e64688fbdcb7531a846cfd3476a54784dcb918a0844682bc7ada5"
767
-
dependencies = [
768
-
"defmt 1.0.1",
769
-
"hash32 0.3.1",
770
-
"serde",
771
-
"stable_deref_trait",
772
-
]
773
-
774
-
[[package]]
775
-
name = "ident_case"
776
-
version = "1.0.1"
777
-
source = "registry+https://github.com/rust-lang/crates.io-index"
778
-
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
779
-
780
-
[[package]]
781
-
name = "lazy_static"
782
-
version = "1.5.0"
783
-
source = "registry+https://github.com/rust-lang/crates.io-index"
784
-
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
785
-
786
-
[[package]]
787
-
name = "libc"
788
-
version = "0.2.175"
789
-
source = "registry+https://github.com/rust-lang/crates.io-index"
790
-
checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
791
-
792
-
[[package]]
793
-
name = "linked_list_allocator"
794
-
version = "0.10.5"
795
-
source = "registry+https://github.com/rust-lang/crates.io-index"
796
-
checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286"
797
-
798
-
[[package]]
799
-
name = "litrs"
800
-
version = "0.4.2"
801
-
source = "registry+https://github.com/rust-lang/crates.io-index"
802
-
checksum = "f5e54036fe321fd421e10d732f155734c4e4afd610dd556d9a82833ab3ee0bed"
803
-
804
-
[[package]]
805
-
name = "lock_api"
806
-
version = "0.4.14"
807
-
source = "registry+https://github.com/rust-lang/crates.io-index"
808
-
checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
809
-
dependencies = [
810
-
"scopeguard",
811
-
]
812
-
813
-
[[package]]
814
-
name = "log"
815
-
version = "0.4.27"
816
-
source = "registry+https://github.com/rust-lang/crates.io-index"
817
-
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
818
-
819
-
[[package]]
820
-
name = "loom"
821
-
version = "0.7.2"
822
-
source = "registry+https://github.com/rust-lang/crates.io-index"
823
-
checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca"
824
-
dependencies = [
825
-
"cfg-if",
826
-
"generator",
827
-
"scoped-tls",
828
-
"tracing",
829
-
"tracing-subscriber",
830
-
]
831
-
832
-
[[package]]
833
-
name = "maitake-sync"
834
-
version = "0.2.2"
835
-
source = "registry+https://github.com/rust-lang/crates.io-index"
836
-
checksum = "748f86d9befd480b602c3bebc9ef30dbf2f3dfc8acc4a73d07b90f0117e6de3f"
837
-
dependencies = [
838
-
"cordyceps",
839
-
"loom",
840
-
"mutex-traits",
841
-
"mycelium-bitfield",
842
-
"pin-project",
843
-
"portable-atomic",
844
-
"tracing",
845
-
]
846
-
847
-
[[package]]
848
-
name = "managed"
849
-
version = "0.8.0"
850
-
source = "registry+https://github.com/rust-lang/crates.io-index"
851
-
checksum = "0ca88d725a0a943b096803bd34e73a4437208b6077654cc4ecb2947a5f91618d"
852
-
853
-
[[package]]
854
-
name = "matchers"
855
-
version = "0.1.0"
856
-
source = "registry+https://github.com/rust-lang/crates.io-index"
857
-
checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
858
-
dependencies = [
859
-
"regex-automata 0.1.10",
860
-
]
861
-
862
-
[[package]]
863
-
name = "memchr"
864
-
version = "2.7.5"
865
-
source = "registry+https://github.com/rust-lang/crates.io-index"
866
-
checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
867
-
868
-
[[package]]
869
-
name = "mutex"
870
-
version = "1.0.2"
871
-
source = "registry+https://github.com/rust-lang/crates.io-index"
872
-
checksum = "f23bf5944734b7a5d1bd0a9b594213dd04de471fd3d3a1bfce672913dd72d606"
873
-
dependencies = [
874
-
"critical-section",
875
-
"mutex-traits",
876
-
]
877
-
878
-
[[package]]
879
-
name = "mutex-traits"
880
-
version = "1.0.1"
881
-
source = "registry+https://github.com/rust-lang/crates.io-index"
882
-
checksum = "3929f2b5633d29cf7b6624992e5f3c1e9334f1193423e12d17be4faf678cde3f"
883
-
884
-
[[package]]
885
-
name = "mycelium-bitfield"
886
-
version = "0.1.5"
887
-
source = "registry+https://github.com/rust-lang/crates.io-index"
888
-
checksum = "24e0cc5e2c585acbd15c5ce911dff71e1f4d5313f43345873311c4f5efd741cc"
889
-
890
-
[[package]]
891
-
name = "nb"
892
-
version = "0.1.3"
893
-
source = "registry+https://github.com/rust-lang/crates.io-index"
894
-
checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f"
895
-
dependencies = [
896
-
"nb 1.1.0",
897
-
]
898
-
899
-
[[package]]
900
-
name = "nb"
901
-
version = "1.1.0"
902
-
source = "registry+https://github.com/rust-lang/crates.io-index"
903
-
checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d"
904
-
905
-
[[package]]
906
-
name = "nu-ansi-term"
907
-
version = "0.46.0"
908
-
source = "registry+https://github.com/rust-lang/crates.io-index"
909
-
checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
910
-
dependencies = [
911
-
"overload",
912
-
"winapi",
913
-
]
914
-
915
-
[[package]]
916
-
name = "nucleoh723zg-blinky"
917
-
version = "0.1.0"
918
-
dependencies = [
919
-
"cortex-m",
920
-
"cortex-m-rt",
921
-
"defmt 1.0.1",
922
-
"defmt-rtt",
923
-
"embassy-executor",
924
-
"embassy-stm32",
925
-
"embassy-time",
926
-
"embedded-hal 1.0.0",
927
-
"ergot",
928
-
"heapless 0.9.1",
929
-
"mutex",
930
-
"panic-probe",
931
-
]
932
-
933
-
[[package]]
934
-
name = "nucleoh723zg-net-udp-pair"
935
-
version = "0.1.0"
936
-
dependencies = [
937
-
"bbq2",
938
-
"cortex-m",
939
-
"cortex-m-rt",
940
-
"defmt 1.0.1",
941
-
"defmt-rtt",
942
-
"embassy-executor",
943
-
"embassy-futures",
944
-
"embassy-net",
945
-
"embassy-stm32",
946
-
"embassy-time",
947
-
"embedded-alloc",
948
-
"embedded-hal 1.0.0",
949
-
"ergot",
950
-
"heapless 0.9.1",
951
-
"log",
952
-
"mutex",
953
-
"panic-probe",
954
-
"postcard-schema",
955
-
"serde",
956
-
"static_cell",
957
-
]
958
-
959
-
[[package]]
960
-
name = "num-traits"
961
-
version = "0.2.19"
962
-
source = "registry+https://github.com/rust-lang/crates.io-index"
963
-
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
964
-
dependencies = [
965
-
"autocfg",
966
-
]
967
-
968
-
[[package]]
969
-
name = "once_cell"
970
-
version = "1.21.3"
971
-
source = "registry+https://github.com/rust-lang/crates.io-index"
972
-
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
973
-
974
-
[[package]]
975
-
name = "overload"
976
-
version = "0.1.1"
977
-
source = "registry+https://github.com/rust-lang/crates.io-index"
978
-
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
979
-
980
-
[[package]]
981
-
name = "panic-probe"
982
-
version = "1.0.0"
983
-
source = "registry+https://github.com/rust-lang/crates.io-index"
984
-
checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a"
985
-
dependencies = [
986
-
"cortex-m",
987
-
"defmt 1.0.1",
988
-
]
989
-
990
-
[[package]]
991
-
name = "pin-project"
992
-
version = "1.1.10"
993
-
source = "registry+https://github.com/rust-lang/crates.io-index"
994
-
checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a"
995
-
dependencies = [
996
-
"pin-project-internal",
997
-
]
998
-
999
-
[[package]]
1000
-
name = "pin-project-internal"
1001
-
version = "1.1.10"
1002
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1003
-
checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861"
1004
-
dependencies = [
1005
-
"proc-macro2",
1006
-
"quote",
1007
-
"syn 2.0.106",
1008
-
]
1009
-
1010
-
[[package]]
1011
-
name = "pin-project-lite"
1012
-
version = "0.2.16"
1013
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1014
-
checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
1015
-
1016
-
[[package]]
1017
-
name = "pin-utils"
1018
-
version = "0.1.0"
1019
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1020
-
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
1021
-
1022
-
[[package]]
1023
-
name = "portable-atomic"
1024
-
version = "1.11.1"
1025
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1026
-
checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
1027
-
1028
-
[[package]]
1029
-
name = "postcard"
1030
-
version = "1.1.3"
1031
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1032
-
checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24"
1033
-
dependencies = [
1034
-
"cobs 0.3.0",
1035
-
"heapless 0.7.17",
1036
-
"serde",
1037
-
]
1038
-
1039
-
[[package]]
1040
-
name = "postcard-derive"
1041
-
version = "0.2.2"
1042
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1043
-
checksum = "e0232bd009a197ceec9cc881ba46f727fcd8060a2d8d6a9dde7a69030a6fe2bb"
1044
-
dependencies = [
1045
-
"proc-macro2",
1046
-
"quote",
1047
-
"syn 2.0.106",
1048
-
]
1049
-
1050
-
[[package]]
1051
-
name = "postcard-schema"
1052
-
version = "0.2.5"
1053
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1054
-
checksum = "9475666d89f42231a0a57da32d5f6ca7f9b5cd4c335ea1fe8f3278215b7a21ff"
1055
-
dependencies = [
1056
-
"heapless 0.9.1",
1057
-
"postcard-derive",
1058
-
"serde",
1059
-
]
1060
-
1061
-
[[package]]
1062
-
name = "proc-macro-error-attr2"
1063
-
version = "2.0.0"
1064
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1065
-
checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5"
1066
-
dependencies = [
1067
-
"proc-macro2",
1068
-
"quote",
1069
-
]
1070
-
1071
-
[[package]]
1072
-
name = "proc-macro-error2"
1073
-
version = "2.0.1"
1074
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1075
-
checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802"
1076
-
dependencies = [
1077
-
"proc-macro-error-attr2",
1078
-
"proc-macro2",
1079
-
"quote",
1080
-
"syn 2.0.106",
1081
-
]
1082
-
1083
-
[[package]]
1084
-
name = "proc-macro2"
1085
-
version = "1.0.101"
1086
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1087
-
checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de"
1088
-
dependencies = [
1089
-
"unicode-ident",
1090
-
]
1091
-
1092
-
[[package]]
1093
-
name = "quote"
1094
-
version = "1.0.40"
1095
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1096
-
checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
1097
-
dependencies = [
1098
-
"proc-macro2",
1099
-
]
1100
-
1101
-
[[package]]
1102
-
name = "rand_core"
1103
-
version = "0.6.4"
1104
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1105
-
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
1106
-
1107
-
[[package]]
1108
-
name = "rand_core"
1109
-
version = "0.9.3"
1110
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1111
-
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
1112
-
1113
-
[[package]]
1114
-
name = "regex"
1115
-
version = "1.11.2"
1116
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1117
-
checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912"
1118
-
dependencies = [
1119
-
"aho-corasick",
1120
-
"memchr",
1121
-
"regex-automata 0.4.10",
1122
-
"regex-syntax 0.8.6",
1123
-
]
1124
-
1125
-
[[package]]
1126
-
name = "regex-automata"
1127
-
version = "0.1.10"
1128
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1129
-
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
1130
-
dependencies = [
1131
-
"regex-syntax 0.6.29",
1132
-
]
1133
-
1134
-
[[package]]
1135
-
name = "regex-automata"
1136
-
version = "0.4.10"
1137
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1138
-
checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6"
1139
-
dependencies = [
1140
-
"aho-corasick",
1141
-
"memchr",
1142
-
"regex-syntax 0.8.6",
1143
-
]
1144
-
1145
-
[[package]]
1146
-
name = "regex-syntax"
1147
-
version = "0.6.29"
1148
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1149
-
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
1150
-
1151
-
[[package]]
1152
-
name = "regex-syntax"
1153
-
version = "0.8.6"
1154
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1155
-
checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001"
1156
-
1157
-
[[package]]
1158
-
name = "rlsf"
1159
-
version = "0.2.1"
1160
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1161
-
checksum = "222fb240c3286247ecdee6fa5341e7cdad0ffdf8e7e401d9937f2d58482a20bf"
1162
-
dependencies = [
1163
-
"cfg-if",
1164
-
"const-default",
1165
-
"libc",
1166
-
"svgbobdoc",
1167
-
]
1168
-
1169
-
[[package]]
1170
-
name = "rustc_version"
1171
-
version = "0.2.3"
1172
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1173
-
checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
1174
-
dependencies = [
1175
-
"semver 0.9.0",
1176
-
]
1177
-
1178
-
[[package]]
1179
-
name = "rustc_version"
1180
-
version = "0.4.1"
1181
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1182
-
checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
1183
-
dependencies = [
1184
-
"semver 1.0.26",
1185
-
]
1186
-
1187
-
[[package]]
1188
-
name = "rustversion"
1189
-
version = "1.0.22"
1190
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1191
-
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
1192
-
1193
-
[[package]]
1194
-
name = "scoped-tls"
1195
-
version = "1.0.1"
1196
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1197
-
checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
1198
-
1199
-
[[package]]
1200
-
name = "scopeguard"
1201
-
version = "1.2.0"
1202
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1203
-
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
1204
-
1205
-
[[package]]
1206
-
name = "sdio-host"
1207
-
version = "0.9.0"
1208
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1209
-
checksum = "b328e2cb950eeccd55b7f55c3a963691455dcd044cfb5354f0c5e68d2c2d6ee2"
1210
-
1211
-
[[package]]
1212
-
name = "semver"
1213
-
version = "0.9.0"
1214
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1215
-
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
1216
-
dependencies = [
1217
-
"semver-parser",
1218
-
]
1219
-
1220
-
[[package]]
1221
-
name = "semver"
1222
-
version = "1.0.26"
1223
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1224
-
checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0"
1225
-
1226
-
[[package]]
1227
-
name = "semver-parser"
1228
-
version = "0.7.0"
1229
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1230
-
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
1231
-
1232
-
[[package]]
1233
-
name = "serde"
1234
-
version = "1.0.219"
1235
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1236
-
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
1237
-
dependencies = [
1238
-
"serde_derive",
1239
-
]
1240
-
1241
-
[[package]]
1242
-
name = "serde_derive"
1243
-
version = "1.0.219"
1244
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1245
-
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
1246
-
dependencies = [
1247
-
"proc-macro2",
1248
-
"quote",
1249
-
"syn 2.0.106",
1250
-
]
1251
-
1252
-
[[package]]
1253
-
name = "sharded-slab"
1254
-
version = "0.1.7"
1255
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1256
-
checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6"
1257
-
dependencies = [
1258
-
"lazy_static",
1259
-
]
1260
-
1261
-
[[package]]
1262
-
name = "shlex"
1263
-
version = "1.3.0"
1264
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1265
-
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
1266
-
1267
-
[[package]]
1268
-
name = "smallvec"
1269
-
version = "1.15.1"
1270
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1271
-
checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
1272
-
1273
-
[[package]]
1274
-
name = "smoltcp"
1275
-
version = "0.12.0"
1276
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1277
-
checksum = "dad095989c1533c1c266d9b1e8d70a1329dd3723c3edac6d03bbd67e7bf6f4bb"
1278
-
dependencies = [
1279
-
"bitflags 1.3.2",
1280
-
"byteorder",
1281
-
"cfg-if",
1282
-
"defmt 0.3.100",
1283
-
"heapless 0.8.0",
1284
-
"managed",
1285
-
]
1286
-
1287
-
[[package]]
1288
-
name = "spin"
1289
-
version = "0.9.8"
1290
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1291
-
checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
1292
-
dependencies = [
1293
-
"lock_api",
1294
-
]
1295
-
1296
-
[[package]]
1297
-
name = "stable_deref_trait"
1298
-
version = "1.2.0"
1299
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1300
-
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
1301
-
1302
-
[[package]]
1303
-
name = "static_assertions"
1304
-
version = "1.1.0"
1305
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1306
-
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
1307
-
1308
-
[[package]]
1309
-
name = "static_cell"
1310
-
version = "2.1.1"
1311
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1312
-
checksum = "0530892bb4fa575ee0da4b86f86c667132a94b74bb72160f58ee5a4afec74c23"
1313
-
dependencies = [
1314
-
"portable-atomic",
1315
-
]
1316
-
1317
-
[[package]]
1318
-
name = "stm32-fmc"
1319
-
version = "0.3.2"
1320
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1321
-
checksum = "c7f0639399e2307c2446c54d91d4f1596343a1e1d5cab605b9cce11d0ab3858c"
1322
-
dependencies = [
1323
-
"embedded-hal 0.2.7",
1324
-
]
1325
-
1326
-
[[package]]
1327
-
name = "stm32-metapac"
1328
-
version = "18.0.0"
1329
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1330
-
checksum = "6fd8ec3a292a0d9fc4798416a61b21da5ae50341b2e7b8d12e662bf305366097"
1331
-
dependencies = [
1332
-
"cortex-m",
1333
-
"cortex-m-rt",
1334
-
"defmt 0.3.100",
1335
-
]
1336
-
1337
-
[[package]]
1338
-
name = "strsim"
1339
-
version = "0.11.1"
1340
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1341
-
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
1342
-
1343
-
[[package]]
1344
-
name = "svgbobdoc"
1345
-
version = "0.3.0"
1346
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1347
-
checksum = "f2c04b93fc15d79b39c63218f15e3fdffaa4c227830686e3b7c5f41244eb3e50"
1348
-
dependencies = [
1349
-
"base64",
1350
-
"proc-macro2",
1351
-
"quote",
1352
-
"syn 1.0.109",
1353
-
"unicode-width",
1354
-
]
1355
-
1356
-
[[package]]
1357
-
name = "syn"
1358
-
version = "1.0.109"
1359
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1360
-
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
1361
-
dependencies = [
1362
-
"proc-macro2",
1363
-
"quote",
1364
-
"unicode-ident",
1365
-
]
1366
-
1367
-
[[package]]
1368
-
name = "syn"
1369
-
version = "2.0.106"
1370
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1371
-
checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6"
1372
-
dependencies = [
1373
-
"proc-macro2",
1374
-
"quote",
1375
-
"unicode-ident",
1376
-
]
1377
-
1378
-
[[package]]
1379
-
name = "thiserror"
1380
-
version = "2.0.16"
1381
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1382
-
checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0"
1383
-
dependencies = [
1384
-
"thiserror-impl",
1385
-
]
1386
-
1387
-
[[package]]
1388
-
name = "thiserror-impl"
1389
-
version = "2.0.16"
1390
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1391
-
checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960"
1392
-
dependencies = [
1393
-
"proc-macro2",
1394
-
"quote",
1395
-
"syn 2.0.106",
1396
-
]
1397
-
1398
-
[[package]]
1399
-
name = "thread_local"
1400
-
version = "1.1.9"
1401
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1402
-
checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185"
1403
-
dependencies = [
1404
-
"cfg-if",
1405
-
]
1406
-
1407
-
[[package]]
1408
-
name = "tracing"
1409
-
version = "0.1.41"
1410
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1411
-
checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
1412
-
dependencies = [
1413
-
"pin-project-lite",
1414
-
"tracing-attributes",
1415
-
"tracing-core",
1416
-
]
1417
-
1418
-
[[package]]
1419
-
name = "tracing-attributes"
1420
-
version = "0.1.30"
1421
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1422
-
checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903"
1423
-
dependencies = [
1424
-
"proc-macro2",
1425
-
"quote",
1426
-
"syn 2.0.106",
1427
-
]
1428
-
1429
-
[[package]]
1430
-
name = "tracing-core"
1431
-
version = "0.1.34"
1432
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1433
-
checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678"
1434
-
dependencies = [
1435
-
"once_cell",
1436
-
"valuable",
1437
-
]
1438
-
1439
-
[[package]]
1440
-
name = "tracing-log"
1441
-
version = "0.2.0"
1442
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1443
-
checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3"
1444
-
dependencies = [
1445
-
"log",
1446
-
"once_cell",
1447
-
"tracing-core",
1448
-
]
1449
-
1450
-
[[package]]
1451
-
name = "tracing-subscriber"
1452
-
version = "0.3.19"
1453
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1454
-
checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008"
1455
-
dependencies = [
1456
-
"matchers",
1457
-
"nu-ansi-term",
1458
-
"once_cell",
1459
-
"regex",
1460
-
"sharded-slab",
1461
-
"smallvec",
1462
-
"thread_local",
1463
-
"tracing",
1464
-
"tracing-core",
1465
-
"tracing-log",
1466
-
]
1467
-
1468
-
[[package]]
1469
-
name = "unicode-ident"
1470
-
version = "1.0.18"
1471
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1472
-
checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
1473
-
1474
-
[[package]]
1475
-
name = "unicode-width"
1476
-
version = "0.1.14"
1477
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1478
-
checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
1479
-
1480
-
[[package]]
1481
-
name = "valuable"
1482
-
version = "0.1.1"
1483
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1484
-
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
1485
-
1486
-
[[package]]
1487
-
name = "vcell"
1488
-
version = "0.1.3"
1489
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1490
-
checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002"
1491
-
1492
-
[[package]]
1493
-
name = "void"
1494
-
version = "1.0.2"
1495
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1496
-
checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
1497
-
1498
-
[[package]]
1499
-
name = "volatile-register"
1500
-
version = "0.2.2"
1501
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1502
-
checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc"
1503
-
dependencies = [
1504
-
"vcell",
1505
-
]
1506
-
1507
-
[[package]]
1508
-
name = "winapi"
1509
-
version = "0.3.9"
1510
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1511
-
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
1512
-
dependencies = [
1513
-
"winapi-i686-pc-windows-gnu",
1514
-
"winapi-x86_64-pc-windows-gnu",
1515
-
]
1516
-
1517
-
[[package]]
1518
-
name = "winapi-i686-pc-windows-gnu"
1519
-
version = "0.4.0"
1520
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1521
-
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
1522
-
1523
-
[[package]]
1524
-
name = "winapi-x86_64-pc-windows-gnu"
1525
-
version = "0.4.0"
1526
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1527
-
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
1528
-
1529
-
[[package]]
1530
-
name = "windows"
1531
-
version = "0.61.3"
1532
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1533
-
checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893"
1534
-
dependencies = [
1535
-
"windows-collections",
1536
-
"windows-core",
1537
-
"windows-future",
1538
-
"windows-link",
1539
-
"windows-numerics",
1540
-
]
1541
-
1542
-
[[package]]
1543
-
name = "windows-collections"
1544
-
version = "0.2.0"
1545
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1546
-
checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8"
1547
-
dependencies = [
1548
-
"windows-core",
1549
-
]
1550
-
1551
-
[[package]]
1552
-
name = "windows-core"
1553
-
version = "0.61.2"
1554
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1555
-
checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
1556
-
dependencies = [
1557
-
"windows-implement",
1558
-
"windows-interface",
1559
-
"windows-link",
1560
-
"windows-result",
1561
-
"windows-strings",
1562
-
]
1563
-
1564
-
[[package]]
1565
-
name = "windows-future"
1566
-
version = "0.2.1"
1567
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1568
-
checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e"
1569
-
dependencies = [
1570
-
"windows-core",
1571
-
"windows-link",
1572
-
"windows-threading",
1573
-
]
1574
-
1575
-
[[package]]
1576
-
name = "windows-implement"
1577
-
version = "0.60.0"
1578
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1579
-
checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836"
1580
-
dependencies = [
1581
-
"proc-macro2",
1582
-
"quote",
1583
-
"syn 2.0.106",
1584
-
]
1585
-
1586
-
[[package]]
1587
-
name = "windows-interface"
1588
-
version = "0.59.1"
1589
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1590
-
checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8"
1591
-
dependencies = [
1592
-
"proc-macro2",
1593
-
"quote",
1594
-
"syn 2.0.106",
1595
-
]
1596
-
1597
-
[[package]]
1598
-
name = "windows-link"
1599
-
version = "0.1.3"
1600
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1601
-
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
1602
-
1603
-
[[package]]
1604
-
name = "windows-numerics"
1605
-
version = "0.2.0"
1606
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1607
-
checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"
1608
-
dependencies = [
1609
-
"windows-core",
1610
-
"windows-link",
1611
-
]
1612
-
1613
-
[[package]]
1614
-
name = "windows-result"
1615
-
version = "0.3.4"
1616
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1617
-
checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"
1618
-
dependencies = [
1619
-
"windows-link",
1620
-
]
1621
-
1622
-
[[package]]
1623
-
name = "windows-strings"
1624
-
version = "0.4.2"
1625
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1626
-
checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"
1627
-
dependencies = [
1628
-
"windows-link",
1629
-
]
1630
-
1631
-
[[package]]
1632
-
name = "windows-threading"
1633
-
version = "0.1.0"
1634
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1635
-
checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6"
1636
-
dependencies = [
1637
-
"windows-link",
1638
-
]
-50
demos/stm32h723zg/Cargo.toml
-50
demos/stm32h723zg/Cargo.toml
···
1
-
[workspace]
2
-
members = [
3
-
"nucleoh723zg-blinky",
4
-
"nucleoh723zg-net-udp-pair",
5
-
]
6
-
resolver = "2"
7
-
8
-
[workspace.dependencies]
9
-
ergot = { path = "../../crates/ergot", features = ["embassy-net-v0_7"] }
10
-
11
-
cortex-m-rt = "0.7.0"
12
-
defmt = "1.0.1"
13
-
defmt-rtt = "1.0.0"
14
-
embedded-hal = "1.0.0"
15
-
mutex = "1.0.2"
16
-
static_cell = "2.1.1"
17
-
embedded-alloc = "0.6.0"
18
-
19
-
bbq2 = { version = "0.4.1", default-features = false, features = ["critical-section", "maitake-sync-0_2"] }
20
-
21
-
cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
22
-
embassy-executor = { version = "0.9.1", features = ["defmt", "arch-cortex-m", "executor-thread", "executor-interrupt"] }
23
-
embassy-stm32 = { version = "0.4.0", features = ["defmt", "stm32h723zg", "unstable-pac", "memory-x", "time-driver-tim2", "exti", "memory-x"] }
24
-
embassy-time = { version = "0.5.0", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
25
-
embassy-net = { version = "0.7.1", features = ["defmt", "tcp", "udp", "dhcpv4", "medium-ethernet", "dns", "proto-ipv4", "proto-ipv6"] }
26
-
embassy-futures = { version = "0.1.2", features = ["defmt"] }
27
-
heapless = { version = "0.9", default-features = false }
28
-
panic-probe = { version = "1.0.0", features = ["print-defmt"] }
29
-
postcard-schema = { version = "0.2.5", features = ["derive"] }
30
-
serde = { version = "1.0.219", default-features = false, features = ["derive"] }
31
-
32
-
[profile.release]
33
-
debug = 2
34
-
lto = true
35
-
opt-level = 0
36
-
codegen-units = 1
37
-
incremental = false
38
-
panic = "abort"
39
-
40
-
[profile.ci]
41
-
inherits = "dev"
42
-
debug = false
43
-
strip = true
44
-
debug-assertions = true
45
-
overflow-checks = true
46
-
lto = false
47
-
panic = 'unwind'
48
-
incremental = false
49
-
codegen-units = 256
50
-
rpath = false
-106
demos/stm32h723zg/memory.x
-106
demos/stm32h723zg/memory.x
···
1
-
MEMORY
2
-
{
3
-
/* This file is intended for parts in the STM32H723 family. (RM0468) */
4
-
/* - FLASH and RAM are mandatory memory sections. */
5
-
/* - The sum of all non-FLASH sections must add to 564k total device RAM. */
6
-
/* - The FLASH section size must match your device, see table below. */
7
-
8
-
/* FLASH */
9
-
/* Select the appropriate FLASH size for your device. */
10
-
/* - STM32H730xB 128K */
11
-
/* - STM32H723xE/725xE 512K */
12
-
/* - STM32H723xG/725xG/733xG/735xG 1M */
13
-
FLASH1 : ORIGIN = 0x08000000, LENGTH = 1M
14
-
15
-
/* Data TCM */
16
-
/* - Two contiguous 64KB RAMs. */
17
-
/* - Used for interrupt handlers, stacks and general RAM. */
18
-
/* - Zero wait-states. */
19
-
/* - The DTCM is taken as the origin of the base ram. (See below.) */
20
-
/* This is also where the interrupt table and such will live, */
21
-
/* which is required for deterministic performance. */
22
-
DTCM : ORIGIN = 0x20000000, LENGTH = 128K
23
-
24
-
/* Instruction TCM */
25
-
/* - More memory can be assigned to ITCM. See AXI SRAM notes, below. */
26
-
/* - Used for latency-critical interrupt handlers etc. */
27
-
/* - Zero wait-states. */
28
-
ITCM : ORIGIN = 0x00000000, LENGTH = 64K + 0K
29
-
30
-
/* AXI SRAM */
31
-
/* - AXISRAM is in D1 and accessible by all system masters except BDMA. */
32
-
/* - Suitable for application data not stored in DTCM. */
33
-
/* - Zero wait-states. */
34
-
/* - The 192k of extra shared RAM is fully allotted to the AXI SRAM by default. */
35
-
/* As a result: 64k (64k + 0k) for ITCM and 320k (128k + 192k) for AXI SRAM. */
36
-
/* This can be re-configured via the TCM_AXI_SHARED[1,0] register when more */
37
-
/* ITCM is required. */
38
-
AXISRAM : ORIGIN = 0x24000000, LENGTH = 128K + 192K
39
-
40
-
/* AHB SRAM */
41
-
/* - SRAM1-2 are in D2 and accessible by all system masters except BDMA, LTDC */
42
-
/* and SDMMC1. Suitable for use as DMA buffers. */
43
-
/* - SRAM4 is in D3 and additionally accessible by the BDMA. Used for BDMA */
44
-
/* buffers, for storing application data in lower-power modes. */
45
-
/* - Zero wait-states. */
46
-
SRAM1 : ORIGIN = 0x30000000, LENGTH = 16K
47
-
SRAM2 : ORIGIN = 0x30040000, LENGTH = 16K
48
-
SRAM4 : ORIGIN = 0x38000000, LENGTH = 16K
49
-
50
-
/* Backup SRAM */
51
-
/* Used to store data during low-power sleeps. */
52
-
BSRAM : ORIGIN = 0x38800000, LENGTH = 4K
53
-
}
54
-
55
-
/*
56
-
/* Assign the memory regions defined above for use. */
57
-
/*
58
-
59
-
/* Provide the mandatory FLASH and RAM definitions for cortex-m-rt's linker script. */
60
-
REGION_ALIAS(FLASH, FLASH1);
61
-
REGION_ALIAS(RAM, AXISRAM);
62
-
63
-
/* The location of the stack can be overridden using the `_stack_start` symbol. */
64
-
/* - Set the stack location at the end of RAM, using all remaining space. */
65
-
_stack_start = ORIGIN(RAM) + LENGTH(RAM);
66
-
67
-
/* The location of the .text section can be overridden using the */
68
-
/* `_stext` symbol. By default it will place after .vector_table. */
69
-
/* _stext = ORIGIN(FLASH) + 0x40c; */
70
-
71
-
/* Define sections for placing symbols into the extra memory regions above. */
72
-
/* This makes them accessible from code. */
73
-
/* - ITCM, DTCM and AXISRAM connect to a 64-bit wide bus -> align to 8 bytes. */
74
-
/* - All other memories connect to a 32-bit wide bus -> align to 4 bytes. */
75
-
SECTIONS {
76
-
.itcm (NOLOAD) : ALIGN(8) {
77
-
*(.itcm .itcm.*);
78
-
. = ALIGN(8);
79
-
} > ITCM
80
-
81
-
.axisram (NOLOAD) : ALIGN(8) {
82
-
*(.axisram .axisram.*);
83
-
. = ALIGN(8);
84
-
} > AXISRAM
85
-
86
-
.sram1 (NOLOAD) : ALIGN(4) {
87
-
*(.sram1 .sram1.*);
88
-
. = ALIGN(4);
89
-
} > SRAM1
90
-
91
-
.sram2 (NOLOAD) : ALIGN(4) {
92
-
*(.sram2 .sram2.*);
93
-
. = ALIGN(4);
94
-
} > SRAM2
95
-
96
-
.sram4 (NOLOAD) : ALIGN(4) {
97
-
*(.sram4 .sram4.*);
98
-
. = ALIGN(4);
99
-
} > SRAM4
100
-
101
-
.bsram (NOLOAD) : ALIGN(4) {
102
-
*(.bsram .bsram.*);
103
-
. = ALIGN(4);
104
-
} > BSRAM
105
-
106
-
};
-18
demos/stm32h723zg/nucleoh723zg-blinky/Cargo.toml
-18
demos/stm32h723zg/nucleoh723zg-blinky/Cargo.toml
···
1
-
[package]
2
-
name = "nucleoh723zg-blinky"
3
-
version = "0.1.0"
4
-
edition = "2024"
5
-
6
-
[dependencies]
7
-
cortex-m-rt.workspace = true
8
-
cortex-m.workspace = true
9
-
defmt-rtt.workspace = true
10
-
defmt.workspace = true
11
-
embassy-executor.workspace = true
12
-
embassy-stm32.workspace = true
13
-
embassy-time.workspace = true
14
-
embedded-hal.workspace = true
15
-
ergot.workspace = true
16
-
heapless.workspace = true
17
-
mutex.workspace = true
18
-
panic-probe.workspace = true
-25
demos/stm32h723zg/nucleoh723zg-blinky/build.rs
-25
demos/stm32h723zg/nucleoh723zg-blinky/build.rs
···
1
-
use std::env;
2
-
use std::fs::File;
3
-
use std::io::Write;
4
-
use std::path::PathBuf;
5
-
6
-
fn main() {
7
-
// Put `memory.x` in our output directory and ensure it's
8
-
// on the linker search path.
9
-
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
10
-
File::create(out.join("memory.x"))
11
-
.unwrap()
12
-
.write_all(include_bytes!("../memory.x"))
13
-
.unwrap();
14
-
println!("cargo:rustc-link-search={}", out.display());
15
-
16
-
// By default, Cargo will re-run a build script whenever
17
-
// any file in the project changes. By specifying `memory.x`
18
-
// here, we ensure the build script is only re-run when
19
-
// `memory.x` is changed.
20
-
println!("cargo:rerun-if-changed=memory.x");
21
-
22
-
println!("cargo:rustc-link-arg-bins=--nmagic");
23
-
println!("cargo:rustc-link-arg-bins=-Tlink.x");
24
-
println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
25
-
}
-56
demos/stm32h723zg/nucleoh723zg-blinky/src/main.rs
-56
demos/stm32h723zg/nucleoh723zg-blinky/src/main.rs
···
1
-
#![no_std]
2
-
#![no_main]
3
-
4
-
use core::pin::pin;
5
-
6
-
use embassy_executor::{Spawner, task};
7
-
use embassy_stm32::gpio::{Level, Output, Speed};
8
-
use embassy_time::{Duration, Ticker};
9
-
use ergot::{Address, NetStack, endpoint, interface_manager::profiles::null::Null};
10
-
use mutex::raw_impls::cs::CriticalSectionRawMutex;
11
-
use {defmt_rtt as _, panic_probe as _};
12
-
13
-
pub static STACK: NetStack<CriticalSectionRawMutex, Null> = NetStack::new();
14
-
15
-
// Define some endpoints
16
-
endpoint!(LedEndpoint, bool, (), "led/set");
17
-
18
-
#[embassy_executor::main]
19
-
async fn main(spawner: Spawner) {
20
-
let p = embassy_stm32::init(Default::default());
21
-
22
-
spawner.must_spawn(led_server(Output::new(p.PB14, Level::High, Speed::Low)));
23
-
24
-
let mut ticker = Ticker::every(Duration::from_millis(500));
25
-
let client = STACK
26
-
.endpoints()
27
-
.client::<LedEndpoint>(Address::unknown(), Some("led"));
28
-
loop {
29
-
ticker.next().await;
30
-
let _ = client.request(&true).await;
31
-
ticker.next().await;
32
-
let _ = client.request(&false).await;
33
-
}
34
-
}
35
-
36
-
#[task]
37
-
async fn led_server(mut led: Output<'static>) {
38
-
let socket = STACK
39
-
.endpoints()
40
-
.bounded_server::<LedEndpoint, 2>(Some("led"));
41
-
let socket = pin!(socket);
42
-
let mut hdl = socket.attach();
43
-
44
-
loop {
45
-
let _ = hdl
46
-
.serve(async |on| {
47
-
defmt::info!("LED set {=bool}", *on);
48
-
if *on {
49
-
led.set_low();
50
-
} else {
51
-
led.set_high();
52
-
}
53
-
})
54
-
.await;
55
-
}
56
-
}
-26
demos/stm32h723zg/nucleoh723zg-net-udp-pair/Cargo.toml
-26
demos/stm32h723zg/nucleoh723zg-net-udp-pair/Cargo.toml
···
1
-
[package]
2
-
name = "nucleoh723zg-net-udp-pair"
3
-
version = "0.1.0"
4
-
edition = "2024"
5
-
6
-
[dependencies]
7
-
cortex-m-rt.workspace = true
8
-
cortex-m.workspace = true
9
-
defmt-rtt.workspace = true
10
-
defmt.workspace = true
11
-
embassy-executor.workspace = true
12
-
embassy-stm32.workspace = true
13
-
embassy-time.workspace = true
14
-
embassy-net.workspace = true
15
-
embassy-futures.workspace = true
16
-
embedded-hal.workspace = true
17
-
ergot.workspace = true
18
-
heapless.workspace = true
19
-
mutex.workspace = true
20
-
panic-probe.workspace = true
21
-
postcard-schema.workspace = true
22
-
serde.workspace = true
23
-
static_cell.workspace = true
24
-
bbq2.workspace = true
25
-
log = "0.4.27"
26
-
embedded-alloc.workspace = true
-25
demos/stm32h723zg/nucleoh723zg-net-udp-pair/build.rs
-25
demos/stm32h723zg/nucleoh723zg-net-udp-pair/build.rs
···
1
-
use std::env;
2
-
use std::fs::File;
3
-
use std::io::Write;
4
-
use std::path::PathBuf;
5
-
6
-
fn main() {
7
-
// Put `memory.x` in our output directory and ensure it's
8
-
// on the linker search path.
9
-
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
10
-
File::create(out.join("memory.x"))
11
-
.unwrap()
12
-
.write_all(include_bytes!("../memory.x"))
13
-
.unwrap();
14
-
println!("cargo:rustc-link-search={}", out.display());
15
-
16
-
// By default, Cargo will re-run a build script whenever
17
-
// any file in the project changes. By specifying `memory.x`
18
-
// here, we ensure the build script is only re-run when
19
-
// `memory.x` is changed.
20
-
println!("cargo:rerun-if-changed=memory.x");
21
-
22
-
println!("cargo:rustc-link-arg-bins=--nmagic");
23
-
println!("cargo:rustc-link-arg-bins=-Tlink.x");
24
-
println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
25
-
}
-360
demos/stm32h723zg/nucleoh723zg-net-udp-pair/src/bin/controller.rs
-360
demos/stm32h723zg/nucleoh723zg-net-udp-pair/src/bin/controller.rs
···
1
-
#![no_std]
2
-
#![no_main]
3
-
extern crate alloc;
4
-
5
-
use alloc::boxed::Box;
6
-
use core::pin::pin;
7
-
8
-
use defmt::*;
9
-
use embassy_executor::Spawner;
10
-
use embassy_net::StackResources;
11
-
use embassy_net::udp::{PacketMetadata, UdpSocket};
12
-
use embassy_net::{IpEndpoint, Ipv4Address};
13
-
use embassy_stm32::eth::PacketQueue;
14
-
use embassy_stm32::eth::{Ethernet, GenericPhy};
15
-
use embassy_stm32::pac::rcc::vals::{Pllm, Plln, Pllsrc};
16
-
use embassy_stm32::peripherals::ETH;
17
-
use embassy_stm32::rcc::mux::{
18
-
Fdcansel, I2c4sel, I2c1235sel, Saisel, Sdmmcsel, Spi6sel, Spi45sel, Usart16910sel, Usart234578sel, Usbsel,
19
-
};
20
-
use embassy_stm32::rcc::{AHBPrescaler, APBPrescaler, LsConfig, PllDiv, Sysclk};
21
-
use embassy_stm32::rng::Rng;
22
-
use embassy_stm32::{Config, bind_interrupts, eth, peripherals, rcc, rng};
23
-
use embassy_time::{Duration, Ticker, Timer, WithTimeout};
24
-
use embedded_alloc::LlffHeap as Heap;
25
-
use ergot::exports::bbq2::traits::coordination::cas::AtomicCoord;
26
-
use ergot::interface_manager::profiles::direct_edge::embassy_net_udp_0_7::{RxTxWorker, UDP_OVER_ETH_ERGOT_FRAME_SIZE_MAX, UDP_OVER_ETH_ERGOT_PAYLOAD_SIZE_MAX};
27
-
use ergot::logging::log_v0_4::LogSink;
28
-
use ergot::toolkits::embassy_net_v0_7 as kit;
29
-
use ergot::well_known::ErgotPingEndpoint;
30
-
use ergot::{Address, topic};
31
-
use mutex::raw_impls::cs::CriticalSectionRawMutex;
32
-
use static_cell::{ConstStaticCell, StaticCell};
33
-
use {defmt_rtt as _, panic_probe as _};
34
-
35
-
const OUT_QUEUE_SIZE: usize = 4096;
36
-
37
-
type Stack = kit::EdgeStack<&'static Queue, CriticalSectionRawMutex>;
38
-
type Queue = kit::Queue<OUT_QUEUE_SIZE, AtomicCoord>;
39
-
40
-
/// Statically store our netstack
41
-
static STACK: Stack = kit::new_controller_stack(OUTQ.framed_producer(), UDP_OVER_ETH_ERGOT_FRAME_SIZE_MAX as u16);
42
-
/// Statically store our outgoing packet buffer
43
-
static OUTQ: Queue = kit::Queue::new();
44
-
/// Statically store receive buffers
45
-
static SCRATCH_BUF: ConstStaticCell<[u8; UDP_OVER_ETH_ERGOT_PAYLOAD_SIZE_MAX]> = ConstStaticCell::new([0u8; UDP_OVER_ETH_ERGOT_PAYLOAD_SIZE_MAX]);
46
-
47
-
static LOGSINK: LogSink<&'static Stack> = LogSink::new(&STACK);
48
-
49
-
#[global_allocator]
50
-
static HEAP: Heap = Heap::empty();
51
-
52
-
bind_interrupts!(struct Irqs {
53
-
ETH => eth::InterruptHandler;
54
-
RNG => rng::InterruptHandler<peripherals::RNG>;
55
-
});
56
-
57
-
#[embassy_executor::main]
58
-
async fn main(spawner: Spawner) -> ! {
59
-
let mut config = Config::default();
60
-
config.rcc.hse = Some(rcc::Hse {
61
-
freq: embassy_stm32::time::Hertz(8_000_000),
62
-
mode: rcc::HseMode::Oscillator,
63
-
});
64
-
config.rcc.ls = LsConfig::off();
65
-
config.rcc.hsi48 = Some(Default::default()); // needed for RNG
66
-
config.rcc.sys = Sysclk::PLL1_P;
67
-
config.rcc.d1c_pre = AHBPrescaler::DIV1;
68
-
config.rcc.ahb_pre = AHBPrescaler::DIV2;
69
-
config.rcc.apb1_pre = APBPrescaler::DIV2;
70
-
config.rcc.apb2_pre = APBPrescaler::DIV2;
71
-
config.rcc.apb3_pre = APBPrescaler::DIV2;
72
-
config.rcc.apb4_pre = APBPrescaler::DIV2;
73
-
config.rcc.timer_prescaler = rcc::TimerPrescaler::DefaultX2;
74
-
75
-
config.rcc.voltage_scale = rcc::VoltageScale::Scale0;
76
-
config.rcc.pll1 = Some(rcc::Pll {
77
-
source: Pllsrc::HSE,
78
-
prediv: Pllm::DIV4,
79
-
mul: Plln::MUL260,
80
-
// 520Mhz
81
-
divp: Some(PllDiv::DIV1),
82
-
// 130Mhz
83
-
divq: Some(PllDiv::DIV4),
84
-
divr: None,
85
-
});
86
-
config.rcc.pll2 = Some(rcc::Pll {
87
-
source: Pllsrc::HSE,
88
-
89
-
prediv: Pllm::DIV4,
90
-
mul: Plln::MUL200,
91
-
// 200Mhz
92
-
divp: Some(PllDiv::DIV2),
93
-
// 100Mhz
94
-
divq: Some(PllDiv::DIV4),
95
-
// 200Mhz
96
-
divr: Some(PllDiv::DIV2),
97
-
});
98
-
config.rcc.pll3 = Some(rcc::Pll {
99
-
source: Pllsrc::HSE,
100
-
prediv: Pllm::DIV4,
101
-
mul: Plln::MUL192,
102
-
// 192Mhz
103
-
divp: Some(PllDiv::DIV2),
104
-
// 48Mhz
105
-
divq: Some(PllDiv::DIV8),
106
-
// 92Mhz
107
-
divr: Some(PllDiv::DIV4),
108
-
});
109
-
110
-
// 200mhz
111
-
//config.rcc.mux.octospisel = Octospisel::PLL2_R; // no support in embassy-stm32 it seems.
112
-
113
-
// 200mhz
114
-
config.rcc.mux.sdmmcsel = Sdmmcsel::PLL2_R;
115
-
// 100mhz
116
-
config.rcc.mux.fdcansel = Fdcansel::PLL2_Q;
117
-
// 48mhz from crystal (not RC48)
118
-
config.rcc.mux.usbsel = Usbsel::PLL3_Q;
119
-
// 100mhz
120
-
config.rcc.mux.usart234578sel = Usart234578sel::PLL2_Q;
121
-
// 100mhz
122
-
config.rcc.mux.usart16910sel = Usart16910sel::PLL2_Q;
123
-
// 130mhz
124
-
config.rcc.mux.i2c1235sel = I2c1235sel::PCLK1;
125
-
// 130mhz
126
-
config.rcc.mux.i2c4sel = I2c4sel::PCLK4;
127
-
// 200mhz
128
-
config.rcc.mux.spi123sel = Saisel::PLL2_P;
129
-
// 100mhz
130
-
config.rcc.mux.spi45sel = Spi45sel::PLL2_Q;
131
-
// 100mhz
132
-
config.rcc.mux.spi6sel = Spi6sel::PLL2_Q;
133
-
134
-
let p = embassy_stm32::init(config);
135
-
136
-
init_heap();
137
-
138
-
// Generate random seed.
139
-
info!("Initializing RNG");
140
-
let mut rng = Rng::new(p.RNG, Irqs);
141
-
let mut seed = [0; 8];
142
-
rng.fill_bytes(&mut seed);
143
-
let seed = u64::from_le_bytes(seed);
144
-
145
-
info!("Initializing ETH");
146
-
// TODO generate mac address from CPU ID
147
-
// potentially using this algorythm (C): https://github.com/zephyrproject-rtos/zephyr/issues/59993#issuecomment-1644030438
148
-
let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF];
149
-
150
-
static PACKETS: StaticCell<PacketQueue<8, 8>> = StaticCell::new();
151
-
// warning: Not all STM32H7 devices have the exact same pins here
152
-
// for STM32H747XIH, replace p.PB13 for PG12
153
-
let device = Ethernet::new(
154
-
PACKETS.init(PacketQueue::<8, 8>::new()),
155
-
p.ETH,
156
-
Irqs,
157
-
p.PA1, // ref_clk
158
-
p.PA2, // mdio
159
-
p.PC1, // eth_mdc
160
-
p.PA7, // CRS_DV: Carrier Sense
161
-
p.PC4, // RX_D0: Received Bit 0
162
-
p.PC5, // RX_D1: Received Bit 1
163
-
p.PG13, // TX_D0: Transmit Bit 0
164
-
p.PB13, // TX_D1: Transmit Bit 1
165
-
p.PG11, // TX_EN: Transmit Enable
166
-
GenericPhy::new_auto(),
167
-
mac_addr,
168
-
);
169
-
170
-
let config = embassy_net::Config::dhcpv4(Default::default());
171
-
//let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
172
-
// address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
173
-
// dns_servers: Vec::new(),
174
-
// gateway: Some(Ipv4Address::new(10, 42, 0, 1)),
175
-
//});
176
-
177
-
// Init network stack
178
-
static RESOURCES: StaticCell<StackResources<5>> = StaticCell::new();
179
-
let (embassy_net_stack, runner) = embassy_net::new(device, config, RESOURCES.init(StackResources::new()), seed);
180
-
181
-
// Launch network task
182
-
spawner.must_spawn(embassy_net_task(runner));
183
-
184
-
// Ensure DHCP configuration is up before trying connect
185
-
let mut attempts: u32 = 0;
186
-
let config = loop {
187
-
if let Some(config) = embassy_net_stack.config_v4() {
188
-
break config;
189
-
}
190
-
191
-
if attempts % 10 == 0 {
192
-
info!("Waiting for DHCP address allocation...");
193
-
}
194
-
195
-
attempts = attempts.wrapping_add(1);
196
-
Timer::after(Duration::from_millis(100)).await;
197
-
};
198
-
199
-
info!(
200
-
"IP address: {}, gateway: {}, dns: {}",
201
-
config.address, config.dns_servers, config.gateway
202
-
);
203
-
204
-
let rx_meta = [PacketMetadata::EMPTY; 1];
205
-
let rx_buffer = [0; 4096];
206
-
let tx_meta = [PacketMetadata::EMPTY; 1];
207
-
let tx_buffer = [0; 4096];
208
-
209
-
// move the buffers into the heap, so they don't get dropped
210
-
let rx_meta = Box::new(rx_meta);
211
-
let rx_meta = Box::leak(rx_meta);
212
-
let tx_meta = Box::new(tx_meta);
213
-
let tx_meta = Box::leak(tx_meta);
214
-
let rx_buffer = Box::new(rx_buffer);
215
-
let rx_buffer = Box::leak(rx_buffer);
216
-
let tx_buffer = Box::new(tx_buffer);
217
-
let tx_buffer = Box::leak(tx_buffer);
218
-
// You need to start a server on the host machine, for example: `nc -lu 8000`
219
-
220
-
let mut socket = UdpSocket::new(embassy_net_stack, rx_meta, rx_buffer, tx_meta, tx_buffer);
221
-
222
-
let port = 8000_u16;
223
-
let remote_endpoint = IpEndpoint::new(Ipv4Address::new(192, 168, 18, 65).into(), port);
224
-
let local_endpoint = IpEndpoint::new(config.address.address().into(), port);
225
-
socket
226
-
.bind(local_endpoint)
227
-
.expect("bound");
228
-
229
-
info!(
230
-
"capacity, receive: {}, send: {}",
231
-
socket.packet_recv_capacity(),
232
-
socket.packet_send_capacity()
233
-
);
234
-
235
-
// Spawn I/O worker tasks
236
-
spawner.must_spawn(run_socket(socket, SCRATCH_BUF.take(), remote_endpoint));
237
-
238
-
// Spawn socket using tasks
239
-
spawner.must_spawn(pingserver());
240
-
spawner.must_spawn(pinger());
241
-
242
-
spawner.must_spawn(yeeter());
243
-
spawner.must_spawn(yeet_listener(0));
244
-
245
-
LOGSINK.register_static(log::LevelFilter::Info);
246
-
247
-
let mut tckr = Ticker::every(Duration::from_secs(2));
248
-
let mut ct = 0;
249
-
loop {
250
-
tckr.next().await;
251
-
log::info!("log # {ct}");
252
-
ct += 1;
253
-
}
254
-
}
255
-
256
-
type Device = Ethernet<'static, ETH, GenericPhy>;
257
-
258
-
#[embassy_executor::task]
259
-
async fn embassy_net_task(mut runner: embassy_net::Runner<'static, Device>) -> ! {
260
-
runner.run().await
261
-
}
262
-
263
-
#[embassy_executor::task]
264
-
async fn run_socket(
265
-
socket: UdpSocket<'static>,
266
-
scratch_buf: &'static mut [u8],
267
-
endpoint: IpEndpoint,
268
-
) {
269
-
let consumer = OUTQ.framed_consumer();
270
-
let mut rxtx = RxTxWorker::new_controller(&STACK, socket, (), consumer, endpoint);
271
-
272
-
loop {
273
-
_ = rxtx.run(scratch_buf).await;
274
-
}
275
-
}
276
-
277
-
#[embassy_executor::task]
278
-
async fn pinger() {
279
-
let mut ticker = Ticker::every(Duration::from_secs(1));
280
-
let mut ctr = 0u32;
281
-
let client = STACK
282
-
.endpoints()
283
-
.client::<ErgotPingEndpoint>(
284
-
Address {
285
-
network_id: 1,
286
-
node_id: 2,
287
-
port_id: 0,
288
-
},
289
-
None,
290
-
);
291
-
loop {
292
-
ticker.next().await;
293
-
let res = client
294
-
.request(&ctr)
295
-
.with_timeout(Duration::from_millis(100))
296
-
.await;
297
-
match res {
298
-
Ok(Ok(n)) => {
299
-
defmt::info!("Got ping {=u32} -> {=u32}", ctr, n);
300
-
ctr = ctr.wrapping_add(1);
301
-
}
302
-
Ok(Err(_e)) => {
303
-
defmt::warn!("Net stack ping error");
304
-
}
305
-
Err(_) => {
306
-
defmt::warn!("Ping timeout");
307
-
}
308
-
}
309
-
}
310
-
}
311
-
312
-
/// Respond to any incoming pings
313
-
#[embassy_executor::task]
314
-
async fn pingserver() {
315
-
STACK
316
-
.services()
317
-
.ping_handler::<4>()
318
-
.await;
319
-
}
320
-
321
-
topic!(YeetTopic, u64, "topic/yeet");
322
-
323
-
#[embassy_executor::task]
324
-
async fn yeeter() {
325
-
let mut ctr = 0;
326
-
info!("Yeeter started");
327
-
Timer::after(Duration::from_secs(3)).await;
328
-
loop {
329
-
Timer::after(Duration::from_secs(5)).await;
330
-
warn!("Sending broadcast message. ctr: {}", ctr);
331
-
STACK
332
-
.topics()
333
-
.broadcast::<YeetTopic>(&ctr, None)
334
-
.unwrap();
335
-
ctr += 1;
336
-
}
337
-
}
338
-
339
-
#[embassy_executor::task]
340
-
async fn yeet_listener(id: u8) {
341
-
let subber = STACK
342
-
.topics()
343
-
.bounded_receiver::<YeetTopic, 4>(None);
344
-
let subber = pin!(subber);
345
-
let mut hdl = subber.subscribe();
346
-
347
-
info!("Yeet listener started");
348
-
loop {
349
-
let msg = hdl.recv().await;
350
-
info!("{:?}: Listener id:{} got {}", msg.hdr, id, msg.t);
351
-
}
352
-
}
353
-
354
-
#[allow(static_mut_refs)]
355
-
fn init_heap() {
356
-
use core::mem::MaybeUninit;
357
-
const HEAP_SIZE: usize = 65536;
358
-
static mut HEAP_MEM: [MaybeUninit<u8>; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE];
359
-
unsafe { HEAP.init(HEAP_MEM.as_ptr() as usize, HEAP_SIZE) }
360
-
}
-360
demos/stm32h723zg/nucleoh723zg-net-udp-pair/src/bin/target.rs
-360
demos/stm32h723zg/nucleoh723zg-net-udp-pair/src/bin/target.rs
···
1
-
#![no_std]
2
-
#![no_main]
3
-
extern crate alloc;
4
-
5
-
use alloc::boxed::Box;
6
-
use core::pin::pin;
7
-
8
-
use defmt::*;
9
-
use embassy_executor::Spawner;
10
-
use embassy_net::StackResources;
11
-
use embassy_net::udp::{PacketMetadata, UdpSocket};
12
-
use embassy_net::{IpEndpoint, Ipv4Address};
13
-
use embassy_stm32::eth::PacketQueue;
14
-
use embassy_stm32::eth::{Ethernet, GenericPhy};
15
-
use embassy_stm32::pac::rcc::vals::{Pllm, Plln, Pllsrc};
16
-
use embassy_stm32::peripherals::ETH;
17
-
use embassy_stm32::rcc::mux::{
18
-
Fdcansel, I2c4sel, I2c1235sel, Saisel, Sdmmcsel, Spi6sel, Spi45sel, Usart16910sel, Usart234578sel, Usbsel,
19
-
};
20
-
use embassy_stm32::rcc::{AHBPrescaler, APBPrescaler, LsConfig, PllDiv, Sysclk};
21
-
use embassy_stm32::rng::Rng;
22
-
use embassy_stm32::{Config, bind_interrupts, eth, peripherals, rcc, rng};
23
-
use embassy_time::{Duration, Ticker, Timer, WithTimeout};
24
-
use embedded_alloc::LlffHeap as Heap;
25
-
use ergot::exports::bbq2::traits::coordination::cas::AtomicCoord;
26
-
use ergot::interface_manager::profiles::direct_edge::embassy_net_udp_0_7::{RxTxWorker, UDP_OVER_ETH_ERGOT_FRAME_SIZE_MAX, UDP_OVER_ETH_ERGOT_PAYLOAD_SIZE_MAX};
27
-
use ergot::logging::log_v0_4::LogSink;
28
-
use ergot::toolkits::embassy_net_v0_7 as kit;
29
-
use ergot::well_known::ErgotPingEndpoint;
30
-
use ergot::{Address, topic};
31
-
use mutex::raw_impls::cs::CriticalSectionRawMutex;
32
-
use static_cell::{ConstStaticCell, StaticCell};
33
-
use {defmt_rtt as _, panic_probe as _};
34
-
35
-
const OUT_QUEUE_SIZE: usize = 4096;
36
-
37
-
type Stack = kit::EdgeStack<&'static Queue, CriticalSectionRawMutex>;
38
-
type Queue = kit::Queue<OUT_QUEUE_SIZE, AtomicCoord>;
39
-
40
-
/// Statically store our netstack
41
-
static STACK: Stack = kit::new_target_stack(OUTQ.framed_producer(), UDP_OVER_ETH_ERGOT_FRAME_SIZE_MAX as u16);
42
-
/// Statically store our outgoing packet buffer
43
-
static OUTQ: Queue = kit::Queue::new();
44
-
/// Statically store receive buffers
45
-
static SCRATCH_BUF: ConstStaticCell<[u8; UDP_OVER_ETH_ERGOT_PAYLOAD_SIZE_MAX]> = ConstStaticCell::new([0u8; UDP_OVER_ETH_ERGOT_PAYLOAD_SIZE_MAX]);
46
-
47
-
static LOGSINK: LogSink<&'static Stack> = LogSink::new(&STACK);
48
-
49
-
#[global_allocator]
50
-
static HEAP: Heap = Heap::empty();
51
-
52
-
bind_interrupts!(struct Irqs {
53
-
ETH => eth::InterruptHandler;
54
-
RNG => rng::InterruptHandler<peripherals::RNG>;
55
-
});
56
-
57
-
#[embassy_executor::main]
58
-
async fn main(spawner: Spawner) -> ! {
59
-
let mut config = Config::default();
60
-
config.rcc.hse = Some(rcc::Hse {
61
-
freq: embassy_stm32::time::Hertz(8_000_000),
62
-
mode: rcc::HseMode::Oscillator,
63
-
});
64
-
config.rcc.ls = LsConfig::off();
65
-
config.rcc.hsi48 = Some(Default::default()); // needed for RNG
66
-
config.rcc.sys = Sysclk::PLL1_P;
67
-
config.rcc.d1c_pre = AHBPrescaler::DIV1;
68
-
config.rcc.ahb_pre = AHBPrescaler::DIV2;
69
-
config.rcc.apb1_pre = APBPrescaler::DIV2;
70
-
config.rcc.apb2_pre = APBPrescaler::DIV2;
71
-
config.rcc.apb3_pre = APBPrescaler::DIV2;
72
-
config.rcc.apb4_pre = APBPrescaler::DIV2;
73
-
config.rcc.timer_prescaler = rcc::TimerPrescaler::DefaultX2;
74
-
75
-
config.rcc.voltage_scale = rcc::VoltageScale::Scale0;
76
-
config.rcc.pll1 = Some(rcc::Pll {
77
-
source: Pllsrc::HSE,
78
-
prediv: Pllm::DIV4,
79
-
mul: Plln::MUL260,
80
-
// 520Mhz
81
-
divp: Some(PllDiv::DIV1),
82
-
// 130Mhz
83
-
divq: Some(PllDiv::DIV4),
84
-
divr: None,
85
-
});
86
-
config.rcc.pll2 = Some(rcc::Pll {
87
-
source: Pllsrc::HSE,
88
-
89
-
prediv: Pllm::DIV4,
90
-
mul: Plln::MUL200,
91
-
// 200Mhz
92
-
divp: Some(PllDiv::DIV2),
93
-
// 100Mhz
94
-
divq: Some(PllDiv::DIV4),
95
-
// 200Mhz
96
-
divr: Some(PllDiv::DIV2),
97
-
});
98
-
config.rcc.pll3 = Some(rcc::Pll {
99
-
source: Pllsrc::HSE,
100
-
prediv: Pllm::DIV4,
101
-
mul: Plln::MUL192,
102
-
// 192Mhz
103
-
divp: Some(PllDiv::DIV2),
104
-
// 48Mhz
105
-
divq: Some(PllDiv::DIV8),
106
-
// 92Mhz
107
-
divr: Some(PllDiv::DIV4),
108
-
});
109
-
110
-
// 200mhz
111
-
//config.rcc.mux.octospisel = Octospisel::PLL2_R; // no support in embassy-stm32 it seems.
112
-
113
-
// 200mhz
114
-
config.rcc.mux.sdmmcsel = Sdmmcsel::PLL2_R;
115
-
// 100mhz
116
-
config.rcc.mux.fdcansel = Fdcansel::PLL2_Q;
117
-
// 48mhz from crystal (not RC48)
118
-
config.rcc.mux.usbsel = Usbsel::PLL3_Q;
119
-
// 100mhz
120
-
config.rcc.mux.usart234578sel = Usart234578sel::PLL2_Q;
121
-
// 100mhz
122
-
config.rcc.mux.usart16910sel = Usart16910sel::PLL2_Q;
123
-
// 130mhz
124
-
config.rcc.mux.i2c1235sel = I2c1235sel::PCLK1;
125
-
// 130mhz
126
-
config.rcc.mux.i2c4sel = I2c4sel::PCLK4;
127
-
// 200mhz
128
-
config.rcc.mux.spi123sel = Saisel::PLL2_P;
129
-
// 100mhz
130
-
config.rcc.mux.spi45sel = Spi45sel::PLL2_Q;
131
-
// 100mhz
132
-
config.rcc.mux.spi6sel = Spi6sel::PLL2_Q;
133
-
134
-
let p = embassy_stm32::init(config);
135
-
136
-
init_heap();
137
-
138
-
// Generate random seed.
139
-
info!("Initializing RNG");
140
-
let mut rng = Rng::new(p.RNG, Irqs);
141
-
let mut seed = [0; 8];
142
-
rng.fill_bytes(&mut seed);
143
-
let seed = u64::from_le_bytes(seed);
144
-
145
-
info!("Initializing ETH");
146
-
// TODO generate mac address from CPU ID
147
-
// potentially using this algorythm (C): https://github.com/zephyrproject-rtos/zephyr/issues/59993#issuecomment-1644030438
148
-
let mac_addr = [0x00, 0x00, 0xFE, 0xED, 0xF0, 0x0D];
149
-
150
-
static PACKETS: StaticCell<PacketQueue<8, 8>> = StaticCell::new();
151
-
// warning: Not all STM32H7 devices have the exact same pins here
152
-
// for STM32H747XIH, replace p.PB13 for PG12
153
-
let device = Ethernet::new(
154
-
PACKETS.init(PacketQueue::<8, 8>::new()),
155
-
p.ETH,
156
-
Irqs,
157
-
p.PA1, // ref_clk
158
-
p.PA2, // mdio
159
-
p.PC1, // eth_mdc
160
-
p.PA7, // CRS_DV: Carrier Sense
161
-
p.PC4, // RX_D0: Received Bit 0
162
-
p.PC5, // RX_D1: Received Bit 1
163
-
p.PG13, // TX_D0: Transmit Bit 0
164
-
p.PB13, // TX_D1: Transmit Bit 1
165
-
p.PG11, // TX_EN: Transmit Enable
166
-
GenericPhy::new_auto(),
167
-
mac_addr,
168
-
);
169
-
170
-
let config = embassy_net::Config::dhcpv4(Default::default());
171
-
//let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
172
-
// address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
173
-
// dns_servers: Vec::new(),
174
-
// gateway: Some(Ipv4Address::new(10, 42, 0, 1)),
175
-
//});
176
-
177
-
// Init network stack
178
-
static RESOURCES: StaticCell<StackResources<5>> = StaticCell::new();
179
-
let (embassy_net_stack, runner) = embassy_net::new(device, config, RESOURCES.init(StackResources::new()), seed);
180
-
181
-
// Launch network task
182
-
spawner.must_spawn(embassy_net_task(runner));
183
-
184
-
// Ensure DHCP configuration is up before trying connect
185
-
let mut attempts: u32 = 0;
186
-
let config = loop {
187
-
if let Some(config) = embassy_net_stack.config_v4() {
188
-
break config;
189
-
}
190
-
191
-
if attempts % 10 == 0 {
192
-
info!("Waiting for DHCP address allocation...");
193
-
}
194
-
195
-
attempts = attempts.wrapping_add(1);
196
-
Timer::after(Duration::from_millis(100)).await;
197
-
};
198
-
199
-
info!(
200
-
"IP address: {}, gateway: {}, dns: {}",
201
-
config.address, config.dns_servers, config.gateway
202
-
);
203
-
204
-
let rx_meta = [PacketMetadata::EMPTY; 1];
205
-
let rx_buffer = [0; 4096];
206
-
let tx_meta = [PacketMetadata::EMPTY; 1];
207
-
let tx_buffer = [0; 4096];
208
-
209
-
// move the buffers into the heap, so they don't get dropped
210
-
let rx_meta = Box::new(rx_meta);
211
-
let rx_meta = Box::leak(rx_meta);
212
-
let tx_meta = Box::new(tx_meta);
213
-
let tx_meta = Box::leak(tx_meta);
214
-
let rx_buffer = Box::new(rx_buffer);
215
-
let rx_buffer = Box::leak(rx_buffer);
216
-
let tx_buffer = Box::new(tx_buffer);
217
-
let tx_buffer = Box::leak(tx_buffer);
218
-
// You need to start a server on the host machine, for example: `nc -lu 8000`
219
-
220
-
let mut socket = UdpSocket::new(embassy_net_stack, rx_meta, rx_buffer, tx_meta, tx_buffer);
221
-
222
-
let port = 8000_u16;
223
-
let remote_endpoint = IpEndpoint::new(Ipv4Address::new(192, 168, 18, 64).into(), port);
224
-
let local_endpoint = IpEndpoint::new(config.address.address().into(), port);
225
-
socket
226
-
.bind(local_endpoint)
227
-
.expect("bound");
228
-
229
-
info!(
230
-
"capacity, receive: {}, send: {}",
231
-
socket.packet_recv_capacity(),
232
-
socket.packet_send_capacity()
233
-
);
234
-
235
-
// Spawn I/O worker tasks
236
-
spawner.must_spawn(run_socket(socket, SCRATCH_BUF.take(), remote_endpoint));
237
-
238
-
// Spawn socket using tasks
239
-
spawner.must_spawn(pingserver());
240
-
spawner.must_spawn(pinger());
241
-
242
-
spawner.must_spawn(yeeter());
243
-
spawner.must_spawn(yeet_listener(0));
244
-
245
-
LOGSINK.register_static(log::LevelFilter::Info);
246
-
247
-
let mut tckr = Ticker::every(Duration::from_secs(2));
248
-
let mut ct = 0;
249
-
loop {
250
-
tckr.next().await;
251
-
log::info!("log # {ct}");
252
-
ct += 1;
253
-
}
254
-
}
255
-
256
-
type Device = Ethernet<'static, ETH, GenericPhy>;
257
-
258
-
#[embassy_executor::task]
259
-
async fn embassy_net_task(mut runner: embassy_net::Runner<'static, Device>) -> ! {
260
-
runner.run().await
261
-
}
262
-
263
-
#[embassy_executor::task]
264
-
async fn run_socket(
265
-
socket: UdpSocket<'static>,
266
-
scratch_buf: &'static mut [u8],
267
-
endpoint: IpEndpoint,
268
-
) {
269
-
let consumer = OUTQ.framed_consumer();
270
-
let mut rxtx = RxTxWorker::new_target(&STACK, socket, (), consumer, endpoint);
271
-
272
-
loop {
273
-
_ = rxtx.run(scratch_buf).await;
274
-
}
275
-
}
276
-
277
-
#[embassy_executor::task]
278
-
async fn pinger() {
279
-
let mut ticker = Ticker::every(Duration::from_secs(1));
280
-
let mut ctr = 0u32;
281
-
let client = STACK
282
-
.endpoints()
283
-
.client::<ErgotPingEndpoint>(
284
-
Address {
285
-
network_id: 1,
286
-
node_id: 1,
287
-
port_id: 0,
288
-
},
289
-
None,
290
-
);
291
-
loop {
292
-
ticker.next().await;
293
-
let res = client
294
-
.request(&ctr)
295
-
.with_timeout(Duration::from_millis(100))
296
-
.await;
297
-
match res {
298
-
Ok(Ok(n)) => {
299
-
defmt::info!("Got ping {=u32} -> {=u32}", ctr, n);
300
-
ctr = ctr.wrapping_add(1);
301
-
}
302
-
Ok(Err(_e)) => {
303
-
defmt::warn!("Net stack ping error");
304
-
}
305
-
Err(_) => {
306
-
defmt::warn!("Ping timeout");
307
-
}
308
-
}
309
-
}
310
-
}
311
-
312
-
/// Respond to any incoming pings
313
-
#[embassy_executor::task]
314
-
async fn pingserver() {
315
-
STACK
316
-
.services()
317
-
.ping_handler::<4>()
318
-
.await;
319
-
}
320
-
321
-
topic!(YeetTopic, u64, "topic/yeet");
322
-
323
-
#[embassy_executor::task]
324
-
async fn yeeter() {
325
-
let mut ctr = 0;
326
-
info!("Yeeter started");
327
-
Timer::after(Duration::from_secs(3)).await;
328
-
loop {
329
-
Timer::after(Duration::from_secs(5)).await;
330
-
warn!("Sending broadcast message. ctr: {}", ctr);
331
-
STACK
332
-
.topics()
333
-
.broadcast::<YeetTopic>(&ctr, None)
334
-
.unwrap();
335
-
ctr += 1;
336
-
}
337
-
}
338
-
339
-
#[embassy_executor::task]
340
-
async fn yeet_listener(id: u8) {
341
-
let subber = STACK
342
-
.topics()
343
-
.bounded_receiver::<YeetTopic, 4>(None);
344
-
let subber = pin!(subber);
345
-
let mut hdl = subber.subscribe();
346
-
347
-
info!("Yeet listener started");
348
-
loop {
349
-
let msg = hdl.recv().await;
350
-
info!("{:?}: Listener id:{} got {}", msg.hdr, id, msg.t);
351
-
}
352
-
}
353
-
354
-
#[allow(static_mut_refs)]
355
-
fn init_heap() {
356
-
use core::mem::MaybeUninit;
357
-
const HEAP_SIZE: usize = 65536;
358
-
static mut HEAP_MEM: [MaybeUninit<u8>; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE];
359
-
unsafe { HEAP.init(HEAP_MEM.as_ptr() as usize, HEAP_SIZE) }
360
-
}
-8
demos/stm32h743zi/.cargo/config.toml
-8
demos/stm32h743zi/.cargo/config.toml
-1638
demos/stm32h743zi/Cargo.lock
-1638
demos/stm32h743zi/Cargo.lock
···
1
-
# This file is automatically @generated by Cargo.
2
-
# It is not intended for manual editing.
3
-
version = 4
4
-
5
-
[[package]]
6
-
name = "aho-corasick"
7
-
version = "1.1.3"
8
-
source = "registry+https://github.com/rust-lang/crates.io-index"
9
-
checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
10
-
dependencies = [
11
-
"memchr",
12
-
]
13
-
14
-
[[package]]
15
-
name = "aligned"
16
-
version = "0.4.2"
17
-
source = "registry+https://github.com/rust-lang/crates.io-index"
18
-
checksum = "377e4c0ba83e4431b10df45c1d4666f178ea9c552cac93e60c3a88bf32785923"
19
-
dependencies = [
20
-
"as-slice",
21
-
]
22
-
23
-
[[package]]
24
-
name = "as-slice"
25
-
version = "0.2.1"
26
-
source = "registry+https://github.com/rust-lang/crates.io-index"
27
-
checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516"
28
-
dependencies = [
29
-
"stable_deref_trait",
30
-
]
31
-
32
-
[[package]]
33
-
name = "atomic-polyfill"
34
-
version = "1.0.3"
35
-
source = "registry+https://github.com/rust-lang/crates.io-index"
36
-
checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4"
37
-
dependencies = [
38
-
"critical-section",
39
-
]
40
-
41
-
[[package]]
42
-
name = "autocfg"
43
-
version = "1.5.0"
44
-
source = "registry+https://github.com/rust-lang/crates.io-index"
45
-
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
46
-
47
-
[[package]]
48
-
name = "bare-metal"
49
-
version = "0.2.5"
50
-
source = "registry+https://github.com/rust-lang/crates.io-index"
51
-
checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3"
52
-
dependencies = [
53
-
"rustc_version 0.2.3",
54
-
]
55
-
56
-
[[package]]
57
-
name = "base64"
58
-
version = "0.13.1"
59
-
source = "registry+https://github.com/rust-lang/crates.io-index"
60
-
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
61
-
62
-
[[package]]
63
-
name = "bbq2"
64
-
version = "0.4.2"
65
-
source = "registry+https://github.com/rust-lang/crates.io-index"
66
-
checksum = "25d3e5fd78b60ce3a60e21e9a92b1d5e741328264de8e609193e2bf7616747bd"
67
-
dependencies = [
68
-
"const-init",
69
-
"critical-section",
70
-
"maitake-sync",
71
-
]
72
-
73
-
[[package]]
74
-
name = "bit_field"
75
-
version = "0.10.2"
76
-
source = "registry+https://github.com/rust-lang/crates.io-index"
77
-
checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61"
78
-
79
-
[[package]]
80
-
name = "bitfield"
81
-
version = "0.13.2"
82
-
source = "registry+https://github.com/rust-lang/crates.io-index"
83
-
checksum = "46afbd2983a5d5a7bd740ccb198caf5b82f45c40c09c0eed36052d91cb92e719"
84
-
85
-
[[package]]
86
-
name = "bitflags"
87
-
version = "1.3.2"
88
-
source = "registry+https://github.com/rust-lang/crates.io-index"
89
-
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
90
-
91
-
[[package]]
92
-
name = "bitflags"
93
-
version = "2.9.3"
94
-
source = "registry+https://github.com/rust-lang/crates.io-index"
95
-
checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d"
96
-
97
-
[[package]]
98
-
name = "block-device-driver"
99
-
version = "0.2.0"
100
-
source = "registry+https://github.com/rust-lang/crates.io-index"
101
-
checksum = "44c051592f59fe68053524b4c4935249b806f72c1f544cfb7abe4f57c3be258e"
102
-
dependencies = [
103
-
"aligned",
104
-
]
105
-
106
-
[[package]]
107
-
name = "byteorder"
108
-
version = "1.5.0"
109
-
source = "registry+https://github.com/rust-lang/crates.io-index"
110
-
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
111
-
112
-
[[package]]
113
-
name = "cc"
114
-
version = "1.2.34"
115
-
source = "registry+https://github.com/rust-lang/crates.io-index"
116
-
checksum = "42bc4aea80032b7bf409b0bc7ccad88853858911b7713a8062fdc0623867bedc"
117
-
dependencies = [
118
-
"shlex",
119
-
]
120
-
121
-
[[package]]
122
-
name = "cfg-if"
123
-
version = "1.0.3"
124
-
source = "registry+https://github.com/rust-lang/crates.io-index"
125
-
checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9"
126
-
127
-
[[package]]
128
-
name = "cobs"
129
-
version = "0.3.0"
130
-
source = "registry+https://github.com/rust-lang/crates.io-index"
131
-
checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1"
132
-
dependencies = [
133
-
"thiserror",
134
-
]
135
-
136
-
[[package]]
137
-
name = "cobs"
138
-
version = "0.4.0"
139
-
source = "registry+https://github.com/rust-lang/crates.io-index"
140
-
checksum = "fea6d1b751c55bd9c0dda7d4ff752074e98f4765ae969664648bd193bb326d15"
141
-
dependencies = [
142
-
"thiserror",
143
-
]
144
-
145
-
[[package]]
146
-
name = "cobs-acc"
147
-
version = "0.1.0"
148
-
dependencies = [
149
-
"cobs 0.4.0",
150
-
]
151
-
152
-
[[package]]
153
-
name = "const-default"
154
-
version = "1.0.0"
155
-
source = "registry+https://github.com/rust-lang/crates.io-index"
156
-
checksum = "0b396d1f76d455557e1218ec8066ae14bba60b4b36ecd55577ba979f5db7ecaa"
157
-
158
-
[[package]]
159
-
name = "const-fnv1a-hash"
160
-
version = "1.1.0"
161
-
source = "registry+https://github.com/rust-lang/crates.io-index"
162
-
checksum = "32b13ea120a812beba79e34316b3942a857c86ec1593cb34f27bb28272ce2cca"
163
-
164
-
[[package]]
165
-
name = "const-init"
166
-
version = "1.0.0"
167
-
source = "registry+https://github.com/rust-lang/crates.io-index"
168
-
checksum = "4bd422bfb4f24a97243f60b6a4443e63d810c925d8da4bb2d8fde26a7c1d57ec"
169
-
170
-
[[package]]
171
-
name = "cordyceps"
172
-
version = "0.3.4"
173
-
source = "registry+https://github.com/rust-lang/crates.io-index"
174
-
checksum = "688d7fbb8092b8de775ef2536f36c8c31f2bc4006ece2e8d8ad2d17d00ce0a2a"
175
-
dependencies = [
176
-
"loom",
177
-
"tracing",
178
-
]
179
-
180
-
[[package]]
181
-
name = "cortex-m"
182
-
version = "0.7.7"
183
-
source = "registry+https://github.com/rust-lang/crates.io-index"
184
-
checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9"
185
-
dependencies = [
186
-
"bare-metal",
187
-
"bitfield",
188
-
"critical-section",
189
-
"embedded-hal 0.2.7",
190
-
"volatile-register",
191
-
]
192
-
193
-
[[package]]
194
-
name = "cortex-m-rt"
195
-
version = "0.7.5"
196
-
source = "registry+https://github.com/rust-lang/crates.io-index"
197
-
checksum = "801d4dec46b34c299ccf6b036717ae0fce602faa4f4fe816d9013b9a7c9f5ba6"
198
-
dependencies = [
199
-
"cortex-m-rt-macros",
200
-
]
201
-
202
-
[[package]]
203
-
name = "cortex-m-rt-macros"
204
-
version = "0.7.5"
205
-
source = "registry+https://github.com/rust-lang/crates.io-index"
206
-
checksum = "e37549a379a9e0e6e576fd208ee60394ccb8be963889eebba3ffe0980364f472"
207
-
dependencies = [
208
-
"proc-macro2",
209
-
"quote",
210
-
"syn 2.0.106",
211
-
]
212
-
213
-
[[package]]
214
-
name = "critical-section"
215
-
version = "1.2.0"
216
-
source = "registry+https://github.com/rust-lang/crates.io-index"
217
-
checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b"
218
-
219
-
[[package]]
220
-
name = "darling"
221
-
version = "0.20.11"
222
-
source = "registry+https://github.com/rust-lang/crates.io-index"
223
-
checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee"
224
-
dependencies = [
225
-
"darling_core",
226
-
"darling_macro",
227
-
]
228
-
229
-
[[package]]
230
-
name = "darling_core"
231
-
version = "0.20.11"
232
-
source = "registry+https://github.com/rust-lang/crates.io-index"
233
-
checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e"
234
-
dependencies = [
235
-
"fnv",
236
-
"ident_case",
237
-
"proc-macro2",
238
-
"quote",
239
-
"strsim",
240
-
"syn 2.0.106",
241
-
]
242
-
243
-
[[package]]
244
-
name = "darling_macro"
245
-
version = "0.20.11"
246
-
source = "registry+https://github.com/rust-lang/crates.io-index"
247
-
checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead"
248
-
dependencies = [
249
-
"darling_core",
250
-
"quote",
251
-
"syn 2.0.106",
252
-
]
253
-
254
-
[[package]]
255
-
name = "defmt"
256
-
version = "0.3.100"
257
-
source = "registry+https://github.com/rust-lang/crates.io-index"
258
-
checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad"
259
-
dependencies = [
260
-
"defmt 1.0.1",
261
-
]
262
-
263
-
[[package]]
264
-
name = "defmt"
265
-
version = "1.0.1"
266
-
source = "registry+https://github.com/rust-lang/crates.io-index"
267
-
checksum = "548d977b6da32fa1d1fda2876453da1e7df63ad0304c8b3dae4dbe7b96f39b78"
268
-
dependencies = [
269
-
"bitflags 1.3.2",
270
-
"defmt-macros",
271
-
]
272
-
273
-
[[package]]
274
-
name = "defmt-macros"
275
-
version = "1.0.1"
276
-
source = "registry+https://github.com/rust-lang/crates.io-index"
277
-
checksum = "3d4fc12a85bcf441cfe44344c4b72d58493178ce635338a3f3b78943aceb258e"
278
-
dependencies = [
279
-
"defmt-parser",
280
-
"proc-macro-error2",
281
-
"proc-macro2",
282
-
"quote",
283
-
"syn 2.0.106",
284
-
]
285
-
286
-
[[package]]
287
-
name = "defmt-parser"
288
-
version = "1.0.0"
289
-
source = "registry+https://github.com/rust-lang/crates.io-index"
290
-
checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e"
291
-
dependencies = [
292
-
"thiserror",
293
-
]
294
-
295
-
[[package]]
296
-
name = "defmt-rtt"
297
-
version = "1.0.0"
298
-
source = "registry+https://github.com/rust-lang/crates.io-index"
299
-
checksum = "b2cac3b8a5644a9e02b75085ebad3b6deafdbdbdec04bb25086523828aa4dfd1"
300
-
dependencies = [
301
-
"critical-section",
302
-
"defmt 1.0.1",
303
-
]
304
-
305
-
[[package]]
306
-
name = "document-features"
307
-
version = "0.2.11"
308
-
source = "registry+https://github.com/rust-lang/crates.io-index"
309
-
checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d"
310
-
dependencies = [
311
-
"litrs",
312
-
]
313
-
314
-
[[package]]
315
-
name = "embassy-embedded-hal"
316
-
version = "0.5.0"
317
-
source = "registry+https://github.com/rust-lang/crates.io-index"
318
-
checksum = "554e3e840696f54b4c9afcf28a0f24da431c927f4151040020416e7393d6d0d8"
319
-
dependencies = [
320
-
"defmt 1.0.1",
321
-
"embassy-futures",
322
-
"embassy-hal-internal",
323
-
"embassy-sync",
324
-
"embassy-time",
325
-
"embedded-hal 0.2.7",
326
-
"embedded-hal 1.0.0",
327
-
"embedded-hal-async",
328
-
"embedded-storage",
329
-
"embedded-storage-async",
330
-
"nb 1.1.0",
331
-
]
332
-
333
-
[[package]]
334
-
name = "embassy-executor"
335
-
version = "0.9.1"
336
-
source = "registry+https://github.com/rust-lang/crates.io-index"
337
-
checksum = "06070468370195e0e86f241c8e5004356d696590a678d47d6676795b2e439c6b"
338
-
dependencies = [
339
-
"cortex-m",
340
-
"critical-section",
341
-
"defmt 1.0.1",
342
-
"document-features",
343
-
"embassy-executor-macros",
344
-
"embassy-executor-timer-queue",
345
-
]
346
-
347
-
[[package]]
348
-
name = "embassy-executor-macros"
349
-
version = "0.7.0"
350
-
source = "registry+https://github.com/rust-lang/crates.io-index"
351
-
checksum = "dfdddc3a04226828316bf31393b6903ee162238576b1584ee2669af215d55472"
352
-
dependencies = [
353
-
"darling",
354
-
"proc-macro2",
355
-
"quote",
356
-
"syn 2.0.106",
357
-
]
358
-
359
-
[[package]]
360
-
name = "embassy-executor-timer-queue"
361
-
version = "0.1.0"
362
-
source = "registry+https://github.com/rust-lang/crates.io-index"
363
-
checksum = "2fc328bf943af66b80b98755db9106bf7e7471b0cf47dc8559cd9a6be504cc9c"
364
-
365
-
[[package]]
366
-
name = "embassy-futures"
367
-
version = "0.1.2"
368
-
source = "registry+https://github.com/rust-lang/crates.io-index"
369
-
checksum = "dc2d050bdc5c21e0862a89256ed8029ae6c290a93aecefc73084b3002cdebb01"
370
-
dependencies = [
371
-
"defmt 1.0.1",
372
-
]
373
-
374
-
[[package]]
375
-
name = "embassy-hal-internal"
376
-
version = "0.3.0"
377
-
source = "registry+https://github.com/rust-lang/crates.io-index"
378
-
checksum = "95285007a91b619dc9f26ea8f55452aa6c60f7115a4edc05085cd2bd3127cd7a"
379
-
dependencies = [
380
-
"cortex-m",
381
-
"critical-section",
382
-
"defmt 1.0.1",
383
-
"num-traits",
384
-
]
385
-
386
-
[[package]]
387
-
name = "embassy-net"
388
-
version = "0.7.1"
389
-
source = "registry+https://github.com/rust-lang/crates.io-index"
390
-
checksum = "0558a231a47e7d4a06a28b5278c92e860f1200f24821d2f365a2f40fe3f3c7b2"
391
-
dependencies = [
392
-
"defmt 1.0.1",
393
-
"document-features",
394
-
"embassy-net-driver",
395
-
"embassy-sync",
396
-
"embassy-time",
397
-
"embedded-io-async",
398
-
"embedded-nal-async",
399
-
"heapless 0.8.0",
400
-
"managed",
401
-
"smoltcp",
402
-
]
403
-
404
-
[[package]]
405
-
name = "embassy-net-driver"
406
-
version = "0.2.0"
407
-
source = "registry+https://github.com/rust-lang/crates.io-index"
408
-
checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d"
409
-
dependencies = [
410
-
"defmt 0.3.100",
411
-
]
412
-
413
-
[[package]]
414
-
name = "embassy-stm32"
415
-
version = "0.4.0"
416
-
source = "registry+https://github.com/rust-lang/crates.io-index"
417
-
checksum = "0d972eab325cc96afee98f80a91ca6b00249b6356dc0fdbff68b70c200df9fae"
418
-
dependencies = [
419
-
"aligned",
420
-
"bit_field",
421
-
"bitflags 2.9.3",
422
-
"block-device-driver",
423
-
"cfg-if",
424
-
"cortex-m",
425
-
"cortex-m-rt",
426
-
"critical-section",
427
-
"defmt 1.0.1",
428
-
"document-features",
429
-
"embassy-embedded-hal",
430
-
"embassy-futures",
431
-
"embassy-hal-internal",
432
-
"embassy-net-driver",
433
-
"embassy-sync",
434
-
"embassy-time",
435
-
"embassy-time-driver",
436
-
"embassy-time-queue-utils",
437
-
"embassy-usb-driver",
438
-
"embassy-usb-synopsys-otg",
439
-
"embedded-can",
440
-
"embedded-hal 0.2.7",
441
-
"embedded-hal 1.0.0",
442
-
"embedded-hal-async",
443
-
"embedded-hal-nb",
444
-
"embedded-io",
445
-
"embedded-io-async",
446
-
"embedded-storage",
447
-
"embedded-storage-async",
448
-
"futures-util",
449
-
"nb 1.1.0",
450
-
"proc-macro2",
451
-
"quote",
452
-
"rand_core 0.6.4",
453
-
"rand_core 0.9.3",
454
-
"sdio-host",
455
-
"static_assertions",
456
-
"stm32-fmc",
457
-
"stm32-metapac",
458
-
"vcell",
459
-
"volatile-register",
460
-
]
461
-
462
-
[[package]]
463
-
name = "embassy-sync"
464
-
version = "0.7.2"
465
-
source = "registry+https://github.com/rust-lang/crates.io-index"
466
-
checksum = "73974a3edbd0bd286759b3d483540f0ebef705919a5f56f4fc7709066f71689b"
467
-
dependencies = [
468
-
"cfg-if",
469
-
"critical-section",
470
-
"defmt 1.0.1",
471
-
"embedded-io-async",
472
-
"futures-core",
473
-
"futures-sink",
474
-
"heapless 0.8.0",
475
-
]
476
-
477
-
[[package]]
478
-
name = "embassy-time"
479
-
version = "0.5.0"
480
-
source = "registry+https://github.com/rust-lang/crates.io-index"
481
-
checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65"
482
-
dependencies = [
483
-
"cfg-if",
484
-
"critical-section",
485
-
"defmt 1.0.1",
486
-
"document-features",
487
-
"embassy-time-driver",
488
-
"embedded-hal 0.2.7",
489
-
"embedded-hal 1.0.0",
490
-
"embedded-hal-async",
491
-
"futures-core",
492
-
]
493
-
494
-
[[package]]
495
-
name = "embassy-time-driver"
496
-
version = "0.2.1"
497
-
source = "registry+https://github.com/rust-lang/crates.io-index"
498
-
checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6"
499
-
dependencies = [
500
-
"document-features",
501
-
]
502
-
503
-
[[package]]
504
-
name = "embassy-time-queue-utils"
505
-
version = "0.3.0"
506
-
source = "registry+https://github.com/rust-lang/crates.io-index"
507
-
checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454"
508
-
dependencies = [
509
-
"embassy-executor-timer-queue",
510
-
"heapless 0.8.0",
511
-
]
512
-
513
-
[[package]]
514
-
name = "embassy-usb-driver"
515
-
version = "0.2.0"
516
-
source = "registry+https://github.com/rust-lang/crates.io-index"
517
-
checksum = "17119855ccc2d1f7470a39756b12068454ae27a3eabb037d940b5c03d9c77b7a"
518
-
dependencies = [
519
-
"defmt 1.0.1",
520
-
"embedded-io-async",
521
-
]
522
-
523
-
[[package]]
524
-
name = "embassy-usb-synopsys-otg"
525
-
version = "0.3.1"
526
-
source = "registry+https://github.com/rust-lang/crates.io-index"
527
-
checksum = "288751f8eaa44a5cf2613f13cee0ca8e06e6638cb96e897e6834702c79084b23"
528
-
dependencies = [
529
-
"critical-section",
530
-
"defmt 1.0.1",
531
-
"embassy-sync",
532
-
"embassy-usb-driver",
533
-
]
534
-
535
-
[[package]]
536
-
name = "embedded-alloc"
537
-
version = "0.6.0"
538
-
source = "registry+https://github.com/rust-lang/crates.io-index"
539
-
checksum = "8f2de9133f68db0d4627ad69db767726c99ff8585272716708227008d3f1bddd"
540
-
dependencies = [
541
-
"const-default",
542
-
"critical-section",
543
-
"linked_list_allocator",
544
-
"rlsf",
545
-
]
546
-
547
-
[[package]]
548
-
name = "embedded-can"
549
-
version = "0.4.1"
550
-
source = "registry+https://github.com/rust-lang/crates.io-index"
551
-
checksum = "e9d2e857f87ac832df68fa498d18ddc679175cf3d2e4aa893988e5601baf9438"
552
-
dependencies = [
553
-
"nb 1.1.0",
554
-
]
555
-
556
-
[[package]]
557
-
name = "embedded-hal"
558
-
version = "0.2.7"
559
-
source = "registry+https://github.com/rust-lang/crates.io-index"
560
-
checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff"
561
-
dependencies = [
562
-
"nb 0.1.3",
563
-
"void",
564
-
]
565
-
566
-
[[package]]
567
-
name = "embedded-hal"
568
-
version = "1.0.0"
569
-
source = "registry+https://github.com/rust-lang/crates.io-index"
570
-
checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89"
571
-
572
-
[[package]]
573
-
name = "embedded-hal-async"
574
-
version = "1.0.0"
575
-
source = "registry+https://github.com/rust-lang/crates.io-index"
576
-
checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884"
577
-
dependencies = [
578
-
"embedded-hal 1.0.0",
579
-
]
580
-
581
-
[[package]]
582
-
name = "embedded-hal-nb"
583
-
version = "1.0.0"
584
-
source = "registry+https://github.com/rust-lang/crates.io-index"
585
-
checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605"
586
-
dependencies = [
587
-
"embedded-hal 1.0.0",
588
-
"nb 1.1.0",
589
-
]
590
-
591
-
[[package]]
592
-
name = "embedded-io"
593
-
version = "0.6.1"
594
-
source = "registry+https://github.com/rust-lang/crates.io-index"
595
-
checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d"
596
-
dependencies = [
597
-
"defmt 0.3.100",
598
-
]
599
-
600
-
[[package]]
601
-
name = "embedded-io-async"
602
-
version = "0.6.1"
603
-
source = "registry+https://github.com/rust-lang/crates.io-index"
604
-
checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f"
605
-
dependencies = [
606
-
"defmt 0.3.100",
607
-
"embedded-io",
608
-
]
609
-
610
-
[[package]]
611
-
name = "embedded-nal"
612
-
version = "0.9.0"
613
-
source = "registry+https://github.com/rust-lang/crates.io-index"
614
-
checksum = "c56a28be191a992f28f178ec338a0bf02f63d7803244add736d026a471e6ed77"
615
-
dependencies = [
616
-
"nb 1.1.0",
617
-
]
618
-
619
-
[[package]]
620
-
name = "embedded-nal-async"
621
-
version = "0.8.0"
622
-
source = "registry+https://github.com/rust-lang/crates.io-index"
623
-
checksum = "76959917cd2b86f40a98c28dd5624eddd1fa69d746241c8257eac428d83cb211"
624
-
dependencies = [
625
-
"embedded-io-async",
626
-
"embedded-nal",
627
-
]
628
-
629
-
[[package]]
630
-
name = "embedded-storage"
631
-
version = "0.3.1"
632
-
source = "registry+https://github.com/rust-lang/crates.io-index"
633
-
checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032"
634
-
635
-
[[package]]
636
-
name = "embedded-storage-async"
637
-
version = "0.4.1"
638
-
source = "registry+https://github.com/rust-lang/crates.io-index"
639
-
checksum = "1763775e2323b7d5f0aa6090657f5e21cfa02ede71f5dc40eead06d64dcd15cc"
640
-
dependencies = [
641
-
"embedded-storage",
642
-
]
643
-
644
-
[[package]]
645
-
name = "ergot"
646
-
version = "0.11.0"
647
-
dependencies = [
648
-
"bbq2",
649
-
"cobs 0.3.0",
650
-
"cobs-acc",
651
-
"const-fnv1a-hash",
652
-
"cordyceps",
653
-
"critical-section",
654
-
"defmt 1.0.1",
655
-
"embassy-futures",
656
-
"embassy-net",
657
-
"heapless 0.9.1",
658
-
"log",
659
-
"maitake-sync",
660
-
"mutex",
661
-
"pin-project",
662
-
"portable-atomic",
663
-
"postcard",
664
-
"postcard-schema",
665
-
"serde",
666
-
"static_cell",
667
-
]
668
-
669
-
[[package]]
670
-
name = "fnv"
671
-
version = "1.0.7"
672
-
source = "registry+https://github.com/rust-lang/crates.io-index"
673
-
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
674
-
675
-
[[package]]
676
-
name = "futures-core"
677
-
version = "0.3.31"
678
-
source = "registry+https://github.com/rust-lang/crates.io-index"
679
-
checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
680
-
681
-
[[package]]
682
-
name = "futures-sink"
683
-
version = "0.3.31"
684
-
source = "registry+https://github.com/rust-lang/crates.io-index"
685
-
checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
686
-
687
-
[[package]]
688
-
name = "futures-task"
689
-
version = "0.3.31"
690
-
source = "registry+https://github.com/rust-lang/crates.io-index"
691
-
checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
692
-
693
-
[[package]]
694
-
name = "futures-util"
695
-
version = "0.3.31"
696
-
source = "registry+https://github.com/rust-lang/crates.io-index"
697
-
checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
698
-
dependencies = [
699
-
"futures-core",
700
-
"futures-task",
701
-
"pin-project-lite",
702
-
"pin-utils",
703
-
]
704
-
705
-
[[package]]
706
-
name = "generator"
707
-
version = "0.8.7"
708
-
source = "registry+https://github.com/rust-lang/crates.io-index"
709
-
checksum = "605183a538e3e2a9c1038635cc5c2d194e2ee8fd0d1b66b8349fad7dbacce5a2"
710
-
dependencies = [
711
-
"cc",
712
-
"cfg-if",
713
-
"libc",
714
-
"log",
715
-
"rustversion",
716
-
"windows",
717
-
]
718
-
719
-
[[package]]
720
-
name = "hash32"
721
-
version = "0.2.1"
722
-
source = "registry+https://github.com/rust-lang/crates.io-index"
723
-
checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67"
724
-
dependencies = [
725
-
"byteorder",
726
-
]
727
-
728
-
[[package]]
729
-
name = "hash32"
730
-
version = "0.3.1"
731
-
source = "registry+https://github.com/rust-lang/crates.io-index"
732
-
checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606"
733
-
dependencies = [
734
-
"byteorder",
735
-
]
736
-
737
-
[[package]]
738
-
name = "heapless"
739
-
version = "0.7.17"
740
-
source = "registry+https://github.com/rust-lang/crates.io-index"
741
-
checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f"
742
-
dependencies = [
743
-
"atomic-polyfill",
744
-
"hash32 0.2.1",
745
-
"rustc_version 0.4.1",
746
-
"serde",
747
-
"spin",
748
-
"stable_deref_trait",
749
-
]
750
-
751
-
[[package]]
752
-
name = "heapless"
753
-
version = "0.8.0"
754
-
source = "registry+https://github.com/rust-lang/crates.io-index"
755
-
checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad"
756
-
dependencies = [
757
-
"defmt 0.3.100",
758
-
"hash32 0.3.1",
759
-
"stable_deref_trait",
760
-
]
761
-
762
-
[[package]]
763
-
name = "heapless"
764
-
version = "0.9.1"
765
-
source = "registry+https://github.com/rust-lang/crates.io-index"
766
-
checksum = "b1edcd5a338e64688fbdcb7531a846cfd3476a54784dcb918a0844682bc7ada5"
767
-
dependencies = [
768
-
"defmt 1.0.1",
769
-
"hash32 0.3.1",
770
-
"serde",
771
-
"stable_deref_trait",
772
-
]
773
-
774
-
[[package]]
775
-
name = "ident_case"
776
-
version = "1.0.1"
777
-
source = "registry+https://github.com/rust-lang/crates.io-index"
778
-
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
779
-
780
-
[[package]]
781
-
name = "lazy_static"
782
-
version = "1.5.0"
783
-
source = "registry+https://github.com/rust-lang/crates.io-index"
784
-
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
785
-
786
-
[[package]]
787
-
name = "libc"
788
-
version = "0.2.175"
789
-
source = "registry+https://github.com/rust-lang/crates.io-index"
790
-
checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
791
-
792
-
[[package]]
793
-
name = "linked_list_allocator"
794
-
version = "0.10.5"
795
-
source = "registry+https://github.com/rust-lang/crates.io-index"
796
-
checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286"
797
-
798
-
[[package]]
799
-
name = "litrs"
800
-
version = "0.4.2"
801
-
source = "registry+https://github.com/rust-lang/crates.io-index"
802
-
checksum = "f5e54036fe321fd421e10d732f155734c4e4afd610dd556d9a82833ab3ee0bed"
803
-
804
-
[[package]]
805
-
name = "lock_api"
806
-
version = "0.4.14"
807
-
source = "registry+https://github.com/rust-lang/crates.io-index"
808
-
checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
809
-
dependencies = [
810
-
"scopeguard",
811
-
]
812
-
813
-
[[package]]
814
-
name = "log"
815
-
version = "0.4.27"
816
-
source = "registry+https://github.com/rust-lang/crates.io-index"
817
-
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
818
-
819
-
[[package]]
820
-
name = "loom"
821
-
version = "0.7.2"
822
-
source = "registry+https://github.com/rust-lang/crates.io-index"
823
-
checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca"
824
-
dependencies = [
825
-
"cfg-if",
826
-
"generator",
827
-
"scoped-tls",
828
-
"tracing",
829
-
"tracing-subscriber",
830
-
]
831
-
832
-
[[package]]
833
-
name = "maitake-sync"
834
-
version = "0.2.2"
835
-
source = "registry+https://github.com/rust-lang/crates.io-index"
836
-
checksum = "748f86d9befd480b602c3bebc9ef30dbf2f3dfc8acc4a73d07b90f0117e6de3f"
837
-
dependencies = [
838
-
"cordyceps",
839
-
"loom",
840
-
"mutex-traits",
841
-
"mycelium-bitfield",
842
-
"pin-project",
843
-
"portable-atomic",
844
-
"tracing",
845
-
]
846
-
847
-
[[package]]
848
-
name = "managed"
849
-
version = "0.8.0"
850
-
source = "registry+https://github.com/rust-lang/crates.io-index"
851
-
checksum = "0ca88d725a0a943b096803bd34e73a4437208b6077654cc4ecb2947a5f91618d"
852
-
853
-
[[package]]
854
-
name = "matchers"
855
-
version = "0.1.0"
856
-
source = "registry+https://github.com/rust-lang/crates.io-index"
857
-
checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
858
-
dependencies = [
859
-
"regex-automata 0.1.10",
860
-
]
861
-
862
-
[[package]]
863
-
name = "memchr"
864
-
version = "2.7.5"
865
-
source = "registry+https://github.com/rust-lang/crates.io-index"
866
-
checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
867
-
868
-
[[package]]
869
-
name = "mutex"
870
-
version = "1.0.2"
871
-
source = "registry+https://github.com/rust-lang/crates.io-index"
872
-
checksum = "f23bf5944734b7a5d1bd0a9b594213dd04de471fd3d3a1bfce672913dd72d606"
873
-
dependencies = [
874
-
"critical-section",
875
-
"mutex-traits",
876
-
]
877
-
878
-
[[package]]
879
-
name = "mutex-traits"
880
-
version = "1.0.1"
881
-
source = "registry+https://github.com/rust-lang/crates.io-index"
882
-
checksum = "3929f2b5633d29cf7b6624992e5f3c1e9334f1193423e12d17be4faf678cde3f"
883
-
884
-
[[package]]
885
-
name = "mycelium-bitfield"
886
-
version = "0.1.5"
887
-
source = "registry+https://github.com/rust-lang/crates.io-index"
888
-
checksum = "24e0cc5e2c585acbd15c5ce911dff71e1f4d5313f43345873311c4f5efd741cc"
889
-
890
-
[[package]]
891
-
name = "nb"
892
-
version = "0.1.3"
893
-
source = "registry+https://github.com/rust-lang/crates.io-index"
894
-
checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f"
895
-
dependencies = [
896
-
"nb 1.1.0",
897
-
]
898
-
899
-
[[package]]
900
-
name = "nb"
901
-
version = "1.1.0"
902
-
source = "registry+https://github.com/rust-lang/crates.io-index"
903
-
checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d"
904
-
905
-
[[package]]
906
-
name = "nu-ansi-term"
907
-
version = "0.46.0"
908
-
source = "registry+https://github.com/rust-lang/crates.io-index"
909
-
checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
910
-
dependencies = [
911
-
"overload",
912
-
"winapi",
913
-
]
914
-
915
-
[[package]]
916
-
name = "nucleoh743zi-blinky"
917
-
version = "0.1.0"
918
-
dependencies = [
919
-
"cortex-m",
920
-
"cortex-m-rt",
921
-
"defmt 1.0.1",
922
-
"defmt-rtt",
923
-
"embassy-executor",
924
-
"embassy-stm32",
925
-
"embassy-time",
926
-
"embedded-hal 1.0.0",
927
-
"ergot",
928
-
"heapless 0.9.1",
929
-
"mutex",
930
-
"panic-probe",
931
-
]
932
-
933
-
[[package]]
934
-
name = "nucleoh743zi-net-udp-pair"
935
-
version = "0.1.0"
936
-
dependencies = [
937
-
"bbq2",
938
-
"cortex-m",
939
-
"cortex-m-rt",
940
-
"defmt 1.0.1",
941
-
"defmt-rtt",
942
-
"embassy-executor",
943
-
"embassy-futures",
944
-
"embassy-net",
945
-
"embassy-stm32",
946
-
"embassy-time",
947
-
"embedded-alloc",
948
-
"embedded-hal 1.0.0",
949
-
"ergot",
950
-
"heapless 0.9.1",
951
-
"log",
952
-
"mutex",
953
-
"panic-probe",
954
-
"postcard-schema",
955
-
"serde",
956
-
"static_cell",
957
-
]
958
-
959
-
[[package]]
960
-
name = "num-traits"
961
-
version = "0.2.19"
962
-
source = "registry+https://github.com/rust-lang/crates.io-index"
963
-
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
964
-
dependencies = [
965
-
"autocfg",
966
-
]
967
-
968
-
[[package]]
969
-
name = "once_cell"
970
-
version = "1.21.3"
971
-
source = "registry+https://github.com/rust-lang/crates.io-index"
972
-
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
973
-
974
-
[[package]]
975
-
name = "overload"
976
-
version = "0.1.1"
977
-
source = "registry+https://github.com/rust-lang/crates.io-index"
978
-
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
979
-
980
-
[[package]]
981
-
name = "panic-probe"
982
-
version = "1.0.0"
983
-
source = "registry+https://github.com/rust-lang/crates.io-index"
984
-
checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a"
985
-
dependencies = [
986
-
"cortex-m",
987
-
"defmt 1.0.1",
988
-
]
989
-
990
-
[[package]]
991
-
name = "pin-project"
992
-
version = "1.1.10"
993
-
source = "registry+https://github.com/rust-lang/crates.io-index"
994
-
checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a"
995
-
dependencies = [
996
-
"pin-project-internal",
997
-
]
998
-
999
-
[[package]]
1000
-
name = "pin-project-internal"
1001
-
version = "1.1.10"
1002
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1003
-
checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861"
1004
-
dependencies = [
1005
-
"proc-macro2",
1006
-
"quote",
1007
-
"syn 2.0.106",
1008
-
]
1009
-
1010
-
[[package]]
1011
-
name = "pin-project-lite"
1012
-
version = "0.2.16"
1013
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1014
-
checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
1015
-
1016
-
[[package]]
1017
-
name = "pin-utils"
1018
-
version = "0.1.0"
1019
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1020
-
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
1021
-
1022
-
[[package]]
1023
-
name = "portable-atomic"
1024
-
version = "1.11.1"
1025
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1026
-
checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
1027
-
1028
-
[[package]]
1029
-
name = "postcard"
1030
-
version = "1.1.3"
1031
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1032
-
checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24"
1033
-
dependencies = [
1034
-
"cobs 0.3.0",
1035
-
"heapless 0.7.17",
1036
-
"serde",
1037
-
]
1038
-
1039
-
[[package]]
1040
-
name = "postcard-derive"
1041
-
version = "0.2.2"
1042
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1043
-
checksum = "e0232bd009a197ceec9cc881ba46f727fcd8060a2d8d6a9dde7a69030a6fe2bb"
1044
-
dependencies = [
1045
-
"proc-macro2",
1046
-
"quote",
1047
-
"syn 2.0.106",
1048
-
]
1049
-
1050
-
[[package]]
1051
-
name = "postcard-schema"
1052
-
version = "0.2.5"
1053
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1054
-
checksum = "9475666d89f42231a0a57da32d5f6ca7f9b5cd4c335ea1fe8f3278215b7a21ff"
1055
-
dependencies = [
1056
-
"heapless 0.9.1",
1057
-
"postcard-derive",
1058
-
"serde",
1059
-
]
1060
-
1061
-
[[package]]
1062
-
name = "proc-macro-error-attr2"
1063
-
version = "2.0.0"
1064
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1065
-
checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5"
1066
-
dependencies = [
1067
-
"proc-macro2",
1068
-
"quote",
1069
-
]
1070
-
1071
-
[[package]]
1072
-
name = "proc-macro-error2"
1073
-
version = "2.0.1"
1074
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1075
-
checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802"
1076
-
dependencies = [
1077
-
"proc-macro-error-attr2",
1078
-
"proc-macro2",
1079
-
"quote",
1080
-
"syn 2.0.106",
1081
-
]
1082
-
1083
-
[[package]]
1084
-
name = "proc-macro2"
1085
-
version = "1.0.101"
1086
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1087
-
checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de"
1088
-
dependencies = [
1089
-
"unicode-ident",
1090
-
]
1091
-
1092
-
[[package]]
1093
-
name = "quote"
1094
-
version = "1.0.40"
1095
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1096
-
checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
1097
-
dependencies = [
1098
-
"proc-macro2",
1099
-
]
1100
-
1101
-
[[package]]
1102
-
name = "rand_core"
1103
-
version = "0.6.4"
1104
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1105
-
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
1106
-
1107
-
[[package]]
1108
-
name = "rand_core"
1109
-
version = "0.9.3"
1110
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1111
-
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
1112
-
1113
-
[[package]]
1114
-
name = "regex"
1115
-
version = "1.11.2"
1116
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1117
-
checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912"
1118
-
dependencies = [
1119
-
"aho-corasick",
1120
-
"memchr",
1121
-
"regex-automata 0.4.10",
1122
-
"regex-syntax 0.8.6",
1123
-
]
1124
-
1125
-
[[package]]
1126
-
name = "regex-automata"
1127
-
version = "0.1.10"
1128
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1129
-
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
1130
-
dependencies = [
1131
-
"regex-syntax 0.6.29",
1132
-
]
1133
-
1134
-
[[package]]
1135
-
name = "regex-automata"
1136
-
version = "0.4.10"
1137
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1138
-
checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6"
1139
-
dependencies = [
1140
-
"aho-corasick",
1141
-
"memchr",
1142
-
"regex-syntax 0.8.6",
1143
-
]
1144
-
1145
-
[[package]]
1146
-
name = "regex-syntax"
1147
-
version = "0.6.29"
1148
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1149
-
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
1150
-
1151
-
[[package]]
1152
-
name = "regex-syntax"
1153
-
version = "0.8.6"
1154
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1155
-
checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001"
1156
-
1157
-
[[package]]
1158
-
name = "rlsf"
1159
-
version = "0.2.1"
1160
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1161
-
checksum = "222fb240c3286247ecdee6fa5341e7cdad0ffdf8e7e401d9937f2d58482a20bf"
1162
-
dependencies = [
1163
-
"cfg-if",
1164
-
"const-default",
1165
-
"libc",
1166
-
"svgbobdoc",
1167
-
]
1168
-
1169
-
[[package]]
1170
-
name = "rustc_version"
1171
-
version = "0.2.3"
1172
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1173
-
checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
1174
-
dependencies = [
1175
-
"semver 0.9.0",
1176
-
]
1177
-
1178
-
[[package]]
1179
-
name = "rustc_version"
1180
-
version = "0.4.1"
1181
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1182
-
checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
1183
-
dependencies = [
1184
-
"semver 1.0.26",
1185
-
]
1186
-
1187
-
[[package]]
1188
-
name = "rustversion"
1189
-
version = "1.0.22"
1190
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1191
-
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
1192
-
1193
-
[[package]]
1194
-
name = "scoped-tls"
1195
-
version = "1.0.1"
1196
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1197
-
checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
1198
-
1199
-
[[package]]
1200
-
name = "scopeguard"
1201
-
version = "1.2.0"
1202
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1203
-
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
1204
-
1205
-
[[package]]
1206
-
name = "sdio-host"
1207
-
version = "0.9.0"
1208
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1209
-
checksum = "b328e2cb950eeccd55b7f55c3a963691455dcd044cfb5354f0c5e68d2c2d6ee2"
1210
-
1211
-
[[package]]
1212
-
name = "semver"
1213
-
version = "0.9.0"
1214
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1215
-
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
1216
-
dependencies = [
1217
-
"semver-parser",
1218
-
]
1219
-
1220
-
[[package]]
1221
-
name = "semver"
1222
-
version = "1.0.26"
1223
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1224
-
checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0"
1225
-
1226
-
[[package]]
1227
-
name = "semver-parser"
1228
-
version = "0.7.0"
1229
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1230
-
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
1231
-
1232
-
[[package]]
1233
-
name = "serde"
1234
-
version = "1.0.219"
1235
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1236
-
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
1237
-
dependencies = [
1238
-
"serde_derive",
1239
-
]
1240
-
1241
-
[[package]]
1242
-
name = "serde_derive"
1243
-
version = "1.0.219"
1244
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1245
-
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
1246
-
dependencies = [
1247
-
"proc-macro2",
1248
-
"quote",
1249
-
"syn 2.0.106",
1250
-
]
1251
-
1252
-
[[package]]
1253
-
name = "sharded-slab"
1254
-
version = "0.1.7"
1255
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1256
-
checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6"
1257
-
dependencies = [
1258
-
"lazy_static",
1259
-
]
1260
-
1261
-
[[package]]
1262
-
name = "shlex"
1263
-
version = "1.3.0"
1264
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1265
-
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
1266
-
1267
-
[[package]]
1268
-
name = "smallvec"
1269
-
version = "1.15.1"
1270
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1271
-
checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
1272
-
1273
-
[[package]]
1274
-
name = "smoltcp"
1275
-
version = "0.12.0"
1276
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1277
-
checksum = "dad095989c1533c1c266d9b1e8d70a1329dd3723c3edac6d03bbd67e7bf6f4bb"
1278
-
dependencies = [
1279
-
"bitflags 1.3.2",
1280
-
"byteorder",
1281
-
"cfg-if",
1282
-
"defmt 0.3.100",
1283
-
"heapless 0.8.0",
1284
-
"managed",
1285
-
]
1286
-
1287
-
[[package]]
1288
-
name = "spin"
1289
-
version = "0.9.8"
1290
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1291
-
checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
1292
-
dependencies = [
1293
-
"lock_api",
1294
-
]
1295
-
1296
-
[[package]]
1297
-
name = "stable_deref_trait"
1298
-
version = "1.2.0"
1299
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1300
-
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
1301
-
1302
-
[[package]]
1303
-
name = "static_assertions"
1304
-
version = "1.1.0"
1305
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1306
-
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
1307
-
1308
-
[[package]]
1309
-
name = "static_cell"
1310
-
version = "2.1.1"
1311
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1312
-
checksum = "0530892bb4fa575ee0da4b86f86c667132a94b74bb72160f58ee5a4afec74c23"
1313
-
dependencies = [
1314
-
"portable-atomic",
1315
-
]
1316
-
1317
-
[[package]]
1318
-
name = "stm32-fmc"
1319
-
version = "0.3.2"
1320
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1321
-
checksum = "c7f0639399e2307c2446c54d91d4f1596343a1e1d5cab605b9cce11d0ab3858c"
1322
-
dependencies = [
1323
-
"embedded-hal 0.2.7",
1324
-
]
1325
-
1326
-
[[package]]
1327
-
name = "stm32-metapac"
1328
-
version = "18.0.0"
1329
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1330
-
checksum = "6fd8ec3a292a0d9fc4798416a61b21da5ae50341b2e7b8d12e662bf305366097"
1331
-
dependencies = [
1332
-
"cortex-m",
1333
-
"cortex-m-rt",
1334
-
"defmt 0.3.100",
1335
-
]
1336
-
1337
-
[[package]]
1338
-
name = "strsim"
1339
-
version = "0.11.1"
1340
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1341
-
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
1342
-
1343
-
[[package]]
1344
-
name = "svgbobdoc"
1345
-
version = "0.3.0"
1346
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1347
-
checksum = "f2c04b93fc15d79b39c63218f15e3fdffaa4c227830686e3b7c5f41244eb3e50"
1348
-
dependencies = [
1349
-
"base64",
1350
-
"proc-macro2",
1351
-
"quote",
1352
-
"syn 1.0.109",
1353
-
"unicode-width",
1354
-
]
1355
-
1356
-
[[package]]
1357
-
name = "syn"
1358
-
version = "1.0.109"
1359
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1360
-
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
1361
-
dependencies = [
1362
-
"proc-macro2",
1363
-
"quote",
1364
-
"unicode-ident",
1365
-
]
1366
-
1367
-
[[package]]
1368
-
name = "syn"
1369
-
version = "2.0.106"
1370
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1371
-
checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6"
1372
-
dependencies = [
1373
-
"proc-macro2",
1374
-
"quote",
1375
-
"unicode-ident",
1376
-
]
1377
-
1378
-
[[package]]
1379
-
name = "thiserror"
1380
-
version = "2.0.16"
1381
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1382
-
checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0"
1383
-
dependencies = [
1384
-
"thiserror-impl",
1385
-
]
1386
-
1387
-
[[package]]
1388
-
name = "thiserror-impl"
1389
-
version = "2.0.16"
1390
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1391
-
checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960"
1392
-
dependencies = [
1393
-
"proc-macro2",
1394
-
"quote",
1395
-
"syn 2.0.106",
1396
-
]
1397
-
1398
-
[[package]]
1399
-
name = "thread_local"
1400
-
version = "1.1.9"
1401
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1402
-
checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185"
1403
-
dependencies = [
1404
-
"cfg-if",
1405
-
]
1406
-
1407
-
[[package]]
1408
-
name = "tracing"
1409
-
version = "0.1.41"
1410
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1411
-
checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
1412
-
dependencies = [
1413
-
"pin-project-lite",
1414
-
"tracing-attributes",
1415
-
"tracing-core",
1416
-
]
1417
-
1418
-
[[package]]
1419
-
name = "tracing-attributes"
1420
-
version = "0.1.30"
1421
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1422
-
checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903"
1423
-
dependencies = [
1424
-
"proc-macro2",
1425
-
"quote",
1426
-
"syn 2.0.106",
1427
-
]
1428
-
1429
-
[[package]]
1430
-
name = "tracing-core"
1431
-
version = "0.1.34"
1432
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1433
-
checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678"
1434
-
dependencies = [
1435
-
"once_cell",
1436
-
"valuable",
1437
-
]
1438
-
1439
-
[[package]]
1440
-
name = "tracing-log"
1441
-
version = "0.2.0"
1442
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1443
-
checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3"
1444
-
dependencies = [
1445
-
"log",
1446
-
"once_cell",
1447
-
"tracing-core",
1448
-
]
1449
-
1450
-
[[package]]
1451
-
name = "tracing-subscriber"
1452
-
version = "0.3.19"
1453
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1454
-
checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008"
1455
-
dependencies = [
1456
-
"matchers",
1457
-
"nu-ansi-term",
1458
-
"once_cell",
1459
-
"regex",
1460
-
"sharded-slab",
1461
-
"smallvec",
1462
-
"thread_local",
1463
-
"tracing",
1464
-
"tracing-core",
1465
-
"tracing-log",
1466
-
]
1467
-
1468
-
[[package]]
1469
-
name = "unicode-ident"
1470
-
version = "1.0.18"
1471
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1472
-
checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
1473
-
1474
-
[[package]]
1475
-
name = "unicode-width"
1476
-
version = "0.1.14"
1477
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1478
-
checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
1479
-
1480
-
[[package]]
1481
-
name = "valuable"
1482
-
version = "0.1.1"
1483
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1484
-
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
1485
-
1486
-
[[package]]
1487
-
name = "vcell"
1488
-
version = "0.1.3"
1489
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1490
-
checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002"
1491
-
1492
-
[[package]]
1493
-
name = "void"
1494
-
version = "1.0.2"
1495
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1496
-
checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
1497
-
1498
-
[[package]]
1499
-
name = "volatile-register"
1500
-
version = "0.2.2"
1501
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1502
-
checksum = "de437e2a6208b014ab52972a27e59b33fa2920d3e00fe05026167a1c509d19cc"
1503
-
dependencies = [
1504
-
"vcell",
1505
-
]
1506
-
1507
-
[[package]]
1508
-
name = "winapi"
1509
-
version = "0.3.9"
1510
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1511
-
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
1512
-
dependencies = [
1513
-
"winapi-i686-pc-windows-gnu",
1514
-
"winapi-x86_64-pc-windows-gnu",
1515
-
]
1516
-
1517
-
[[package]]
1518
-
name = "winapi-i686-pc-windows-gnu"
1519
-
version = "0.4.0"
1520
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1521
-
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
1522
-
1523
-
[[package]]
1524
-
name = "winapi-x86_64-pc-windows-gnu"
1525
-
version = "0.4.0"
1526
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1527
-
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
1528
-
1529
-
[[package]]
1530
-
name = "windows"
1531
-
version = "0.61.3"
1532
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1533
-
checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893"
1534
-
dependencies = [
1535
-
"windows-collections",
1536
-
"windows-core",
1537
-
"windows-future",
1538
-
"windows-link",
1539
-
"windows-numerics",
1540
-
]
1541
-
1542
-
[[package]]
1543
-
name = "windows-collections"
1544
-
version = "0.2.0"
1545
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1546
-
checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8"
1547
-
dependencies = [
1548
-
"windows-core",
1549
-
]
1550
-
1551
-
[[package]]
1552
-
name = "windows-core"
1553
-
version = "0.61.2"
1554
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1555
-
checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
1556
-
dependencies = [
1557
-
"windows-implement",
1558
-
"windows-interface",
1559
-
"windows-link",
1560
-
"windows-result",
1561
-
"windows-strings",
1562
-
]
1563
-
1564
-
[[package]]
1565
-
name = "windows-future"
1566
-
version = "0.2.1"
1567
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1568
-
checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e"
1569
-
dependencies = [
1570
-
"windows-core",
1571
-
"windows-link",
1572
-
"windows-threading",
1573
-
]
1574
-
1575
-
[[package]]
1576
-
name = "windows-implement"
1577
-
version = "0.60.0"
1578
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1579
-
checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836"
1580
-
dependencies = [
1581
-
"proc-macro2",
1582
-
"quote",
1583
-
"syn 2.0.106",
1584
-
]
1585
-
1586
-
[[package]]
1587
-
name = "windows-interface"
1588
-
version = "0.59.1"
1589
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1590
-
checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8"
1591
-
dependencies = [
1592
-
"proc-macro2",
1593
-
"quote",
1594
-
"syn 2.0.106",
1595
-
]
1596
-
1597
-
[[package]]
1598
-
name = "windows-link"
1599
-
version = "0.1.3"
1600
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1601
-
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
1602
-
1603
-
[[package]]
1604
-
name = "windows-numerics"
1605
-
version = "0.2.0"
1606
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1607
-
checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"
1608
-
dependencies = [
1609
-
"windows-core",
1610
-
"windows-link",
1611
-
]
1612
-
1613
-
[[package]]
1614
-
name = "windows-result"
1615
-
version = "0.3.4"
1616
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1617
-
checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"
1618
-
dependencies = [
1619
-
"windows-link",
1620
-
]
1621
-
1622
-
[[package]]
1623
-
name = "windows-strings"
1624
-
version = "0.4.2"
1625
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1626
-
checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"
1627
-
dependencies = [
1628
-
"windows-link",
1629
-
]
1630
-
1631
-
[[package]]
1632
-
name = "windows-threading"
1633
-
version = "0.1.0"
1634
-
source = "registry+https://github.com/rust-lang/crates.io-index"
1635
-
checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6"
1636
-
dependencies = [
1637
-
"windows-link",
1638
-
]
-50
demos/stm32h743zi/Cargo.toml
-50
demos/stm32h743zi/Cargo.toml
···
1
-
[workspace]
2
-
members = [
3
-
"nucleoh743zi-blinky",
4
-
"nucleoh743zi-net-udp-pair",
5
-
]
6
-
resolver = "2"
7
-
8
-
[workspace.dependencies]
9
-
ergot = { path = "../../crates/ergot", features = ["embassy-net-v0_7"] }
10
-
11
-
cortex-m-rt = "0.7.0"
12
-
defmt = "1.0.1"
13
-
defmt-rtt = "1.0.0"
14
-
embedded-hal = "1.0.0"
15
-
mutex = "1.0.2"
16
-
static_cell = "2.1.1"
17
-
embedded-alloc = "0.6.0"
18
-
19
-
bbq2 = { version = "0.4.1", default-features = false, features = ["critical-section", "maitake-sync-0_2"] }
20
-
21
-
cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
22
-
embassy-executor = { version = "0.9.1", features = ["defmt", "arch-cortex-m", "executor-thread", "executor-interrupt"] }
23
-
embassy-stm32 = { version = "0.4.0", features = ["defmt", "stm32h743zi", "unstable-pac", "memory-x", "time-driver-tim2", "exti"] }
24
-
embassy-time = { version = "0.5.0", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
25
-
embassy-net = { version = "0.7.1", features = ["defmt", "tcp", "udp", "dhcpv4", "medium-ethernet", "dns", "proto-ipv4", "proto-ipv6"] }
26
-
embassy-futures = { version = "0.1.2", features = ["defmt"] }
27
-
heapless = { version = "0.9", default-features = false }
28
-
panic-probe = { version = "1.0.0", features = ["print-defmt"] }
29
-
postcard-schema = { version = "0.2.5", features = ["derive"] }
30
-
serde = { version = "1.0.219", default-features = false, features = ["derive"] }
31
-
32
-
[profile.release]
33
-
debug = 2
34
-
lto = true
35
-
opt-level = 0
36
-
codegen-units = 1
37
-
incremental = false
38
-
panic = "abort"
39
-
40
-
[profile.ci]
41
-
inherits = "dev"
42
-
debug = false
43
-
strip = true
44
-
debug-assertions = true
45
-
overflow-checks = true
46
-
lto = false
47
-
panic = 'unwind'
48
-
incremental = false
49
-
codegen-units = 256
50
-
rpath = false
-18
demos/stm32h743zi/nucleoh743zi-blinky/Cargo.toml
-18
demos/stm32h743zi/nucleoh743zi-blinky/Cargo.toml
···
1
-
[package]
2
-
name = "nucleoh743zi-blinky"
3
-
version = "0.1.0"
4
-
edition = "2024"
5
-
6
-
[dependencies]
7
-
cortex-m-rt.workspace = true
8
-
cortex-m.workspace = true
9
-
defmt-rtt.workspace = true
10
-
defmt.workspace = true
11
-
embassy-executor.workspace = true
12
-
embassy-stm32.workspace = true
13
-
embassy-time.workspace = true
14
-
embedded-hal.workspace = true
15
-
ergot.workspace = true
16
-
heapless.workspace = true
17
-
mutex.workspace = true
18
-
panic-probe.workspace = true
-5
demos/stm32h743zi/nucleoh743zi-blinky/build.rs
-5
demos/stm32h743zi/nucleoh743zi-blinky/build.rs
-56
demos/stm32h743zi/nucleoh743zi-blinky/src/main.rs
-56
demos/stm32h743zi/nucleoh743zi-blinky/src/main.rs
···
1
-
#![no_std]
2
-
#![no_main]
3
-
4
-
use core::pin::pin;
5
-
6
-
use embassy_executor::{Spawner, task};
7
-
use embassy_stm32::gpio::{Level, Output, Speed};
8
-
use embassy_time::{Duration, Ticker};
9
-
use ergot::{Address, NetStack, endpoint, interface_manager::profiles::null::Null};
10
-
use mutex::raw_impls::cs::CriticalSectionRawMutex;
11
-
use {defmt_rtt as _, panic_probe as _};
12
-
13
-
pub static STACK: NetStack<CriticalSectionRawMutex, Null> = NetStack::new();
14
-
15
-
// Define some endpoints
16
-
endpoint!(LedEndpoint, bool, (), "led/set");
17
-
18
-
#[embassy_executor::main]
19
-
async fn main(spawner: Spawner) {
20
-
let p = embassy_stm32::init(Default::default());
21
-
22
-
spawner.must_spawn(led_server(Output::new(p.PB14, Level::High, Speed::Low)));
23
-
24
-
let mut ticker = Ticker::every(Duration::from_millis(500));
25
-
let client = STACK
26
-
.endpoints()
27
-
.client::<LedEndpoint>(Address::unknown(), Some("led"));
28
-
loop {
29
-
ticker.next().await;
30
-
let _ = client.request(&true).await;
31
-
ticker.next().await;
32
-
let _ = client.request(&false).await;
33
-
}
34
-
}
35
-
36
-
#[task]
37
-
async fn led_server(mut led: Output<'static>) {
38
-
let socket = STACK
39
-
.endpoints()
40
-
.bounded_server::<LedEndpoint, 2>(Some("led"));
41
-
let socket = pin!(socket);
42
-
let mut hdl = socket.attach();
43
-
44
-
loop {
45
-
let _ = hdl
46
-
.serve(async |on| {
47
-
defmt::info!("LED set {=bool}", *on);
48
-
if *on {
49
-
led.set_low();
50
-
} else {
51
-
led.set_high();
52
-
}
53
-
})
54
-
.await;
55
-
}
56
-
}
-26
demos/stm32h743zi/nucleoh743zi-net-udp-pair/Cargo.toml
-26
demos/stm32h743zi/nucleoh743zi-net-udp-pair/Cargo.toml
···
1
-
[package]
2
-
name = "nucleoh743zi-net-udp-pair"
3
-
version = "0.1.0"
4
-
edition = "2024"
5
-
6
-
[dependencies]
7
-
cortex-m-rt.workspace = true
8
-
cortex-m.workspace = true
9
-
defmt-rtt.workspace = true
10
-
defmt.workspace = true
11
-
embassy-executor.workspace = true
12
-
embassy-stm32.workspace = true
13
-
embassy-time.workspace = true
14
-
embassy-net.workspace = true
15
-
embassy-futures.workspace = true
16
-
embedded-hal.workspace = true
17
-
ergot.workspace = true
18
-
heapless.workspace = true
19
-
mutex.workspace = true
20
-
panic-probe.workspace = true
21
-
postcard-schema.workspace = true
22
-
serde.workspace = true
23
-
static_cell.workspace = true
24
-
bbq2.workspace = true
25
-
log = "0.4.27"
26
-
embedded-alloc.workspace = true
-5
demos/stm32h743zi/nucleoh743zi-net-udp-pair/build.rs
-5
demos/stm32h743zi/nucleoh743zi-net-udp-pair/build.rs
-382
demos/stm32h743zi/nucleoh743zi-net-udp-pair/src/bin/controller.rs
-382
demos/stm32h743zi/nucleoh743zi-net-udp-pair/src/bin/controller.rs
···
1
-
#![no_std]
2
-
#![no_main]
3
-
extern crate alloc;
4
-
5
-
use alloc::boxed::Box;
6
-
use core::pin::pin;
7
-
8
-
use defmt::*;
9
-
use embassy_executor::Spawner;
10
-
use embassy_net::StackResources;
11
-
use embassy_net::udp::{PacketMetadata, UdpSocket};
12
-
use embassy_net::{IpEndpoint, Ipv4Address};
13
-
use embassy_stm32::eth::PacketQueue;
14
-
use embassy_stm32::eth::{Ethernet, GenericPhy};
15
-
use embassy_stm32::pac::rcc::vals::{Pllm, Plln, Pllsrc};
16
-
use embassy_stm32::peripherals::ETH;
17
-
use embassy_stm32::rcc::mux::{
18
-
Fdcansel, Fmcsel, I2c4sel, I2c1235sel, Saisel, Sdmmcsel, Spi6sel, Spi45sel, Usart16910sel, Usart234578sel, Usbsel,
19
-
};
20
-
use embassy_stm32::rcc::{AHBPrescaler, APBPrescaler, LsConfig, PllDiv, Sysclk};
21
-
use embassy_stm32::rng::Rng;
22
-
use embassy_stm32::{Config, bind_interrupts, eth, peripherals, rcc, rng};
23
-
use embassy_time::{Duration, Ticker, Timer, WithTimeout};
24
-
use embedded_alloc::LlffHeap as Heap;
25
-
use ergot::exports::bbq2::traits::coordination::cas::AtomicCoord;
26
-
use ergot::interface_manager::profiles::direct_edge::embassy_net_udp_0_7::{RxTxWorker, UDP_OVER_ETH_ERGOT_FRAME_SIZE_MAX, UDP_OVER_ETH_ERGOT_PAYLOAD_SIZE_MAX};
27
-
use ergot::logging::log_v0_4::LogSink;
28
-
use ergot::toolkits::embassy_net_v0_7 as kit;
29
-
use ergot::well_known::ErgotPingEndpoint;
30
-
use ergot::{Address, topic};
31
-
use mutex::raw_impls::cs::CriticalSectionRawMutex;
32
-
use static_cell::{ConstStaticCell, StaticCell};
33
-
use {defmt_rtt as _, panic_probe as _};
34
-
35
-
const OUT_QUEUE_SIZE: usize = 4096;
36
-
37
-
type Stack = kit::EdgeStack<&'static Queue, CriticalSectionRawMutex>;
38
-
type Queue = kit::Queue<OUT_QUEUE_SIZE, AtomicCoord>;
39
-
40
-
/// Statically store our netstack
41
-
static STACK: Stack = kit::new_controller_stack(OUTQ.framed_producer(), UDP_OVER_ETH_ERGOT_FRAME_SIZE_MAX as u16);
42
-
/// Statically store our outgoing packet buffer
43
-
static OUTQ: Queue = kit::Queue::new();
44
-
/// Statically store receive buffers
45
-
static SCRATCH_BUF: ConstStaticCell<[u8; UDP_OVER_ETH_ERGOT_PAYLOAD_SIZE_MAX]> = ConstStaticCell::new([0u8; UDP_OVER_ETH_ERGOT_PAYLOAD_SIZE_MAX]);
46
-
47
-
static LOGSINK: LogSink<&'static Stack> = LogSink::new(&STACK);
48
-
49
-
#[derive(Debug, Copy, Clone, PartialEq, Hash)]
50
-
#[allow(dead_code)]
51
-
enum CpuRevision {
52
-
RevV,
53
-
RevY,
54
-
RevZ,
55
-
}
56
-
const CPU_REV: CpuRevision = CpuRevision::RevY;
57
-
58
-
#[global_allocator]
59
-
static HEAP: Heap = Heap::empty();
60
-
61
-
bind_interrupts!(struct Irqs {
62
-
ETH => eth::InterruptHandler;
63
-
RNG => rng::InterruptHandler<peripherals::RNG>;
64
-
});
65
-
66
-
#[embassy_executor::main]
67
-
async fn main(spawner: Spawner) -> ! {
68
-
let mut config = Config::default();
69
-
config.rcc.hse = Some(rcc::Hse {
70
-
freq: embassy_stm32::time::Hertz(8_000_000),
71
-
mode: rcc::HseMode::Oscillator,
72
-
});
73
-
config.rcc.ls = LsConfig::off();
74
-
config.rcc.hsi48 = Some(Default::default()); // needed for RNG
75
-
config.rcc.sys = Sysclk::PLL1_P;
76
-
config.rcc.d1c_pre = AHBPrescaler::DIV1;
77
-
config.rcc.ahb_pre = AHBPrescaler::DIV2;
78
-
config.rcc.apb1_pre = APBPrescaler::DIV2;
79
-
config.rcc.apb2_pre = APBPrescaler::DIV2;
80
-
config.rcc.apb3_pre = APBPrescaler::DIV2;
81
-
config.rcc.apb4_pre = APBPrescaler::DIV2;
82
-
config.rcc.timer_prescaler = rcc::TimerPrescaler::DefaultX2;
83
-
84
-
if CPU_REV == CpuRevision::RevV {
85
-
config.rcc.voltage_scale = rcc::VoltageScale::Scale0;
86
-
config.rcc.pll1 = Some(rcc::Pll {
87
-
source: Pllsrc::HSE,
88
-
prediv: Pllm::DIV1,
89
-
mul: Plln::MUL120,
90
-
// 480Mhz
91
-
divp: Some(PllDiv::DIV2),
92
-
// 160Mhz
93
-
divq: Some(PllDiv::DIV6),
94
-
divr: None,
95
-
});
96
-
} else {
97
-
config.rcc.voltage_scale = rcc::VoltageScale::Scale1;
98
-
config.rcc.pll1 = Some(rcc::Pll {
99
-
source: Pllsrc::HSE,
100
-
prediv: Pllm::DIV1,
101
-
mul: Plln::MUL100,
102
-
// 400Mhz
103
-
divp: Some(PllDiv::DIV2),
104
-
// 160Mhz
105
-
divq: Some(PllDiv::DIV5),
106
-
divr: None,
107
-
});
108
-
}
109
-
config.rcc.pll2 = Some(rcc::Pll {
110
-
source: Pllsrc::HSE,
111
-
112
-
prediv: Pllm::DIV4,
113
-
mul: Plln::MUL200,
114
-
// 200Mhz
115
-
divp: Some(PllDiv::DIV2),
116
-
// 100Mhz
117
-
divq: Some(PllDiv::DIV4),
118
-
// 200Mhz
119
-
divr: Some(PllDiv::DIV2),
120
-
});
121
-
config.rcc.pll3 = Some(rcc::Pll {
122
-
source: Pllsrc::HSE,
123
-
prediv: Pllm::DIV4,
124
-
mul: Plln::MUL192,
125
-
// 192Mhz
126
-
divp: Some(PllDiv::DIV2),
127
-
// 48Mhz
128
-
divq: Some(PllDiv::DIV8),
129
-
// 92Mhz
130
-
divr: Some(PllDiv::DIV4),
131
-
});
132
-
133
-
// 200mhz
134
-
config.rcc.mux.quadspisel = Fmcsel::PLL2_R;
135
-
// 200mhz
136
-
config.rcc.mux.sdmmcsel = Sdmmcsel::PLL2_R;
137
-
// 100mhz
138
-
config.rcc.mux.fdcansel = Fdcansel::PLL2_Q;
139
-
// 48mhz from crystal (not RC48)
140
-
config.rcc.mux.usbsel = Usbsel::PLL3_Q;
141
-
// 100/120mhz
142
-
config.rcc.mux.usart234578sel = Usart234578sel::PCLK1;
143
-
// 100/120mhz
144
-
config.rcc.mux.usart16910sel = Usart16910sel::PCLK2;
145
-
// 100/120mhz
146
-
config.rcc.mux.i2c1235sel = I2c1235sel::PCLK1;
147
-
// 100mhz
148
-
config.rcc.mux.i2c4sel = I2c4sel::PCLK4;
149
-
// 200mhz
150
-
config.rcc.mux.spi123sel = Saisel::PLL2_P;
151
-
// 100mhz
152
-
config.rcc.mux.spi45sel = Spi45sel::PLL2_Q;
153
-
// 100mhz
154
-
config.rcc.mux.spi6sel = Spi6sel::PLL2_Q;
155
-
156
-
let p = embassy_stm32::init(config);
157
-
158
-
init_heap();
159
-
160
-
// Generate random seed.
161
-
info!("Initializing RNG");
162
-
let mut rng = Rng::new(p.RNG, Irqs);
163
-
let mut seed = [0; 8];
164
-
rng.fill_bytes(&mut seed);
165
-
let seed = u64::from_le_bytes(seed);
166
-
167
-
info!("Initializing ETH");
168
-
// TODO generate mac address from CPU ID
169
-
// potentially using this algorythm (C): https://github.com/zephyrproject-rtos/zephyr/issues/59993#issuecomment-1644030438
170
-
let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF];
171
-
172
-
static PACKETS: StaticCell<PacketQueue<8, 8>> = StaticCell::new();
173
-
// warning: Not all STM32H7 devices have the exact same pins here
174
-
// for STM32H747XIH, replace p.PB13 for PG12
175
-
let device = Ethernet::new(
176
-
PACKETS.init(PacketQueue::<8, 8>::new()),
177
-
p.ETH,
178
-
Irqs,
179
-
p.PA1, // ref_clk
180
-
p.PA2, // mdio
181
-
p.PC1, // eth_mdc
182
-
p.PA7, // CRS_DV: Carrier Sense
183
-
p.PC4, // RX_D0: Received Bit 0
184
-
p.PC5, // RX_D1: Received Bit 1
185
-
p.PG13, // TX_D0: Transmit Bit 0
186
-
p.PB13, // TX_D1: Transmit Bit 1
187
-
p.PG11, // TX_EN: Transmit Enable
188
-
GenericPhy::new_auto(),
189
-
mac_addr,
190
-
);
191
-
192
-
let config = embassy_net::Config::dhcpv4(Default::default());
193
-
//let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
194
-
// address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
195
-
// dns_servers: Vec::new(),
196
-
// gateway: Some(Ipv4Address::new(10, 42, 0, 1)),
197
-
//});
198
-
199
-
// Init network stack
200
-
static RESOURCES: StaticCell<StackResources<5>> = StaticCell::new();
201
-
let (embassy_net_stack, runner) = embassy_net::new(device, config, RESOURCES.init(StackResources::new()), seed);
202
-
203
-
// Launch network task
204
-
spawner.must_spawn(embassy_net_task(runner));
205
-
206
-
// Ensure DHCP configuration is up before trying connect
207
-
let mut attempts: u32 = 0;
208
-
let config = loop {
209
-
if let Some(config) = embassy_net_stack.config_v4() {
210
-
break config;
211
-
}
212
-
213
-
if attempts % 10 == 0 {
214
-
info!("Waiting for DHCP address allocation...");
215
-
}
216
-
217
-
attempts = attempts.wrapping_add(1);
218
-
Timer::after(Duration::from_millis(100)).await;
219
-
};
220
-
221
-
info!(
222
-
"IP address: {}, gateway: {}, dns: {}",
223
-
config.address, config.dns_servers, config.gateway
224
-
);
225
-
226
-
let rx_meta = [PacketMetadata::EMPTY; 1];
227
-
let rx_buffer = [0; 4096];
228
-
let tx_meta = [PacketMetadata::EMPTY; 1];
229
-
let tx_buffer = [0; 4096];
230
-
231
-
// move the buffers into the heap, so they don't get dropped
232
-
let rx_meta = Box::new(rx_meta);
233
-
let rx_meta = Box::leak(rx_meta);
234
-
let tx_meta = Box::new(tx_meta);
235
-
let tx_meta = Box::leak(tx_meta);
236
-
let rx_buffer = Box::new(rx_buffer);
237
-
let rx_buffer = Box::leak(rx_buffer);
238
-
let tx_buffer = Box::new(tx_buffer);
239
-
let tx_buffer = Box::leak(tx_buffer);
240
-
// You need to start a server on the host machine, for example: `nc -lu 8000`
241
-
242
-
let mut socket = UdpSocket::new(embassy_net_stack, rx_meta, rx_buffer, tx_meta, tx_buffer);
243
-
244
-
let port = 8000_u16;
245
-
let remote_endpoint = IpEndpoint::new(Ipv4Address::new(192, 168, 18, 65).into(), port);
246
-
let local_endpoint = IpEndpoint::new(config.address.address().into(), port);
247
-
socket
248
-
.bind(local_endpoint)
249
-
.expect("bound");
250
-
251
-
info!(
252
-
"capacity, receive: {}, send: {}",
253
-
socket.packet_recv_capacity(),
254
-
socket.packet_send_capacity()
255
-
);
256
-
257
-
// Spawn I/O worker tasks
258
-
spawner.must_spawn(run_socket(socket, SCRATCH_BUF.take(), remote_endpoint));
259
-
260
-
// Spawn socket using tasks
261
-
spawner.must_spawn(pingserver());
262
-
spawner.must_spawn(pinger());
263
-
264
-
spawner.must_spawn(yeeter());
265
-
spawner.must_spawn(yeet_listener(0));
266
-
267
-
LOGSINK.register_static(log::LevelFilter::Info);
268
-
269
-
let mut tckr = Ticker::every(Duration::from_secs(2));
270
-
let mut ct = 0;
271
-
loop {
272
-
tckr.next().await;
273
-
log::info!("log # {ct}");
274
-
ct += 1;
275
-
}
276
-
}
277
-
278
-
type Device = Ethernet<'static, ETH, GenericPhy>;
279
-
280
-
#[embassy_executor::task]
281
-
async fn embassy_net_task(mut runner: embassy_net::Runner<'static, Device>) -> ! {
282
-
runner.run().await
283
-
}
284
-
285
-
#[embassy_executor::task]
286
-
async fn run_socket(
287
-
socket: UdpSocket<'static>,
288
-
scratch_buf: &'static mut [u8],
289
-
endpoint: IpEndpoint,
290
-
) {
291
-
let consumer = OUTQ.framed_consumer();
292
-
let mut rxtx = RxTxWorker::new_controller(&STACK, socket, (), consumer, endpoint);
293
-
294
-
loop {
295
-
_ = rxtx.run(scratch_buf).await;
296
-
}
297
-
}
298
-
299
-
#[embassy_executor::task]
300
-
async fn pinger() {
301
-
let mut ticker = Ticker::every(Duration::from_secs(1));
302
-
let mut ctr = 0u32;
303
-
let client = STACK
304
-
.endpoints()
305
-
.client::<ErgotPingEndpoint>(
306
-
Address {
307
-
network_id: 1,
308
-
node_id: 2,
309
-
port_id: 0,
310
-
},
311
-
None,
312
-
);
313
-
loop {
314
-
ticker.next().await;
315
-
let res = client
316
-
.request(&ctr)
317
-
.with_timeout(Duration::from_millis(100))
318
-
.await;
319
-
match res {
320
-
Ok(Ok(n)) => {
321
-
defmt::info!("Got ping {=u32} -> {=u32}", ctr, n);
322
-
ctr = ctr.wrapping_add(1);
323
-
}
324
-
Ok(Err(_e)) => {
325
-
defmt::warn!("Net stack ping error");
326
-
}
327
-
Err(_) => {
328
-
defmt::warn!("Ping timeout");
329
-
}
330
-
}
331
-
}
332
-
}
333
-
334
-
/// Respond to any incoming pings
335
-
#[embassy_executor::task]
336
-
async fn pingserver() {
337
-
STACK
338
-
.services()
339
-
.ping_handler::<4>()
340
-
.await;
341
-
}
342
-
343
-
topic!(YeetTopic, u64, "topic/yeet");
344
-
345
-
#[embassy_executor::task]
346
-
async fn yeeter() {
347
-
let mut ctr = 0;
348
-
info!("Yeeter started");
349
-
Timer::after(Duration::from_secs(3)).await;
350
-
loop {
351
-
Timer::after(Duration::from_secs(5)).await;
352
-
warn!("Sending broadcast message. ctr: {}", ctr);
353
-
STACK
354
-
.topics()
355
-
.broadcast::<YeetTopic>(&ctr, None)
356
-
.unwrap();
357
-
ctr += 1;
358
-
}
359
-
}
360
-
361
-
#[embassy_executor::task]
362
-
async fn yeet_listener(id: u8) {
363
-
let subber = STACK
364
-
.topics()
365
-
.bounded_receiver::<YeetTopic, 4>(None);
366
-
let subber = pin!(subber);
367
-
let mut hdl = subber.subscribe();
368
-
369
-
info!("Yeet listener started");
370
-
loop {
371
-
let msg = hdl.recv().await;
372
-
info!("{:?}: Listener id:{} got {}", msg.hdr, id, msg.t);
373
-
}
374
-
}
375
-
376
-
#[allow(static_mut_refs)]
377
-
fn init_heap() {
378
-
use core::mem::MaybeUninit;
379
-
const HEAP_SIZE: usize = 65536;
380
-
static mut HEAP_MEM: [MaybeUninit<u8>; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE];
381
-
unsafe { HEAP.init(HEAP_MEM.as_ptr() as usize, HEAP_SIZE) }
382
-
}
-382
demos/stm32h743zi/nucleoh743zi-net-udp-pair/src/bin/target.rs
-382
demos/stm32h743zi/nucleoh743zi-net-udp-pair/src/bin/target.rs
···
1
-
#![no_std]
2
-
#![no_main]
3
-
extern crate alloc;
4
-
5
-
use alloc::boxed::Box;
6
-
use core::pin::pin;
7
-
8
-
use defmt::*;
9
-
use embassy_executor::Spawner;
10
-
use embassy_net::StackResources;
11
-
use embassy_net::udp::{PacketMetadata, UdpSocket};
12
-
use embassy_net::{IpEndpoint, Ipv4Address};
13
-
use embassy_stm32::eth::PacketQueue;
14
-
use embassy_stm32::eth::{Ethernet, GenericPhy};
15
-
use embassy_stm32::pac::rcc::vals::{Pllm, Plln, Pllsrc};
16
-
use embassy_stm32::peripherals::ETH;
17
-
use embassy_stm32::rcc::mux::{
18
-
Fdcansel, Fmcsel, I2c4sel, I2c1235sel, Saisel, Sdmmcsel, Spi6sel, Spi45sel, Usart16910sel, Usart234578sel, Usbsel,
19
-
};
20
-
use embassy_stm32::rcc::{AHBPrescaler, APBPrescaler, LsConfig, PllDiv, Sysclk};
21
-
use embassy_stm32::rng::Rng;
22
-
use embassy_stm32::{Config, bind_interrupts, eth, peripherals, rcc, rng};
23
-
use embassy_time::{Duration, Ticker, Timer, WithTimeout};
24
-
use embedded_alloc::LlffHeap as Heap;
25
-
use ergot::exports::bbq2::traits::coordination::cas::AtomicCoord;
26
-
use ergot::interface_manager::profiles::direct_edge::embassy_net_udp_0_7::{RxTxWorker, UDP_OVER_ETH_ERGOT_FRAME_SIZE_MAX, UDP_OVER_ETH_ERGOT_PAYLOAD_SIZE_MAX};
27
-
use ergot::logging::log_v0_4::LogSink;
28
-
use ergot::toolkits::embassy_net_v0_7 as kit;
29
-
use ergot::well_known::ErgotPingEndpoint;
30
-
use ergot::{Address, topic};
31
-
use mutex::raw_impls::cs::CriticalSectionRawMutex;
32
-
use static_cell::{ConstStaticCell, StaticCell};
33
-
use {defmt_rtt as _, panic_probe as _};
34
-
35
-
const OUT_QUEUE_SIZE: usize = 4096;
36
-
37
-
type Stack = kit::EdgeStack<&'static Queue, CriticalSectionRawMutex>;
38
-
type Queue = kit::Queue<OUT_QUEUE_SIZE, AtomicCoord>;
39
-
40
-
/// Statically store our netstack
41
-
static STACK: Stack = kit::new_target_stack(OUTQ.framed_producer(), UDP_OVER_ETH_ERGOT_FRAME_SIZE_MAX as u16);
42
-
/// Statically store our outgoing packet buffer
43
-
static OUTQ: Queue = kit::Queue::new();
44
-
/// Statically store receive buffers
45
-
static SCRATCH_BUF: ConstStaticCell<[u8; UDP_OVER_ETH_ERGOT_PAYLOAD_SIZE_MAX]> = ConstStaticCell::new([0u8; UDP_OVER_ETH_ERGOT_PAYLOAD_SIZE_MAX]);
46
-
47
-
static LOGSINK: LogSink<&'static Stack> = LogSink::new(&STACK);
48
-
49
-
#[derive(Debug, Copy, Clone, PartialEq, Hash)]
50
-
#[allow(dead_code)]
51
-
enum CpuRevision {
52
-
RevV,
53
-
RevY,
54
-
RevZ,
55
-
}
56
-
const CPU_REV: CpuRevision = CpuRevision::RevY;
57
-
58
-
#[global_allocator]
59
-
static HEAP: Heap = Heap::empty();
60
-
61
-
bind_interrupts!(struct Irqs {
62
-
ETH => eth::InterruptHandler;
63
-
RNG => rng::InterruptHandler<peripherals::RNG>;
64
-
});
65
-
66
-
#[embassy_executor::main]
67
-
async fn main(spawner: Spawner) -> ! {
68
-
let mut config = Config::default();
69
-
config.rcc.hse = Some(rcc::Hse {
70
-
freq: embassy_stm32::time::Hertz(8_000_000),
71
-
mode: rcc::HseMode::Oscillator,
72
-
});
73
-
config.rcc.ls = LsConfig::off();
74
-
config.rcc.hsi48 = Some(Default::default()); // needed for RNG
75
-
config.rcc.sys = Sysclk::PLL1_P;
76
-
config.rcc.d1c_pre = AHBPrescaler::DIV1;
77
-
config.rcc.ahb_pre = AHBPrescaler::DIV2;
78
-
config.rcc.apb1_pre = APBPrescaler::DIV2;
79
-
config.rcc.apb2_pre = APBPrescaler::DIV2;
80
-
config.rcc.apb3_pre = APBPrescaler::DIV2;
81
-
config.rcc.apb4_pre = APBPrescaler::DIV2;
82
-
config.rcc.timer_prescaler = rcc::TimerPrescaler::DefaultX2;
83
-
84
-
if CPU_REV == CpuRevision::RevV {
85
-
config.rcc.voltage_scale = rcc::VoltageScale::Scale0;
86
-
config.rcc.pll1 = Some(rcc::Pll {
87
-
source: Pllsrc::HSE,
88
-
prediv: Pllm::DIV1,
89
-
mul: Plln::MUL120,
90
-
// 480Mhz
91
-
divp: Some(PllDiv::DIV2),
92
-
// 160Mhz
93
-
divq: Some(PllDiv::DIV6),
94
-
divr: None,
95
-
});
96
-
} else {
97
-
config.rcc.voltage_scale = rcc::VoltageScale::Scale1;
98
-
config.rcc.pll1 = Some(rcc::Pll {
99
-
source: Pllsrc::HSE,
100
-
prediv: Pllm::DIV1,
101
-
mul: Plln::MUL100,
102
-
// 400Mhz
103
-
divp: Some(PllDiv::DIV2),
104
-
// 160Mhz
105
-
divq: Some(PllDiv::DIV5),
106
-
divr: None,
107
-
});
108
-
}
109
-
config.rcc.pll2 = Some(rcc::Pll {
110
-
source: Pllsrc::HSE,
111
-
112
-
prediv: Pllm::DIV4,
113
-
mul: Plln::MUL200,
114
-
// 200Mhz
115
-
divp: Some(PllDiv::DIV2),
116
-
// 100Mhz
117
-
divq: Some(PllDiv::DIV4),
118
-
// 200Mhz
119
-
divr: Some(PllDiv::DIV2),
120
-
});
121
-
config.rcc.pll3 = Some(rcc::Pll {
122
-
source: Pllsrc::HSE,
123
-
prediv: Pllm::DIV4,
124
-
mul: Plln::MUL192,
125
-
// 192Mhz
126
-
divp: Some(PllDiv::DIV2),
127
-
// 48Mhz
128
-
divq: Some(PllDiv::DIV8),
129
-
// 92Mhz
130
-
divr: Some(PllDiv::DIV4),
131
-
});
132
-
133
-
// 200mhz
134
-
config.rcc.mux.quadspisel = Fmcsel::PLL2_R;
135
-
// 200mhz
136
-
config.rcc.mux.sdmmcsel = Sdmmcsel::PLL2_R;
137
-
// 100mhz
138
-
config.rcc.mux.fdcansel = Fdcansel::PLL2_Q;
139
-
// 48mhz from crystal (not RC48)
140
-
config.rcc.mux.usbsel = Usbsel::PLL3_Q;
141
-
// 100/120mhz
142
-
config.rcc.mux.usart234578sel = Usart234578sel::PCLK1;
143
-
// 100/120mhz
144
-
config.rcc.mux.usart16910sel = Usart16910sel::PCLK2;
145
-
// 100/120mhz
146
-
config.rcc.mux.i2c1235sel = I2c1235sel::PCLK1;
147
-
// 100mhz
148
-
config.rcc.mux.i2c4sel = I2c4sel::PCLK4;
149
-
// 200mhz
150
-
config.rcc.mux.spi123sel = Saisel::PLL2_P;
151
-
// 100mhz
152
-
config.rcc.mux.spi45sel = Spi45sel::PLL2_Q;
153
-
// 100mhz
154
-
config.rcc.mux.spi6sel = Spi6sel::PLL2_Q;
155
-
156
-
let p = embassy_stm32::init(config);
157
-
158
-
init_heap();
159
-
160
-
// Generate random seed.
161
-
info!("Initializing RNG");
162
-
let mut rng = Rng::new(p.RNG, Irqs);
163
-
let mut seed = [0; 8];
164
-
rng.fill_bytes(&mut seed);
165
-
let seed = u64::from_le_bytes(seed);
166
-
167
-
info!("Initializing ETH");
168
-
// TODO generate mac address from CPU ID
169
-
// potentially using this algorythm (C): https://github.com/zephyrproject-rtos/zephyr/issues/59993#issuecomment-1644030438
170
-
let mac_addr = [0x00, 0x00, 0xFE, 0xED, 0xF0, 0x0D];
171
-
172
-
static PACKETS: StaticCell<PacketQueue<8, 8>> = StaticCell::new();
173
-
// warning: Not all STM32H7 devices have the exact same pins here
174
-
// for STM32H747XIH, replace p.PB13 for PG12
175
-
let device = Ethernet::new(
176
-
PACKETS.init(PacketQueue::<8, 8>::new()),
177
-
p.ETH,
178
-
Irqs,
179
-
p.PA1, // ref_clk
180
-
p.PA2, // mdio
181
-
p.PC1, // eth_mdc
182
-
p.PA7, // CRS_DV: Carrier Sense
183
-
p.PC4, // RX_D0: Received Bit 0
184
-
p.PC5, // RX_D1: Received Bit 1
185
-
p.PG13, // TX_D0: Transmit Bit 0
186
-
p.PB13, // TX_D1: Transmit Bit 1
187
-
p.PG11, // TX_EN: Transmit Enable
188
-
GenericPhy::new_auto(),
189
-
mac_addr,
190
-
);
191
-
192
-
let config = embassy_net::Config::dhcpv4(Default::default());
193
-
//let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
194
-
// address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
195
-
// dns_servers: Vec::new(),
196
-
// gateway: Some(Ipv4Address::new(10, 42, 0, 1)),
197
-
//});
198
-
199
-
// Init network stack
200
-
static RESOURCES: StaticCell<StackResources<5>> = StaticCell::new();
201
-
let (embassy_net_stack, runner) = embassy_net::new(device, config, RESOURCES.init(StackResources::new()), seed);
202
-
203
-
// Launch network task
204
-
spawner.must_spawn(embassy_net_task(runner));
205
-
206
-
// Ensure DHCP configuration is up before trying connect
207
-
let mut attempts: u32 = 0;
208
-
let config = loop {
209
-
if let Some(config) = embassy_net_stack.config_v4() {
210
-
break config;
211
-
}
212
-
213
-
if attempts % 10 == 0 {
214
-
info!("Waiting for DHCP address allocation...");
215
-
}
216
-
217
-
attempts = attempts.wrapping_add(1);
218
-
Timer::after(Duration::from_millis(100)).await;
219
-
};
220
-
221
-
info!(
222
-
"IP address: {}, gateway: {}, dns: {}",
223
-
config.address, config.dns_servers, config.gateway
224
-
);
225
-
226
-
let rx_meta = [PacketMetadata::EMPTY; 1];
227
-
let rx_buffer = [0; 4096];
228
-
let tx_meta = [PacketMetadata::EMPTY; 1];
229
-
let tx_buffer = [0; 4096];
230
-
231
-
// move the buffers into the heap, so they don't get dropped
232
-
let rx_meta = Box::new(rx_meta);
233
-
let rx_meta = Box::leak(rx_meta);
234
-
let tx_meta = Box::new(tx_meta);
235
-
let tx_meta = Box::leak(tx_meta);
236
-
let rx_buffer = Box::new(rx_buffer);
237
-
let rx_buffer = Box::leak(rx_buffer);
238
-
let tx_buffer = Box::new(tx_buffer);
239
-
let tx_buffer = Box::leak(tx_buffer);
240
-
// You need to start a server on the host machine, for example: `nc -lu 8000`
241
-
242
-
let mut socket = UdpSocket::new(embassy_net_stack, rx_meta, rx_buffer, tx_meta, tx_buffer);
243
-
244
-
let port = 8000_u16;
245
-
let remote_endpoint = IpEndpoint::new(Ipv4Address::new(192, 168, 18, 64).into(), port);
246
-
let local_endpoint = IpEndpoint::new(config.address.address().into(), port);
247
-
socket
248
-
.bind(local_endpoint)
249
-
.expect("bound");
250
-
251
-
info!(
252
-
"capacity, receive: {}, send: {}",
253
-
socket.packet_recv_capacity(),
254
-
socket.packet_send_capacity()
255
-
);
256
-
257
-
// Spawn I/O worker tasks
258
-
spawner.must_spawn(run_socket(socket, SCRATCH_BUF.take(), remote_endpoint));
259
-
260
-
// Spawn socket using tasks
261
-
spawner.must_spawn(pingserver());
262
-
spawner.must_spawn(pinger());
263
-
264
-
spawner.must_spawn(yeeter());
265
-
spawner.must_spawn(yeet_listener(0));
266
-
267
-
LOGSINK.register_static(log::LevelFilter::Info);
268
-
269
-
let mut tckr = Ticker::every(Duration::from_secs(2));
270
-
let mut ct = 0;
271
-
loop {
272
-
tckr.next().await;
273
-
log::info!("log # {ct}");
274
-
ct += 1;
275
-
}
276
-
}
277
-
278
-
type Device = Ethernet<'static, ETH, GenericPhy>;
279
-
280
-
#[embassy_executor::task]
281
-
async fn embassy_net_task(mut runner: embassy_net::Runner<'static, Device>) -> ! {
282
-
runner.run().await
283
-
}
284
-
285
-
#[embassy_executor::task]
286
-
async fn run_socket(
287
-
socket: UdpSocket<'static>,
288
-
scratch_buf: &'static mut [u8],
289
-
endpoint: IpEndpoint,
290
-
) {
291
-
let consumer = OUTQ.framed_consumer();
292
-
let mut rxtx = RxTxWorker::new_target(&STACK, socket, (), consumer, endpoint);
293
-
294
-
loop {
295
-
_ = rxtx.run(scratch_buf).await;
296
-
}
297
-
}
298
-
299
-
#[embassy_executor::task]
300
-
async fn pinger() {
301
-
let mut ticker = Ticker::every(Duration::from_secs(1));
302
-
let mut ctr = 0u32;
303
-
let client = STACK
304
-
.endpoints()
305
-
.client::<ErgotPingEndpoint>(
306
-
Address {
307
-
network_id: 1,
308
-
node_id: 1,
309
-
port_id: 0,
310
-
},
311
-
None,
312
-
);
313
-
loop {
314
-
ticker.next().await;
315
-
let res = client
316
-
.request(&ctr)
317
-
.with_timeout(Duration::from_millis(100))
318
-
.await;
319
-
match res {
320
-
Ok(Ok(n)) => {
321
-
defmt::info!("Got ping {=u32} -> {=u32}", ctr, n);
322
-
ctr = ctr.wrapping_add(1);
323
-
}
324
-
Ok(Err(_e)) => {
325
-
defmt::warn!("Net stack ping error");
326
-
}
327
-
Err(_) => {
328
-
defmt::warn!("Ping timeout");
329
-
}
330
-
}
331
-
}
332
-
}
333
-
334
-
/// Respond to any incoming pings
335
-
#[embassy_executor::task]
336
-
async fn pingserver() {
337
-
STACK
338
-
.services()
339
-
.ping_handler::<4>()
340
-
.await;
341
-
}
342
-
343
-
topic!(YeetTopic, u64, "topic/yeet");
344
-
345
-
#[embassy_executor::task]
346
-
async fn yeeter() {
347
-
let mut ctr = 0;
348
-
info!("Yeeter started");
349
-
Timer::after(Duration::from_secs(3)).await;
350
-
loop {
351
-
Timer::after(Duration::from_secs(5)).await;
352
-
warn!("Sending broadcast message. ctr: {}", ctr);
353
-
STACK
354
-
.topics()
355
-
.broadcast::<YeetTopic>(&ctr, None)
356
-
.unwrap();
357
-
ctr += 1;
358
-
}
359
-
}
360
-
361
-
#[embassy_executor::task]
362
-
async fn yeet_listener(id: u8) {
363
-
let subber = STACK
364
-
.topics()
365
-
.bounded_receiver::<YeetTopic, 4>(None);
366
-
let subber = pin!(subber);
367
-
let mut hdl = subber.subscribe();
368
-
369
-
info!("Yeet listener started");
370
-
loop {
371
-
let msg = hdl.recv().await;
372
-
info!("{:?}: Listener id:{} got {}", msg.hdr, id, msg.t);
373
-
}
374
-
}
375
-
376
-
#[allow(static_mut_refs)]
377
-
fn init_heap() {
378
-
use core::mem::MaybeUninit;
379
-
const HEAP_SIZE: usize = 65536;
380
-
static mut HEAP_MEM: [MaybeUninit<u8>; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE];
381
-
unsafe { HEAP.init(HEAP_MEM.as_ptr() as usize, HEAP_SIZE) }
382
-
}
+238
notes/proposals/0145-phone-number-addressing.md
+238
notes/proposals/0145-phone-number-addressing.md
···
1
+
# Phone number addressing
2
+
3
+
Status: WIP
4
+
5
+
This is a proposal to move from AppleTalk-style "fixed class" routing, to a technique we're referring to as "phone number addressing".
6
+
7
+
As the name suggests, this technique takes inspiration from the way that phone numbers in many locations operate:
8
+
9
+
* You can dial "local" numbers using a shorter number
10
+
* You can dial "further away" numbers using a longer number
11
+
* The shorter "local" numbers are a suffix of the longer "further away" numbers.
12
+
13
+
Phone number addressing is a form of [prefix coding](https://en.wikipedia.org/wiki/Prefix_code), and is somewhat inspired by [Classless Inter-Domain Routing (CIDR)](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) from TCP/IP, but diverges somewhat in usage.
14
+
15
+
As an example, within your *building*, you could dial any 4-digit number, e.g. 1234, to reach that room. Your building may have a prefix of 678, meaning that from other buildings (but still on your street), you could dial 678-1234 to reach that same room. Within your city, your street may have the prefix of 808, meaning that someone on the other side of the city could reach that same room by dialing 808-678-1234. Even if your street was reassigned a new prefix, changing 808 to 909, people on your street (and in all buildings) would be unaffected by the change when dialing inside of the "relocated" street.
16
+
17
+
The primary motivations of this scheme are:
18
+
19
+
* We can use shorter numbers when speaking "locally", reducing the amount of data sent in every packet
20
+
* Zones of entities that may "travel together" can assign and retain stable addresses autonomously, even if they are relocated and assigned a different prefix, or go from "disconnected" to "connected" with a larger network.
21
+
22
+
Currently, Phone Number Addressing is only intended to provide addressing for strictly hierarchical networks, e.g. those without loops or duplicate routes. This simplification/restriction makes it unsuitable for general "internet" style routing, but still usable for the simple networks targeted by ergot.
23
+
24
+
## Implementation Details
25
+
26
+
For the current implementation, an address space of 32 bits is planned, though this may be expanded in the future.
27
+
28
+
In *contrast* to CIDR notation, which uses the `/N` notation to state how many bits are in the PREFIX, e.g. `/24` means that there are 24 "network prefix" bits, and 8 "host identifier" bits, we will use the "PNA" (Phone Number Addressing) notation `^N` to denote the number of significant address bits. This means that an address notated `^8` would have eight address bits used, with an unused 24 bits as a prefix. This `^8` would contain up to 256 addresses (including any reserved addresses), and would take up the eight *least significant* bits of the 32-bit address space.
29
+
30
+
This shift from "left-notation" (in CIDR) to "right-notation" (in PNA) also allows for the removal of ambiguity in the future if 64-bit addresses are allowed.
31
+
32
+
Phone Number Addresses are typically written in hexidecimal format, with letters in all caps, and the PNA suffix denoting the "scope" written in decimal form. An address may be written as `3A0^10`, meaning the binary address of `0b11_1010_0000`, or in decimal form: 928. Leading zeros WITHIN the PNA scope should always be contained, e.g. `001^10`, NOT `1^10`.
33
+
34
+
A PNA notation of `^0` is invalid, as it describes an address range containing no addresses.
35
+
36
+
## Merging "Network Segments", "Node IDs", and "Ports"
37
+
38
+
In the previous system, we had:
39
+
40
+
* 16-bit network segments (NET_ID)
41
+
* 8-bit node addresses (NODE_ID)
42
+
* 8-bit ports for sockets (PORT)
43
+
44
+
In general, the `NET_ID.NODE_ID` was used to route to the destination *device*, and once a packet had reached the destination device, the `PORT` would be used to deliver to the relevant socket.
45
+
46
+
Under Phone Number Addressing, these concepts are all merged, meaning that a specific address now always refers to a socket.
47
+
48
+
## Address Allocators
49
+
50
+
In an ergot network, there may be multiple aspects of the system that act as "Address Allocators". These allocators need to keep track of two primary pieces of information:
51
+
52
+
* Their "Pool" of addresses that they can allocate FROM
53
+
* Their list of "Allocations", or address ranges within their Poll that have been exclusively assigned. These Allocations include:
54
+
* Specific allocations, e.g. single-address assignments to sockets
55
+
* Range allocations, e.g. for downstream devices
56
+
57
+
For example:
58
+
59
+
* A single device might allocate a range of `^7` to itself, to use as a range of socket addresses.
60
+
* A routing device may assign `^10` ranges to each of it's "downstream" connected devices
61
+
62
+
It is not currently specified whether the "Pool" of addresses are always contiguous, or a single `^N` allocation.
63
+
64
+
### Apex Entities
65
+
66
+
An entity without an "upstream" or "parent" entity above them is referred to as an "Apex" entity.
67
+
68
+
An Apex entity is able to use the entire 32-bit address space as it sees fit, as it has no upstream network that it needs to "fit within". However, Apex entities may still want to be conservative in how they use this space for two reasons:
69
+
70
+
1. The existence as an "Apex" may be temporary, if they later join a network as a "downstream" or "child" entity
71
+
2. The smaller addresses uses, the more compact they will be when transmitting.
72
+
73
+
Currently, it is suggested that Apex entity make a best guess at the maximum address space needed for all downstream entities, including its own local sockets.
74
+
75
+
### Downstream Entities
76
+
77
+
Devices that are connected to another device are referred to as "Downstream" entities. They may be directly connected to an Apex entity, or to another Downstream entity with or more "hops" to the Apex entity.
78
+
79
+
Like Apex entities, Downstream entities are expected to make a best guess at the size of address space necessary for themselves and any further downstream entitites.
80
+
81
+
### Initializing the Address Allocator
82
+
83
+
When an entity first boots, it must initialize its address allocator. The "best guess" address range is used to initialize the pool.
84
+
85
+
For example, if a device has guessed that it needs a `^10` address space, it will seed the allocator with that initial `^10` space, giving it the starting range of `000^10` to `3FF^10`, or 0 to 1023.
86
+
87
+
The pool is now ready for allocating. As a common first step, an entity will allocate a range for local sockets, usable for handing out individual addresses. It may decide that a `^7` range is suitable for this, allowing for 128 sockets (including reserved addresses), meaning addresses `00^7` to `7F^7` refer to local sockets. This ALSO means that `000^10` to `07F^10` will refer to sockets on THIS entity.
88
+
89
+
This would leave the device with addresses `080^10` to `3FF^10` eligible to allocate.
90
+
91
+
This space could be divided up in numerous different ways:
92
+
93
+
* A single `^9` could be assigned in EITHER of the ranges:
94
+
* `100^10` to `2FF^10` (TODO: allow unaligned?)
95
+
* `200^10` to `3FF^10`
96
+
* Three `^8`s could be assigned in the ranges:
97
+
* `100^10` to `1FF^10`
98
+
* `200^10` to `2FF^10`
99
+
* `300^10` to `3FF^10`
100
+
* Seven `^7`s could be assigned in the ranges:
101
+
* `080^10` to `0FF^10`
102
+
* `100^10` to `17F^10`
103
+
* `180^10` to `1FF^10`
104
+
* `200^10` to `27F^10`
105
+
* `280^10` to `2FF^10`
106
+
* `300^10` to `37F^10`
107
+
* `380^10` to `3FF^10`
108
+
* And so on
109
+
110
+
Allocators are NOT required to divide the space evenly, however all divisions must be a power of two, with a minimum size of `^1`. For example, we could end up with:
111
+
112
+
* `000^10` to `07F^10`: A `^7` for local sockets
113
+
* `080^10` to `0BF^10`: A `^6` for a downstream device
114
+
* `0C0^10` to `0FF^10`: A `^6` for a downstream device
115
+
* `100^10` to `1FF^10`: A `^8` for a downstream device
116
+
* `200^10` to `3FF^10`: A `^9` for a downstream device
117
+
118
+
## Any/All messages
119
+
120
+
In the previous system, port `0` was reserved as the "Any" port, which ergot would attempt to find a single port that matched the requested characteristics. Port `255` was reserved as the "All" port, which ergot would flood to all sockets and interfaces, except for the source interface, until the TTL was consumed.
121
+
122
+
In the new system, the 0th address in a range is reserved as the "Any/All" port. A bit in the header will be used to determine if a message is a "broadcast" message. This address is allowed to exist in the local "socket" range, as long as the 0th address is not used for a specific socket.
123
+
124
+
This "0th" address is also contextually sensitive to the "scope" of the address.
125
+
126
+
# Phone Number Addressing, by example
127
+
128
+
For example, if we had a network as follows:
129
+
130
+
* Entity A, the Apex entity, with an address scope of `^10`:
131
+
* `000^10` to `3FF^10`
132
+
* A's sockets assigned the scope `^7`:
133
+
* `000^10` to `07F^10` OR `00^7` to `7F^7`
134
+
* Entity B, a Downstream entity, with an address scope of `^8`:
135
+
* `080^10` to `17F^10` OR `00^8` to `FF^8`
136
+
* B's sockets assigned the full scope:
137
+
* `00^8` to `FF^8`
138
+
* Entity C, a Downstream entity, with an address scope of `^9`:
139
+
* `180^10` to `37F^10` OR `000^9` to `1FF^9`
140
+
* C's sockets assigned the scope `^7`:
141
+
* `180^10` to `1FF^10` OR `000^9` to `07F^9` OR `00^7` to `7F^7`
142
+
* Entity D, a Downstream entity, with an address scope of `^8`:
143
+
* `200^10` to `2FF^10` OR `080^9` to `17F^9` OR `00^8` to `FF^8`
144
+
* D's sockets assigned the scope `^7`:
145
+
* `200^10` to `27F^10` OR `080^9` to `17F^9` OR `00^8` to `FF^8`
146
+
* Entity E, a Downstream entity, with an address scope of `^6`:
147
+
* `300^10` to `33F^10` OR `180^9` to `1BF^9` OR `00^6` to `3F^6`
148
+
* Entity F, a Downstream entity, with an address scope of `^7`:
149
+
* `380^10` to `3FF^10` OR `00^7` to `7F^7`
150
+
151
+
Visually:
152
+
153
+
```text
154
+
┌─────────────┬─────────────┐
155
+
│ 000 │
156
+
│ Entity A │ A's Sockets │
157
+
│ ^10 ^7 │
158
+
│ 000-3FF │ 00-7F │
159
+
│ │
160
+
│ 07F│ │
161
+
│ ┌─────────────┼─────────────┐
162
+
│ 080│ 00 │
163
+
│ │ Entity B │ B's Sockets │
164
+
│ │ ^8 ^8 │
165
+
│ │ 00-FF │ 00-FF │
166
+
│ │ │
167
+
│ │ │ │
168
+
│ │ │
169
+
│ │ │ │
170
+
│ │ │
171
+
│ │ │ │
172
+
│ │ │
173
+
│ │ │ │
174
+
│ 17F│ FF │
175
+
│ ├─────────────┼─────────────┤
176
+
│ 180│ 000 │
177
+
│ │ Entity C │ C's Sockets │
178
+
│ │ ^9 ^7 │
179
+
│ │ 000-1FF │ 00-7F │
180
+
│ │ │
181
+
│ 1FF│ 07F│ │
182
+
│ │ ┌─────────────┼─────────────┐
183
+
│ 200│ 080│ 00 │
184
+
│ │ │ Entity D │ D's Sockets │
185
+
│ │ │ ^8 ^7 │
186
+
│ │ │ 00-FF │ 00-7F │
187
+
│ │ │ │
188
+
│ 27F│ 0FF│ 7F│ │
189
+
│ │ │ ┌─────────────┤
190
+
│ 280│ 100│ 80│ │
191
+
│ │ │ │ Unused │
192
+
│ │ │ │ │
193
+
│ │ │ │ │
194
+
│ │ │ │ │
195
+
│ 2FF│ 17F│ FF│ │
196
+
│ │ ├─────────────┼─────────────┤
197
+
│ 300│ 180│ Entity E 00 E's Sockets │
198
+
│ │ │ ^6 │ ^6 │
199
+
│ 33F│ 1BF│ 00-3F 3F 00-3F │
200
+
│ │ ├─────────────┼─────────────┘
201
+
│ 340│ 1C0│ │
202
+
│ │ │ Unused │
203
+
│ 37F│ 1FF│ │
204
+
│ ├─────────────┼─────────────┤
205
+
│ 380│ 00 │
206
+
│ │ Entity F │ F's Sockets │
207
+
│ │ ^7 ^7 │
208
+
│ │ 00-FF │ 00-7F │
209
+
│ │ │
210
+
│ 3FF│ 7F│ │
211
+
└─────────────┴───────────────────────────┘
212
+
```
213
+
214
+
Like:
215
+
216
+
## How does E find B, and do something with it?
217
+
218
+
219
+
1. E sends a broadcast discovery message to 00000000^32 asking "who has endpoint service $LED_OUTPUT?, with the source address of `03^6`.
220
+
2. E's Profile says "this needs to go to my parent. I am aware my base address in my parent's space is `180^9`. I will forward this message to my parent, C, and update the source address to `183^9`.
221
+
3. C delivers to it's own socket range, as well as to D, both with the source address `183^9`. Let's say neither respond.
222
+
4. C's profile knows it's base address is `180^10`. It forwards to its parent, A, and updates the source address to `303^10`.
223
+
5. A delivers to it's own socket range, as well as entities B and F. Let's say only B cares, and it is delivered to B's 09^8.
224
+
6. B receives the discovery request, and notes that it has an `$LED_OUTPUT` service on socket `0A^8`, which it does ??? to determine that `0A^8` maps to `08A^10`. It replies TO `303^10` with this info.
225
+
7. B sends it to A:303^10 is outside it's range of 080^10 to 17F^10.
226
+
8. A sends it to C, as 303^10 is in the range 180^10 to 37F^10.
227
+
9. C sends it to E, as 303^10 is in the range 300^10 to 33F^10
228
+
10. E gives it to it's own sockets, as 303^10 is in the range 300^10 to 33F^10
229
+
230
+
Now: E can send messages to B, using `303^10` as the source (it got this in the header of the reply), and `08A^10` as the destination (it got this in the body of the reply). B can reply to E using the same.
231
+
232
+
As descrived, this generally requires:
233
+
234
+
1. All devices know their own range (e.g. E's socket knows it is `03^6`)
235
+
2. The profile of a device knows it's parents range, and it's own offset in that range (e.g. E's profile knows it is 180^9, so its socket is `183^9`
236
+
3. A device has some way of looking up it's offset in a given range, e.g. B's socket `0A^8` can ask `000^10`, "hey what is my offset in the `^10` range?", and get back "you are `08A^10`".
237
+
4. Profiles are smart enough to route UP to addresses outside their range, and DOWN to addresses inside their range
238
+
5. A nice-to-have would be some way to determine the "smallest possible scope" between two addresses. e.g. What is the closest common parent between `08A^10` and `303^10`? In this case it would be `^10`, but for `303^10` and `202^10`, it's actually `^9` (doesn't need to leave C's address space)