Skip to content

Commit 195b1a5

Browse files
authored
Merge pull request #3792 from adamgreig/stm32-clkmux-unreachable
stm32: Change unreachable panic to explicit error message when access…
2 parents 010d462 + da8612e commit 195b1a5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

embassy-stm32/build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,11 @@ fn main() {
532532
match crate::pac::RCC.#fieldset_name().read().#field_name() {
533533
#match_arms
534534
#[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+
)
536540
}
537541
}
538542
}

0 commit comments

Comments
 (0)