Skip to content

Commit a25f20d

Browse files
committed
making console flags happy
1 parent e7ac821 commit a25f20d

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

services/bao-console/src/main.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,20 +110,20 @@ fn main() {
110110

111111
#[cfg(feature = "battery-readout")]
112112
{
113-
// use cramium_api::I2cApi;
114-
// let mut i2c = cram_hal_service::I2c::new();
115-
// use cramium_hal::axp2101::*;
116-
// let measurements = [("VBAT", REG_VBAT_H), ("VBUS", REG_VBUS_H), ("VSYS", REG_VSYS_H)];
117-
// let mut buf = [0u8, 0u8];
113+
use cramium_api::I2cApi;
114+
let mut i2c = cram_hal_service::I2c::new();
115+
use cramium_hal::axp2101::*;
116+
let measurements = [("VBAT", REG_VBAT_H), ("VBUS", REG_VBUS_H), ("VSYS", REG_VSYS_H)];
117+
let mut buf = [0u8, 0u8];
118118
loop {
119119
tt.sleep_ms(2_000).ok();
120-
// for (name, offset) in measurements {
121-
// i2c.i2c_read(AXP2101_DEV, offset, &mut buf, false).unwrap();
122-
// let v: u32 = (((buf[0] as u32) & 0x3F) << 8) | buf[1] as u32;
123-
// log::info!("{}: {:0.3}V", name, v as f32 / 1000.0);
124-
// i2c.i2c_read(AXP2101_DEV, REG_SOC, &mut buf[0..1], false).unwrap();
125-
// log::info!("SOC: {}%", buf[0]);
126-
// }
120+
for (name, offset) in measurements {
121+
i2c.i2c_read(AXP2101_DEV, offset, &mut buf, false).unwrap();
122+
let v: u32 = (((buf[0] as u32) & 0x3F) << 8) | buf[1] as u32;
123+
log::info!("{}: {:0.3}V", name, v as f32 / 1000.0);
124+
i2c.i2c_read(AXP2101_DEV, REG_SOC, &mut buf[0..1], false).unwrap();
125+
log::info!("SOC: {}%", buf[0]);
126+
}
127127
}
128128
}
129129
#[cfg(any(feature = "hosted-baosec", not(feature = "battery-readout")))]

xtask/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
620620
builder.add_loader_feature("swap");
621621
builder.add_kernel_feature("swap");
622622
builder.add_feature("swap");
623-
// builder.add_feature("autotest");
624623

625624
builder.add_loader_feature("debug-print");
626625
// the following feature needs to be uncommented if we also enable

0 commit comments

Comments
 (0)