aboutsummaryrefslogtreecommitdiff
path: root/src/register
diff options
context:
space:
mode:
authorGravatar Mara Bos <m-ou.se@m-ou.se> 2019-10-09 12:53:05 +0200
committerGravatar Mara Bos <m-ou.se@m-ou.se> 2019-10-29 07:47:24 +0100
commit073c8f059b7b68543b944059f681bc67ab809d5e (patch)
tree45c30198060b578b64868bb591c2a56ae8d6baae /src/register
parent1608a660034bcc4334a6e0ca2d363c6b6bb94228 (diff)
downloadcortex-m-073c8f059b7b68543b944059f681bc67ab809d5e.tar.gz
cortex-m-073c8f059b7b68543b944059f681bc67ab809d5e.tar.zst
cortex-m-073c8f059b7b68543b944059f681bc67ab809d5e.zip
Add `#[inline]` to some more functions.
Now the only public non-inline functions left are: - write_all - write_aligned - All (derived) Debug implementations (Checked using Clippy's missing_inline_in_public_items lint.)
Diffstat (limited to 'src/register')
-rw-r--r--src/register/apsr.rs6
-rw-r--r--src/register/faultmask.rs2
-rw-r--r--src/register/primask.rs2
3 files changed, 10 insertions, 0 deletions
diff --git a/src/register/apsr.rs b/src/register/apsr.rs
index 5ad5f9a..0e54022 100644
--- a/src/register/apsr.rs
+++ b/src/register/apsr.rs
@@ -8,31 +8,37 @@ pub struct Apsr {
impl Apsr {
/// Returns the contents of the register as raw bits
+ #[inline]
pub fn bits(self) -> u32 {
self.bits
}
/// DSP overflow and saturation flag
+ #[inline]
pub fn q(self) -> bool {
self.bits & (1 << 27) == (1 << 27)
}
/// Overflow flag
+ #[inline]
pub fn v(self) -> bool {
self.bits & (1 << 28) == (1 << 28)
}
/// Carry or borrow flag
+ #[inline]
pub fn c(self) -> bool {
self.bits & (1 << 29) == (1 << 29)
}
/// Zero flag
+ #[inline]
pub fn z(self) -> bool {
self.bits & (1 << 30) == (1 << 30)
}
/// Negative flag
+ #[inline]
pub fn n(self) -> bool {
self.bits & (1 << 31) == (1 << 31)
}
diff --git a/src/register/faultmask.rs b/src/register/faultmask.rs
index dfeccf9..6fa09af 100644
--- a/src/register/faultmask.rs
+++ b/src/register/faultmask.rs
@@ -11,11 +11,13 @@ pub enum Faultmask {
impl Faultmask {
/// All exceptions are active
+ #[inline]
pub fn is_active(self) -> bool {
self == Faultmask::Active
}
/// All exceptions, except for NMI, are inactive
+ #[inline]
pub fn is_inactive(self) -> bool {
self == Faultmask::Inactive
}
diff --git a/src/register/primask.rs b/src/register/primask.rs
index 55fbab6..612abc5 100644
--- a/src/register/primask.rs
+++ b/src/register/primask.rs
@@ -11,11 +11,13 @@ pub enum Primask {
impl Primask {
/// All exceptions with configurable priority are active
+ #[inline]
pub fn is_active(self) -> bool {
self == Primask::Active
}
/// All exceptions with configurable priority are inactive
+ #[inline]
pub fn is_inactive(self) -> bool {
self == Primask::Inactive
}