2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-30 13:57:41 +00:00

Changed scaling of /proc temperature entries to be 10^4 (i.e. accurate to

four decimal places).


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1440 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Abraham van der Merwe 2002-07-10 08:46:50 +00:00
parent a603f8e78b
commit 15fd257b64

View File

@ -56,6 +56,8 @@
if ((x) > TEMP_MAX) (x) = TEMP_MAX; \
} while (0)
#define PROC_TO_NATIVE(x) ((x) / 625)
#define NATIVE_TO_PROC(x) ((x) * 625)
#define CELSIUS(x) ((x) * 16)
#define ENTRY(name,proc,perm,callback) \
@ -184,17 +186,17 @@ static void lm92_temp (struct i2c_client *client,int operation,int ctl_name,int
if (operation == SENSORS_PROC_REAL_READ) {
lm92_read (client);
results[0] = data->temp.high;
results[1] = data->temp.low;
results[2] = data->temp.crit;
results[3] = data->temp.hyst;
results[4] = data->temp.input;
results[0] = NATIVE_TO_PROC (data->temp.high);
results[1] = NATIVE_TO_PROC (data->temp.low);
results[2] = NATIVE_TO_PROC (data->temp.crit);
results[3] = NATIVE_TO_PROC (data->temp.hyst);
results[4] = NATIVE_TO_PROC (data->temp.input);
*nrels_mag = 5;
} else if (operation == SENSORS_PROC_REAL_WRITE && *nrels_mag == 4) {
data->temp.high = results[0];
data->temp.low = results[1];
data->temp.crit = results[2];
data->temp.hyst = results[3];
data->temp.high = PROC_TO_NATIVE (results[0]);
data->temp.low = PROC_TO_NATIVE (results[1]);
data->temp.crit = PROC_TO_NATIVE (results[2]);
data->temp.hyst = PROC_TO_NATIVE (results[3]);
lm92_write (client);
} else if (operation == SENSORS_PROC_REAL_INFO) {
*nrels_mag = 0;