summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-07-30 13:59:22 -0600
committerCommit Bot <commit-bot@chromium.org>2019-08-02 17:12:11 +0000
commit6fbf076045a644d8740b40551dd3252d9252a8c4 (patch)
tree1089aa46264d15efb3b6fe7016b1e00081dd4303
parent8b52438f84fa32d1508bc26c33f9b97414b185a0 (diff)
downloadchrome-ec-6fbf076045a644d8740b40551dd3252d9252a8c4.tar.gz
ectool: print unsigned version of sensor values
Some sensors use the full 16-bits for an unsigned number; print out the unsigned interpretation of the signed value as well in ectool. Example output: Timestamp:10e87e Timestamp:fdbde87d Sensor 1: -96 -8027 -1559 (as uint16: 4294967200 4294959269 4294965737) Timestamp:2c77e87f Sensor 1: -98 -8025 -1568 (as uint16: 4294967198 4294959271 4294965728) Timestamp:61bee880 Timestamp:5b38e880 Sensor 1: -97 -8026 -1568 (as uint16: 4294967199 4294959270 4294965728) Timestamp:8a10e881 Sensor 1: -98 -8025 -1560 (as uint16: 4294967198 4294959271 4294965736) BRANCH=none BUG=b:138096172, TEST=builds Change-Id: Ifa0eef9721a64b1b9e21624ee7113fbf949adbf7 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1726735 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--util/ectool.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/ectool.c b/util/ectool.c
index f3a7cf09b2..b77215bdb8 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -4897,10 +4897,14 @@ static int cmd_motionsense(int argc, char **argv)
MOTIONSENSE_SENSOR_FLAG_FLUSH ?
" - Flush" : ""));
} else {
- printf("Sensor %d: %d\t%d\t%d\n",
+ printf("Sensor %d: %d\t%d\t%d "
+ "(as uint16: %u\t%u\t%u)\n",
vector->sensor_num,
vector->data[0],
vector->data[1],
+ vector->data[2],
+ vector->data[0],
+ vector->data[1],
vector->data[2]);
}
}