diff --git a/examples/calibrate.rs b/examples/calibrate.rs index c8e9c5c..5e09971 100644 --- a/examples/calibrate.rs +++ b/examples/calibrate.rs @@ -6,7 +6,8 @@ fn main() { let dev = I2cdev::new("/dev/i2c-0").unwrap(); let mut delay = Delay {}; let mut imu = Bno055::new(dev).with_alternative_address(); - imu.init(&mut delay).expect("An error occurred while building the IMU"); + imu.init(&mut delay) + .expect("An error occurred while building the IMU"); imu.set_mode(BNO055OperationMode::NDOF, &mut delay) .expect("An error occurred while setting the IMU mode"); diff --git a/src/acc_config.rs b/src/acc_config.rs index e78157d..6dbb496 100644 --- a/src/acc_config.rs +++ b/src/acc_config.rs @@ -1,12 +1,16 @@ use num_derive::FromPrimitive; use num_traits::FromPrimitive; +#[allow(clippy::unusual_byte_groupings)] const ACC_G_RANGE_MASK: u8 = 0b000_000_11; +#[allow(clippy::unusual_byte_groupings)] const ACC_BANDWIDTH_MASK: u8 = 0b000_111_00; +#[allow(clippy::unusual_byte_groupings)] const ACC_OPERATION_MODE_MASK: u8 = 0b111_000_00; #[derive(Debug)] #[cfg_attr(feature = "defmt-03", derive(defmt::Format))] +#[allow(clippy::enum_variant_names)] pub enum Error { BadAccGRange, BadAccBandwidth, @@ -16,6 +20,7 @@ pub enum Error { #[derive(Debug, Clone, Copy, FromPrimitive)] #[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[repr(u8)] +#[allow(clippy::unusual_byte_groupings)] pub enum AccGRange { G2 = 0b000_000_00, G4 = 0b000_000_01, @@ -26,6 +31,7 @@ pub enum AccGRange { #[derive(Debug, Clone, Copy, FromPrimitive)] #[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[repr(u8)] +#[allow(clippy::unusual_byte_groupings)] pub enum AccBandwidth { Hz7_81 = 0b000_000_00, Hz15_63 = 0b000_001_00, @@ -40,6 +46,7 @@ pub enum AccBandwidth { #[derive(Debug, Clone, Copy, FromPrimitive)] #[cfg_attr(feature = "defmt-03", derive(defmt::Format))] #[repr(u8)] +#[allow(clippy::unusual_byte_groupings)] pub enum AccOperationMode { Normal = 0b000_000_00, Suspend = 0b001_000_00, diff --git a/src/lib.rs b/src/lib.rs index 8f93927..1bf64de 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,8 +1,8 @@ #![doc(html_root_url = "https://docs.rs/bno055/0.3.3")] #![cfg_attr(not(feature = "std"), no_std)] -///! Bosch Sensortec BNO055 9-axis IMU sensor driver. -///! Datasheet: https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BNO055-DS000.pdf +//! Bosch Sensortec BNO055 9-axis IMU sensor driver. +//! Datasheet: https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BNO055-DS000.pdf use embedded_hal::{ delay::DelayNs, i2c::{I2c, SevenBitAddress}, @@ -668,6 +668,7 @@ bitflags! { } } +#[allow(clippy::misnamed_getters)] impl AxisRemap { pub fn x(&self) -> BNO055AxisConfig { self.x @@ -762,6 +763,7 @@ impl AxisRemapBuilder { self.remap.x == self.remap.y || self.remap.y == self.remap.z || self.remap.z == self.remap.x } + #[allow(clippy::result_unit_err)] pub fn build(self) -> Result { if self.is_invalid() { Err(())