diff --git a/macros/Cargo.toml b/macros/Cargo.toml index e4f5cc2379..f9d8add79c 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -12,7 +12,7 @@ license = "MIT OR Apache-2.0" name = "cortex-m-rtic-macros" readme = "../README.md" repository = "https://github.com/rtic-rs/cortex-m-rtic" -version = "1.1.2" +version = "1.1.3" [lib] proc-macro = true diff --git a/macros/src/codegen/assertions.rs b/macros/src/codegen/assertions.rs index 36ab036445..f6a098b5e6 100644 --- a/macros/src/codegen/assertions.rs +++ b/macros/src/codegen/assertions.rs @@ -28,7 +28,11 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec 31 { + ::core::panic!("An interrupt above value 31 is used while in armv6"); + } + )) } else { None } diff --git a/macros/src/codegen/pre_init.rs b/macros/src/codegen/pre_init.rs index ae2fd0503f..3d541a4749 100644 --- a/macros/src/codegen/pre_init.rs +++ b/macros/src/codegen/pre_init.rs @@ -55,7 +55,7 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec= #priority as usize, #es); + const _: () = if (1 << #nvic_prio_bits) < #priority as usize { ::core::panic!(#es); }; )); stmts.push(quote!( @@ -84,7 +84,7 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec= #priority as usize, #es); + const _: () = if (1 << #nvic_prio_bits) < #priority as usize { ::core::panic!(#es); }; )); stmts.push(quote!(core.SCB.set_priority( @@ -109,7 +109,7 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec= #priority as usize, #es); + const _: () = if (1 << #nvic_prio_bits) < #priority as usize { ::core::panic!(#es); }; )); let mono_type = &monotonic.ty; diff --git a/src/export.rs b/src/export.rs index 42f3fe2e34..6e1e4a6567 100644 --- a/src/export.rs +++ b/src/export.rs @@ -66,7 +66,9 @@ impl Barrier { } pub fn wait(&self) { - while !self.inner.load(Ordering::Acquire) {} + while !self.inner.load(Ordering::Acquire) { + core::hint::spin_loop() + } } }