Merge pull request #3792 from adamgreig/stm32-clkmux-unreachable

stm32: Change unreachable panic to explicit error message when access…
This commit is contained in:
Dario Nieuwenhuis 2025-01-22 01:22:37 +00:00 committed by GitHub
commit 195b1a593a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -532,7 +532,11 @@ fn main() {
match crate::pac::RCC.#fieldset_name().read().#field_name() {
#match_arms
#[allow(unreachable_patterns)]
_ => unreachable!(),
_ => panic!(
"attempted to use peripheral '{}' but its clock mux is not set to a valid \
clock. Change 'config.rcc.mux' to another clock.",
#peripheral
)
}
}
}