From 271ed686f3681aac977a23993e0db60614b64189 Mon Sep 17 00:00:00 2001 From: Jerome Coutant Date: Tue, 19 Apr 2022 15:01:39 +0200 Subject: [PATCH] STM32L0 : I2C2 was missing --- targets/TARGET_STM/TARGET_STM32L0/i2c_device.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/targets/TARGET_STM/TARGET_STM32L0/i2c_device.c b/targets/TARGET_STM/TARGET_STM32L0/i2c_device.c index e728a413e6..46999b683f 100755 --- a/targets/TARGET_STM/TARGET_STM32L0/i2c_device.c +++ b/targets/TARGET_STM/TARGET_STM32L0/i2c_device.c @@ -46,6 +46,11 @@ uint32_t i2c_get_pclk(I2CName i2c) break; } } +#if defined I2C2_BASE + else if (i2c == I2C_2) { + pclk = HAL_RCC_GetPCLK1Freq(); + } +#endif #if defined I2C3_BASE else if (i2c == I2C_3) { clocksource = __HAL_RCC_GET_I2C3_SOURCE();