diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/i386/esm.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/arch/i386/i386/esm.c b/sys/arch/i386/i386/esm.c index 3fecb325ea6..e9b0db828ff 100644 --- a/sys/arch/i386/i386/esm.c +++ b/sys/arch/i386/i386/esm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: esm.c,v 1.3 2005/11/21 22:07:49 deraadt Exp $ */ +/* $OpenBSD: esm.c,v 1.4 2005/11/21 22:13:30 dlg Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -105,6 +105,7 @@ int esm_smb_cmd(struct esm_softc *, struct esm_smb_req *, struct esm_smb_resp *); int64_t esm_val2temp(u_int16_t); +int64_t esm_val2volts(u_int16_t); int esm_match(struct device *parent, void *match, void *aux) @@ -198,6 +199,9 @@ esm_refresh(void *arg) case SENSOR_TEMP: sensor->es_sensor.value = esm_val2temp(val->v_reading); break; + case SENSOR_VOLTS_DC: + sensor->es_sensor.value = esm_val2volts(val->v_reading); + break; default: sensor->es_sensor.value = val->v_reading; break; @@ -562,3 +566,9 @@ esm_val2temp(u_int16_t value) { return (((int64_t)value/10 * 1000000) + 273150000); } + +int64_t +esm_val2volts(u_int16_t value) +{ + return ((int64_t)value * 1000); +} |