Skip to content

Commit

Permalink
Bump version to 0.1.1, fix data conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Henk Dieter Oordt committed Nov 14, 2019
1 parent 4d3b173 commit 7d731f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ads129xx"
version = "0.1.0"
version = "0.1.1"
authors = ["Henk Dieter <[email protected]>"]
edition = "2018"
readme = "README.md"
Expand Down
3 changes: 2 additions & 1 deletion src/data.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use core::fmt;

#[derive(Default, Copy, Clone)]
pub struct LeadOffStatus {
/// The status. Bits [5:7] are unused
pub status: u8,
Expand Down Expand Up @@ -106,7 +107,7 @@ impl ChannelData {

impl From<ChannelData> for i32 {
fn from(channel_data: ChannelData) -> Self {
unsafe { core::mem::transmute([0, channel_data.0, channel_data.1, channel_data.2]) }
i32::from_be_bytes([channel_data.0, channel_data.1, channel_data.2, 0]) >> 8
}
}

Expand Down

0 comments on commit 7d731f5

Please sign in to comment.