tjko / fanpico

Fanpico: Open Source Smart PWM (PC) Fan Controller
GNU General Public License v3.0
115 stars 10 forks source link

Bugfix for when temperature sensor reading exceeds highest mapped value in temperature map. #56

Closed physcon closed 10 months ago

physcon commented 10 months ago

Fixed bug which allowed i to be incremented past the end of the array in various functions: pwm_map(), tacho_map(), get_sensor_duty(). This can cause fan speeds to drop to minimum when temperature of a sensor exceeds the highest value in the temperature map. For example, setting CONF:SENSOR1:TEMPMAP 25,20,50,100 would result in 0% fan speed when temperature exceeds 50C.

tjko commented 10 months ago

Thanks! Rather obvious off-by-one error, I must never have tested for input values going past the last point in the map...