コンテンツにスキップ

Embassy Executor — Crate 詳細

Embassy Executor

Beta no_std

組み込み向け async/await 実行環境(エグゼキュータ)。割り込み駆動・スレッド駆動など複数の実行モデルをサポートし、static ベースのタスク生成でヒープ不要の構成も可能。

Async executor for embedded systems, part of the embassy project.

バージョン
0.5.0
ライセンス
MIT OR Apache-2.0
メンテナンス
活発に開発中

コード例

タスクを spawn して周期処理を実行します。

最小の async タスク実行
#![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;
}

関連 Crates

関連記事