Warn about outputs found in automatic mode.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5063 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2007-12-04 10:21:16 +00:00
1 parent 972e5e2f01
commit 9bf2d8c187
2 files changed
+30

No files matched your search

+1
View File
@@ -6,6 +6,7 @@ SVN
Makefile: No warnings about ld configuration for staged installations
pwmconfig: Really hide errors on sysfs writes
Deal gracefully with read-only pwm_enable files
Warn about outputs found in automatic mode
sensors-detect: Drop PCA9540 detection
3.0.0 (2007-11-24)
+29
View File
@@ -109,6 +109,21 @@ function print_devices()
done
}
# $1 = pwm file name
function is_pwm_auto()
{
if [ -n "$SYSFS" ]
then
ENABLE=${1}_enable
if [ -f $ENABLE -a "`cat $ENABLE`" -gt 1 ]
then
return 0
fi
fi
return 1
}
# $1 = pwm file name
function pwmdisable()
{
@@ -192,6 +207,20 @@ do
echo " $i"
if [ -w $i ]
then
# First check if PWM output is in automatic mode
if is_pwm_auto $i
then
echo "$i is currently setup for automatic speed control."
echo 'In general, automatic mode is preferred over manual mode, as'
echo 'it is more efficient and it reacts faster. Are you sure that'
echo -n 'you want to setup this output for manual control? (n) '
read X
if [ "$X" = "" -o "$X" != "y" -a "$X" != "Y" ]
then
continue
fi
fi
pwmdisable $i
if [ $? -ne 0 ]
then