diff options
Diffstat (limited to 'ports/stm32/i2c.c')
| -rw-r--r-- | ports/stm32/i2c.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ports/stm32/i2c.c b/ports/stm32/i2c.c index 8f94e783d..6c135b3a5 100644 --- a/ports/stm32/i2c.c +++ b/ports/stm32/i2c.c @@ -650,6 +650,10 @@ STATIC mp_obj_t pyb_i2c_make_new(const mp_obj_type_t *type, size_t n_args, size_ } else if (strcmp(port, MICROPY_HW_I2C3_NAME) == 0) { i2c_id = 3; #endif + #ifdef MICROPY_HW_I2C4_NAME + } else if (strcmp(port, MICROPY_HW_I2C4_NAME) == 0) { + i2c_id = 4; + #endif } else { nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "I2C(%s) doesn't exist", port)); |
