diff options
author | Yojiro Uo <yuo@cvs.openbsd.org> | 2012-09-20 20:11:59 +0000 |
---|---|---|
committer | Yojiro Uo <yuo@cvs.openbsd.org> | 2012-09-20 20:11:59 +0000 |
commit | 862a65ad28ed788f381eaec33721df1ee8b6ee61 (patch) | |
tree | 6f03c3aec2b8c99104edb01384f26c9896b7f700 /usr.bin/systat/sensors.c | |
parent | 0e23b6d7673107501af89200b19d0af5aea84086 (diff) |
add more sensor types to sensor framework.
- Pressure (10^-3 Pa)
- distance (10^-6 m)
- acceleration (10^-6 m/s^2)
ok deraadt@ reyk@
Diffstat (limited to 'usr.bin/systat/sensors.c')
-rw-r--r-- | usr.bin/systat/sensors.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.bin/systat/sensors.c b/usr.bin/systat/sensors.c index ab187b074dc..f57efd7967c 100644 --- a/usr.bin/systat/sensors.c +++ b/usr.bin/systat/sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sensors.c,v 1.26 2011/09/16 20:52:48 yuo Exp $ */ +/* $OpenBSD: sensors.c,v 1.27 2012/09/20 20:11:58 yuo Exp $ */ /* * Copyright (c) 2007 Deanna Phillips <deanna@openbsd.org> @@ -278,6 +278,15 @@ showsensor(struct sensinfo *s) case SENSOR_ANGLE: tbprintf("%3.4f degrees", s->sn_value / 1000000.0); break; + case SENSOR_DISTANCE: + printf("%.2f mm", s->sn_value / 1000.0); + break; + case SENSOR_PRESSURE: + printf("%.2f Pa", s->sn_value / 1000.0); + break; + case SENSOR_ACCEL: + printf("%2.4f m/s^2", s->sn_value / 1000000.0); + break; default: tbprintf("%10lld", s->sn_value); break; |