今天在学习AT32F437系列I2C的参考例程时,看到I2C中断方式通讯的例程里面有下面一个延时操作。有人知道为什么吗?
/* wait for the communication to end */
if(i2c_wait_end(&hi2cx, I2C_TIMEOUT) != I2C_OK)
{
error_handler(i2c_status);
}
delay_ms(10);
/* start the request reception process */
if((i2c_status = i2c_master_receive_int(&hi2cx, I2Cx_ADDRESS, rx_buf, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
{
error_handler(i2c_status);
}
上文中的第7行,delay_ms(10)延时处理。
我在单步调试时,看到没有这个延时处理通讯也正常的。
还有人做过类似的测试不??
|