mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-21 22:32:29 +00:00
[doc] Remove obsolete code sample
This commit is contained in:
parent
ea61c19280
commit
9505a6f752
@ -48,19 +48,6 @@ The `Spawner` is the way the main application spawns other tasks. The `Periphera
|
||||
include::example$basic/src/main.rs[lines="22..-1"]
|
||||
----
|
||||
|
||||
`#[embassy_executor::main]` takes an optional `config` parameter specifying a function that returns an instance of HAL's `Config` struct. For example:
|
||||
|
||||
```rust
|
||||
fn embassy_config() -> embassy_nrf::config::Config {
|
||||
embassy_nrf::config::Config::default()
|
||||
}
|
||||
|
||||
#[embassy_executor::main(config = "embassy_config()")]
|
||||
async fn main(_spawner: Spawner, p: embassy_nrf::Peripherals) {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
What happens when the `blinker` task has been spawned and main returns? Well, the main entry point is actually just like any other task, except that you can only have one and it takes some specific type arguments. The magic lies within the `#[embassy::main]` macro. The macro does the following:
|
||||
|
||||
. Creates an Embassy Executor
|
||||
|
Loading…
Reference in New Issue
Block a user