FXLS896xAF library: fxls896xaf_disable_interrupt() uses wrong register?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

FXLS896xAF library: fxls896xaf_disable_interrupt() uses wrong register?

736 次查看
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);

 

标签 (1)
0 项奖励
回复
0 回复数