usb: do not allow converting Directon to/from u8
This commit is contained in:
@ -106,7 +106,7 @@ impl Request {
|
||||
let recipient = rt & 0b11111;
|
||||
|
||||
Request {
|
||||
direction: rt.into(),
|
||||
direction: if rt & 0x80 == 0 { Direction::Out } else { Direction::In },
|
||||
request_type: unsafe { mem::transmute((rt >> 5) & 0b11) },
|
||||
recipient: if recipient <= 3 {
|
||||
unsafe { mem::transmute(recipient) }
|
||||
|
Reference in New Issue
Block a user