void EEPROM_Wait()
{
do
{
I2C_GenerateSTART(EEPROM_IIC,ENABLE);
//while(I2C_CheckEvent(EEPROM_IIC,I2C_EVENT_MASTER_MODE_SELECT)==ERROR);
while( I2C_GetFlagStatus(EEPROM_IIC,I2C_FLAG_SB)==RESET);
I2C_Send7bitAddress(EEPROM_IIC,EEPROM_ARRD,I2C_Direction_Transmitter);
}
//while(I2C_CheckEvent(EEPROM_IIC,I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED )==ERROR);
while( I2C_GetFlagStatus(EEPROM_IIC,I2C_FLAG_ADDR)==RESET);
I2C_GenerateSTOP(EEPROM_IIC,ENABLE);
}
两段while是被注释的,视频中说是32运行过快,但为啥我改成了FLAG,还是调试不出来,一步步调试时,还是在这一步卡死了,怎么改
附说明:EEPROM_IIC就是I2C1 |