FXLS896xAF library: fxls896xaf_disable_interrupt() uses wrong register?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

FXLS896xAF library: fxls896xaf_disable_interrupt() uses wrong register?

1,109件の閲覧回数
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 返答(返信)
%3CLINGO-SUB%20id%3D%22lingo-sub-1789691%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EFXLS896xAF%20%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%3A%20fxls896xaf_disable_interrupt()%20%E3%81%AF%E9%96%93%E9%81%95%E3%81%A3%E3%81%9F%E3%83%AC%E3%82%B8%E3%82%B9%E3%82%BF%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%81%8B%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1789691%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E3%81%93%E3%81%AE%E9%96%A2%E6%95%B0%E3%81%AF%20SENS_CONFIG4%20%E3%83%AC%E3%82%B8%E3%82%B9%E3%82%BF%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%20translate%3D%22no%22%3Euint8_t%20fxls896xaf_disable_interrupt(fxls896xaf_driver_t%20*pDriver%2C%20fxls896xaf_interrupt_source_t%20intSource)%0A%7B%0A%20%20%20%20if(NULL%20%3D%3D%20pDriver)%0A%09%7B%0A%09%09return%20SENSOR_INVALIDPARAM_ERR%3B%0A%09%7D%0A%09uint8_t%20ctrlReg%3B%0A%09uint8_t%20status%20%3D%20SENSOR_SUCCESS%3B%0A%09status%20%3D%20sensor_comm_read(%26amp%3BpDriver-%26gt%3BcomHandle%2C%20FXLS896xAF_SENS_CONFIG4%2C%201%2C%20%26amp%3BctrlReg)%3B%0A%09if(status%20!%3D%20SENSOR_SUCCESS)%0A%09%7B%0A%09%20%20%20%20return%20status%3B%0A%09%7D%0A%09ctrlReg%20%26amp%3B%3D%20~intSource%3B%0A%09%2F%2F%20disable%20the%20interrupt%20sources%20configured%0A%09status%20%3D%20sensor_comm_write(%26amp%3BpDriver-%26gt%3BcomHandle%2C%20FXLS896xAF_SENS_CONFIG4%2C%201%2C%20%26amp%3BctrlReg)%3B%0A%09if(status%20!%3D%20SENSOR_SUCCESS)%0A%09%7B%0A%09%20%20%20%20return%20status%3B%0A%09%7D%0A%20%20%20%20return%20status%3B%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3CP%3E%E3%81%97%E3%81%8B%E3%81%97%E3%80%81%E7%A2%BA%E3%81%8B%E3%81%AB%E3%80%81%20SENS_CONFIG4%20%E3%81%AF%E9%96%93%E9%81%95%E3%81%A3%E3%81%9F%E3%83%AC%E3%82%B8%E3%82%B9%E3%82%BF%E3%81%A7%E3%81%99%20-%20INT_EN%20%E3%81%A7%E3%81%82%E3%82%8B%E3%81%B9%E3%81%8D%E3%81%A7%E3%81%AF%E3%81%AA%E3%81%84%E3%81%A7%E3%81%97%E3%82%87%E3%81%86%E3%81%8B%3F%3C%2FP%3E%3CP%3E%E3%81%BE%E3%81%9F%E3%80%81%E3%83%98%E3%83%83%E3%83%80%E3%83%BC%E3%82%B3%E3%83%A1%E3%83%B3%E3%83%88%E3%81%AB%E3%81%AF%E9%96%93%E9%81%95%E3%81%A3%E3%81%9F%E3%83%91%E3%83%A9%E3%83%A1%E3%83%BC%E3%82%BF%E3%81%AE%E8%AA%AC%E6%98%8E%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%20(%E3%82%B3%E3%83%94%E3%83%BC%20%E3%82%A2%E3%83%B3%E3%83%89%20%E3%83%9A%E3%83%BC%E3%82%B9%E3%83%88%20%E3%82%A8%E3%83%A9%E3%83%BC)%E3%80%82%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%20translate%3D%22no%22%3E%2F*!%20%40brief%20%20%20%20%20%20%20The%20interface%20function%20to%20disable%20specified%20interrupt%20source%2Fsources%20%0A%20*%20%20%40details%20%20%20%20%20This%20function%20allow%20the%20disable%20the%20multiple%20source%20using%20single%20call.%0A%20*%20%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F197964%22%20target%3D%22_blank%22%3E%40Param%3C%2FA%3E%5Bin%5D%20%20%20pDriver%20-%20Pointer%20to%20the%20driver.%20%0A%20*%20%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F197964%22%20target%3D%22_blank%22%3E%40Param%3C%2FA%3E%5Bin%5D%20%20%20ODR%20-%20ODR%20to%20be%20configured%20%0A%20*%20%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F197964%22%20target%3D%22_blank%22%3E%40Param%3C%2FA%3E%5Bin%5D%20%20%20pConfig%2C%20the%20pointer%20to%20the%20acceleration%20configuration.%0A%20*%20%20%40return%20%20%20%20%20%20returns%20the%20status%20of%20the%20operation.%0A%20*%2F%0Auint8_t%20fxls896xaf_disable_interrupt(fxls896xaf_driver_t%20*pDriver%2C%20fxls896xaf_interrupt_source_t%20intSource)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1789691%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3E%E5%8A%A0%E9%80%9F%E5%BA%A6%E3%82%BB%E3%83%B3%E3%82%B5%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E