File tree Expand file tree Collapse file tree
framework_lib/src/chromium_ec Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1044,21 +1044,21 @@ impl CrosEc {
10441044 loop {
10451045 match cmd. send_command_vec ( self ) {
10461046 Ok ( data) => {
1047- // EC Buffer is empty. That means we've read everything from the snapshot
1048- // The windows crosecbus driver returns all NULL instead of empty response
1049- if data. is_empty ( ) || data. iter ( ) . all ( |x| * x == 0 ) {
1047+ // EC Buffer is empty. That means we've read everything from the snapshot.
1048+ // The windows crosecbus driver returns all NULL with a leading 0x01 instead of
1049+ // an empty response.
1050+ if data. is_empty ( ) || data. iter ( ) . all ( |x| * x == 0 || * x == 1 ) {
10501051 debug ! ( "Empty EC response. Stopping console read" ) ;
1051- // Don't read too fast, wait a second before reading more
1052- os_specific:: sleep ( 1_000_000 ) ;
1052+ // Don't read too fast, wait 100ms before reading more
1053+ os_specific:: sleep ( 100_000 ) ;
10531054 EcRequestConsoleSnapshot { } . send_command ( self ) ?;
10541055 cmd. subcmd = ConsoleReadSubCommand :: ConsoleReadRecent as u8 ;
10551056 continue ;
10561057 }
10571058
10581059 let utf8 = std:: str:: from_utf8 ( & data) . unwrap ( ) ;
1059- let ascii = utf8
1060- . replace ( |c : char | !c. is_ascii ( ) , "" )
1061- . replace ( [ '\0' ] , "" ) ;
1060+ let full_ascii = utf8. replace ( |c : char | !c. is_ascii ( ) , "" ) ;
1061+ let ascii = full_ascii. replace ( [ '\0' ] , "" ) ;
10621062
10631063 print ! ( "{}" , ascii) ;
10641064 }
You can’t perform that action at this time.
0 commit comments