Skip to content

Commit 0bd4f5c

Browse files
committed
--inputdeck: Try Framework 16 if can't detect system type
In some cases we can't detect the system type, but if sleep_l GPIO is present, we know it's a Framework 16. Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 7c17569 commit 0bd4f5c

File tree

1 file changed

+10
-1
lines changed
  • framework_lib/src/commandline

1 file changed

+10
-1
lines changed

framework_lib/src/commandline/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,16 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
980980
Some(PlatformFamily::Framework12) => ec.print_fw12_inputdeck_status(),
981981
Some(PlatformFamily::Framework13) => ec.print_fw13_inputdeck_status(),
982982
Some(PlatformFamily::Framework16) => ec.print_fw16_inputdeck_status(),
983-
_ => Ok(()),
983+
// If we don't know which platform it is, we can use some heuristics
984+
_ => {
985+
// Only Framework 16 has this GPIO
986+
if ec.get_gpio("sleep_l").is_ok() {
987+
ec.print_fw16_inputdeck_status()
988+
} else {
989+
println!(" Unable to tell");
990+
Ok(())
991+
}
992+
}
984993
};
985994
print_err(res);
986995
} else if let Some(mode) = &args.inputdeck_mode {

0 commit comments

Comments
 (0)