File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -943,8 +943,14 @@ fn selftest(ec: &CrosEc) -> Option<()> {
943
943
return None ;
944
944
}
945
945
946
- // Try to get PD versions through EC
947
- power:: read_pd_version ( ec) . ok ( ) ?;
946
+ println ! ( "Reading PD Version from EC" ) ;
947
+ if let Err ( err) = power:: read_pd_version ( ec) {
948
+ // TGL does not have this command, so we have to ignore it
949
+ if err != EcError :: Response ( EcResponseStatus :: InvalidCommand ) {
950
+ println ! ( "Err: {:?}" , err) ;
951
+ return None ;
952
+ }
953
+ }
948
954
949
955
let pd_01 = PdController :: new ( PdPort :: Left01 , ec. clone ( ) ) ;
950
956
let pd_23 = PdController :: new ( PdPort :: Right23 , ec. clone ( ) ) ;
Original file line number Diff line number Diff line change @@ -194,6 +194,7 @@ pub fn print_memmap_version_info(ec: &CrosEc) {
194
194
pub fn print_sensors ( ec : & CrosEc ) {
195
195
let als = ec. read_memory ( EC_MEMMAP_ALS , 0x04 ) . unwrap ( ) ;
196
196
197
+ // Not supported on TGL EC
197
198
let als_int = u32:: from_le_bytes ( [ als[ 0 ] , als[ 1 ] , als[ 2 ] , als[ 3 ] ] ) ;
198
199
println ! ( "ALS: {:>4} Lux" , als_int) ;
199
200
}
You can’t perform that action at this time.
0 commit comments