Skip to content

Commit

Permalink
🐛 fix accelerometer bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pyaillet committed Feb 28, 2022
1 parent 4f68559 commit 7f26300
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# BMA423 Rust driver

This is an experimental Rust driver for the BMA423 accelerometer.

4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,14 @@ where
use accelerometer::error::{Error, ErrorKind};
let (x, y, z) = self
.get_x_y_z()
.map_err(Error::new_with_cause(ErrorKind::Bus, Bma423Error::I2cError))?;
.map_err(|_e| Error::new_with_cause(ErrorKind::Bus, Bma423Error::I2cError))?;
Ok(F32x3::new(x, y, z))
}

fn sample_rate(&mut self) -> Result<f32, accelerometer::Error<Bma423Error>> {
use accelerometer::error::{Error, ErrorKind};
match self.config {
Some(config) => match config {
Some(config) => match config.sample_rate {
AccelConfigOdr::Odr0p78 => Ok(25.0 / 32.0),
AccelConfigOdr::Odr1p5 => Ok(25.0 / 16.0),
AccelConfigOdr::Odr3p1 => Ok(25.0 / 8.0),
Expand Down

0 comments on commit 7f26300

Please sign in to comment.