scratch repo for intrusive networking
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bump embassy dependencies (#147)

Bump embassy dependencies such that we can use the latest
embassy-executor and embassy-time crates. Along the way, embassy-usb
v0.4 support is dropped.

Inspired by a similar PR on `postcard-rpc`.

authored by

Felipe Balbi and committed by
GitHub
4efea2a0 9caeab48

+177 -757
+15 -121
crates/ergot/Cargo.lock
··· 262 262 checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" 263 263 264 264 [[package]] 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" 291 - source = "registry+https://github.com/rust-lang/crates.io-index" 292 - checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" 293 - dependencies = [ 294 - "darling_core", 295 - "quote", 296 - "syn 2.0.101", 297 - ] 298 - 299 - [[package]] 300 265 name = "defmt" 301 266 version = "1.0.1" 302 267 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 338 303 ] 339 304 340 305 [[package]] 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" 306 + name = "embassy-executor-timer-queue" 307 + version = "0.1.0" 354 308 source = "registry+https://github.com/rust-lang/crates.io-index" 355 - checksum = "3577b1e9446f61381179a330fc5324b01d511624c55f25e3c66c9e3c626dbecf" 356 - dependencies = [ 357 - "darling", 358 - "proc-macro2", 359 - "quote", 360 - "syn 2.0.101", 361 - ] 309 + checksum = "2fc328bf943af66b80b98755db9106bf7e7471b0cf47dc8559cd9a6be504cc9c" 362 310 363 311 [[package]] 364 312 name = "embassy-futures" ··· 380 328 dependencies = [ 381 329 "embassy-futures", 382 330 "embassy-net-driver", 383 - "embassy-sync 0.7.0", 384 - ] 385 - 386 - [[package]] 387 - name = "embassy-sync" 388 - version = "0.6.2" 389 - source = "registry+https://github.com/rust-lang/crates.io-index" 390 - checksum = "8d2c8cdff05a7a51ba0087489ea44b0b1d97a296ca6b1d6d1a33ea7423d34049" 391 - dependencies = [ 392 - "cfg-if", 393 - "critical-section", 394 - "embedded-io-async", 395 - "futures-sink", 396 - "futures-util", 397 - "heapless 0.8.0", 331 + "embassy-sync", 398 332 ] 399 333 400 334 [[package]] ··· 413 347 414 348 [[package]] 415 349 name = "embassy-time" 416 - version = "0.4.0" 350 + version = "0.5.0" 417 351 source = "registry+https://github.com/rust-lang/crates.io-index" 418 - checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" 352 + checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65" 419 353 dependencies = [ 420 354 "cfg-if", 421 355 "critical-section", ··· 425 359 "embedded-hal 0.2.7", 426 360 "embedded-hal 1.0.0", 427 361 "embedded-hal-async", 428 - "futures-util", 362 + "futures-core", 429 363 ] 430 364 431 365 [[package]] 432 366 name = "embassy-time-driver" 433 - version = "0.2.0" 367 + version = "0.2.1" 434 368 source = "registry+https://github.com/rust-lang/crates.io-index" 435 - checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" 369 + checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6" 436 370 dependencies = [ 437 371 "document-features", 438 372 ] 439 373 440 374 [[package]] 441 375 name = "embassy-time-queue-utils" 442 - version = "0.1.0" 376 + version = "0.3.0" 443 377 source = "registry+https://github.com/rust-lang/crates.io-index" 444 - checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" 378 + checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454" 445 379 dependencies = [ 446 - "embassy-executor", 380 + "embassy-executor-timer-queue", 447 381 "heapless 0.8.0", 448 382 ] 449 383 450 384 [[package]] 451 385 name = "embassy-usb" 452 - version = "0.4.0" 453 - source = "registry+https://github.com/rust-lang/crates.io-index" 454 - checksum = "6e651b9b7b47b514e6e6d1940a6e2e300891a2c33641917130643602a0cb6386" 455 - dependencies = [ 456 - "embassy-futures", 457 - "embassy-net-driver-channel", 458 - "embassy-sync 0.6.2", 459 - "embassy-usb-driver 0.1.0", 460 - "heapless 0.8.0", 461 - "ssmarshal", 462 - "usbd-hid", 463 - ] 464 - 465 - [[package]] 466 - name = "embassy-usb" 467 386 version = "0.5.0" 468 387 source = "registry+https://github.com/rust-lang/crates.io-index" 469 388 checksum = "eb69c7ca7fa90b9ae590e3dea985ef80df06d900a350f9cc9d3f3c8113fc4370" 470 389 dependencies = [ 471 390 "embassy-futures", 472 391 "embassy-net-driver-channel", 473 - "embassy-sync 0.7.0", 474 - "embassy-usb-driver 0.2.0", 392 + "embassy-sync", 393 + "embassy-usb-driver", 475 394 "embedded-io-async", 476 395 "heapless 0.8.0", 477 396 "ssmarshal", 478 397 "usbd-hid", 479 398 ] 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" 486 399 487 400 [[package]] 488 401 name = "embassy-usb-driver" ··· 581 494 "defmt", 582 495 "embassy-futures", 583 496 "embassy-time", 584 - "embassy-usb 0.4.0", 585 - "embassy-usb 0.5.0", 497 + "embassy-usb", 586 498 "embedded-io-async", 587 499 "env_logger", 588 500 "heapless 0.9.1", ··· 611 523 "libc", 612 524 "windows-sys 0.60.2", 613 525 ] 614 - 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 526 621 527 [[package]] 622 528 name = "futures" ··· 800 706 "serde", 801 707 "stable_deref_trait", 802 708 ] 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" 809 709 810 710 [[package]] 811 711 name = "io-kit-sys" ··· 1453 1353 dependencies = [ 1454 1354 "portable-atomic", 1455 1355 ] 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" 1462 1356 1463 1357 [[package]] 1464 1358 name = "syn"
+1 -9
crates/ergot/Cargo.toml
··· 42 42 "tokio", 43 43 "std", 44 44 ] 45 - embassy-usb-v0_4 = [ 46 - "defmt-v1", 47 - "dep:embassy-usb-0_4", 48 - "dep:static_cell", 49 - ] 50 45 embassy-usb-v0_5 = [ 51 46 "defmt-v1", 52 47 "dep:embassy-usb-0_5", ··· 87 82 bbq2 = { version = "0.4.2", default-features = false, features = ["maitake-sync-0_2"] } 88 83 cobs = { version = "0.3.0", default-features = false } 89 84 cordyceps = { version = "0.3.4", default-features = false } 90 - embassy-time = { version = "0.4.0" } 85 + embassy-time = { version = "0.5.0" } 91 86 maitake-sync = { version = "0.2.2", default-features = false } 92 87 mutex = { version = "1.0.0", features = ["impl-critical-section"] } 93 88 serde = { version = "1.0", default-features = false, features = ["derive"] } ··· 104 99 # embassy-usb-* 105 100 defmt = { version = "1.0.0", optional = true } 106 101 static_cell = { version = "2.1", optional = true } 107 - 108 - # embassy-usb-v0_4 109 - embassy-usb-0_4 = { version = "0.4", optional = true, package = "embassy-usb" } 110 102 111 103 # embassy-usb-v0_5 112 104 embassy-usb-0_5 = { version = "0.5", optional = true, package = "embassy-usb" }
+4 -298
crates/ergot/src/interface_manager/interface_impls/embassy_usb.rs
··· 18 18 }; 19 19 use static_cell::ConstStaticCell; 20 20 21 - use crate::interface_manager::{Interface, utils::framed_stream}; 21 + use crate::interface_manager::{utils::framed_stream, Interface}; 22 22 23 23 /// An Embassy-USB interface implementation 24 24 pub struct EmbassyInterface<Q: BbqHandle + 'static> { ··· 114 114 traits::{coordination::Coord, notifier::maitake::MaiNotSpsc, storage::Inline}, 115 115 }; 116 116 use defmt::{debug, info, warn}; 117 - use embassy_futures::select::{Either, select}; 117 + use embassy_futures::select::{select, Either}; 118 118 use embassy_time::Timer; 119 119 use embassy_usb_0_5::{ 120 - Builder, UsbDevice, 121 120 driver::{Driver, Endpoint, EndpointIn}, 122 121 msos::{self, windows_version}, 122 + Builder, UsbDevice, 123 123 }; 124 124 use static_cell::ConstStaticCell; 125 125 126 126 use crate::interface_manager::interface_impls::embassy_usb::TransmitError; 127 127 128 - use super::{DEVICE_INTERFACE_GUIDS, ErgotHandler, HDLR, STINDX, UsbDeviceBuffers}; 128 + use super::{ErgotHandler, UsbDeviceBuffers, DEVICE_INTERFACE_GUIDS, HDLR, STINDX}; 129 129 130 130 /// A helper type for `static` storage of buffers and driver components 131 131 pub struct WireStorage< ··· 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
··· 9 9 use defmt::info; 10 10 use embedded_io_async_0_6::Write; 11 11 12 - use crate::interface_manager::{Interface, utils::cobs_stream}; 12 + use crate::interface_manager::{utils::cobs_stream, Interface}; 13 13 14 14 pub struct IoInterface<Q: BbqHandle> { 15 15 _pd: PhantomData<Q>,
+1 -1
crates/ergot/src/interface_manager/interface_impls/mod.rs
··· 9 9 #[cfg(feature = "tokio-serial-v5")] 10 10 pub mod tokio_serial_cobs; 11 11 12 - #[cfg(any(feature = "embassy-usb-v0_4", feature = "embassy-usb-v0_5"))] 12 + #[cfg(feature = "embassy-usb-v0_5")] 13 13 pub mod embassy_usb; 14 14 15 15 #[cfg(feature = "nusb-v0_1")]
+1 -1
crates/ergot/src/interface_manager/interface_impls/nusb_bulk.rs
··· 9 9 use nusb::transfer::{Direction, EndpointType, Queue, RequestBuffer}; 10 10 11 11 use crate::interface_manager::{ 12 - Interface, 13 12 utils::{framed_stream, std::StdQueue}, 13 + Interface, 14 14 }; 15 15 use log::{debug, info, trace, warn}; 16 16
+1 -1
crates/ergot/src/interface_manager/interface_impls/tokio_serial_cobs.rs
··· 3 3 //! std serial cobs uses COBS for framing over a serial stream. 4 4 5 5 use crate::interface_manager::{ 6 - Interface, 7 6 utils::{cobs_stream, std::StdQueue}, 7 + Interface, 8 8 }; 9 9 10 10 /// An interface implementation for serial using tokio
+1 -1
crates/ergot/src/interface_manager/interface_impls/tokio_tcp.rs
··· 3 3 //! std tcp uses COBS for framing over a TCP stream. 4 4 5 5 use crate::interface_manager::{ 6 - Interface, 7 6 utils::{cobs_stream, std::StdQueue}, 7 + Interface, 8 8 }; 9 9 10 10 /// An interface implementation for TCP using tokio
-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 - }
-3
crates/ergot/src/interface_manager/profiles/direct_edge/mod.rs
··· 16 16 #[cfg(feature = "embedded-io-async-v0_6")] 17 17 pub mod eio_0_6; 18 18 19 - #[cfg(feature = "embassy-usb-v0_4")] 20 - pub mod eusb_0_4; 21 - 22 19 #[cfg(feature = "embassy-usb-v0_5")] 23 20 pub mod eusb_0_5; 24 21
+22 -6
demos/esp32c6/Cargo.lock
··· 287 287 "embassy-embedded-hal 0.4.0", 288 288 "embassy-futures", 289 289 "embassy-sync 0.6.2", 290 - "embassy-time", 290 + "embassy-time 0.4.0", 291 291 "embedded-hal 0.2.7", 292 292 "embedded-hal 1.0.0", 293 293 "embedded-hal-async", ··· 402 402 ] 403 403 404 404 [[package]] 405 + name = "embassy-time" 406 + version = "0.5.0" 407 + source = "registry+https://github.com/rust-lang/crates.io-index" 408 + checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65" 409 + dependencies = [ 410 + "cfg-if", 411 + "critical-section", 412 + "document-features", 413 + "embassy-time-driver", 414 + "embedded-hal 0.2.7", 415 + "embedded-hal 1.0.0", 416 + "embedded-hal-async", 417 + "futures-core", 418 + ] 419 + 420 + [[package]] 405 421 name = "embassy-time-driver" 406 - version = "0.2.0" 422 + version = "0.2.1" 407 423 source = "registry+https://github.com/rust-lang/crates.io-index" 408 - checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" 424 + checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6" 409 425 dependencies = [ 410 426 "document-features", 411 427 ] ··· 531 547 "critical-section", 532 548 "defmt 1.0.1", 533 549 "embassy-futures", 534 - "embassy-time", 550 + "embassy-time 0.5.0", 535 551 "embedded-io-async", 536 552 "heapless 0.9.1", 537 553 "log", ··· 634 650 "document-features", 635 651 "embassy-executor", 636 652 "embassy-sync 0.6.2", 637 - "embassy-time", 653 + "embassy-time 0.4.0", 638 654 "embassy-time-driver", 639 655 "embassy-time-queue-utils", 640 656 "esp-config", ··· 769 785 "defmt 1.0.1", 770 786 "embassy-executor", 771 787 "embassy-sync 0.7.0", 772 - "embassy-time", 788 + "embassy-time 0.4.0", 773 789 "embedded-io-async", 774 790 "ergot", 775 791 "esp-bootloader-esp-idf",
+20 -4
demos/microbit/Cargo.lock
··· 313 313 "embassy-embedded-hal 0.4.0", 314 314 "embassy-futures", 315 315 "embassy-sync 0.6.2", 316 - "embassy-time", 316 + "embassy-time 0.4.0", 317 317 "embedded-hal 0.2.7", 318 318 "embedded-hal 1.0.0", 319 319 "embedded-hal-async", ··· 415 415 "embassy-embedded-hal 0.3.2", 416 416 "embassy-hal-internal", 417 417 "embassy-sync 0.7.2", 418 - "embassy-time", 418 + "embassy-time 0.4.0", 419 419 "embassy-time-driver", 420 420 "embassy-time-queue-utils", 421 421 "embassy-usb-driver", ··· 479 479 ] 480 480 481 481 [[package]] 482 + name = "embassy-time" 483 + version = "0.5.0" 484 + source = "registry+https://github.com/rust-lang/crates.io-index" 485 + checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65" 486 + dependencies = [ 487 + "cfg-if", 488 + "critical-section", 489 + "document-features", 490 + "embassy-time-driver", 491 + "embedded-hal 0.2.7", 492 + "embedded-hal 1.0.0", 493 + "embedded-hal-async", 494 + "futures-core", 495 + ] 496 + 497 + [[package]] 482 498 name = "embassy-time-driver" 483 499 version = "0.2.1" 484 500 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 596 612 "critical-section", 597 613 "defmt 1.0.1", 598 614 "embassy-futures", 599 - "embassy-time", 615 + "embassy-time 0.5.0", 600 616 "embassy-usb", 601 617 "heapless 0.9.1", 602 618 "log", ··· 846 862 "embassy-executor", 847 863 "embassy-nrf", 848 864 "embassy-sync 0.7.2", 849 - "embassy-time", 865 + "embassy-time 0.4.0", 850 866 "embassy-usb", 851 867 "ergot", 852 868 "mutex",
+23 -7
demos/nrf52840/Cargo.lock
··· 312 312 "embassy-futures", 313 313 "embassy-hal-internal", 314 314 "embassy-sync", 315 - "embassy-time", 315 + "embassy-time 0.4.0", 316 316 "embedded-hal 0.2.7", 317 317 "embedded-hal 1.0.0", 318 318 "embedded-hal-async", ··· 397 397 "embassy-embedded-hal", 398 398 "embassy-hal-internal", 399 399 "embassy-sync", 400 - "embassy-time", 400 + "embassy-time 0.4.0", 401 401 "embassy-time-driver", 402 402 "embassy-time-queue-utils", 403 403 "embassy-usb-driver", ··· 447 447 ] 448 448 449 449 [[package]] 450 + name = "embassy-time" 451 + version = "0.5.0" 452 + source = "registry+https://github.com/rust-lang/crates.io-index" 453 + checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65" 454 + dependencies = [ 455 + "cfg-if", 456 + "critical-section", 457 + "document-features", 458 + "embassy-time-driver", 459 + "embedded-hal 0.2.7", 460 + "embedded-hal 1.0.0", 461 + "embedded-hal-async", 462 + "futures-core", 463 + ] 464 + 465 + [[package]] 450 466 name = "embassy-time-driver" 451 - version = "0.2.0" 467 + version = "0.2.1" 452 468 source = "registry+https://github.com/rust-lang/crates.io-index" 453 - checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" 469 + checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6" 454 470 dependencies = [ 455 471 "document-features", 456 472 ] ··· 564 580 "critical-section", 565 581 "defmt 1.0.1", 566 582 "embassy-futures", 567 - "embassy-time", 583 + "embassy-time 0.5.0", 568 584 "embassy-usb", 569 585 "heapless 0.9.1", 570 586 "log", ··· 855 871 "embassy-executor", 856 872 "embassy-nrf", 857 873 "embassy-sync", 858 - "embassy-time", 874 + "embassy-time 0.4.0", 859 875 "embassy-usb", 860 876 "ergot", 861 877 "mutex", ··· 873 889 "defmt-rtt", 874 890 "embassy-executor", 875 891 "embassy-nrf", 876 - "embassy-time", 892 + "embassy-time 0.4.0", 877 893 "ergot", 878 894 "mutex", 879 895 "panic-probe",
+24 -8
demos/rp2040/Cargo.lock
··· 409 409 "embassy-futures", 410 410 "embassy-hal-internal", 411 411 "embassy-sync", 412 - "embassy-time", 412 + "embassy-time 0.4.0", 413 413 "embedded-hal 0.2.7", 414 414 "embedded-hal 1.0.0", 415 415 "embedded-hal-async", ··· 495 495 "embassy-futures", 496 496 "embassy-hal-internal", 497 497 "embassy-sync", 498 - "embassy-time", 498 + "embassy-time 0.4.0", 499 499 "embassy-time-driver", 500 500 "embassy-time-queue-utils", 501 501 "embassy-usb-driver", ··· 550 550 ] 551 551 552 552 [[package]] 553 + name = "embassy-time" 554 + version = "0.5.0" 555 + source = "registry+https://github.com/rust-lang/crates.io-index" 556 + checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65" 557 + dependencies = [ 558 + "cfg-if", 559 + "critical-section", 560 + "document-features", 561 + "embassy-time-driver", 562 + "embedded-hal 0.2.7", 563 + "embedded-hal 1.0.0", 564 + "embedded-hal-async", 565 + "futures-core", 566 + ] 567 + 568 + [[package]] 553 569 name = "embassy-time-driver" 554 - version = "0.2.0" 570 + version = "0.2.1" 555 571 source = "registry+https://github.com/rust-lang/crates.io-index" 556 - checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" 572 + checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6" 557 573 dependencies = [ 558 574 "document-features", 559 575 ] ··· 692 708 "critical-section", 693 709 "defmt 1.0.1", 694 710 "embassy-futures", 695 - "embassy-time", 711 + "embassy-time 0.5.0", 696 712 "embassy-usb", 697 713 "heapless 0.9.1", 698 714 "log", ··· 1438 1454 "embassy-executor", 1439 1455 "embassy-rp", 1440 1456 "embassy-sync", 1441 - "embassy-time", 1457 + "embassy-time 0.4.0", 1442 1458 "embassy-usb", 1443 1459 "ergot", 1444 1460 "maitake-sync", ··· 1458 1474 "defmt-rtt", 1459 1475 "embassy-executor", 1460 1476 "embassy-rp", 1461 - "embassy-time", 1477 + "embassy-time 0.4.0", 1462 1478 "ergot", 1463 1479 "maitake-sync", 1464 1480 "mutex", ··· 1478 1494 "embassy-executor", 1479 1495 "embassy-futures", 1480 1496 "embassy-rp", 1481 - "embassy-time", 1497 + "embassy-time 0.4.0", 1482 1498 "ergot", 1483 1499 "maitake-sync", 1484 1500 "mutex",
+24 -8
demos/rp2350/Cargo.lock
··· 409 409 "embassy-futures", 410 410 "embassy-hal-internal", 411 411 "embassy-sync", 412 - "embassy-time", 412 + "embassy-time 0.4.0", 413 413 "embedded-hal 0.2.7", 414 414 "embedded-hal 1.0.0", 415 415 "embedded-hal-async", ··· 495 495 "embassy-futures", 496 496 "embassy-hal-internal", 497 497 "embassy-sync", 498 - "embassy-time", 498 + "embassy-time 0.4.0", 499 499 "embassy-time-driver", 500 500 "embassy-time-queue-utils", 501 501 "embassy-usb-driver", ··· 550 550 ] 551 551 552 552 [[package]] 553 + name = "embassy-time" 554 + version = "0.5.0" 555 + source = "registry+https://github.com/rust-lang/crates.io-index" 556 + checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65" 557 + dependencies = [ 558 + "cfg-if", 559 + "critical-section", 560 + "document-features", 561 + "embassy-time-driver", 562 + "embedded-hal 0.2.7", 563 + "embedded-hal 1.0.0", 564 + "embedded-hal-async", 565 + "futures-core", 566 + ] 567 + 568 + [[package]] 553 569 name = "embassy-time-driver" 554 - version = "0.2.0" 570 + version = "0.2.1" 555 571 source = "registry+https://github.com/rust-lang/crates.io-index" 556 - checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" 572 + checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6" 557 573 dependencies = [ 558 574 "document-features", 559 575 ] ··· 703 719 "critical-section", 704 720 "defmt 1.0.1", 705 721 "embassy-futures", 706 - "embassy-time", 722 + "embassy-time 0.5.0", 707 723 "embassy-usb", 708 724 "heapless 0.9.1", 709 725 "log", ··· 1449 1465 "embassy-executor", 1450 1466 "embassy-rp", 1451 1467 "embassy-sync", 1452 - "embassy-time", 1468 + "embassy-time 0.4.0", 1453 1469 "embassy-usb", 1454 1470 "ergot", 1455 1471 "maitake-sync", ··· 1469 1485 "defmt-rtt", 1470 1486 "embassy-executor", 1471 1487 "embassy-rp", 1472 - "embassy-time", 1488 + "embassy-time 0.4.0", 1473 1489 "ergot", 1474 1490 "maitake-sync", 1475 1491 "mutex", ··· 1490 1506 "embassy-futures", 1491 1507 "embassy-rp", 1492 1508 "embassy-sync", 1493 - "embassy-time", 1509 + "embassy-time 0.4.0", 1494 1510 "embassy-usb", 1495 1511 "embedded-hal 1.0.0", 1496 1512 "embedded-hal-async",
+5 -29
demos/shared-icd/Cargo.lock
··· 127 127 128 128 [[package]] 129 129 name = "embassy-time" 130 - version = "0.4.0" 130 + version = "0.5.0" 131 131 source = "registry+https://github.com/rust-lang/crates.io-index" 132 - checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" 132 + checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65" 133 133 dependencies = [ 134 134 "cfg-if", 135 135 "critical-section", ··· 138 138 "embedded-hal 0.2.7", 139 139 "embedded-hal 1.0.0", 140 140 "embedded-hal-async", 141 - "futures-util", 141 + "futures-core", 142 142 ] 143 143 144 144 [[package]] 145 145 name = "embassy-time-driver" 146 - version = "0.2.0" 146 + version = "0.2.1" 147 147 source = "registry+https://github.com/rust-lang/crates.io-index" 148 - checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" 148 + checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6" 149 149 dependencies = [ 150 150 "document-features", 151 151 ] ··· 203 203 version = "0.3.31" 204 204 source = "registry+https://github.com/rust-lang/crates.io-index" 205 205 checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" 206 - 207 - [[package]] 208 - name = "futures-task" 209 - version = "0.3.31" 210 - source = "registry+https://github.com/rust-lang/crates.io-index" 211 - checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" 212 - 213 - [[package]] 214 - name = "futures-util" 215 - version = "0.3.31" 216 - source = "registry+https://github.com/rust-lang/crates.io-index" 217 - checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" 218 - dependencies = [ 219 - "futures-core", 220 - "futures-task", 221 - "pin-project-lite", 222 - "pin-utils", 223 - ] 224 206 225 207 [[package]] 226 208 name = "generator" ··· 440 422 version = "0.2.16" 441 423 source = "registry+https://github.com/rust-lang/crates.io-index" 442 424 checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" 443 - 444 - [[package]] 445 - name = "pin-utils" 446 - version = "0.1.0" 447 - source = "registry+https://github.com/rust-lang/crates.io-index" 448 - checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 449 425 450 426 [[package]] 451 427 name = "portable-atomic"
+11 -81
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]] 885 850 name = "dispatch" 886 851 version = "0.2.0" 887 852 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1081 1046 ] 1082 1047 1083 1048 [[package]] 1084 - name = "embassy-executor" 1085 - version = "0.7.0" 1086 - source = "registry+https://github.com/rust-lang/crates.io-index" 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" 1049 + name = "embassy-executor-timer-queue" 1050 + version = "0.1.0" 1097 1051 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 - ] 1052 + checksum = "2fc328bf943af66b80b98755db9106bf7e7471b0cf47dc8559cd9a6be504cc9c" 1105 1053 1106 1054 [[package]] 1107 1055 name = "embassy-futures" ··· 1111 1059 1112 1060 [[package]] 1113 1061 name = "embassy-time" 1114 - version = "0.4.0" 1062 + version = "0.5.0" 1115 1063 source = "registry+https://github.com/rust-lang/crates.io-index" 1116 - checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" 1064 + checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65" 1117 1065 dependencies = [ 1118 1066 "cfg-if", 1119 1067 "critical-section", ··· 1123 1071 "embedded-hal 0.2.7", 1124 1072 "embedded-hal 1.0.0", 1125 1073 "embedded-hal-async", 1126 - "futures-util", 1074 + "futures-core", 1127 1075 ] 1128 1076 1129 1077 [[package]] 1130 1078 name = "embassy-time-driver" 1131 - version = "0.2.0" 1079 + version = "0.2.1" 1132 1080 source = "registry+https://github.com/rust-lang/crates.io-index" 1133 - checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" 1081 + checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6" 1134 1082 dependencies = [ 1135 1083 "document-features", 1136 1084 ] 1137 1085 1138 1086 [[package]] 1139 1087 name = "embassy-time-queue-utils" 1140 - version = "0.1.0" 1088 + version = "0.3.0" 1141 1089 source = "registry+https://github.com/rust-lang/crates.io-index" 1142 - checksum = "dc55c748d16908a65b166d09ce976575fb8852cf60ccd06174092b41064d8f83" 1090 + checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454" 1143 1091 dependencies = [ 1144 - "embassy-executor", 1092 + "embassy-executor-timer-queue", 1145 1093 "heapless 0.8.0", 1146 1094 ] 1147 1095 ··· 1410 1358 "crc32fast", 1411 1359 "miniz_oxide", 1412 1360 ] 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" 1419 1361 1420 1362 [[package]] 1421 1363 name = "foldhash" ··· 1925 1867 "zerotrie", 1926 1868 "zerovec", 1927 1869 ] 1928 - 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 1870 1935 1871 [[package]] 1936 1872 name = "idna" ··· 3553 3489 version = "0.1.1" 3554 3490 source = "registry+https://github.com/rust-lang/crates.io-index" 3555 3491 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" 3562 3492 3563 3493 [[package]] 3564 3494 name = "strum"
+23 -7
demos/stm32f303vc/Cargo.lock
··· 326 326 "embassy-futures", 327 327 "embassy-hal-internal", 328 328 "embassy-sync", 329 - "embassy-time", 329 + "embassy-time 0.4.0", 330 330 "embedded-hal 0.2.7", 331 331 "embedded-hal 1.0.0", 332 332 "embedded-hal-async", ··· 419 419 "embassy-hal-internal", 420 420 "embassy-net-driver", 421 421 "embassy-sync", 422 - "embassy-time", 422 + "embassy-time 0.4.0", 423 423 "embassy-time-driver", 424 424 "embassy-time-queue-utils", 425 425 "embassy-usb-driver", ··· 480 480 ] 481 481 482 482 [[package]] 483 + name = "embassy-time" 484 + version = "0.5.0" 485 + source = "registry+https://github.com/rust-lang/crates.io-index" 486 + checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65" 487 + dependencies = [ 488 + "cfg-if", 489 + "critical-section", 490 + "document-features", 491 + "embassy-time-driver", 492 + "embedded-hal 0.2.7", 493 + "embedded-hal 1.0.0", 494 + "embedded-hal-async", 495 + "futures-core", 496 + ] 497 + 498 + [[package]] 483 499 name = "embassy-time-driver" 484 - version = "0.2.0" 500 + version = "0.2.1" 485 501 source = "registry+https://github.com/rust-lang/crates.io-index" 486 - checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" 502 + checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6" 487 503 dependencies = [ 488 504 "document-features", 489 505 ] ··· 632 648 "critical-section", 633 649 "defmt 1.0.1", 634 650 "embassy-futures", 635 - "embassy-time", 651 + "embassy-time 0.5.0", 636 652 "embassy-usb", 637 653 "heapless 0.9.1", 638 654 "log", ··· 1261 1277 "defmt-rtt", 1262 1278 "embassy-executor", 1263 1279 "embassy-stm32", 1264 - "embassy-time", 1280 + "embassy-time 0.4.0", 1265 1281 "embedded-hal 1.0.0", 1266 1282 "ergot", 1267 1283 "heapless 0.9.1", ··· 1279 1295 "defmt-rtt", 1280 1296 "embassy-executor", 1281 1297 "embassy-stm32", 1282 - "embassy-time", 1298 + "embassy-time 0.4.0", 1283 1299 "embedded-hal 1.0.0", 1284 1300 "ergot", 1285 1301 "heapless 0.9.1",