index fix

This commit is contained in:
Hierophect 2019-09-19 12:45:47 -04:00
parent 60985968a8
commit c85873e4e6

View File

@ -54,9 +54,9 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
}
}
//check if pins are on the same I2C peripheral
//handle typedef selection, errors
if(self->sda->i2c_index == self->scl->i2c_index) {
I2Cx = mcu_i2c_banks[self->sda->i2c_index];
I2Cx = mcu_i2c_banks[self->sda->i2c_index-1];
} else {
mp_raise_RuntimeError(translate("Invalid I2C pin selection"));
}