Fix ectool command_finish
This commit is contained in:
parent
08490002b9
commit
346775b941
@ -83,12 +83,12 @@ impl<T: Timeout> Ec<T> {
|
||||
/// Finish an EC command
|
||||
pub unsafe fn command_finish(&mut self) -> Result<(), Error> {
|
||||
if self.can_command() {
|
||||
Err(Error::WouldBlock)
|
||||
} else {
|
||||
match self.read(1) {
|
||||
0 => Ok(()),
|
||||
err => Err(Error::Protocol(err)),
|
||||
}
|
||||
} else {
|
||||
Err(Error::WouldBlock)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user