File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -812,6 +812,7 @@ pub fn get_and_print_cypd_pd_info(ec: &CrosEc) {
812812 match result {
813813 Ok ( info) => {
814814 let c_state = CypdTypeCState :: from ( info. c_state ) ;
815+ let connected = !matches ! ( c_state, CypdTypeCState :: Nothing ) ;
815816 let power_role = CypdPdPowerRole :: from ( info. power_role ) ;
816817 let data_role = CypdPdDataRole :: from ( info. data_role ) ;
817818 let voltage = { info. voltage } ;
@@ -849,7 +850,18 @@ pub fn get_and_print_cypd_pd_info(ec: &CrosEc) {
849850 ""
850851 }
851852 ) ;
852- println ! ( " CC Polarity: CC{}" , info. cc_polarity + 1 ) ;
853+ if connected {
854+ println ! (
855+ " CC Polarity: {}" ,
856+ match info. cc_polarity {
857+ 0 => "CC1" ,
858+ 1 => "CC2" ,
859+ 2 => "CC1 (Debug)" ,
860+ 3 => "CC2 (Debug)" ,
861+ _ => "Unknown" ,
862+ }
863+ ) ;
864+ }
853865 println ! (
854866 " Active Port: {}" ,
855867 if info. active_port != 0 { "Yes" } else { "No" }
You can’t perform that action at this time.
0 commit comments