diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-09-26 12:35:33 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-09-26 12:35:33 +0200 |
| commit | f4f58249722bc656a13865e06535d208440c3e4a (patch) | |
| tree | e5fd41f7c32bb479791d2ec16327e938efce0501 /embassy-usb/src | |
| parent | 7f7c14b7bce5b84eb27c8122535a96a6f0e5dd77 (diff) | |
usb: do not allow converting Directon to/from u8
Diffstat (limited to 'embassy-usb/src')
| -rw-r--r-- | embassy-usb/src/control.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/embassy-usb/src/control.rs b/embassy-usb/src/control.rs index 9e0dee888..d6d0c6565 100644 --- a/embassy-usb/src/control.rs +++ b/embassy-usb/src/control.rs | |||
| @@ -106,7 +106,7 @@ impl Request { | |||
| 106 | let recipient = rt & 0b11111; | 106 | let recipient = rt & 0b11111; |
| 107 | 107 | ||
| 108 | Request { | 108 | Request { |
| 109 | direction: rt.into(), | 109 | direction: if rt & 0x80 == 0 { Direction::Out } else { Direction::In }, |
| 110 | request_type: unsafe { mem::transmute((rt >> 5) & 0b11) }, | 110 | request_type: unsafe { mem::transmute((rt >> 5) & 0b11) }, |
| 111 | recipient: if recipient <= 3 { | 111 | recipient: if recipient <= 3 { |
| 112 | unsafe { mem::transmute(recipient) } | 112 | unsafe { mem::transmute(recipient) } |
