diff --git a/arch/arm/src/stm32/stm32_i2c.c b/arch/arm/src/stm32/stm32_i2c.c index 5f3e1c2c5c9..6a08e141437 100644 --- a/arch/arm/src/stm32/stm32_i2c.c +++ b/arch/arm/src/stm32/stm32_i2c.c @@ -1272,7 +1272,7 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv) * device. */ -#ifdef CONFIG_I2C_POLLED +#ifndef CONFIG_I2C_POLLED irqstate_t flags = enter_critical_section(); #endif /* Receive a byte */ @@ -1287,7 +1287,7 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv) stm32_i2c_modifyreg(priv, STM32_I2C_CR1_OFFSET, I2C_CR1_ACK, 0); } -#ifdef CONFIG_I2C_POLLED +#ifndef CONFIG_I2C_POLLED leave_critical_section(flags); #endif } diff --git a/arch/arm/src/stm32/stm32f30xxx_i2c.c b/arch/arm/src/stm32/stm32f30xxx_i2c.c index 539305194d7..9d616b74890 100644 --- a/arch/arm/src/stm32/stm32f30xxx_i2c.c +++ b/arch/arm/src/stm32/stm32f30xxx_i2c.c @@ -1332,7 +1332,7 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv) * device. */ -#ifdef CONFIG_I2C_POLLED +#ifndef CONFIG_I2C_POLLED irqstate_t flags = enter_critical_section(); #endif /* Receive a byte */ @@ -1347,7 +1347,7 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv) /* autoend? */ } -#ifdef CONFIG_I2C_POLLED +#ifndef CONFIG_I2C_POLLED leave_critical_section(flags); #endif } diff --git a/arch/arm/src/stm32f0/stm32f0_i2c.c b/arch/arm/src/stm32f0/stm32f0_i2c.c index c782754fc34..b8f7ede7d6b 100644 --- a/arch/arm/src/stm32f0/stm32f0_i2c.c +++ b/arch/arm/src/stm32f0/stm32f0_i2c.c @@ -1306,7 +1306,7 @@ static int stm32f0_i2c_isr_process(struct stm32f0_i2c_priv_s *priv) * device. */ -#ifdef CONFIG_I2C_POLLED +#ifndef CONFIG_I2C_POLLED irqstate_t flags = enter_critical_section(); #endif /* Receive a byte */ @@ -1321,7 +1321,7 @@ static int stm32f0_i2c_isr_process(struct stm32f0_i2c_priv_s *priv) /* autoend? */ } -#ifdef CONFIG_I2C_POLLED +#ifndef CONFIG_I2C_POLLED leave_critical_section(flags); #endif } diff --git a/arch/arm/src/stm32f7/stm32_i2c.c b/arch/arm/src/stm32f7/stm32_i2c.c index be3122ea4e2..d85023e6c55 100644 --- a/arch/arm/src/stm32f7/stm32_i2c.c +++ b/arch/arm/src/stm32f7/stm32_i2c.c @@ -1776,7 +1776,7 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv) * sequence. Otherwise, additional bytes may be received. */ -#ifdef CONFIG_I2C_POLLED +#ifndef CONFIG_I2C_POLLED irqstate_t state = enter_critical_section(); #endif /* Receive a byte */ @@ -1793,7 +1793,7 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv) priv->dcnt--; -#ifdef CONFIG_I2C_POLLED +#ifndef CONFIG_I2C_POLLED leave_critical_section(state); #endif } diff --git a/arch/arm/src/stm32l4/stm32l4_i2c.c b/arch/arm/src/stm32l4/stm32l4_i2c.c index 58c2fa780f8..956dd8c7884 100644 --- a/arch/arm/src/stm32l4/stm32l4_i2c.c +++ b/arch/arm/src/stm32l4/stm32l4_i2c.c @@ -1384,7 +1384,7 @@ static int stm32l4_i2c_isr_process(struct stm32l4_i2c_priv_s *priv) * device. */ -#ifdef CONFIG_I2C_POLLED +#ifndef CONFIG_I2C_POLLED irqstate_t flags = enter_critical_section(); #endif /* Receive a byte */ @@ -1399,7 +1399,7 @@ static int stm32l4_i2c_isr_process(struct stm32l4_i2c_priv_s *priv) /* autoend? */ } -#ifdef CONFIG_I2C_POLLED +#ifndef CONFIG_I2C_POLLED leave_critical_section(flags); #endif }