Skip to content

Commit

Permalink
fix: add a proper default interface option
Browse files Browse the repository at this point in the history
  • Loading branch information
WeirdTreeThing committed Apr 30, 2024
1 parent 02976a0 commit e7031bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crosec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use thiserror::Error;
// In the future, portio should be supported as well
pub enum EcInterface {
Dev(String),
Default,
}

#[derive(FromPrimitive, Debug, Copy, Clone)]
Expand Down Expand Up @@ -52,7 +53,6 @@ pub type EcCmdResult<T> = Result<T, EcError>;
pub fn ec_command(command: CrosEcCmd, command_version: u8, data: &[u8], interface: EcInterface) -> EcCmdResult<Vec<u8>> {
match interface {
EcInterface::Dev(path) => dev_ec_command(command, command_version, data, path),
// Default to dev if all else fails
_ => dev_ec_command(command, command_version, data, String::from("/dev/cros_ec")),
EcInterface::Default => dev_ec_command(command, command_version, data, String::from("/dev/cros_ec")),
}
}

0 comments on commit e7031bc

Please sign in to comment.