From b0e880b04c336b3c3d7b4da7dfa477fb9c295b97 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 3 May 2017 18:26:24 -0600 Subject: [PATCH] Revert "STM32 I2C: More backward tests of CONFIG_I2C_POLLED. Needs to be reviewed." This reverts commit 1e054a2d3b1e3fb7be4348d88e35db3773e836b9. --- arch/arm/src/stm32/stm32_i2c.c | 4 ++-- arch/arm/src/stm32/stm32f30xxx_i2c.c | 4 ++-- arch/arm/src/stm32f0/stm32f0_i2c.c | 4 ++-- arch/arm/src/stm32f7/stm32_i2c.c | 4 ++-- arch/arm/src/stm32l4/stm32l4_i2c.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arm/src/stm32/stm32_i2c.c b/arch/arm/src/stm32/stm32_i2c.c index 6a08e14143..5f3e1c2c5c 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. */ -#ifndef CONFIG_I2C_POLLED +#ifdef 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); } -#ifndef CONFIG_I2C_POLLED +#ifdef 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 9d616b7489..539305194d 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. */ -#ifndef CONFIG_I2C_POLLED +#ifdef 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? */ } -#ifndef CONFIG_I2C_POLLED +#ifdef 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 b8f7ede7d6..c782754fc3 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. */ -#ifndef CONFIG_I2C_POLLED +#ifdef 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? */ } -#ifndef CONFIG_I2C_POLLED +#ifdef 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 d85023e6c5..be3122ea4e 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. */ -#ifndef CONFIG_I2C_POLLED +#ifdef 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--; -#ifndef CONFIG_I2C_POLLED +#ifdef 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 956dd8c788..58c2fa780f 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. */ -#ifndef CONFIG_I2C_POLLED +#ifdef 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? */ } -#ifndef CONFIG_I2C_POLLED +#ifdef CONFIG_I2C_POLLED leave_critical_section(flags); #endif }