3 unstable releases
0.6.1 | May 19, 2023 |
---|---|
0.6.0 | Nov 24, 2021 |
0.3.1 | Nov 15, 2020 |
#1435 in Asynchronous
35 downloads per month
Used in adafruit-featherwing-oled…
29KB
783 lines
nostd_async
Example
pub fn main() {
let runtime = nostd_async::Runtime::new();
let mut task = nostd_async::Task::new(async { println!("Hello World") });
let handle = task.spawn(&runtime);
handle.join();
}
Features
cortex-m
Enables Cortex-M Support.
- Disables interrupts when scheduling and descheduling tasks
- Waits for interrupts when there are no tasks remaining
wfe
Uses wfe
instead of wfi
if there are no pending tasks
lib.rs
:
Example
let runtime = nostd_async::Runtime::new();
let mut task = nostd_async::Task::new(async {
println!("Hello World");
42
});
let handle = task.spawn(&runtime);
assert_eq!(handle.join(), 42);
See more examples in the examples directory
Dependencies
~155KB