Skip to content

Commit

Permalink
Reverse the condition so that Wire.endTransmission() will always try …
Browse files Browse the repository at this point in the history
…to run before incrementing retry count
  • Loading branch information
Lisa Seelye committed Aug 14, 2010
1 parent ab3adf6 commit 089907d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion beacon2.pde
Expand Up @@ -193,7 +193,7 @@ inline void set_led_status(struct layer layer, const byte led_idx, const byte co
Wire.beginTransmission(layer.i2c_addr);
Wire.send(led_idx);
Wire.send(layer.leds[led_idx].colour); /* other end needs to decode as above */
} while (retried++ < MAX_I2C_RETRIES && Wire.endTransmission() > 0);
} while (Wire.endTransmission() > 0 && retried++ <= MAX_I2C_RETRIES);
}
return;
}
Expand Down

0 comments on commit 089907d

Please sign in to comment.