clang-format

This commit is contained in:
rob tillaart 2022-08-08 21:31:17 +02:00
parent 3cc0846d78
commit e238822921
1 changed files with 6 additions and 6 deletions

View File

@ -266,19 +266,19 @@ bool Adafruit_I2CDevice::setSpeed(uint32_t desiredclk) {
// calculate TWBR correctly // calculate TWBR correctly
if ((F_CPU / 18) < desiredclk) { if ((F_CPU / 18) < desiredclk) {
#ifdef DEBUG_SERIAL #ifdef DEBUG_SERIAL
Serial.println(F("I2C.setSpeed too high.")); Serial.println(F("I2C.setSpeed too high."));
#endif #endif
return false; return false;
} }
uint32_t atwbr = ((F_CPU / desiredclk) - 16) / 2; uint32_t atwbr = ((F_CPU / desiredclk) - 16) / 2;
if (atwbr > 16320) { if (atwbr > 16320) {
#ifdef DEBUG_SERIAL #ifdef DEBUG_SERIAL
Serial.println(F("I2C.setSpeed too low.")); Serial.println(F("I2C.setSpeed too low."));
#endif #endif
return false; return false;
} }
if (atwbr <= 255) { if (atwbr <= 255) {
atwbr /= 1; atwbr /= 1;
TWSR = 0x0; TWSR = 0x0;
@ -288,7 +288,7 @@ bool Adafruit_I2CDevice::setSpeed(uint32_t desiredclk) {
} else if (atwbr <= 4080) { } else if (atwbr <= 4080) {
atwbr /= 16; atwbr /= 16;
TWSR = 0x2; TWSR = 0x2;
} else { // if (atwbr <= 16320) } else { // if (atwbr <= 16320)
atwbr /= 64; atwbr /= 64;
TWSR = 0x3; TWSR = 0x3;
} }