diff options
author | warhog <warhog@gmx.de> | 2011-05-28 15:15:24 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2011-05-30 14:58:11 +0200 |
commit | 148dd71e1391602e4bd216c0bf3311baebb031f4 (patch) | |
tree | e79a17269922c9d82989251d4280711ba8d41af3 /package/alix-temperature/files | |
parent | 29309d77022616b497b68581fd0bc7b0af0084a9 (diff) |
new package alix-temperature
Signed-off-by: warhog <warhog@gmx.de>
Diffstat (limited to 'package/alix-temperature/files')
-rw-r--r-- | package/alix-temperature/files/alix-temperature | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/package/alix-temperature/files/alix-temperature b/package/alix-temperature/files/alix-temperature new file mode 100644 index 000000000..cdcf5c1fe --- /dev/null +++ b/package/alix-temperature/files/alix-temperature @@ -0,0 +1,43 @@ +#!/bin/sh +# temperature.sh +# this tool reads the lm86 from pcengines alix mainboards. +# http://pcengines.ch/alix.htm +# tested only on alix2d13 but should work on the other +# alix2dxx and alix3dxx boards too. +# +# Copyright (C) 2011 Tobias Breckle <tobias.breckle@stz-bt.de> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +CMD="i2cget -y 0 0x4c" + +TEMP_LOCAL=`$CMD 0x00` +TEMP_REMOTE_HIGH=`$CMD 0x01` +TEMP_REMOTE_LOW=`$CMD 0x10` + +let "TEMP_REMOTE_LOW >>= 5" +let "TEMP_REMOTE_LOW = TEMP_REMOTE_LOW * 125" + +if [ "$1" = "local" ] +then + printf "Local:\t%d\n" $TEMP_LOCAL +elif [ "$1" = "remote" ] +then + printf "Remote:\t%d,%d\n" $TEMP_REMOTE_HIGH $TEMP_REMOTE_LOW +elif [ -z "$1" ] +then + printf "Local:\t%d\n" $TEMP_LOCAL + printf "Remote:\t%d,%d\n" $TEMP_REMOTE_HIGH $TEMP_REMOTE_LOW +fi + |