FlagStatus i2c_flag_get(uint32_t i2c_periph,uint32_t flag )
{
uint32_t reg = 0U;
FlagStatus reval = RESET;
/* get the flag in which register */
reg = (BIT(31) & flag);
if((BIT(31) == reg)){
if((I2C_STAT1(i2c_periph)&(flag & I2C_FLAG_MASK))){
reval = SET;
}else{
reval = RESET;
}
}else{
if((I2C_STAT0(i2c_periph)&(flag & I2C_FLAG_MASK))){
reval = SET;
}else{
reval = RESET;
}
}
/* return the flag status */
return reval;
}
这是代码部分,最后的if语句输入一直是RESET,这个问题究竟是什么原因???
|