Add G731 support

This commit is contained in:
Luke D Jones
2020-08-04 22:04:25 +12:00
parent 7adb477e1b
commit 4011bdd554
8 changed files with 50 additions and 42 deletions

View File

@@ -47,6 +47,7 @@ impl crate::Controller for CtrlFanAndCPU {
}
});
// need to watch file path
// TODO: split this out to a struct CtrlFanAndCPUWatcher or similar
tokio::spawn(async move {
loop {
if let Ok(mut lock) = gate2.try_lock() {
@@ -65,7 +66,10 @@ impl crate::Controller for CtrlFanAndCPU {
file.write_all(format!("{:?}\n", config.power_profile).as_bytes())
.unwrap_or_else(|err| error!("Could not write to {}, {:?}", self.path, err));
self.set_pstate_for_fan_mode(FanLevel::from(config.power_profile), config)?;
info!("Reloaded fan mode: {:?}", FanLevel::from(config.power_profile));
info!(
"Reloaded fan mode: {:?}",
FanLevel::from(config.power_profile)
);
Ok(())
}
}
@@ -128,7 +132,10 @@ impl CtrlFanAndCPU {
fan_ctrl
.write_all(format!("{:?}\n", config.power_profile).as_bytes())
.unwrap_or_else(|err| error!("Could not write to {}, {:?}", self.path, err));
info!("Fan mode set to: {:?}", FanLevel::from(config.power_profile));
info!(
"Fan mode set to: {:?}",
FanLevel::from(config.power_profile)
);
self.set_pstate_for_fan_mode(FanLevel::from(n), config)?;
Ok(())
}