diff --git a/rog-aura/src/builtin_modes.rs b/rog-aura/src/builtin_modes.rs index 212eecd9..47b94b56 100644 --- a/rog-aura/src/builtin_modes.rs +++ b/rog-aura/src/builtin_modes.rs @@ -216,7 +216,7 @@ pub enum AuraZone { /// Default factory modes structure. This easily converts to an USB HID packet with: /// ```rust -/// let bytes: [u8; LED_MSG_LEN] = mode.into(); +/// // let bytes: [u8; LED_MSG_LEN] = mode.into(); /// ``` #[cfg_attr(feature = "dbus", derive(Type))] #[derive(Debug, Clone, Deserialize, Serialize)] diff --git a/rog-profiles/src/fan_curve_set.rs b/rog-profiles/src/fan_curve_set.rs index 830c3d4a..adf15b4a 100644 --- a/rog-profiles/src/fan_curve_set.rs +++ b/rog-profiles/src/fan_curve_set.rs @@ -71,10 +71,10 @@ impl std::str::FromStr for CurveData { } else { let mut p = r; if percentages { - p *= 255 / 100; if r > 100 { return Err(ProfileError::ParseFanCurvePercentOver100(r)); } + p = (p as f32 * 2.55).round() as u8; } if pwm_prev > p { return Err(ProfileError::ParseFanCurvePrevHigher( @@ -222,7 +222,7 @@ mod tests { .unwrap(); assert_eq!(curve.fan, FanCurvePU::CPU); assert_eq!(curve.temp, [30, 49, 59, 69, 79, 89, 99, 109]); - assert_eq!(curve.pwm, [1, 2, 3, 4, 31, 49, 56, 58]); + assert_eq!(curve.pwm, [3, 5, 8, 10, 79, 125, 143, 148]); } #[test]