mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
making console flags happy
This commit is contained in:
parent
e7ac82161f
commit
a25f20d045
2 changed files with 12 additions and 13 deletions
|
|
@ -110,20 +110,20 @@ fn main() {
|
|||
|
||||
#[cfg(feature = "battery-readout")]
|
||||
{
|
||||
// use cramium_api::I2cApi;
|
||||
// let mut i2c = cram_hal_service::I2c::new();
|
||||
// use cramium_hal::axp2101::*;
|
||||
// let measurements = [("VBAT", REG_VBAT_H), ("VBUS", REG_VBUS_H), ("VSYS", REG_VSYS_H)];
|
||||
// let mut buf = [0u8, 0u8];
|
||||
use cramium_api::I2cApi;
|
||||
let mut i2c = cram_hal_service::I2c::new();
|
||||
use cramium_hal::axp2101::*;
|
||||
let measurements = [("VBAT", REG_VBAT_H), ("VBUS", REG_VBUS_H), ("VSYS", REG_VSYS_H)];
|
||||
let mut buf = [0u8, 0u8];
|
||||
loop {
|
||||
tt.sleep_ms(2_000).ok();
|
||||
// for (name, offset) in measurements {
|
||||
// i2c.i2c_read(AXP2101_DEV, offset, &mut buf, false).unwrap();
|
||||
// let v: u32 = (((buf[0] as u32) & 0x3F) << 8) | buf[1] as u32;
|
||||
// log::info!("{}: {:0.3}V", name, v as f32 / 1000.0);
|
||||
// i2c.i2c_read(AXP2101_DEV, REG_SOC, &mut buf[0..1], false).unwrap();
|
||||
// log::info!("SOC: {}%", buf[0]);
|
||||
// }
|
||||
for (name, offset) in measurements {
|
||||
i2c.i2c_read(AXP2101_DEV, offset, &mut buf, false).unwrap();
|
||||
let v: u32 = (((buf[0] as u32) & 0x3F) << 8) | buf[1] as u32;
|
||||
log::info!("{}: {:0.3}V", name, v as f32 / 1000.0);
|
||||
i2c.i2c_read(AXP2101_DEV, REG_SOC, &mut buf[0..1], false).unwrap();
|
||||
log::info!("SOC: {}%", buf[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(any(feature = "hosted-baosec", not(feature = "battery-readout")))]
|
||||
|
|
|
|||
|
|
@ -620,7 +620,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
builder.add_loader_feature("swap");
|
||||
builder.add_kernel_feature("swap");
|
||||
builder.add_feature("swap");
|
||||
// builder.add_feature("autotest");
|
||||
|
||||
builder.add_loader_feature("debug-print");
|
||||
// the following feature needs to be uncommented if we also enable
|
||||
|
|
|
|||
Loading…
Reference in a new issue