mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-28 07:51:19 +01:00
Merge pull request #5832 from immesys/patch-1
samd21: i2c: clear timeout_counter
This commit is contained in:
commit
9cb73dd63f
@ -447,6 +447,7 @@ static inline int _write(SercomI2cm *dev, char *data, int length)
|
||||
dev->DATA.reg = data[buffer_counter++];
|
||||
|
||||
DEBUG("Wait for response.\n");
|
||||
timeout_counter = 0;
|
||||
while (!(dev->INTFLAG.reg & SERCOM_I2CM_INTFLAG_MB)
|
||||
&& !(dev->INTFLAG.reg & SERCOM_I2CM_INTFLAG_SB)) {
|
||||
if (++timeout_counter >= SAMD21_I2C_TIMEOUT) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user