Skip to content

Commit 1cfc55c

Browse files
committed
Implement is_stalled()
1 parent a03fc7a commit 1cfc55c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

mod.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,15 @@ impl UsbBus for Usbd<'_> {
563563
}
564564

565565
fn is_stalled(&self, ep_addr: EndpointAddress) -> bool {
566-
unimplemented!("is_stalled(ep={:?})", ep_addr);
566+
interrupt::free(|cs| {
567+
let regs = self.periph.borrow(cs);
568+
569+
let i = ep_addr.index();
570+
match ep_addr.direction() {
571+
UsbDirection::Out => regs.halted.epout[i].read().getstatus().is_halted(),
572+
UsbDirection::In => regs.halted.epin[i].read().getstatus().is_halted(),
573+
}
574+
})
567575
}
568576

569577
#[inline]

0 commit comments

Comments
 (0)