Skip to content

Commit e7e2474

Browse files
Otpvondoiatsxiaoxiang781216
authored andcommitted
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 <[email protected]>
1 parent 899eeb3 commit e7e2474

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

include/nuttx/uorb.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -784,11 +784,9 @@ struct sensor_device_info_s
784784

785785
uint32_t version;
786786

787-
/* Rough estimate of this sensor's power consumption in mA.
788-
* Divide the current data by 1000 to get the real data.
789-
*/
787+
/* Rough estimate of this sensor's power consumption in mA. */
790788

791-
uint32_t power;
789+
float power;
792790

793791
/* Maximum range of this sensor's value in SI units. */
794792

@@ -806,7 +804,7 @@ struct sensor_device_info_s
806804
* special : 0, unless otherwise noted
807805
*/
808806

809-
long min_delay;
807+
int32_t min_delay;
810808

811809
/* This value is defined only for continuous mode and on-change sensors.
812810
* it is the delay between two sensor events corresponding to the lowest
@@ -816,7 +814,7 @@ struct sensor_device_info_s
816814
* applications to estimate when the batch FIFO may be full.
817815
*/
818816

819-
unsigned long max_delay;
817+
int32_t max_delay;
820818

821819
/* Number of events reserved for this sensor in the batch mode FIFO.
822820
* if there is a dedicated FIFO for this sensor, then this is the

0 commit comments

Comments
 (0)