mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-21 22:32:29 +00:00
Merge pull request #3242 from embassy-rs/cyw43-pls-yield
cyw43: make sure to yield if doing busy-polling for interrupts.
This commit is contained in:
commit
b55726c515
@ -365,6 +365,13 @@ where
|
||||
}
|
||||
Either4::Fourth(()) => {
|
||||
self.handle_irq(&mut buf).await;
|
||||
|
||||
// If we do busy-polling, make sure to yield.
|
||||
// `handle_irq` will only do a 32bit read if there's no work to do, which is really fast.
|
||||
// Depending on optimization level, it is possible that the 32-bit read finishes on
|
||||
// first poll, so it never yields and we starve all other tasks.
|
||||
#[cfg(feature = "bluetooth")]
|
||||
embassy_futures::yield_now().await;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -64,8 +64,11 @@ trouble-host = { version = "0.1.0", features = ["defmt", "gatt"] }
|
||||
|
||||
[profile.release]
|
||||
debug = 2
|
||||
lto = true
|
||||
opt-level = 'z'
|
||||
|
||||
[profile.dev]
|
||||
debug = 2
|
||||
lto = true
|
||||
opt-level = "z"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user