diff --git a/slides/lectures/fils_en/04/slides.md b/slides/lectures/fils_en/04/slides.md index c2c97133de7602cf23b52e024f1caca63663dfd8..03459ea2aa25efc01ad6a1a89e6c8c0d57d63974 100644 --- a/slides/lectures/fils_en/04/slides.md +++ b/slides/lectures/fils_en/04/slides.md @@ -11,7 +11,7 @@ drawings: defaults: foo: true transition: slide-left -title: MA - 05 - Asynchronous Development +title: MA - 04 - Asynchronous Development mdc: true layout: cover themeConfig: @@ -22,7 +22,7 @@ background: --- # Asynchronous Development -Lecture 5 +Lecture 4 --- --- diff --git a/slides/lectures/fils_en/05/slides.md b/slides/lectures/fils_en/05/slides.md index 2da2050cdf19c67721448d7b9c8ea6598358185f..b46c46e18a286a16219c9ba9a2b5ddd2de8d9fc0 100644 --- a/slides/lectures/fils_en/05/slides.md +++ b/slides/lectures/fils_en/05/slides.md @@ -11,7 +11,7 @@ drawings: defaults: foo: true transition: slide-left -title: MA - 03 - UART & SPI +title: MA - 05 - UART & SPI mdc: true layout: cover themeConfig: @@ -22,7 +22,7 @@ background: --- # UART & SPI -Lecture 6 +Lecture 5 --- diff --git a/slides/lectures/fils_en/06/slides.md b/slides/lectures/fils_en/06/slides.md index 6483085153d8915f0f04f072c1ca2de27c732958..eee4ee102f0adb66329aca1c8d29dc40e3b1a49b 100644 --- a/slides/lectures/fils_en/06/slides.md +++ b/slides/lectures/fils_en/06/slides.md @@ -11,7 +11,7 @@ drawings: defaults: foo: true transition: slide-left -title: MA - 07 - I2C & USB 2.0 +title: MA - 06 - I2C & USB 2.0 mdc: true layout: cover themeConfig: @@ -22,7 +22,7 @@ background: --- # I2C & USB 2.0 -Lecture 7 +Lecture 6 --- diff --git a/slides/lectures/fils_en/07/slides.md b/slides/lectures/fils_en/07/slides.md index 864f9806c71dfe98fd5a157428901dd4a954d683..9df110dd6aa42e7b12b8b170e3862a17baa44fad 100644 --- a/slides/lectures/fils_en/07/slides.md +++ b/slides/lectures/fils_en/07/slides.md @@ -11,7 +11,7 @@ drawings: defaults: foo: true transition: slide-left -title: MA - 03 - Exceptions and Interrupts +title: MA - 07 - Exceptions and Interrupts mdc: true layout: cover themeConfig: @@ -22,7 +22,7 @@ background: --- # Exceptions and Interrupts -Lecture 3 +Lecture 7 --- diff --git a/slides/lectures/resources/communication/slides.md b/slides/lectures/resources/communication/slides.md index 20a7d83f1a5af28dd0a007949fda7487ed5b2345..66ab5ab169968805436d4dc19e4dacab9a1322f7 100644 --- a/slides/lectures/resources/communication/slides.md +++ b/slides/lectures/resources/communication/slides.md @@ -119,8 +119,8 @@ Embassy provides four types of channels synchronized using `Mutex`s |-|-| | [`Channel`](https://docs.embassy.dev/embassy-sync/git/default/channel/struct.Channel.html) | A Multiple Producer Multiple Consumer (MPMC) channel. Each message is only received by a single consumer. | | [`PriorityChannel`](https://docs.embassy.dev/embassy-sync/git/default/priority_channel/struct.PriorityChannel.html) | A Multiple Producer Multiple Consumer (MPMC) channel. Each message is only received by a single consumer. Higher priority items are shifted to the front of the channel. | -| [`Signal`](https://docs.embassy.dev/embassy-sync/git/default/pubsub/struct.PubSubChannel.html) | Signalling latest value to a single consumer. | -| [`PubSubChannel`](https://docs.embassy.dev/embassy-sync/git/default/signal/struct.Signal.html) | A broadcast channel (publish-subscribe) channel. Each message is received by all consumers. | +| [`Signal`](https://docs.embassy.dev/embassy-sync/git/default/signal/struct.Signal.html) | Signalling latest value to a single consumer. | +| [`PubSubChannel`](https://docs.embassy.dev/embassy-sync/git/default/pubsub/struct.PubSubChannel.html) | A broadcast channel (publish-subscribe) channel. Each message is received by all consumers. | --- --- @@ -129,7 +129,7 @@ sends data from one task to another [`Channel`](https://docs.embassy.dev/embassy-sync/git/default/channel/struct.Channel.html) - A Multiple Producer Multiple Consumer (MPMC) channel. Each message is only received by a single consumer. -[`Signal`](https://docs.embassy.dev/embassy-sync/git/default/pubsub/struct.PubSubChannel.html) - Signalling latest value to a single consumer. +[`Signal`](https://docs.embassy.dev/embassy-sync/git/default/signal/struct.Signal.html) - Signalling latest value to a single consumer. ```mermaid flowchart LR @@ -166,7 +166,7 @@ flowchart LR # PubSubChannel sends data from one task to all receiver tasks -[`PubSubChannel`](https://docs.embassy.dev/embassy-sync/git/default/signal/struct.Signal.html) - A broadcast channel (publish-subscribe) channel. Each message is received by all consumers. +[`PubSubChannel`](https://docs.embassy.dev/embassy-sync/git/default/pubsub/struct.PubSubChannel.html) - A broadcast channel (publish-subscribe) channel. Each message is received by all consumers. ```mermaid flowchart LR @@ -181,7 +181,7 @@ flowchart LR # Channel Example -```rust{all|1|2|5,7,14,17-25|5,8-14} +```rust{1|2|5,7,14,17-25|5,8-14|all} enum LedState { On, Off } static CHANNEL: Channel<ThreadModeRawMutex, LedState, 64> = Channel::new(); diff --git a/slides/lectures/resources/concurrency/slides.md b/slides/lectures/resources/concurrency/slides.md index a00a93de84044f6268450a4304e6c1dc8d3836e5..66e51965085bd685502e3e2e02f7a9d133634837 100644 --- a/slides/lectures/resources/concurrency/slides.md +++ b/slides/lectures/resources/concurrency/slides.md @@ -22,7 +22,7 @@ layout: two-cols } </style> -- MCUs are usually *single core*[^rp2040] +- MCUs are usually *single core*[^rp2350] - Tasks in parallel require an OS[^interrupts] - Tasks can be suspended at any time - **Switching** the task is **expensive** @@ -54,7 +54,7 @@ sequenceDiagram end ``` -[^rp2040]: RP2040 is a dual core MCU, we use only one core +[^rp2350]: RP2350 is a dual core MCU, we use only one core [^interrupts]: Running in an ISR is not considered a normal task --- diff --git a/slides/lectures/resources/executor/slides.md b/slides/lectures/resources/executor/slides.md index b1c101fc13c0cab2fc9d704e77f4444b61d00ed7..4a742b3087cf8120bd50de293732e8c7aeb6dd79 100644 --- a/slides/lectures/resources/executor/slides.md +++ b/slides/lectures/resources/executor/slides.md @@ -9,10 +9,10 @@ of Embassy # Bibliography for this section -**Embassy Documentation**, *[Embassy executor](https://embassy.dev/book/dev/runtime.html)* +**Embassy Documentation**, *[Embassy executor](https://embassy.dev/book/#_embassy_executor)* --- ---- + # Tasks <div grid="~ cols-2 gap5"> @@ -32,9 +32,9 @@ for this section </div> -```rust {all|9-22|1-7|18-21|19|3-6|4|5} +```rust {9-22|1-7|18-21|19|3-6|4|5|all} #[embassy_executor::task(pool_size = 2)] -async fn led_blink(mut led:Output<'static, PIN_X>) { +async fn led_blink(mut led: AnyPin) { loop { led.toogle(); Timer::after_secs(1).await; @@ -60,7 +60,7 @@ async fn main(spawner: Spawner) { </div> --- ---- + # Tasks can stop the executor <div grid="~ cols-2 gap5"> @@ -73,9 +73,9 @@ async fn main(spawner: Spawner) { </div> -``` {all|5-8|3-9} +```rust {5-8|3-9|all} #[embassy_executor::task] -async fn led_blink(mut led:Output<'static, PIN_X>) { +async fn led_blink(mut led: AnyPin) { loop { led.toogle(); // this does not execute anything @@ -114,6 +114,7 @@ async fn main(spawner: Spawner) { --- layout: two-cols --- + ## Priority Tasks <style> @@ -139,7 +140,7 @@ unsafe fn SWI_IRQ_0() { :: right :: -```rust {all|5,6,22|1,7-10|2,12-15|3,17-21} +```rust {5,6,22|1,7-10|2,12-15|3,17-21|all} static EXECUTOR_HIGH: InterruptExecutor = InterruptExecutor::new(); static EXECUTOR_MED: InterruptExecutor = InterruptExecutor::new(); static EXECUTOR_LOW: StaticCell<Executor> = StaticCell::new(); diff --git a/slides/lectures/resources/future/slides.md b/slides/lectures/resources/future/slides.md index 723a8ce6fa28bb82948e14aad1db3278a56521b2..c9d5df8f1588d61af7732679a6349ccb8e842682 100644 --- a/slides/lectures/resources/future/slides.md +++ b/slides/lectures/resources/future/slides.md @@ -33,7 +33,7 @@ trait Future { } ``` -```rust {all|5,10|6|6,7|6|6,7|6|6,8|1,8}{lines: false} +```rust {5,10|6|6,7|6|6,7|6|6,8|1,8|all}{lines: false} fn execute<F>(mut f: F) -> F::Output where F: Future @@ -74,7 +74,7 @@ sequenceDiagram <div grid="~ cols-2 gap-5"> -```rust {all|1-4|6-9|11-18} +```rust {1-4|6-9|11-18|all} enum SleepStatus { SetAlarm, WaitForAlarm, @@ -97,7 +97,7 @@ impl Sleep { <v-click> -```rust {all|1,20|1,2,20|4,19|5,18|6-10|11-17|11,12,13|11,14,15}{lines: false} +```rust {1,20|1,2,20|4,19|5,18|6-10|11-17|11,12,13|11,14,15|all}{lines: false} impl Future for Sleep { type Output = (); @@ -130,7 +130,7 @@ impl Future for Sleep { <div grid="~ cols-2 gap-5"> -```rust {all|1,20|1,2,20|4,19|5,18|6-10|11-17|11,12,13|11,14,15}{lines: false} +```rust {1,20|1,2,20|4,19|5,18|6-10|11-17|11,12,13|11,14,15|all}{lines: false} impl Future for Sleep { type Output = (); @@ -218,7 +218,7 @@ fn blink(led: Output<'static, PIN_X>) -> Blink { <v-click> -```rust {4-23|5-22|5,6-10,22|5,11-17,22|12-14|5,11-17,22|12,14,15,16|5,18-21,22}{lines: false} +```rust {4-23|5-22|5,6-10,22|5,11-17,22|12-14|5,11-17,22|12,14,15,16|5,18-21,22|all}{lines: false} impl Future for Blink { type Output = (); fn poll(&mut self) -> Poll<Self::Output> { @@ -257,7 +257,7 @@ impl Future for Blink { - it does not know how to execute them - executors are implemented into third party libraries -```rust {all|12|11,13,15|14} +```rust {12|11,13,15|14|all} use engine::execute; // Rust rewrites the function to a Future @@ -280,7 +280,7 @@ fn main() -> ! { --- # Executor -```rust {all|1|4-16|5-12|14,15} +```rust {1|4-16|5-12|14,15|all} static TASKS: [Option<impl Future>; N] = [None, N]; fn executor() {