FXLS896xAF library: fxls896xaf_disable_interrupt() uses wrong register?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FXLS896xAF library: fxls896xaf_disable_interrupt() uses wrong register?

726 Views
andrewneil
Contributor III

The function uses the SENS_CONFIG4 register:

uint8_t fxls896xaf_disable_interrupt(fxls896xaf_driver_t *pDriver, fxls896xaf_interrupt_source_t intSource)
{
    if(NULL == pDriver)
	{
		return SENSOR_INVALIDPARAM_ERR;
	}
	uint8_t ctrlReg;
	uint8_t status = SENSOR_SUCCESS;
	status = sensor_comm_read(&pDriver->comHandle, FXLS896xAF_SENS_CONFIG4, 1, &ctrlReg);
	if(status != SENSOR_SUCCESS)
	{
	    return status;
	}
	ctrlReg &= ~intSource;
	// disable the interrupt sources configured
	status = sensor_comm_write(&pDriver->comHandle, FXLS896xAF_SENS_CONFIG4, 1, &ctrlReg);
	if(status != SENSOR_SUCCESS)
	{
	    return status;
	}
    return status;
}

 

But, surely, SENS_CONFIG4 is the wrong register - it should be INT_EN ?

Also, the header comment has the wrong parameter descriptions (copy-paste error):

/*! @brief       The interface function to disable specified interrupt source/sources 
 *  @details     This function allow the disable the multiple source using single call.
 *  @Param[in]   pDriver - Pointer to the driver. 
 *  @Param[in]   ODR - ODR to be configured 
 *  @Param[in]   pConfig, the pointer to the acceleration configuration.
 *  @return      returns the status of the operation.
 */
uint8_t fxls896xaf_disable_interrupt(fxls896xaf_driver_t *pDriver, fxls896xaf_interrupt_source_t intSource);

 

Labels (1)
0 Kudos
Reply
0 Replies