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

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

commit 31c7fa0bc996230023acb8b9cc6f63b540b0d627
Author: raiden00pl <[email protected]>
AuthorDate: Sun Nov 22 10:58:54 2026 +0100

    drivers/sensors/lis2mdl: fix the vendor field and the self-test exit.
    
    get_info() copied the vendor string over the sensor name, so the name
    read "STMicro" and the vendor field stayed empty.
    
    The self-test set the SELF_TEST bit again instead of clearing it, so
    the sensor kept its self-test field offset in normal operation.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: raiden00pl <[email protected]>
---
 drivers/sensors/lis2mdl_uorb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/sensors/lis2mdl_uorb.c b/drivers/sensors/lis2mdl_uorb.c
index 0aebfb43346..bf57c107921 100644
--- a/drivers/sensors/lis2mdl_uorb.c
+++ b/drivers/sensors/lis2mdl_uorb.c
@@ -671,7 +671,7 @@ static int lis2mdl_get_info(FAR struct sensor_lowerhalf_s 
*lower,
   info->version = 0;
   info->power = CURRENT_CONS[dev->odr][dev->lowpower][dev->offsets];
   memcpy(info->name, "LIS2MDL", sizeof("LIS2MDL"));
-  memcpy(info->name, "STMicro", sizeof("STMicro"));
+  memcpy(info->vendor, "STMicro", sizeof("STMicro"));
 
   info->min_delay = ODR_TO_INTERVAL[ODR_10HZ];
   info->max_delay = ODR_TO_INTERVAL[ODR_10HZ];
@@ -937,7 +937,7 @@ static int lis2mdl_selftest(FAR struct sensor_lowerhalf_s 
*lower,
 
   /* Turn off self-test for normal operation */
 
-  err = lis2mdl_set_bit(dev, REG_CFG_REG_C, BIT_SELF_TEST, true);
+  err = lis2mdl_set_bit(dev, REG_CFG_REG_C, BIT_SELF_TEST, false);
   if (err < 0)
     {
       goto end_test;

Reply via email to