Skip to content

Commit

Permalink
Merge pull request #33 from vitalyvb/usb-device-3
Browse files Browse the repository at this point in the history
Update to usb-device 0.3.1
  • Loading branch information
ryan-summers authored Feb 2, 2024
2 parents 0590039 + aa1840d commit ca23b91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ keywords = ["no-std", "embedded", "usb"]
[dependencies]
vcell = "0.1.2"
cortex-m = "0.7.1"
usb-device = "0.2.3"
usb-device = "0.3.1"

[dev-dependencies]
stm32f1xx-hal = { version = "0.7.0", features = ["stm32f103"] }
3 changes: 2 additions & 1 deletion src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ trait EndpointTypeExt {
impl EndpointTypeExt for EndpointType {
fn bits(self) -> u8 {
const BITS: [u8; 4] = [0b01, 0b10, 0b00, 0b11];
return BITS[self as usize];
let transfer_type = self.to_bm_attributes() & 0b11;
return BITS[transfer_type as usize];
}
}

Expand Down

0 comments on commit ca23b91

Please sign in to comment.