(Phil) Modified REG_TO_TEMP to work with negative values. Some testing

is needed.  (Which I will do immediately after this commit.)


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@851 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Philip Edelbrock committed 2000-08-03 22:40:43 +00:00
1 parent 213d20a82e
commit 622594be1e
1 file changed
+1 -1
+1 -1
View File
@@ -57,7 +57,7 @@ SENSORS_INSMOD_1(lm75);
variants. Note that you should be a bit careful with which arguments
these macros are called: arguments may be evaluated more than once.
Fixing this is just not worth it. */
#define TEMP_FROM_REG(val) (((val) >> 7) * 5)
#define TEMP_FROM_REG(val) ((((val & 0x7fff) >> 7) * 5) | ((val & 0x8000)?-256:0))
#define TEMP_TO_REG(val) (SENSORS_LIMIT(((((val) + 2) / 5) << 7),0,0xffff))
/* Initial values */