-
I2C一直卡在了while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND));
FlagStatusi2c_flag_get(uint32_ti2c_periph,uint32_tflag){uint32_treg=0U;FlagStatusreval=RESET;/*gettheflaginwhichregister*/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;}}/*returntheflagstatus*/returnreval;}这是代码部分,最后的if语句输入一直是RESET,这个问题究竟是什么原因???
2023-11-07 0