Skip to content

Commit 1348cb4

Browse files
committed
Fix SAMD I2C frequency check
1 parent 8b2f061 commit 1348cb4

File tree

1 file changed

+1
-1
lines changed
  • ports/atmel-samd/common-hal/busio

1 file changed

+1
-1
lines changed

ports/atmel-samd/common-hal/busio/I2C.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
123123
// The maximum frequency divisor gives a clock rate of around 48MHz/2/255
124124
// but set_baudrate does not diagnose this problem. (This is not the
125125
// exact cutoff, but no frequency well under 100kHz is available)
126-
if (frequency < 95000 &&
126+
if (frequency < 95000 ||
127127
i2c_m_sync_set_baudrate(&self->i2c_desc, 0, frequency / 1000) != ERR_NONE) {
128128
reset_pin_number(sda->number);
129129
reset_pin_number(scl->number);

0 commit comments

Comments
 (0)