diff --git a/Cargo.toml b/Cargo.toml index 8645f17..4274e6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ members = [ ] [workspace.package] -version = "0.3.6" +version = "0.3.7" edition = "2021" repository = "https://git.bfpower.io/BFPOWER/physical" readme = "README.md" diff --git a/node/src/stm32/usb.rs b/node/src/stm32/usb.rs index d2f767f..aab470a 100644 --- a/node/src/stm32/usb.rs +++ b/node/src/stm32/usb.rs @@ -11,6 +11,13 @@ pub type TypedUSB = UsbDevice<'static, Driver<'static, USB_OTG_FS>>; pub type TypedInterIn = Endpoint<'static, USB_OTG_FS, In>; pub type TypedInterOut = Endpoint<'static, USB_OTG_FS, Out>; +pub struct UsbIO { + /// Send to master + interrupt_in: TypedInterIn, + /// Recieve from master + interrupt_out: TypedInterOut, +} + impl comms::Sender for TypedInterIn { async fn send(&mut self, msg: &[u8]) -> Result<(), comms::Reset> { self.write(msg).await.map_err(|_| comms::Reset) @@ -26,9 +33,9 @@ impl comms::Receiver for TypedInterOut { .map(|_| ()) .map_err(|_| comms::Reset) } - + #[cfg(not(feature = "single-packet-msgs"))] - async fn receive(&mut self, buffer: &mut [u8]) -> Result<(), comms::Reset> { + async fn receive(&mut self, buffer: &mut [u8]) -> Result<(), comms::Reset> { todo!("Decide if we want a general purpose multi-packet message receive") } }