Check intrstatus before signalling suspended

This commit is contained in:
Ben Simms 2023-07-13 19:29:09 +01:00
parent d979841f17
commit 460cdc9e0f
No known key found for this signature in database
GPG key ID: 6BE6D0D71F2E9A27

View file

@ -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);
} }