Skip to content

Commit 9fa08ae

Browse files
committed
Update ICM_20948_C.c
1 parent 87233c0 commit 9fa08ae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/util/ICM_20948_C.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,8 +1512,6 @@ ICM_20948_Status_e inv_icm20948_enable_dmp_sensor(ICM_20948_Device_t *pdev, enum
15121512

15131513
ICM_20948_Status_e inv_icm20948_enable_dmp_sensor_int(ICM_20948_Device_t *pdev, enum inv_icm20948_sensor sensor, int state)
15141514
{
1515-
// TO DO: figure out how to disable the sensor if state is 0
1516-
15171515
ICM_20948_Status_e result = ICM_20948_Stat_Ok;
15181516

15191517
if (pdev->_dmp_firmware_available == false)
@@ -1526,6 +1524,9 @@ ICM_20948_Status_e inv_icm20948_enable_dmp_sensor_int(ICM_20948_Device_t *pdev,
15261524
if (delta == 0xFFFF)
15271525
return ICM_20948_Stat_SensorNotSupported;
15281526

1527+
if (state == 0)
1528+
delta = 0;
1529+
15291530
unsigned char data_intr_ctl[2];
15301531

15311532
data_intr_ctl[0] = (unsigned char)(delta >> 8);

0 commit comments

Comments
 (0)