mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-20 19:41:47 +00:00
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:
1 parent
c1e28f8896
commit
a3c77b0191
5 files changed
+10
-10
No files matched your search
+2
-2
@@ -137,12 +137,12 @@ static int init = 1;
|
||||
#define THERMISTOR 2
|
||||
#define PIIDIODE 3
|
||||
|
||||
/* Conversions. Rounding and limit checking is only done on the TO_REG
|
||||
/* Conversions. Limit checking is only done on the TO_REG
|
||||
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 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)
|
||||
|
||||
static inline u8 FAN_TO_REG(long rpm, int div)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user