Skip to content

Commit ca23b91

Browse files
authored
Merge pull request #33 from vitalyvb/usb-device-3
Update to usb-device 0.3.1
2 parents 0590039 + aa1840d commit ca23b91

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ keywords = ["no-std", "embedded", "usb"]
1212
[dependencies]
1313
vcell = "0.1.2"
1414
cortex-m = "0.7.1"
15-
usb-device = "0.2.3"
15+
usb-device = "0.3.1"
1616

1717
[dev-dependencies]
1818
stm32f1xx-hal = { version = "0.7.0", features = ["stm32f103"] }

src/endpoint.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ trait EndpointTypeExt {
237237
impl EndpointTypeExt for EndpointType {
238238
fn bits(self) -> u8 {
239239
const BITS: [u8; 4] = [0b01, 0b10, 0b00, 0b11];
240-
return BITS[self as usize];
240+
let transfer_type = self.to_bm_attributes() & 0b11;
241+
return BITS[transfer_type as usize];
241242
}
242243
}
243244

0 commit comments

Comments
 (0)