mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Keyboard backlight fix for G14/G15 (#20)
* fixed mode and brightness combination if mmode is empty * corrected order in laptops
This commit is contained in:
@@ -56,6 +56,15 @@ fn choose_1866_device(prod: u16) -> LaptopBase {
|
|||||||
//backlight: Backlight::new("intel_backlight").unwrap(),
|
//backlight: Backlight::new("intel_backlight").unwrap(),
|
||||||
};
|
};
|
||||||
match &board_name.as_str()[..5] {
|
match &board_name.as_str()[..5] {
|
||||||
|
"GA401" => {
|
||||||
|
// Has no RGB control
|
||||||
|
info!("Found GA401 series");
|
||||||
|
laptop.support_animatrix = true;
|
||||||
|
}
|
||||||
|
"GA502" => {
|
||||||
|
// Has no RGB control
|
||||||
|
info!("Found GA502 series");
|
||||||
|
}
|
||||||
"GX502" => {
|
"GX502" => {
|
||||||
info!("Found GX502 series");
|
info!("Found GX502 series");
|
||||||
laptop.supported_modes = vec![
|
laptop.supported_modes = vec![
|
||||||
@@ -82,15 +91,6 @@ fn choose_1866_device(prod: u16) -> LaptopBase {
|
|||||||
BuiltInModeByte::Rainbow,
|
BuiltInModeByte::Rainbow,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
"GA502" => {
|
|
||||||
// Has no RGB control
|
|
||||||
info!("Found GA502 series");
|
|
||||||
}
|
|
||||||
"GA401" => {
|
|
||||||
// Has no RGB control
|
|
||||||
info!("Found GA401 series");
|
|
||||||
laptop.support_animatrix = true;
|
|
||||||
}
|
|
||||||
_ => panic!("Unsupported laptop: {}, please request support at\nhttps://github.com/flukejones/rog-core", board_name),
|
_ => panic!("Unsupported laptop: {}, please request support at\nhttps://github.com/flukejones/rog-core", board_name),
|
||||||
}
|
}
|
||||||
laptop
|
laptop
|
||||||
|
|||||||
@@ -221,18 +221,23 @@ where
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
async fn reload_last_builtin(&self, config: &Config) -> Result<(), AuraError> {
|
async fn reload_last_builtin(&self, config: &Config) -> Result<(), AuraError> {
|
||||||
let mode_curr = config.current_mode[3];
|
// set current mode (if any)
|
||||||
let mode = config
|
if self.supported_modes.len() > 1 {
|
||||||
.builtin_modes
|
let mode_curr = config.current_mode[3];
|
||||||
.get_field_from(mode_curr)
|
let mode = config
|
||||||
.ok_or(AuraError::NotSupported)?
|
.builtin_modes
|
||||||
.to_owned();
|
.get_field_from(mode_curr)
|
||||||
self.write_bytes(&mode).await?;
|
.ok_or(AuraError::NotSupported)?
|
||||||
// Reload brightness too
|
.to_owned();
|
||||||
|
self.write_bytes(&mode).await?;
|
||||||
|
info!("Reloaded last used mode");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reload brightness
|
||||||
let bright = config.brightness;
|
let bright = config.brightness;
|
||||||
let bytes = aura_brightness_bytes(bright);
|
let bytes = aura_brightness_bytes(bright);
|
||||||
self.write_bytes(&bytes).await?;
|
self.write_bytes(&bytes).await?;
|
||||||
info!("Reloaded last used mode and brightness");
|
info!("Reloaded last used brightness");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user