mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Adjust anime init sequence
This commit is contained in:
@@ -12,7 +12,7 @@ use crate::error::SlashError;
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||
pub enum SlashType {
|
||||
GA403,
|
||||
Unknown,
|
||||
GA605,
|
||||
Unsupported,
|
||||
}
|
||||
|
||||
@@ -22,7 +22,8 @@ impl FromStr for SlashType {
|
||||
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
|
||||
Ok(match s {
|
||||
"ga403" | "GA403" => Self::GA403,
|
||||
_ => Self::Unknown,
|
||||
"ga605" | "GA605" => Self::GA605,
|
||||
_ => Self::Unsupported,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,12 +28,14 @@ pub type SlashUsbPacket = [u8; PACKET_SIZE];
|
||||
///
|
||||
/// The currently known USB device is `193B`.
|
||||
#[inline]
|
||||
pub fn get_slash_type() -> Result<SlashType, SlashError> {
|
||||
pub fn get_maybe_slash_type() -> Result<SlashType, SlashError> {
|
||||
let dmi = DMIID::new().map_err(|_| SlashError::NoDevice)?; // TODO: better error
|
||||
let board_name = dmi.board_name;
|
||||
|
||||
if board_name.contains("GA403") {
|
||||
return Ok(SlashType::GA403);
|
||||
} else if board_name.contains("GA605") {
|
||||
return Ok(SlashType::GA605);
|
||||
}
|
||||
Ok(SlashType::Unsupported)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user