From 57af6174f05cd6c15c89325809d7c5dc7d7c8c74 Mon Sep 17 00:00:00 2001 From: jinxudong Date: Tue, 6 Sep 2022 11:27:14 +0800 Subject: [PATCH] fix: sensor: update hall data type update hall data type to int32_t Signed-off-by: jinxudong --- system/uorb/sensor/hall.c | 3 ++- testing/sensortest/sensortest.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system/uorb/sensor/hall.c b/system/uorb/sensor/hall.c index f55409ff6..fa97e4e4d 100644 --- a/system/uorb/sensor/hall.c +++ b/system/uorb/sensor/hall.c @@ -35,7 +35,8 @@ static void print_sensor_hall_message(FAR const struct orb_metadata *meta, FAR const struct sensor_hall *message = buffer; const orb_abstime now = orb_absolute_time(); - uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) hall: %d", + uorbinfo_raw("%s:\ttimestamp: %" PRIu64 " (%" PRIu64 " us ago) " + "hall: %" PRIi32 "", meta->o_name, message->timestamp, now - message->timestamp, message->hall); } diff --git a/testing/sensortest/sensortest.c b/testing/sensortest/sensortest.c index 4a4b27f3a..11c1b400e 100644 --- a/testing/sensortest/sensortest.c +++ b/testing/sensortest/sensortest.c @@ -128,7 +128,7 @@ static void print_vec3(const char *buffer, const char *name) static void print_valb(const char *buffer, const char *name) { FAR struct sensor_hall *event = (FAR struct sensor_hall *)buffer; - printf("%s: timestamp:%" PRIu64 " value:%d\n", + printf("%s: timestamp:%" PRIu64 " value:%" PRIi32 "\n", name, event->timestamp, event->hall); }