diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-07-29 21:58:35 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-07-29 23:40:36 +0200 |
| commit | a0f1b0ee01d461607660d2d56b5b1bdc57e0d3fb (patch) | |
| tree | e60fc8f8db8ec07e55d655c1a830b07f4db0b7d2 /README.md | |
| parent | 8745d646f0976791b7098456aa61adb983fb1c18 (diff) | |
Split embassy crate into embassy-executor, embassy-util.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 12 |
1 files changed, 6 insertions, 6 deletions
| @@ -16,7 +16,7 @@ Rust's <a href="https://rust-lang.github.io/async-book/">async/await</a> allows | |||
| 16 | - <a href="https://docs.embassy.dev/embassy-nrf/">embassy-nrf</a>, for the Nordic Semiconductor nRF52, nRF53, nRF91 series. | 16 | - <a href="https://docs.embassy.dev/embassy-nrf/">embassy-nrf</a>, for the Nordic Semiconductor nRF52, nRF53, nRF91 series. |
| 17 | 17 | ||
| 18 | - **Time that Just Works** - | 18 | - **Time that Just Works** - |
| 19 | No more messing with hardware timers. <a href="https://docs.embassy.dev/embassy/git/thumbv7em-none-eabihf/time/index.html">embassy::time</a> provides Instant, Duration and Timer types that are globally available and never overflow. | 19 | No more messing with hardware timers. <a href="https://docs.embassy.dev/embassy/git/thumbv7em-none-eabihf/time/index.html">embassy_executor::time</a> provides Instant, Duration and Timer types that are globally available and never overflow. |
| 20 | 20 | ||
| 21 | - **Real-time ready** - | 21 | - **Real-time ready** - |
| 22 | Tasks on the same async executor run cooperatively, but you can create multiple executors with different priorities, so that higher priority tasks preempt lower priority ones. See the <a href="https://github.com/embassy-rs/embassy/blob/master/examples/nrf/src/bin/multiprio.rs">example</a>. | 22 | Tasks on the same async executor run cooperatively, but you can create multiple executors with different priorities, so that higher priority tasks preempt lower priority ones. See the <a href="https://github.com/embassy-rs/embassy/blob/master/examples/nrf/src/bin/multiprio.rs">example</a>. |
| @@ -44,13 +44,13 @@ The <a href="https://github.com/embassy-rs/nrf-softdevice">nrf-softdevice</a> cr | |||
| 44 | 44 | ||
| 45 | ```rust,ignore | 45 | ```rust,ignore |
| 46 | use defmt::info; | 46 | use defmt::info; |
| 47 | use embassy::executor::Spawner; | 47 | use embassy_executor::executor::Spawner; |
| 48 | use embassy::time::{Duration, Timer}; | 48 | use embassy_executor::time::{Duration, Timer}; |
| 49 | use embassy_nrf::gpio::{AnyPin, Input, Level, Output, OutputDrive, Pin, Pull}; | 49 | use embassy_nrf::gpio::{AnyPin, Input, Level, Output, OutputDrive, Pin, Pull}; |
| 50 | use embassy_nrf::Peripherals; | 50 | use embassy_nrf::Peripherals; |
| 51 | 51 | ||
| 52 | // Declare async tasks | 52 | // Declare async tasks |
| 53 | #[embassy::task] | 53 | #[embassy_executor::task] |
| 54 | async fn blink(pin: AnyPin) { | 54 | async fn blink(pin: AnyPin) { |
| 55 | let mut led = Output::new(pin, Level::Low, OutputDrive::Standard); | 55 | let mut led = Output::new(pin, Level::Low, OutputDrive::Standard); |
| 56 | 56 | ||
| @@ -64,7 +64,7 @@ async fn blink(pin: AnyPin) { | |||
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | // Main is itself an async task as well. | 66 | // Main is itself an async task as well. |
| 67 | #[embassy::main] | 67 | #[embassy_executor::main] |
| 68 | async fn main(spawner: Spawner, p: Peripherals) { | 68 | async fn main(spawner: Spawner, p: Peripherals) { |
| 69 | // Spawned tasks run in the background, concurrently. | 69 | // Spawned tasks run in the background, concurrently. |
| 70 | spawner.spawn(blink(p.P0_13.degrade())).unwrap(); | 70 | spawner.spawn(blink(p.P0_13.degrade())).unwrap(); |
| @@ -132,7 +132,7 @@ Embassy is guaranteed to compile on the latest stable Rust version at the time o | |||
| 132 | 132 | ||
| 133 | Several features require nightly: | 133 | Several features require nightly: |
| 134 | 134 | ||
| 135 | - The `#[embassy::main]` and `#[embassy::task]` attribute macros. | 135 | - The `#[embassy_executor::main]` and `#[embassy_executor::task]` attribute macros. |
| 136 | - Async traits | 136 | - Async traits |
| 137 | 137 | ||
| 138 | These are enabled by activating the `nightly` Cargo feature. If you do so, Embassy is guaranteed to compile on the exact nightly version specified in `rust-toolchain.toml`. It might compile with older or newer nightly versions, but that may change in any new patch release. | 138 | These are enabled by activating the `nightly` Cargo feature. If you do so, Embassy is guaranteed to compile on the exact nightly version specified in `rust-toolchain.toml`. It might compile with older or newer nightly versions, but that may change in any new patch release. |
