mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-26 00:32:33 +00:00
Merge pull request #1649 from simmsb/master
rp: Check intrstatus before signalling suspended
This commit is contained in:
commit
7b36fe049d
@ -361,6 +361,7 @@ impl<'d, T: Instance> driver::Bus for Bus<'d, T> {
|
|||||||
|
|
||||||
let regs = T::regs();
|
let regs = T::regs();
|
||||||
let siestatus = regs.sie_status().read();
|
let siestatus = regs.sie_status().read();
|
||||||
|
let intrstatus = regs.intr().read();
|
||||||
|
|
||||||
if siestatus.resume() {
|
if siestatus.resume() {
|
||||||
regs.sie_status().write(|w| w.set_resume(true));
|
regs.sie_status().write(|w| w.set_resume(true));
|
||||||
@ -389,7 +390,7 @@ impl<'d, T: Instance> driver::Bus for Bus<'d, T> {
|
|||||||
return Poll::Ready(Event::Reset);
|
return Poll::Ready(Event::Reset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if siestatus.suspended() {
|
if siestatus.suspended() && intrstatus.dev_suspend() {
|
||||||
regs.sie_status().write(|w| w.set_suspended(true));
|
regs.sie_status().write(|w| w.set_suspended(true));
|
||||||
return Poll::Ready(Event::Suspend);
|
return Poll::Ready(Event::Suspend);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user