diff options
| author | Adam Greig <[email protected]> | 2025-01-22 01:17:20 +0000 |
|---|---|---|
| committer | Adam Greig <[email protected]> | 2025-01-22 01:17:20 +0000 |
| commit | da8612e95b93eff0720150317848694a76418151 (patch) | |
| tree | dbeb4c8226e8d37a724aa1126e16110023fff6fd | |
| parent | c65b6db318da7ecbe888a0a66b85d9ffb28106f0 (diff) | |
stm32: Change unreachable panic to explicit error message when accessing clock-muxed peripherals set to invalid clocks
| -rw-r--r-- | embassy-stm32/build.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/embassy-stm32/build.rs b/embassy-stm32/build.rs index 4abbf8d69..03d4383ac 100644 --- a/embassy-stm32/build.rs +++ b/embassy-stm32/build.rs | |||
| @@ -532,7 +532,11 @@ fn main() { | |||
| 532 | match crate::pac::RCC.#fieldset_name().read().#field_name() { | 532 | match crate::pac::RCC.#fieldset_name().read().#field_name() { |
| 533 | #match_arms | 533 | #match_arms |
| 534 | #[allow(unreachable_patterns)] | 534 | #[allow(unreachable_patterns)] |
| 535 | _ => unreachable!(), | 535 | _ => panic!( |
| 536 | "attempted to use peripheral '{}' but its clock mux is not set to a valid \ | ||
| 537 | clock. Change 'config.rcc.mux' to another clock.", | ||
| 538 | #peripheral | ||
| 539 | ) | ||
| 536 | } | 540 | } |
| 537 | } | 541 | } |
| 538 | } | 542 | } |
