mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Remove a dbg!()
This commit is contained in:
@@ -522,7 +522,6 @@ mod tests {
|
|||||||
let mut data_path = PathBuf::from(DATA_DIR);
|
let mut data_path = PathBuf::from(DATA_DIR);
|
||||||
data_path.push("data");
|
data_path.push("data");
|
||||||
data_path.push("aura_support.ron");
|
data_path.push("aura_support.ron");
|
||||||
dbg!(&data_path);
|
|
||||||
|
|
||||||
let mut buf = std::fs::read_to_string(&data_path).unwrap();
|
let mut buf = std::fs::read_to_string(&data_path).unwrap();
|
||||||
let data: LedSupportFile = ron::from_str(&buf).unwrap();
|
let data: LedSupportFile = ron::from_str(&buf).unwrap();
|
||||||
|
|||||||
@@ -8,26 +8,27 @@ use zbus::zvariant::Type;
|
|||||||
use crate::error::ProfileError;
|
use crate::error::ProfileError;
|
||||||
use crate::FanCurvePU;
|
use crate::FanCurvePU;
|
||||||
|
|
||||||
|
fn set_sysfs_name(string: &mut [u8], fan: char, index: usize) {
|
||||||
|
string[3] = fan as u8;
|
||||||
|
string[15] = char::from_digit(index as u32 + 1, 10).unwrap() as u8;
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) fn pwm_str(fan: char, index: usize) -> String {
|
pub(crate) fn pwm_str(fan: char, index: usize) -> String {
|
||||||
// The char 'X' is replaced via indexing
|
// The char 'X' is replaced via indexing
|
||||||
let mut buf = "pwmX_auto_pointX_pwm".to_owned();
|
let mut string = "pwmX_auto_pointX_pwm".to_owned();
|
||||||
unsafe {
|
unsafe {
|
||||||
let tmp = buf.as_bytes_mut();
|
set_sysfs_name(string.as_bytes_mut(), fan, index);
|
||||||
tmp[3] = fan as u8;
|
|
||||||
tmp[15] = char::from_digit(index as u32 + 1, 10).unwrap() as u8;
|
|
||||||
}
|
}
|
||||||
buf
|
string
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn temp_str(fan: char, index: usize) -> String {
|
pub(crate) fn temp_str(fan: char, index: usize) -> String {
|
||||||
// The char 'X' is replaced via indexing
|
// The char 'X' is replaced via indexing
|
||||||
let mut buf = "pwmX_auto_pointX_temp".to_owned();
|
let mut string = "pwmX_auto_pointX_temp".to_owned();
|
||||||
unsafe {
|
unsafe {
|
||||||
let tmp = buf.as_bytes_mut();
|
set_sysfs_name(string.as_bytes_mut(), fan, index);
|
||||||
tmp[3] = fan as u8;
|
|
||||||
tmp[15] = char::from_digit(index as u32 + 1, 10).unwrap() as u8;
|
|
||||||
}
|
}
|
||||||
buf
|
string
|
||||||
}
|
}
|
||||||
|
|
||||||
#[typeshare]
|
#[typeshare]
|
||||||
|
|||||||
Reference in New Issue
Block a user