mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 17:33:19 +01:00
Compare commits
4 Commits
a4957a6eeb
...
392436808d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
392436808d | ||
|
|
3d9a08d7e0 | ||
|
|
ff103f98af | ||
|
|
d05182ae64 |
@@ -1192,7 +1192,7 @@ fn print_firmware_attr(attr: &AsusArmouryProxyBlocking) -> Result<(), Box<dyn st
|
||||
fn handle_armoury_command(cmd: &ArmouryCommand) -> Result<(), Box<dyn std::error::Error>> {
|
||||
{
|
||||
if cmd.free.is_empty() || (cmd.free.len() % 2 != 0) || cmd.help {
|
||||
const USAGE: &str = "Usage: asusctl platform panel_overdrive 1 nv_dynamic_boost 5";
|
||||
const USAGE: &str = "Usage: asusctl armoury panel_overdrive 1 nv_dynamic_boost 5";
|
||||
if cmd.free.len() % 2 != 0 {
|
||||
println!(
|
||||
"Incorrect number of args, each attribute label must be paired with a setting:"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use config_traits::StdConfig;
|
||||
use log::{debug, error, info};
|
||||
use log::{debug, error, info, warn};
|
||||
use rog_platform::asus_armoury::{AttrValue, Attribute, FirmwareAttribute, FirmwareAttributes};
|
||||
use rog_platform::platform::{PlatformProfile, RogPlatform};
|
||||
use rog_platform::power::AsusPower;
|
||||
@@ -205,7 +205,13 @@ impl crate::Reloadable for AsusArmouryAttribute {
|
||||
self.attr.base_path_exists();
|
||||
e
|
||||
})?;
|
||||
info!("Set {} to {:?}", self.attr.name(), tune);
|
||||
info!(
|
||||
"Restored PPT armoury setting {} to {:?}",
|
||||
self.attr.name(),
|
||||
tune
|
||||
);
|
||||
} else {
|
||||
info!("Ignored restoring PPT armoury setting {} as tuning group is disabled or no saved value", self.attr.name());
|
||||
}
|
||||
} else {
|
||||
// Handle non-PPT attributes (boolean and other settings)
|
||||
@@ -213,7 +219,10 @@ impl crate::Reloadable for AsusArmouryAttribute {
|
||||
self.attr
|
||||
.set_current_value(&AttrValue::Integer(*saved_value))
|
||||
.map_err(|e| {
|
||||
error!("Could not set {} value: {e:?}", self.attr.name());
|
||||
error!(
|
||||
"Error restoring armoury setting {}: {e:?}",
|
||||
self.attr.name()
|
||||
);
|
||||
self.attr.base_path_exists();
|
||||
e
|
||||
})?;
|
||||
@@ -222,6 +231,11 @@ impl crate::Reloadable for AsusArmouryAttribute {
|
||||
self.attr.name(),
|
||||
saved_value
|
||||
);
|
||||
} else {
|
||||
info!(
|
||||
"No saved armoury setting for {}: skipping restore",
|
||||
self.attr.name()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -397,44 +411,44 @@ impl AsusArmouryAttribute {
|
||||
self.attr
|
||||
.set_current_value(&AttrValue::Integer(value))
|
||||
.map_err(|e| {
|
||||
error!("Could not set value: {e:?}");
|
||||
error!(
|
||||
"Could not set value to PPT property {}: {e:?}",
|
||||
self.attr.name()
|
||||
);
|
||||
e
|
||||
})?;
|
||||
} else {
|
||||
warn!(
|
||||
"Tuning group is disabled: skipping setting value to PPT property {}",
|
||||
self.attr.name()
|
||||
);
|
||||
}
|
||||
} else {
|
||||
self.attr
|
||||
.set_current_value(&AttrValue::Integer(value))
|
||||
.map_err(|e| {
|
||||
error!("Could not set value: {e:?}");
|
||||
error!(
|
||||
"Could not set value {value} to attribute {}: {e:?}",
|
||||
self.attr.name()
|
||||
);
|
||||
e
|
||||
})?;
|
||||
|
||||
let has_attr = self
|
||||
.config
|
||||
.lock()
|
||||
.await
|
||||
let mut settings = self.config.lock().await;
|
||||
settings
|
||||
.armoury_settings
|
||||
.contains_key(&self.name());
|
||||
if has_attr {
|
||||
if let Some(setting) = self
|
||||
.config
|
||||
.lock()
|
||||
.await
|
||||
.armoury_settings
|
||||
.get_mut(&self.name())
|
||||
{
|
||||
*setting = value
|
||||
}
|
||||
} else {
|
||||
debug!("Adding config for {}", self.attr.name());
|
||||
self.config
|
||||
.lock()
|
||||
.await
|
||||
.armoury_settings
|
||||
.insert(self.name(), value);
|
||||
debug!("Set config for {} = {:?}", self.attr.name(), value);
|
||||
}
|
||||
.entry(self.name())
|
||||
.and_modify(|setting| {
|
||||
debug!("Set config for {} = {value}", self.attr.name());
|
||||
*setting = value;
|
||||
})
|
||||
.or_insert_with(|| {
|
||||
debug!("Adding config for {} = {value}", self.attr.name());
|
||||
value
|
||||
});
|
||||
}
|
||||
|
||||
// write config after setting value
|
||||
self.config.lock().await.write();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ Environment=IS_SERVICE=1
|
||||
# Reduce noisy span logs while keeping useful debug info for asusd and related crates.
|
||||
# Keep global level at info but allow debug for our crates; silence tracing::span (very noisy)
|
||||
# RUST_LOG format: <module>=<level>,... (levels: error,warn,info,debug,trace)
|
||||
Environment=RUST_LOG="info,asusd=debug,rog_platform=debug,tracing::span=error"
|
||||
Environment=RUST_LOG="info,asusd=debug,rog_platform=debug,tracing::span=error,zbus::object_server=error,zbus::connection::handshake::common=error,zbus::connection::handshake::client=error"
|
||||
# required to prevent init issues with hid_asus and MCU
|
||||
ExecStartPre=/bin/sleep 1
|
||||
ExecStart=/usr/bin/asusd
|
||||
|
||||
Reference in New Issue
Block a user