From 6a4196c57286bc6d62bbcadf25da27c0ebd8e8bc Mon Sep 17 00:00:00 2001 From: likun17 Date: Thu, 27 Jun 2024 14:19:49 +0800 Subject: [PATCH] sensor:sensor info power max_range and resolution are unified with Android type. https://cs.android.com/android/_/android/platform/hardware/libhardware/+/0e67aa0caee9500b61b9c1c8b6e5cab18301364c:include_all/hardware/sensors.h Nuttx <-------------------------------> Android int32_t <-- version --> int float <-- power --> float float <-- max_range --> float float <-- resolution --> float int32_t <-- min_delay --> int32_t int32_t <-- max_delay --> int32/64_t uint32_t <-- fifo_reserved_event_count --> uint32_t uint32_t <-- fifo_max_event_count --> uint32_t char[] <-- name --> char* char[] <-- vendor --> char* Signed-off-by: likun17 --- include/nuttx/uorb.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/nuttx/uorb.h b/include/nuttx/uorb.h index 98e94f59f5..08cd67953c 100644 --- a/include/nuttx/uorb.h +++ b/include/nuttx/uorb.h @@ -784,11 +784,9 @@ struct sensor_device_info_s uint32_t version; - /* Rough estimate of this sensor's power consumption in mA. - * Divide the current data by 1000 to get the real data. - */ + /* Rough estimate of this sensor's power consumption in mA. */ - uint32_t power; + float power; /* Maximum range of this sensor's value in SI units. */ @@ -806,7 +804,7 @@ struct sensor_device_info_s * special : 0, unless otherwise noted */ - long min_delay; + int32_t min_delay; /* This value is defined only for continuous mode and on-change sensors. * it is the delay between two sensor events corresponding to the lowest @@ -816,7 +814,7 @@ struct sensor_device_info_s * applications to estimate when the batch FIFO may be full. */ - unsigned long max_delay; + int32_t max_delay; /* Number of events reserved for this sensor in the batch mode FIFO. * if there is a dedicated FIFO for this sensor, then this is the