avr: sleep fix

This commit is contained in:
sodo 2024-01-02 14:48:27 +09:00
parent 6ee153a3e2
commit b0071c5070

View File

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