fancontrol
This commit is contained in:
28
fancontrol
28
fancontrol
@@ -335,21 +335,20 @@ function UpdateFanSpeeds {
|
|||||||
echo "pwmpval=$pwmpval"
|
echo "pwmpval=$pwmpval"
|
||||||
echo "fanval=$fanval"
|
echo "fanval=$fanval"
|
||||||
fi
|
fi
|
||||||
|
if (( $tval <= $offt )); then
|
||||||
if (( $tval <= $offt ))
|
pwmval=$minpwm # below min temp, use defined min pwm
|
||||||
then pwmval=$minpwm # below min temp, use defined min pwm
|
elif (( $tval >= $maxt )); then
|
||||||
elif (( $tval >= $maxt ))
|
pwmval=$maxpwm # over max temp, use defined max pwm
|
||||||
then pwmval=$maxpwm # over max temp, use defined max pwm
|
elif(( $tval > $mint )); then
|
||||||
elif(( $tval > $mint ))
|
pwmval=$maxpwm # over max temp, use defined max pwm
|
||||||
then
|
|
||||||
# calculate the new value from temperature and settings
|
# calculate the new value from temperature and settings
|
||||||
pwmval="(${tval}-${mint})*(${maxpwm}-${minso})/(${maxt}-${mint})+${minso}"
|
#pwmval="(${tval}-${mint})*(${maxpwm}-${minso})/(${maxt}-${mint})+${minso}"
|
||||||
if [ $pwmpval -eq 0 -o $fanval -eq 0 ]
|
#if [ $pwmpval -eq 0 -o $fanval -eq 0 ]
|
||||||
then # if fan was stopped start it using a safe value
|
#then # if fan was stopped start it using a safe value
|
||||||
echo $minsa > $pwmo
|
# echo $minsa > $pwmo
|
||||||
# Sleep while still handling signals
|
# # Sleep while still handling signals
|
||||||
read < <(exec sleep 1)
|
# read < <(exec sleep 1)
|
||||||
fi
|
#fi
|
||||||
#else ( > offt and < mint )
|
#else ( > offt and < mint )
|
||||||
# keep running on current value
|
# keep running on current value
|
||||||
fi
|
fi
|
||||||
@@ -382,6 +381,7 @@ do
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo 'Starting automatic fan control...'
|
echo 'Starting automatic fan control...'
|
||||||
|
pwmval=$maxpwm
|
||||||
|
|
||||||
# main loop calling the main function at specified intervals
|
# main loop calling the main function at specified intervals
|
||||||
while true
|
while true
|
||||||
|
|||||||
Reference in New Issue
Block a user