Skip to content

Commit 17e63c4

Browse files
conorppnickray
authored andcommitted
separate intstat_r, devcmdstat checks
1 parent df8f74f commit 17e63c4

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/drivers/usbd.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ where
233233
usb.devcmdstat.modify(|_, w| w.dev_en().set_bit().dcon().set_bit());
234234

235235
// HERE TOO?
236-
usb.inten.modify(|r, w| unsafe { w.bits(r.bits() | ((1 << 11) - 1)) } );
236+
usb.inten.modify(|r, w| unsafe { w.bits(r.bits() | ((1 << 12) - 1)) } );
237237
usb.inten.modify(|r, w| unsafe { w.bits(r.bits() | (1 << 31)) } );
238238
});
239239
}
@@ -328,11 +328,10 @@ where
328328

329329
// First handle endpoint 0 (the only control endpoint)
330330
if intstat_r.ep0out().bit_is_set() {
331-
if devcmdstat.read().setup().bit_is_set() {
332-
ep_setup |= bit;
333-
} else {
334-
ep_out |= bit;
335-
}
331+
ep_out |= bit;
332+
}
333+
if devcmdstat.read().setup().bit_is_set() {
334+
ep_setup |= bit;
336335
}
337336

338337
if intstat_r.ep0in().bit_is_set() {

0 commit comments

Comments
 (0)