File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,7 +120,6 @@ impl Device {
120120 // Write input Data to DATA1
121121 if !in_data. is_empty ( ) {
122122 self . write_block ( TPS_REG_DATA1 , in_data) ?;
123- info ! ( "Wrote Data: {:02X?}" , in_data) ;
124123 }
125124
126125 // Write 4-byte command tag
@@ -132,12 +131,10 @@ impl Device {
132131 let mut status_buf = [ 0u8 ; 4 ] ;
133132 self . read_block ( TPS_REG_CMD1 , & mut status_buf) ?;
134133 let val = u32:: from_le_bytes ( status_buf) ;
135-
136134 if is_invalid_cmd ( val) {
137135 info ! ( "Invalid Command" ) ;
138- return Err ( Error :: InvalidArgument ) ;
136+ return Err ( Error :: TypecController ) ;
139137 }
140-
141138 if val == 0 {
142139 break ;
143140 }
@@ -146,7 +143,6 @@ impl Device {
146143 }
147144 }
148145 thread:: sleep ( res_delay) ;
149-
150146 Ok ( ( ) )
151147 }
152148
@@ -176,7 +172,6 @@ impl Device {
176172 self . read_block ( TPS_REG_MODE , & mut buf) ?;
177173 let s = std:: str:: from_utf8 ( & buf) . unwrap ( ) ;
178174 let m = TpsMode :: from_str ( s) . map_err ( |_| Error :: TypecController ) ?;
179-
180175 Ok ( m)
181176 }
182177
You can’t perform that action at this time.
0 commit comments