Changeset 851

Show
Ignore:
Timestamp:
08/04/00 00:40:43 (13 years ago)
Author:
phil
Message:

(Phil) Modified REG_TO_TEMP to work with negative values. Some testing
is needed. (Which I will do immediately after this commit.)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/kernel/chips/lm75.c

    r823 r851  
    5858   these macros are called: arguments may be evaluated more than once. 
    5959   Fixing this is just not worth it. */ 
    60 #define TEMP_FROM_REG(val) (((val) >> 7) * 5) 
     60#define TEMP_FROM_REG(val) ((((val & 0x7fff) >> 7) * 5) | ((val & 0x8000)?-256:0)) 
    6161#define TEMP_TO_REG(val)   (SENSORS_LIMIT(((((val) + 2) / 5) << 7),0,0xffff)) 
    6262