From 2fdf703486082be790930328c534fdb48a20c560 Mon Sep 17 00:00:00 2001 From: PaulZC Date: Mon, 11 Nov 2024 08:42:01 +0000 Subject: [PATCH] v1.3.0 - resolve issue #150 --- library.properties | 2 +- src/util/ICM_20948_C.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/library.properties b/library.properties index e659375..02c745d 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library -version=1.2.13 +version=1.3.0 author=SparkFun Electronics maintainer=SparkFun Electronics sentence=Use the low-power high-resolution ICM 20948 9 DoF IMU from Invensense with I2C or SPI. Version 1.2 of the library includes support for the InvenSense Digital Motion Processor (DMP™). diff --git a/src/util/ICM_20948_C.c b/src/util/ICM_20948_C.c index 6a98a51..969e144 100644 --- a/src/util/ICM_20948_C.c +++ b/src/util/ICM_20948_C.c @@ -1793,17 +1793,21 @@ ICM_20948_Status_e inv_icm20948_enable_dmp_sensor(ICM_20948_Device_t *pdev, enum } // Also check which bits need to be set in the Data Ready Status and Motion Event Control registers // Compare to INV_NEEDS_ACCEL_MASK, INV_NEEDS_GYRO_MASK and INV_NEEDS_COMPASS_MASK - if (((androidSensorAsBitMask & INV_NEEDS_ACCEL_MASK) > 0) || ((androidSensorAsBitMask & INV_NEEDS_ACCEL_MASK1) > 0)) + // See issue #150 - thank you @dobodu + if (((pdev->_enabled_Android_0 & androidSensorAsBitMask & INV_NEEDS_ACCEL_MASK) > 0) + || ((pdev->_enabled_Android_1 & androidSensorAsBitMask & INV_NEEDS_ACCEL_MASK1) > 0)) { data_rdy_status |= DMP_Data_ready_Accel; inv_event_control |= DMP_Motion_Event_Control_Accel_Calibr; } - if (((androidSensorAsBitMask & INV_NEEDS_GYRO_MASK) > 0) || ((androidSensorAsBitMask & INV_NEEDS_GYRO_MASK1) > 0)) + if (((pdev->_enabled_Android_0 & androidSensorAsBitMask & INV_NEEDS_GYRO_MASK) > 0) + || ((pdev->_enabled_Android_1 & androidSensorAsBitMask & INV_NEEDS_GYRO_MASK1) > 0)) { data_rdy_status |= DMP_Data_ready_Gyro; inv_event_control |= DMP_Motion_Event_Control_Gyro_Calibr; } - if (((androidSensorAsBitMask & INV_NEEDS_COMPASS_MASK) > 0) || ((androidSensorAsBitMask & INV_NEEDS_COMPASS_MASK1) > 0)) + if (((pdev->_enabled_Android_0 & androidSensorAsBitMask & INV_NEEDS_COMPASS_MASK) > 0) + || ((pdev->_enabled_Android_1 & androidSensorAsBitMask & INV_NEEDS_COMPASS_MASK1) > 0)) { data_rdy_status |= DMP_Data_ready_Secondary_Compass; inv_event_control |= DMP_Motion_Event_Control_Compass_Calibr;