Skip to content

Commit

Permalink
separate intstat_r, devcmdstat checks
Browse files Browse the repository at this point in the history
  • Loading branch information
conorpp authored and nickray committed Apr 23, 2021
1 parent df8f74f commit 17e63c4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/drivers/usbd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ where
usb.devcmdstat.modify(|_, w| w.dev_en().set_bit().dcon().set_bit());

// HERE TOO?
usb.inten.modify(|r, w| unsafe { w.bits(r.bits() | ((1 << 11) - 1)) } );
usb.inten.modify(|r, w| unsafe { w.bits(r.bits() | ((1 << 12) - 1)) } );
usb.inten.modify(|r, w| unsafe { w.bits(r.bits() | (1 << 31)) } );
});
}
Expand Down Expand Up @@ -328,11 +328,10 @@ where

// First handle endpoint 0 (the only control endpoint)
if intstat_r.ep0out().bit_is_set() {
if devcmdstat.read().setup().bit_is_set() {
ep_setup |= bit;
} else {
ep_out |= bit;
}
ep_out |= bit;
}
if devcmdstat.read().setup().bit_is_set() {
ep_setup |= bit;
}

if intstat_r.ep0in().bit_is_set() {
Expand Down

0 comments on commit 17e63c4

Please sign in to comment.