Various cleanup. Add GA402X LED modes

This commit is contained in:
Luke D. Jones
2023-07-24 10:04:10 +12:00
parent 51bcb0082b
commit a6d89a622b
7 changed files with 139 additions and 28 deletions

View File

@@ -300,7 +300,7 @@ impl FanCurveProfiles {
Ok(())
}
pub fn set_profile_curve_enabled(&mut self, profile: Profile, enabled: bool) {
pub fn set_profile_curves_enabled(&mut self, profile: Profile, enabled: bool) {
match profile {
Profile::Balanced => {
for curve in self.balanced.iter_mut() {
@@ -320,6 +320,40 @@ impl FanCurveProfiles {
}
}
pub fn set_profile_fan_curve_enabled(
&mut self,
profile: Profile,
fan: FanCurvePU,
enabled: bool,
) {
match profile {
Profile::Balanced => {
for curve in self.balanced.iter_mut() {
if curve.fan == fan {
curve.enabled = enabled;
break;
}
}
}
Profile::Performance => {
for curve in self.performance.iter_mut() {
if curve.fan == fan {
curve.enabled = enabled;
break;
}
}
}
Profile::Quiet => {
for curve in self.quiet.iter_mut() {
if curve.fan == fan {
curve.enabled = enabled;
break;
}
}
}
}
}
pub fn get_fan_curves_for(&self, name: Profile) -> &[CurveData] {
match name {
Profile::Balanced => &self.balanced,