File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -266,19 +266,19 @@ bool Adafruit_I2CDevice::setSpeed(uint32_t desiredclk) {
266
266
// calculate TWBR correctly
267
267
268
268
if ((F_CPU / 18 ) < desiredclk) {
269
- #ifdef DEBUG_SERIAL
269
+ #ifdef DEBUG_SERIAL
270
270
Serial.println (F (" I2C.setSpeed too high." ));
271
- #endif
271
+ #endif
272
272
return false ;
273
273
}
274
274
uint32_t atwbr = ((F_CPU / desiredclk) - 16 ) / 2 ;
275
275
if (atwbr > 16320 ) {
276
- #ifdef DEBUG_SERIAL
276
+ #ifdef DEBUG_SERIAL
277
277
Serial.println (F (" I2C.setSpeed too low." ));
278
- #endif
278
+ #endif
279
279
return false ;
280
280
}
281
-
281
+
282
282
if (atwbr <= 255 ) {
283
283
atwbr /= 1 ;
284
284
TWSR = 0x0 ;
@@ -288,7 +288,7 @@ bool Adafruit_I2CDevice::setSpeed(uint32_t desiredclk) {
288
288
} else if (atwbr <= 4080 ) {
289
289
atwbr /= 16 ;
290
290
TWSR = 0x2 ;
291
- } else { // if (atwbr <= 16320)
291
+ } else { // if (atwbr <= 16320)
292
292
atwbr /= 64 ;
293
293
TWSR = 0x3 ;
294
294
}
You can’t perform that action at this time.
0 commit comments