#async #no-std

no-std nostd_async

An asyncronous runtime for a single-threaded no_std environment

3 unstable releases

0.6.1 May 19, 2023
0.6.0 Nov 24, 2021
0.3.1 Nov 15, 2020

#1131 in Embedded development

Download history 14/week @ 2023-12-11 97/week @ 2024-01-01 163/week @ 2024-01-29 115/week @ 2024-02-05 180/week @ 2024-02-12 267/week @ 2024-02-19 154/week @ 2024-02-26 58/week @ 2024-03-04 59/week @ 2024-03-11 45/week @ 2024-03-18 35/week @ 2024-03-25

214 downloads per month
Used in 2 crates

MIT license

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