diff options
Diffstat (limited to 'embassy-usb-synopsys-otg')
| -rw-r--r-- | embassy-usb-synopsys-otg/Cargo.toml | 2 | ||||
| -rw-r--r-- | embassy-usb-synopsys-otg/src/lib.rs | 17 |
2 files changed, 6 insertions, 13 deletions
diff --git a/embassy-usb-synopsys-otg/Cargo.toml b/embassy-usb-synopsys-otg/Cargo.toml index 61b14a215..eca68095d 100644 --- a/embassy-usb-synopsys-otg/Cargo.toml +++ b/embassy-usb-synopsys-otg/Cargo.toml | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | [package] | 1 | [package] |
| 2 | name = "embassy-usb-synopsys-otg" | 2 | name = "embassy-usb-synopsys-otg" |
| 3 | version = "0.3.1" | 3 | version = "0.3.1" |
| 4 | edition = "2021" | 4 | edition = "2024" |
| 5 | license = "MIT OR Apache-2.0" | 5 | license = "MIT OR Apache-2.0" |
| 6 | description = "`embassy-usb-driver` implementation for Synopsys OTG USB controllers" | 6 | description = "`embassy-usb-driver` implementation for Synopsys OTG USB controllers" |
| 7 | keywords = ["embedded", "async", "usb", "hal", "embedded-hal"] | 7 | keywords = ["embedded", "async", "usb", "hal", "embedded-hal"] |
diff --git a/embassy-usb-synopsys-otg/src/lib.rs b/embassy-usb-synopsys-otg/src/lib.rs index 6b4a87bdf..d94209f45 100644 --- a/embassy-usb-synopsys-otg/src/lib.rs +++ b/embassy-usb-synopsys-otg/src/lib.rs | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | #![cfg_attr(not(test), no_std)] | 1 | #![cfg_attr(not(test), no_std)] |
| 2 | #![allow(async_fn_in_trait)] | 2 | #![allow(async_fn_in_trait)] |
| 3 | #![allow(unsafe_op_in_unsafe_fn)] | ||
| 3 | #![doc = include_str!("../README.md")] | 4 | #![doc = include_str!("../README.md")] |
| 4 | #![warn(missing_docs)] | 5 | #![warn(missing_docs)] |
| 5 | 6 | ||
| @@ -22,7 +23,7 @@ use crate::fmt::Bytes; | |||
| 22 | 23 | ||
| 23 | pub mod otg_v1; | 24 | pub mod otg_v1; |
| 24 | 25 | ||
| 25 | use otg_v1::{regs, vals, Otg}; | 26 | use otg_v1::{Otg, regs, vals}; |
| 26 | 27 | ||
| 27 | /// Handle interrupts. | 28 | /// Handle interrupts. |
| 28 | pub unsafe fn on_interrupt<const MAX_EP_COUNT: usize>(r: Otg, state: &State<MAX_EP_COUNT>, ep_count: usize) { | 29 | pub unsafe fn on_interrupt<const MAX_EP_COUNT: usize>(r: Otg, state: &State<MAX_EP_COUNT>, ep_count: usize) { |
| @@ -679,9 +680,7 @@ impl<'d, const MAX_EP_COUNT: usize> Bus<'d, MAX_EP_COUNT> { | |||
| 679 | if let Some(ep) = self.ep_in[i] { | 680 | if let Some(ep) = self.ep_in[i] { |
| 680 | trace!( | 681 | trace!( |
| 681 | "configuring tx fifo ep={}, offset={}, size={}", | 682 | "configuring tx fifo ep={}, offset={}, size={}", |
| 682 | i, | 683 | i, fifo_top, ep.fifo_size_words |
| 683 | fifo_top, | ||
| 684 | ep.fifo_size_words | ||
| 685 | ); | 684 | ); |
| 686 | 685 | ||
| 687 | let dieptxf = if i == 0 { regs.dieptxf0() } else { regs.dieptxf(i - 1) }; | 686 | let dieptxf = if i == 0 { regs.dieptxf0() } else { regs.dieptxf(i - 1) }; |
| @@ -1158,9 +1157,7 @@ impl<'d> embassy_usb_driver::EndpointIn for Endpoint<'d, In> { | |||
| 1158 | let dtxfsts = self.regs.dtxfsts(index).read(); | 1157 | let dtxfsts = self.regs.dtxfsts(index).read(); |
| 1159 | trace!( | 1158 | trace!( |
| 1160 | "write ep={:?}: diepctl {:08x} ftxfsts {:08x}", | 1159 | "write ep={:?}: diepctl {:08x} ftxfsts {:08x}", |
| 1161 | self.info.addr, | 1160 | self.info.addr, diepctl.0, dtxfsts.0 |
| 1162 | diepctl.0, | ||
| 1163 | dtxfsts.0 | ||
| 1164 | ); | 1161 | ); |
| 1165 | if !diepctl.usbaep() { | 1162 | if !diepctl.usbaep() { |
| 1166 | trace!("write ep={:?} wait for prev: error disabled", self.info.addr); | 1163 | trace!("write ep={:?} wait for prev: error disabled", self.info.addr); |
| @@ -1375,11 +1372,7 @@ fn ep_irq_mask(eps: &[Option<EndpointData>]) -> u16 { | |||
| 1375 | eps.iter().enumerate().fold( | 1372 | eps.iter().enumerate().fold( |
| 1376 | 0, | 1373 | 0, |
| 1377 | |mask, (index, ep)| { | 1374 | |mask, (index, ep)| { |
| 1378 | if ep.is_some() { | 1375 | if ep.is_some() { mask | (1 << index) } else { mask } |
| 1379 | mask | (1 << index) | ||
| 1380 | } else { | ||
| 1381 | mask | ||
| 1382 | } | ||
| 1383 | }, | 1376 | }, |
| 1384 | ) | 1377 | ) |
| 1385 | } | 1378 | } |
