Fix IN_FROM_REG rounding.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2124 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2003-11-30 11:40:20 +00:00
1 parent c1e28f8896
commit a3c77b0191
5 files changed
+10 -10

No files matched your search

+2 -2
View File
@@ -102,7 +102,7 @@ SENSORS_INSMOD_1(mtp008);
#define PIIDIODE 3
/*
* Conversion routines and macros. Rounding and limit checking is only done on
* Conversion routines and macros. Limit checking is only done on
* the TO_REG variants.
*
* Note that IN values are expressed as 100 times the actual voltage to avoid
@@ -110,7 +110,7 @@ SENSORS_INSMOD_1(mtp008);
* 409 (0V to 4.096V).
*/
#define IN_TO_REG(val) (SENSORS_LIMIT((((val) * 10 + 8) / 16), 0, 255))
#define IN_FROM_REG(val) (((val) * 16) / 10)
#define IN_FROM_REG(val) (((val) * 16 + 5) / 10)
/*
* The fan cotation count (as stored in the register) is calculated using the