Added check for resource usage and to generate an compile error for thumbv6 exceptions

This commit is contained in:
Emil Fresk 2022-04-20 13:02:55 +02:00
parent 9f38a39377
commit 0f8bdbdd3f
2 changed files with 39 additions and 1 deletions

View file

@ -339,3 +339,13 @@ pub const fn create_mask<const N: usize>(list_of_shifts: [u32; N]) -> u32 {
mask
}
#[cfg(not(armv6m))]
pub const fn v6_panic() {
// For non-v6 all is fine
}
#[cfg(armv6m)]
pub const fn v6_panic() {
panic!("Exceptions with shared resources are not allowed when compiling for thumbv6. Use local resources or `#[lock_free]` shared resources");
}