diff --git a/bdk/thermal/fan.c b/bdk/thermal/fan.c index ad1998c..9e7a65e 100644 --- a/bdk/thermal/fan.c +++ b/bdk/thermal/fan.c @@ -29,9 +29,14 @@ void set_fan_duty(u32 duty) static bool fan_init = false; static u16 curr_duty = -1; + if (duty > 236) + duty = 236; + if (curr_duty == duty) return; + curr_duty = duty; + //! TODO: Add HOAG/AULA support. u32 hw_type = fuse_read_hw_type(); if (hw_type != FUSE_NX_HW_TYPE_ICOSA && @@ -53,9 +58,6 @@ void set_fan_duty(u32 duty) fan_init = true; } - if (duty > 236) - duty = 236; - // Inverted polarity. u32 inv_duty = 236 - duty; @@ -78,8 +80,6 @@ void set_fan_duty(u32 duty) // Enable fan. PINMUX_AUX(PINMUX_AUX_LCD_GPIO2) = 1; // Set source to PWM1. } - - curr_duty = duty; } void get_fan_speed(u32 *duty, u32 *rpm)