Skip to content

Commit d3a9f76

Browse files
committed
--features: Make the output prettier
``` framework_tool.exe --features ID | Name | Enabled? -- | --------------------------- | -------- 0 | Limited | false 1 | Flash | true 2 | PwmFan | true 3 | PwmKeyboardBacklight | false 4 | Lightbar | false 5 | Led | true [...] ``` Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 49eb0b9 commit d3a9f76

File tree

1 file changed

+4
-1
lines changed
  • framework_lib/src/chromium_ec

1 file changed

+4
-1
lines changed

framework_lib/src/chromium_ec/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,14 +1086,17 @@ impl CrosEc {
10861086
/// Check features supported by the firmware
10871087
pub fn get_features(&self) -> EcResult<()> {
10881088
let data = EcRequestGetFeatures {}.send_command(self)?;
1089+
println!(" ID | Name | Enabled?");
1090+
println!(" -- | --------------------------- | --------");
10891091
for i in 0..64 {
10901092
let byte = i / 32;
10911093
let bit = i % 32;
10921094
let val = (data.flags[byte] & (1 << bit)) > 0;
10931095
let feat: Option<EcFeatureCode> = FromPrimitive::from_usize(i);
10941096

10951097
if let Some(feat) = feat {
1096-
println!("{:>2}: {:>5} {:?}", i, val, feat);
1098+
let name = format!("{:?}", feat);
1099+
println!(" {:>2} | {:<27} | {:>5}", i, name, val);
10971100
}
10981101
}
10991102

0 commit comments

Comments
 (0)