diff --git a/arch/arm/src/stm32/stm32_i2c.c b/arch/arm/src/stm32/stm32_i2c.c index c7301c60372..a46cc4af99a 100644 --- a/arch/arm/src/stm32/stm32_i2c.c +++ b/arch/arm/src/stm32/stm32_i2c.c @@ -1409,7 +1409,7 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms * will not complete normally if the FSMC is enabled. */ -#ifndef CONFIG_STM32_I2C1 +#if !defined(CONFIG_STM32_FSMC) || !defined (CONFIG_STM32_I2C1) stm32_i2c_sem_waitstop(priv); #endif @@ -1550,7 +1550,7 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms * will not complete normally if the FSMC is enabled. */ -#ifdef CONFIG_STM32_I2C1 +#if defined(CONFIG_STM32_FSMC) && defined (CONFIG_STM32_I2C1) stm32_i2c_sem_waitstop(priv); #endif