Merge pull request #4012 from adom-inc/rp2350-adc-fix
rp/adc: fix potential race condition
This commit is contained in:
commit
d097ccc68c
@ -205,11 +205,13 @@ impl<'d> Adc<'d, Async> {
|
|||||||
|
|
||||||
fn wait_for_ready() -> impl Future<Output = ()> {
|
fn wait_for_ready() -> impl Future<Output = ()> {
|
||||||
let r = Self::regs();
|
let r = Self::regs();
|
||||||
r.inte().write(|w| w.set_fifo(true));
|
|
||||||
compiler_fence(Ordering::SeqCst);
|
|
||||||
|
|
||||||
poll_fn(move |cx| {
|
poll_fn(move |cx| {
|
||||||
WAKER.register(cx.waker());
|
WAKER.register(cx.waker());
|
||||||
|
|
||||||
|
r.inte().write(|w| w.set_fifo(true));
|
||||||
|
compiler_fence(Ordering::SeqCst);
|
||||||
|
|
||||||
if r.cs().read().ready() {
|
if r.cs().read().ready() {
|
||||||
return Poll::Ready(());
|
return Poll::Ready(());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user