diff options
author | Andrew Leech <andrew.leech@planetinnovation.com.au> | 2019-04-18 10:31:44 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-05-21 12:20:19 +1000 |
commit | ed2b6ea0a8f4d55a373af032faeca128c0741317 (patch) | |
tree | bb88cf6e52ff93bb159c827841a977bf1807bf31 /ports/stm32/mpconfigboard_common.h | |
parent | e5e472198c0cf5cbac8fdf0a9ad5037a9c995f02 (diff) | |
download | micropython-ed2b6ea0a8f4d55a373af032faeca128c0741317.tar.gz micropython-ed2b6ea0a8f4d55a373af032faeca128c0741317.zip |
stm32/i2c: Make timeout for hardware I2C configurable.
Previously the hardware I2C timeout was hard coded to 50ms which isn't
guaranteed to be enough depending on the clock stretching specs of the I2C
device(s) in use.
This patch ensures the hardware I2C implementation honors the existing
timeout argument passed to the machine.I2C constructor. The default
timeout for software and hardware I2C is now 50ms.
Diffstat (limited to 'ports/stm32/mpconfigboard_common.h')
-rw-r--r-- | ports/stm32/mpconfigboard_common.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ports/stm32/mpconfigboard_common.h b/ports/stm32/mpconfigboard_common.h index 4348f50bdd..f3a3d48e7f 100644 --- a/ports/stm32/mpconfigboard_common.h +++ b/ports/stm32/mpconfigboard_common.h @@ -138,6 +138,7 @@ #define MP_HAL_UNIQUE_ID_ADDRESS (0x1ffff7ac) #define PYB_EXTI_NUM_VECTORS (23) +#define MICROPY_HW_MAX_I2C (2) #define MICROPY_HW_MAX_TIMER (17) #define MICROPY_HW_MAX_UART (8) @@ -146,6 +147,7 @@ #define MP_HAL_UNIQUE_ID_ADDRESS (0x1fff7a10) #define PYB_EXTI_NUM_VECTORS (23) +#define MICROPY_HW_MAX_I2C (3) #define MICROPY_HW_MAX_TIMER (14) #if defined(UART10) #define MICROPY_HW_MAX_UART (10) @@ -169,6 +171,7 @@ #endif #define PYB_EXTI_NUM_VECTORS (24) +#define MICROPY_HW_MAX_I2C (4) #define MICROPY_HW_MAX_TIMER (17) #define MICROPY_HW_MAX_UART (8) |