You can use ```i2c_disable_interrupt(i2c, I2C_CR2_ITERREN)``` and ```i2c_disable_interrupt(i2c, I2C_CR2_ITEVTEN)``` instead of checking for each i2c bus.