avr: sleep fix
This commit is contained in:
parent
6ee153a3e2
commit
b0071c5070
1 changed files with 5 additions and 2 deletions
|
@ -57,10 +57,13 @@ mod thread {
|
|||
|
||||
loop {
|
||||
unsafe {
|
||||
avr_device::interrupt::disable();
|
||||
if SIGNAL_WORK_THREAD_MODE.swap(false, Ordering::SeqCst) {
|
||||
self.inner.poll();
|
||||
} else {
|
||||
avr_device::interrupt::enable();
|
||||
avr_device::asm::sleep();
|
||||
} else {
|
||||
avr_device::interrupt::enable();
|
||||
self.inner.poll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue