Skip to content

Commit 16cb1b2

Browse files
Merge pull request #188 from FrameworkComputer/inputdeck
--inputdeck: Try Framework 16 if can't detect system type
2 parents 7c17569 + 0bd4f5c commit 16cb1b2

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

  • framework_lib/src/commandline

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)