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 siestatus = regs.sie_status().read();
|
||||
let intrstatus = regs.intr().read();
|
||||
|
||||
if siestatus.resume() {
|
||||
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);
|
||||
}
|
||||
|
||||
if siestatus.suspended() {
|
||||
if siestatus.suspended() && intrstatus.dev_suspend() {
|
||||
regs.sie_status().write(|w| w.set_suspended(true));
|
||||
return Poll::Ready(Event::Suspend);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user