You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/faq.adoc
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,7 +171,11 @@ Note that the git revision should match any other embassy patches or git depende
171
171
172
172
== Can I use manual ISRs alongside Embassy?
173
173
174
-
Yes! This can be useful if you need to respond to an event as fast as possible, and the latency caused by the usual “ISR, wake, return from ISR, context switch to woken task” flow is too much for your application. Simply define a `#[interrupt] fn INTERRUPT_NAME() {}` handler as you would link:https://docs.rust-embedded.org/book/start/interrupts.html[in any other embedded rust project].
174
+
Yes! This can be useful if you need to respond to an event as fast as possible, and the latency caused by the usual “ISR, wake, return from ISR, context switch to woken task” flow is too much for your application.
175
+
176
+
You may simply define a `#[interrupt] fn INTERRUPT_NAME() {}` handler as you would link:https://docs.rust-embedded.org/book/start/interrupts.html[in any other embedded rust project].
177
+
178
+
Or you may define a struct implementing the `embassy-[family]::interrupt::typelevel::Handler` trait with an on_interrupt() method, and bind it to the interrupt vector via the `bind_interrupts!` macro, which introduces only a single indirection. This allows the mixing of manual ISRs with Embassy driver-defined ISRs; handlers will be called directly in the order they appear in the macro.
175
179
176
180
== How can I measure resource usage (CPU, RAM, etc.)?
Copy file name to clipboardExpand all lines: docs/pages/layer_by_layer.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ The async version looks very similar to the HAL version, apart from a few minor
76
76
* The peripheral initialization is done by the main macro, and is handed to the main task.
77
77
* Before checking the button state, the application is awaiting a transition in the pin state (low -> high or high -> low).
78
78
79
-
When `button.wait_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 `ExtiInput`), so that whenever an interrupt is raised, the task awaiting the button will be woken up.
79
+
When `button.wait_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. On this chip, interrupt signals on EXTI lines 10-15 (including the button on EXTI line 13) raise the hardware interrupt EXTI15_10. This interrupt handler has been bound (using `bind_interrupts!`) to call the `InterruptHandler` provided by the exti module, so that whenever an interrupt is raised, the task awaiting the button via `wait_for_any_edge()` will be woken up.
80
80
81
81
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.
/// [Enum-level Interrupt](InterruptEnum), which may be the same for multiple channels.
379
+
fnirq(&self) -> InterruptEnum;
380
+
/// [Type-level Interrupt](InterruptType), which may be the same for multiple channels.
381
+
typeIRQ:InterruptType;
364
382
}
365
383
366
-
/// Type-erased EXTI channel.
384
+
//Doc isn't hidden in order to surface the explanation to users, even though it's completely inoperable, not just deprecated.
385
+
//Entire type along with doc can probably be removed after deprecation has appeared in a release once.
386
+
/// Deprecated type-erased EXTI channel.
367
387
///
368
-
/// This represents ownership over any EXTI channel, known at runtime.
388
+
/// Support for AnyChannel was removed in order to support manually bindable EXTI interrupts via bind_interrupts; [ExtiInput::new()]
389
+
/// must know the required IRQ at compile time, and therefore cannot support type-erased channels.
390
+
#[deprecated = "type-erased EXTI channels are no longer supported, in order to support manually bindable EXTI interrupts (more info: https://github.com/embassy-rs/embassy/pull/4922)"]
0 commit comments