Skip to content

Commit d46e741

Browse files
committed
power: AccelData values are i16
Not unsigned Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent b276fdd commit d46e741

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

framework_lib/src/power.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,18 @@ impl From<PowerInfo> for ReducedPowerInfo {
164164
}
165165
}
166166

167-
#[derive(Debug)]
168-
struct AccelData {
169-
x: u16,
170-
y: u16,
171-
z: u16,
167+
#[derive(Debug, Clone, PartialEq, Eq)]
168+
pub struct AccelData {
169+
pub x: i16,
170+
pub y: i16,
171+
pub z: i16,
172172
}
173173
impl From<Vec<u8>> for AccelData {
174174
fn from(t: Vec<u8>) -> Self {
175175
Self {
176-
x: u16::from_le_bytes([t[0], t[1]]),
177-
y: u16::from_le_bytes([t[2], t[3]]),
178-
z: u16::from_le_bytes([t[4], t[5]]),
176+
x: i16::from_le_bytes([t[0], t[1]]),
177+
y: i16::from_le_bytes([t[2], t[3]]),
178+
z: i16::from_le_bytes([t[4], t[5]]),
179179
}
180180
}
181181
}

0 commit comments

Comments
 (0)