Embassy Executor — Crate 詳細
Embassy Executor
Beta no_std
組み込み向け async/await 実行環境(エグゼキュータ)。割り込み駆動・スレッド駆動など複数の実行モデルをサポートし、static ベースのタスク生成でヒープ不要の構成も可能。
Async executor for embedded systems, part of the embassy project.
コード例
タスクを spawn して周期処理を実行します。
#![no_std]#![no_main]
use embassy_executor::Spawner;use embassy_time::{Duration, Timer};use {defmt_rtt as _, panic_probe as _};
#[embassy_executor::task]async fn worker() { loop { defmt::info!("tick"); Timer::after(Duration::from_millis(500)).await; }}
#[embassy_executor::main]async fn main(spawner: Spawner) { spawner.spawn(worker()).unwrap(); core::future::pending::<()>().await;}