Comments (1)
I'm not entirely sure what you're asking or if my answer is relevant to you, but the way to create a timer is this:
use embassy_time::{Timer, Duration};
Timer::after(Duration::from_millis(20)).await
You can then combine the timer with other things such as the read:
use embassy_futures::select::{select, Either};
match select(Timer::after(Duration::from_millis(20)), rx.read_until_idle(&mut buf)).await {
Either::First(_) => {} // Timer fired!
Either::Second(_) => {} // Data was read
}
It's not entirely clear to me why you'd want to do this, because read_until_idle kinda does what you describe internally, waiting until the RX is idle before returning.
from embassy.
Related Issues (20)
- Re-add stm32 flash otp support?
- wrong reading stride on `uid::uid_hex()` HOT 6
- stm32h7: RNG locks up HOT 4
- stm32f401 Hardfault in i2cv1 write_frame (only with SPI enabled) HOT 1
- STM32H7 Sdmmc not functional
- Signal and !Send types? HOT 1
- `defmt` serial example? HOT 1
- STM32F373 does not have methods for using ADC
- LNK2019: unresolved external symbol HOT 1
- embassy-net does not have feature 'raw'. HOT 2
- Large arena causes memory errors and strange behaviour? HOT 4
- Getting started with nrf 52840 Error: No debug probes were found. HOT 7
- Examples should have a "different chip" checklist HOT 1
- macro expansion broken on latest nightly (2024-06-13) HOT 2
- Panick in examples/stm32h5/button_exti.rs when pressing the button HOT 2
- Do not set PLLSAI dividers in LTDC code
- Help wanted: embassy-net-ppp HOT 1
- Cannot create ospi instance for stm32h7b0 HOT 4
- STM32F1: `<ADC1 as SealedRccPeripheral>::frequency()` is wrong
- embassy_stm32: `rcc::frequency()` is UB if called before `init()`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from embassy.