diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2020-10-07 13:46:45 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-08 07:09:55 +0000 |
commit | 07a5e62872edfab8cdcd831e023675e4bbb1bf85 (patch) | |
tree | 21f53fdf1015f4d3456a4a61b27bdb1afc5e6518 | |
parent | 4a8bef2e93e435d7f3fd9591139250718d5a4026 (diff) | |
download | chrome-ec-07a5e62872edfab8cdcd831e023675e4bbb1bf85.tar.gz |
util/ectool: Fix timestamp display in motionsense fifo_read
|timestamp| decoding was wrong. Use union field instead.
BUG=none
BRANCH=none
TEST=Check 'ectool motionsense fifo_read 256' displays a reasonable
timestamp when sensors are producing events.
Change-Id: Idf7362730f9d66ec2f125b0c3dbcf2b14c1235ca
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2458836
Reviewed-by: Ching-Kang Yen <chingkang@chromium.org>
-rw-r--r-- | util/ectool.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/util/ectool.c b/util/ectool.c index 6d2a74d94e..81bd860b53 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -5473,12 +5473,9 @@ static int cmd_motionsense(int argc, char **argv) if (vector->flags & (MOTIONSENSE_SENSOR_FLAG_TIMESTAMP | MOTIONSENSE_SENSOR_FLAG_FLUSH)) { - uint32_t timestamp = 0; - memcpy(×tamp, vector->data, - sizeof(uint32_t)); printf("Timestamp:%" PRIx32 "%s\n", - timestamp, + vector->timestamp, (vector->flags & MOTIONSENSE_SENSOR_FLAG_FLUSH ? " - Flush" : "")); |