aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cyw43/src/runner.rs7
-rw-r--r--examples/rp/Cargo.toml3
2 files changed, 10 insertions, 0 deletions
diff --git a/cyw43/src/runner.rs b/cyw43/src/runner.rs
index 6522d40fa..959718341 100644
--- a/cyw43/src/runner.rs
+++ b/cyw43/src/runner.rs
@@ -365,6 +365,13 @@ where
365 } 365 }
366 Either4::Fourth(()) => { 366 Either4::Fourth(()) => {
367 self.handle_irq(&mut buf).await; 367 self.handle_irq(&mut buf).await;
368
369 // If we do busy-polling, make sure to yield.
370 // `handle_irq` will only do a 32bit read if there's no work to do, which is really fast.
371 // Depending on optimization level, it is possible that the 32-bit read finishes on
372 // first poll, so it never yields and we starve all other tasks.
373 #[cfg(feature = "bluetooth")]
374 embassy_futures::yield_now().await;
368 } 375 }
369 } 376 }
370 } else { 377 } else {
diff --git a/examples/rp/Cargo.toml b/examples/rp/Cargo.toml
index 2884ca85a..031f68253 100644
--- a/examples/rp/Cargo.toml
+++ b/examples/rp/Cargo.toml
@@ -64,8 +64,11 @@ trouble-host = { version = "0.1.0", features = ["defmt", "gatt"] }
64 64
65[profile.release] 65[profile.release]
66debug = 2 66debug = 2
67lto = true
68opt-level = 'z'
67 69
68[profile.dev] 70[profile.dev]
71debug = 2
69lto = true 72lto = true
70opt-level = "z" 73opt-level = "z"
71 74