stm32/usb: add TODO: implement VBUS detection.
This commit is contained in:
parent
80407aa930
commit
5e6e18b310
@ -480,7 +480,12 @@ impl<'d, T: Instance> driver::Bus for Bus<'d, T> {
|
|||||||
poll_fn(move |cx| {
|
poll_fn(move |cx| {
|
||||||
BUS_WAKER.register(cx.waker());
|
BUS_WAKER.register(cx.waker());
|
||||||
|
|
||||||
if self.inited {
|
// TODO: implement VBUS detection.
|
||||||
|
if !self.inited {
|
||||||
|
self.inited = true;
|
||||||
|
return Poll::Ready(Event::PowerDetected);
|
||||||
|
}
|
||||||
|
|
||||||
let regs = T::regs();
|
let regs = T::regs();
|
||||||
|
|
||||||
if IRQ_RESUME.load(Ordering::Acquire) {
|
if IRQ_RESUME.load(Ordering::Acquire) {
|
||||||
@ -526,10 +531,6 @@ impl<'d, T: Instance> driver::Bus for Bus<'d, T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Poll::Pending
|
Poll::Pending
|
||||||
} else {
|
|
||||||
self.inited = true;
|
|
||||||
return Poll::Ready(Event::PowerDetected);
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user