Skip to content

Commit d488a1f

Browse files
committed
--sensors: Prettier formatting of Accel
Signed-off-by: Daniel Schaefer <[email protected]>
1 parent 7c1b988 commit d488a1f

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

EXAMPLES.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,9 @@ ALS: 76 Lux
150150
> sudo framework_tool --sensors
151151
ALS: 0 Lux
152152
Accelerometers:
153-
Status Bit: 140 0x8C
154-
Present: true
155-
Busy: true
156-
Lid Angle: 122 Deg
157-
Sensor 1: X: 0.00G Y: 0.84G, Z: 0.52G
158-
Sensor 2: X: -0.03G Y: 0.00G, Z: 1.01G
153+
Lid Angle: 122 Deg
154+
Sensor 1: X=+0.00G Y=+0.84G, Z=+0.52G
155+
Sensor 2: X=-0.03G Y=+0.00G, Z=+1.01G
159156
```
160157

161158
## Set custom fan duty/RPM

framework_lib/src/power.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl fmt::Display for AccelData {
190190
let x = (self.x as f32) / quarter;
191191
let y = (self.y as f32) / quarter;
192192
let z = (self.z as f32) / quarter;
193-
write!(f, "X: {:.2}G Y: {:.2}G, Z: {:.2}G", x, y, z)
193+
write!(f, "X={:+.2}G Y={:+.2}G, Z={:+.2}G", x, y, z)
194194
}
195195
}
196196

@@ -291,17 +291,17 @@ pub fn print_sensors(ec: &CrosEc) {
291291
let present = (acc_status & 0x80) > 0;
292292
if present {
293293
println!("Accelerometers:");
294-
println!(" Status Bit: {} 0x{:X}", acc_status, acc_status);
295-
println!(" Present: {}", present);
296-
println!(" Busy: {}", (acc_status & 0x8) > 0);
297-
print!(" Lid Angle: ");
294+
debug!(" Status Bit: {} 0x{:X}", acc_status, acc_status);
295+
debug!(" Present: {}", present);
296+
debug!(" Busy: {}", (acc_status & 0x8) > 0);
297+
print!(" Lid Angle: ");
298298
if lid_angle == LID_ANGLE_UNRELIABLE {
299299
println!("Unreliable");
300300
} else {
301301
println!("{} Deg", lid_angle);
302302
}
303-
println!(" Sensor 1: {}", AccelData::from(accel_1));
304-
println!(" Sensor 2: {}", AccelData::from(accel_2));
303+
println!(" Sensor 1: {}", AccelData::from(accel_1));
304+
println!(" Sensor 2: {}", AccelData::from(accel_2));
305305
// Accelerometers
306306
// Lid Angle: 26 Deg
307307
// Sensor 1: 00.00 X 00.00 Y 00.00 Z

0 commit comments

Comments
 (0)