aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-04-07 16:16:13 +0000
committerGitHub <[email protected]>2024-04-07 16:16:13 +0000
commita4eebdcc6895d6b530e38fbf652bc1a4df00ab0c (patch)
treee636106f1c364f6f6ed02912c314c6343503b3c8
parent328cb99068c3b75489969406dceddc7783882df1 (diff)
parenteffc08dde34c39da3f6bb4363d517de4f5c1ddd4 (diff)
Merge pull request #2785 from barnabywalters/stm32-multiprio
[embassy-stm32] added comments explaining multiprio interrupts
-rw-r--r--examples/stm32f0/src/bin/multiprio.rs5
-rw-r--r--examples/stm32f3/src/bin/multiprio.rs5
-rw-r--r--examples/stm32f4/src/bin/multiprio.rs5
-rw-r--r--examples/stm32h7/src/bin/multiprio.rs5
4 files changed, 20 insertions, 0 deletions
diff --git a/examples/stm32f0/src/bin/multiprio.rs b/examples/stm32f0/src/bin/multiprio.rs
index e49951726..1c3f3991a 100644
--- a/examples/stm32f0/src/bin/multiprio.rs
+++ b/examples/stm32f0/src/bin/multiprio.rs
@@ -126,6 +126,11 @@ fn main() -> ! {
126 // Initialize and create handle for devicer peripherals 126 // Initialize and create handle for devicer peripherals
127 let _p = embassy_stm32::init(Default::default()); 127 let _p = embassy_stm32::init(Default::default());
128 128
129 // STM32s don’t have any interrupts exclusively for software use, but they can all be triggered by software as well as
130 // by the peripheral, so we can just use any free interrupt vectors which aren’t used by the rest of your application.
131 // In this case we’re using UART1 and UART2, but there’s nothing special about them. Any otherwise unused interrupt
132 // vector would work exactly the same.
133
129 // High-priority executor: USART1, priority level 6 134 // High-priority executor: USART1, priority level 6
130 interrupt::USART1.set_priority(Priority::P6); 135 interrupt::USART1.set_priority(Priority::P6);
131 let spawner = EXECUTOR_HIGH.start(interrupt::USART1); 136 let spawner = EXECUTOR_HIGH.start(interrupt::USART1);
diff --git a/examples/stm32f3/src/bin/multiprio.rs b/examples/stm32f3/src/bin/multiprio.rs
index 328447210..87830b416 100644
--- a/examples/stm32f3/src/bin/multiprio.rs
+++ b/examples/stm32f3/src/bin/multiprio.rs
@@ -127,6 +127,11 @@ fn main() -> ! {
127 127
128 let _p = embassy_stm32::init(Default::default()); 128 let _p = embassy_stm32::init(Default::default());
129 129
130 // STM32s don’t have any interrupts exclusively for software use, but they can all be triggered by software as well as
131 // by the peripheral, so we can just use any free interrupt vectors which aren’t used by the rest of your application.
132 // In this case we’re using UART4 and UART5, but there’s nothing special about them. Any otherwise unused interrupt
133 // vector would work exactly the same.
134
130 // High-priority executor: UART4, priority level 6 135 // High-priority executor: UART4, priority level 6
131 interrupt::UART4.set_priority(Priority::P6); 136 interrupt::UART4.set_priority(Priority::P6);
132 let spawner = EXECUTOR_HIGH.start(interrupt::UART4); 137 let spawner = EXECUTOR_HIGH.start(interrupt::UART4);
diff --git a/examples/stm32f4/src/bin/multiprio.rs b/examples/stm32f4/src/bin/multiprio.rs
index 328447210..87830b416 100644
--- a/examples/stm32f4/src/bin/multiprio.rs
+++ b/examples/stm32f4/src/bin/multiprio.rs
@@ -127,6 +127,11 @@ fn main() -> ! {
127 127
128 let _p = embassy_stm32::init(Default::default()); 128 let _p = embassy_stm32::init(Default::default());
129 129
130 // STM32s don’t have any interrupts exclusively for software use, but they can all be triggered by software as well as
131 // by the peripheral, so we can just use any free interrupt vectors which aren’t used by the rest of your application.
132 // In this case we’re using UART4 and UART5, but there’s nothing special about them. Any otherwise unused interrupt
133 // vector would work exactly the same.
134
130 // High-priority executor: UART4, priority level 6 135 // High-priority executor: UART4, priority level 6
131 interrupt::UART4.set_priority(Priority::P6); 136 interrupt::UART4.set_priority(Priority::P6);
132 let spawner = EXECUTOR_HIGH.start(interrupt::UART4); 137 let spawner = EXECUTOR_HIGH.start(interrupt::UART4);
diff --git a/examples/stm32h7/src/bin/multiprio.rs b/examples/stm32h7/src/bin/multiprio.rs
index 73f8dd092..fcbb6c653 100644
--- a/examples/stm32h7/src/bin/multiprio.rs
+++ b/examples/stm32h7/src/bin/multiprio.rs
@@ -127,6 +127,11 @@ fn main() -> ! {
127 127
128 let _p = embassy_stm32::init(Default::default()); 128 let _p = embassy_stm32::init(Default::default());
129 129
130 // STM32s don’t have any interrupts exclusively for software use, but they can all be triggered by software as well as
131 // by the peripheral, so we can just use any free interrupt vectors which aren’t used by the rest of your application.
132 // In this case we’re using UART4 and UART5, but there’s nothing special about them. Any otherwise unused interrupt
133 // vector would work exactly the same.
134
130 // High-priority executor: UART4, priority level 6 135 // High-priority executor: UART4, priority level 6
131 interrupt::UART4.set_priority(Priority::P6); 136 interrupt::UART4.set_priority(Priority::P6);
132 let spawner = EXECUTOR_HIGH.start(interrupt::UART4); 137 let spawner = EXECUTOR_HIGH.start(interrupt::UART4);