This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 7121debb1d2437da8fc74d3f43ec8a1f300d137b
Author: likun17 <[email protected]>
AuthorDate: Thu Aug 21 15:06:53 2025 +0800

    drivers/sensors: Add light uncalibrated sensor type.
    
    There is no sensor type for the raw value of an ambient light sensor,
    so a driver that reports both the calibrated and the uncalibrated lux
    can only register one of them. nuttx-apps already defines the
    sensor_light_uncal topic.
    
    Add SENSOR_TYPE_LIGHT_UNCALIBRATED after the existing types and the
    matching "light_uncal" entry, using struct sensor_light, to the sensor
    meta table. The values of the existing types do not change.
    
    Signed-off-by: likun17 <[email protected]>
---
 drivers/sensors/sensor.c | 1 +
 include/nuttx/uorb.h     | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/sensors/sensor.c b/drivers/sensors/sensor.c
index 52554c31115..ec2416a75ec 100644
--- a/drivers/sensors/sensor.c
+++ b/drivers/sensors/sensor.c
@@ -235,6 +235,7 @@ static const struct sensor_meta_s g_sensor_meta[] =
   {sizeof(struct sensor_energy),              "energy"},
   {sizeof(struct sensor_charge),              "charge"},
   {sizeof(struct sensor_inclinometer),        "inclinometer"},
+  {sizeof(struct sensor_light),               "light_uncal"},
 };
 
 static const struct file_operations g_sensor_fops =
diff --git a/include/nuttx/uorb.h b/include/nuttx/uorb.h
index f884910bc1b..11ee6ff4b9a 100644
--- a/include/nuttx/uorb.h
+++ b/include/nuttx/uorb.h
@@ -660,11 +660,17 @@
 
 #define SENSOR_TYPE_INCLINOMETER                    66
 
+/* Ambient Light Uncalibrated
+ * The ambient light sensor uncalibrated value is returned in SI units lux.
+ */
+
+#define SENSOR_TYPE_LIGHT_UNCALIBRATED              67
+
 /* The total number of sensor
  * please increase it if you added a new sensor type!
  */
 
-#define SENSOR_TYPE_COUNT                           67
+#define SENSOR_TYPE_COUNT                           68
 
 /* The additional sensor open flags */
 

Reply via email to