mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 08:12:30 +00:00
Update after review
This commit is contained in:
parent
092eef3ae7
commit
0d19dcc8e5
@ -77,9 +77,9 @@ The async version looks very similar to the HAL version, apart from a few minor
|
|||||||
* The peripheral initialization is done by the main macro, and is handed to the main task.
|
* The peripheral initialization is done by the main macro, and is handed to the main task.
|
||||||
* Before checking the button state, the application is awaiting a transition in the pin state (low -> high or high -> low).
|
* Before checking the button state, the application is awaiting a transition in the pin state (low -> high or high -> low).
|
||||||
|
|
||||||
When `button.awit_for_any_edge().await` is called, the executor will pause the main task and put the microcontroller in sleep mode. Internally, the Embassy HAL has configured the interrupt handler for the button (in `ExtiButton`), so that whenever an interrupt is raised, the task awaiting the button will be woken up.
|
When `button.await_for_any_edge().await` is called, the executor will pause the main task and put the microcontroller in sleep mode, unless there are other tasks that can run. Internally, the Embassy HAL has configured the interrupt handler for the button (in `ExtiButton`), so that whenever an interrupt is raised, the task awaiting the button will be woken up.
|
||||||
|
|
||||||
The overhead of the executor is minimal, and combined with the enormous simplification of the application, `async` is a great fit for embedded.
|
The minimal overhead of the executor and the ability to run multiple tasks "concurrently" combined with the enormous simplification of the application, makes `async` a great fit for embedded.
|
||||||
|
|
||||||
== Summary
|
== Summary
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user