File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,13 +56,34 @@ use windows_sys::Win32::{
5656} ;
5757
5858use framework_lib:: windows:: * ;
59+ use framework_lib:: smbios:: { self , Platform } ;
60+ use framework_lib:: chromium_ec:: { CrosEc , EcResult } ;
61+
62+ fn print_framework12_gpios ( ) -> EcResult < ( ) > {
63+ if let Some ( Platform :: Framework12 ) = smbios:: get_platform ( ) {
64+ let gpios = [
65+ "chassis_open_l" ,
66+ "lid_sw_l" ,
67+ "tablet_mode_l" ,
68+ ] ;
69+
70+ let ec = CrosEc :: new ( ) ;
71+ println ! ( "GPIO State" ) ;
72+ for gpio in gpios {
73+ println ! ( " {:<25} {}" , gpio, ec. get_gpio( gpio) ?) ;
74+ }
75+ }
76+ Ok ( ( ) )
77+ }
5978
6079fn main ( ) -> Result < ( ) , Box < dyn Error > > {
6180 let tablet_mode = check_tablet_mode ( ) ;
6281 println ! ( "Currently in tablet mode: {:?}" , tablet_mode) ;
6382 let touchpad_enable = check_touchpad_enable ( ) ?;
6483 println ! ( "Touchpad currently enabled: {:?}" , touchpad_enable) ;
6584
85+ print_framework12_gpios ( ) . unwrap ( ) ;
86+
6687 let args: Vec < _ > = env:: args ( ) . collect ( ) ;
6788 if args. len ( ) > 1 {
6889 match args[ 1 ] . as_str ( ) {
You can’t perform that action at this time.
0 commit comments