clang
This commit is contained in:
parent
fe6bb61052
commit
0e5b03fcfb
|
|
@ -261,7 +261,8 @@ uint8_t Adafruit_I2CDevice::address(void) { return _addr; }
|
||||||
* Not necessarily that the speed was achieved!
|
* Not necessarily that the speed was achieved!
|
||||||
*/
|
*/
|
||||||
bool Adafruit_I2CDevice::setSpeed(uint32_t desiredclk) {
|
bool Adafruit_I2CDevice::setSpeed(uint32_t desiredclk) {
|
||||||
#if defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) // fix arduino core set clock
|
#if defined(__AVR_ATmega328__) || \
|
||||||
|
defined(__AVR_ATmega328P__) // fix arduino core set clock
|
||||||
// calculate TWBR correctly
|
// calculate TWBR correctly
|
||||||
uint8_t prescaler = 1;
|
uint8_t prescaler = 1;
|
||||||
uint32_t atwbr = ((F_CPU / desiredclk) - 16) / 2;
|
uint32_t atwbr = ((F_CPU / desiredclk) - 16) / 2;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue