diff options
author | 2022-03-01 17:44:02 +0000 | |
---|---|---|
committer | 2022-03-01 17:44:02 +0000 | |
commit | 2e4cbe9df595c2c4cb90c788030351a7f91339f6 (patch) | |
tree | 2e1bf40e2eaeeb4b58c996c1659c8a7429e2a518 /src/export.rs | |
parent | 57da1e0403510cafbdcf88e402b39ae6d3bf323e (diff) | |
parent | 5ed93bd1bf056f1d2b8632502300d7488df4e9df (diff) | |
download | rtic-2e4cbe9df595c2c4cb90c788030351a7f91339f6.tar.gz rtic-2e4cbe9df595c2c4cb90c788030351a7f91339f6.tar.zst rtic-2e4cbe9df595c2c4cb90c788030351a7f91339f6.zip |
Merge #617
617: Clippy with pedantic suggestions r=korken89 a=AfoHT
Co-authored-by: Henrik Tjäder <henrik@grepit.se>
Diffstat (limited to 'src/export.rs')
-rw-r--r-- | src/export.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/export.rs b/src/export.rs index a124c78b..838ae843 100644 --- a/src/export.rs +++ b/src/export.rs @@ -1,3 +1,4 @@ +#![allow(clippy::inline_always)] use core::{ cell::Cell, sync::atomic::{AtomicBool, Ordering}, @@ -61,7 +62,7 @@ impl Barrier { } pub fn release(&self) { - self.inner.store(true, Ordering::Release) + self.inner.store(true, Ordering::Release); } pub fn wait(&self) { @@ -91,7 +92,7 @@ impl Priority { // These two methods are used by `lock` (see below) but can't be used from the RTIC application #[inline(always)] fn set(&self, value: u8) { - self.inner.set(value) + self.inner.set(value); } /// Get the current priority @@ -160,7 +161,7 @@ pub unsafe fn lock<T, R>( } /// Lock the resource proxy by setting the PRIMASK -/// and running the closure with interrupt::free +/// and running the closure with ``interrupt::free`` /// /// # Safety /// @@ -188,6 +189,7 @@ pub unsafe fn lock<T, R>( } #[inline] +#[must_use] pub fn logical2hw(logical: u8, nvic_prio_bits: u8) -> u8 { ((1 << nvic_prio_bits) - logical) << (8 - nvic_prio_bits) } |