OSDN Git Service
(root)
/
android-x86
/
hardware-intel-libsensors.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d3b18bb
)
STPK-1429 Cut off temperature readings at two decimals
author
Patrick Porlan
<patrick.porlan@intel.com>
Mon, 12 May 2014 14:53:37 +0000
(16:53 +0200)
committer
suyyala
<sridhar.uyyala@intel.com>
Fri, 16 May 2014 18:14:41 +0000
(11:14 -0700)
Centigrades are enough and make temperature readings much
easier to read.
Issue: STPK-1429
Change-Id: Id15f7ecca38c191b00996569d70ad6caabebd8a5
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
transform.c
patch
|
blob
|
history
diff --git
a/transform.c
b/transform.c
index
efc9cea
..
b91642c
100644
(file)
--- a/
transform.c
+++ b/
transform.c
@@
-195,6
+195,12
@@
static void finalize_sample_default(int s, struct sensors_event_t* data)
data->data[2] = 0;
}
break;
+
+ case SENSOR_TYPE_AMBIENT_TEMPERATURE:
+ case SENSOR_TYPE_TEMPERATURE:
+ /* Only keep two decimals for temperature readings */
+ data->data[0] = 0.01 * ((int) (data->data[0] * 100));
+ break;
}
}