From fbe02dfe6b124cad2a7b39cb306a8f66caef6fb7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 2 May 2017 10:07:31 -0600 Subject: [PATCH 1/6] net/pkt: Eliminate a warning. --- net/pkt/pkt.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/pkt/pkt.h b/net/pkt/pkt.h index aa6237da818..a1005f1d934 100644 --- a/net/pkt/pkt.h +++ b/net/pkt/pkt.h @@ -94,7 +94,8 @@ extern "C" * Public Function Prototypes ****************************************************************************/ -struct eth_hdr_s; /* Forward reference */ +struct net_driver_s; /* Forward reference */ +struct eth_hdr_s; /* Forward reference */ /* Defined in pkt_conn.c ****************************************************/ /**************************************************************************** From 74e016d01369944b025c10761240e572d4f3dd89 Mon Sep 17 00:00:00 2001 From: Juha Niskanen Date: Tue, 2 May 2017 12:36:01 +0300 Subject: [PATCH 2/6] STM32F7: flash: macro naming errors, there is no FLASH_CONFIG_F for F7 Signed-off-by: Juha Niskanen --- arch/arm/src/stm32f7/Kconfig | 14 +++++------- .../src/stm32f7/chip/stm32f74xx75xx_flash.h | 16 ++++++-------- .../src/stm32f7/chip/stm32f76xx77xx_flash.h | 22 +++++++++---------- 3 files changed, 23 insertions(+), 29 deletions(-) diff --git a/arch/arm/src/stm32f7/Kconfig b/arch/arm/src/stm32f7/Kconfig index ae131dd2f19..95e931abc21 100644 --- a/arch/arm/src/stm32f7/Kconfig +++ b/arch/arm/src/stm32f7/Kconfig @@ -26,7 +26,7 @@ config ARCH_CHIP_STM32F745VE select STM32F7_FLASH_CONFIG_E select STM32F7_IO_CONFIG_V ---help--- - STM32 F7 Cortex M7, 512 320K FLASH, 320K (240+16+64) Kb SRAM + STM32 F7 Cortex M7, 512 FLASH, 320K (240+16+64) Kb SRAM config ARCH_CHIP_STM32F745IG bool "STM32F745IG" @@ -835,7 +835,7 @@ config STM32F7_FLASH_CONFIG_E bool default n -config STM32F7_FLASH_CONFIG_I +config STM32F7_FLASH_CONFIG_G bool default n @@ -844,7 +844,7 @@ config STM32F7_FLASH_CONFIG_I default n choice - prompt "Overrdide Flash Size Designator" + prompt "Override Flash Size Designator" depends on ARCH_CHIP_STM32F7 default STM32F7_FLASH_OVERRIDE_DEFAULT ---help--- @@ -862,7 +862,7 @@ choice Examples: If the STM32F745VE is chosen, the Flash configuration would be 'E', if a variant of - the part with a 2048 KiB Flash is released in the future one could simply select + the part with a 2048 KiB Flash is released in the future one could simply select the 'I' designator here. If an STM32F7xxx Series parts is chosen the default Flash configuration will be set @@ -880,7 +880,7 @@ config STM32F7_FLASH_OVERRIDE_G config STM32F7_FLASH_OVERRIDE_I bool "I 2048KiB" -endchoice # "Overrdide Flash Size Designator" +endchoice # "Override Flash Size Designator" menu "STM32 Peripheral Support" @@ -895,7 +895,6 @@ config STM32F7_HAVE_FSMC bool default n - config STM32F7_HAVE_ETHRNET bool default n @@ -928,7 +927,6 @@ config STM32F7_HAVE_ADC3_DMA bool default n - config STM32F7_HAVE_CAN3 bool default n @@ -966,7 +964,7 @@ config STM32F7_HAVE_DFSDM1 default n # These "hidden" settings are the OR of individual peripheral selections -# indicating that the general capabilitiy is required. +# indicating that the general capability is required. config STM32F7_ADC bool diff --git a/arch/arm/src/stm32f7/chip/stm32f74xx75xx_flash.h b/arch/arm/src/stm32f7/chip/stm32f74xx75xx_flash.h index 74c2759fc94..a7624471d06 100644 --- a/arch/arm/src/stm32f7/chip/stm32f74xx75xx_flash.h +++ b/arch/arm/src/stm32f7/chip/stm32f74xx75xx_flash.h @@ -56,13 +56,11 @@ #define _K(x) ((x)*1024) #if !defined(CONFIG_STM32F7_FLASH_OVERRIDE_DEFAULT) && \ - !defined(CONFIG_STM32_FLASH_OVERRIDE_E) && \ - !defined(CONFIG_STM32_FLASH_OVERRIDE_F) && \ - !defined(CONFIG_STM32_FLASH_OVERRIDE_G) && \ - !defined(CONFIG_STM32_FLASH_CONFIG_E) && \ - !defined(CONFIG_STM32_FLASH_CONFIG_F) && \ - !defined(CONFIG_STM32_FLASH_CONFIG_G) -# define CONFIG_STM32_FLASH_OVERRIDE_E + !defined(CONFIG_STM32F7_FLASH_OVERRIDE_E) && \ + !defined(CONFIG_STM32F7_FLASH_OVERRIDE_G) && \ + !defined(CONFIG_STM32F7_FLASH_CONFIG_E) && \ + !defined(CONFIG_STM32F7_FLASH_CONFIG_G) +# define CONFIG_STM32F7_FLASH_OVERRIDE_E # warning "Flash size not defined defaulting to 512KiB (E)" #endif @@ -82,14 +80,14 @@ # endif #endif -#if defined(CONFIG_STM32_FLASH_CONFIG_E) +#if defined(CONFIG_STM32F7_FLASH_CONFIG_E) # define STM32_FLASH_NPAGES 6 # define STM32_FLASH_SIZE _K((4 * 32) + (1 * 128) + (1 * 256)) # define STM32_FLASH_SIZES {_K(32), _K(32), _K(32), _K(32), \ _K(128), _K(256)} -#elif defined(CONFIG_STM32_FLASH_CONFIG_G) +#elif defined(CONFIG_STM32F7_FLASH_CONFIG_G) # define STM32_FLASH_NPAGES 8 # define STM32_FLASH_SIZE _K((4 * 32) + (1 * 128) + (3 * 256)) diff --git a/arch/arm/src/stm32f7/chip/stm32f76xx77xx_flash.h b/arch/arm/src/stm32f7/chip/stm32f76xx77xx_flash.h index 0b6f764c365..9ceeff02214 100644 --- a/arch/arm/src/stm32f7/chip/stm32f76xx77xx_flash.h +++ b/arch/arm/src/stm32f7/chip/stm32f76xx77xx_flash.h @@ -56,15 +56,13 @@ #define _K(x) ((x)*1024) #if !defined(CONFIG_STM32F7_FLASH_OVERRIDE_DEFAULT) && \ - !defined(CONFIG_STM32_FLASH_OVERRIDE_E) && \ - !defined(CONFIG_STM32_FLASH_OVERRIDE_F) && \ - !defined(CONFIG_STM32_FLASH_OVERRIDE_G) && \ - !defined(CONFIG_STM32_FLASH_OVERRIDE_I) && \ - !defined(CONFIG_STM32_FLASH_CONFIG_E) && \ - !defined(CONFIG_STM32_FLASH_CONFIG_F) && \ - !defined(CONFIG_STM32_FLASH_CONFIG_G) && \ - !defined(CONFIG_STM32_FLASH_CONFIG_I) -# define CONFIG_STM32_FLASH_OVERRIDE_E + !defined(CONFIG_STM32F7_FLASH_OVERRIDE_E) && \ + !defined(CONFIG_STM32F7_FLASH_OVERRIDE_G) && \ + !defined(CONFIG_STM32F7_FLASH_OVERRIDE_I) && \ + !defined(CONFIG_STM32F7_FLASH_CONFIG_E) && \ + !defined(CONFIG_STM32F7_FLASH_CONFIG_G) && \ + !defined(CONFIG_STM32F7_FLASH_CONFIG_I) +# define CONFIG_STM32F7_FLASH_OVERRIDE_E # warning "Flash size not defined defaulting to 512KiB (E)" #endif @@ -89,21 +87,21 @@ # endif #endif -#if defined(CONFIG_STM32_FLASH_CONFIG_E) +#if defined(CONFIG_STM32F7_FLASH_CONFIG_E) # define STM32_FLASH_NPAGES 6 # define STM32_FLASH_SIZE _K((4 * 32) + (1 * 128) + (1 * 256)) # define STM32_FLASH_SIZES {_K(32), _K(32), _K(32), _K(32), \ _K(128), _K(256)} -#elif defined(CONFIG_STM32_FLASH_CONFIG_G) +#elif defined(CONFIG_STM32F7_FLASH_CONFIG_G) # define STM32_FLASH_NPAGES 8 # define STM32_FLASH_SIZE _K((4 * 32) + (1 * 128) + (3 * 256)) # define STM32_FLASH_SIZES {_K(32), _K(32), _K(32), _K(32), \ _K(128), _K(256), _K(256), _K(256)} -#elif defined(CONFIG_STM32_FLASH_CONFIG_I) +#elif defined(CONFIG_STM32F7_FLASH_CONFIG_I) # define STM32_FLASH_NPAGES 12 # define STM32_FLASH_SIZE _K((4 * 32) + (1 * 128) + (7 * 256)) From ad3b941c443725cff945932619873e1f3b4681ca Mon Sep 17 00:00:00 2001 From: Juha Niskanen Date: Tue, 2 May 2017 12:30:11 +0300 Subject: [PATCH 3/6] STM32L4: stm32l4x6xx_pinmap: update I2C4 and DCMI pins Signed-off-by: Juha Niskanen --- .../arm/src/stm32l4/chip/stm32l4x6xx_pinmap.h | 36 +++++++++++++++++-- arch/arm/src/stm32l4/stm32l4_i2c.c | 2 +- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/arch/arm/src/stm32l4/chip/stm32l4x6xx_pinmap.h b/arch/arm/src/stm32l4/chip/stm32l4x6xx_pinmap.h index 19f90a0148e..4fd685b7176 100644 --- a/arch/arm/src/stm32l4/chip/stm32l4x6xx_pinmap.h +++ b/arch/arm/src/stm32l4/chip/stm32l4x6xx_pinmap.h @@ -163,7 +163,36 @@ #define GPIO_DCMI_HSYNC_1 (GPIO_ALT|GPIO_AF10|GPIO_PORTA|GPIO_PIN4) #define GPIO_DCMI_HSYNC_2 (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN8) #define GPIO_DCMI_VSYNC_1 (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN7) -/* TODO: DCMI data pins missing */ +#define GPIO_DCMI_VSYNC_2 (GPIO_ALT|GPIO_AF10|GPIO_PORTI|GPIO_PIN5) + +#define GPIO_DCMI_D0_1 (GPIO_ALT|GPIO_AF5|GPIO_PORTA|GPIO_PIN9) +#define GPIO_DCMI_D0_2 (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN6) +#define GPIO_DCMI_D1_1 (GPIO_ALT|GPIO_AF5|GPIO_PORTA|GPIO_PIN10) +#define GPIO_DCMI_D1_2 (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN7) +#define GPIO_DCMI_D2_1 (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN8) +#define GPIO_DCMI_D2_2 (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN0) +#define GPIO_DCMI_D3_1 (GPIO_ALT|GPIO_AF4|GPIO_PORTC|GPIO_PIN9) +#define GPIO_DCMI_D3_2 (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN1) +#define GPIO_DCMI_D4_1 (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN11) +#define GPIO_DCMI_D4_2 (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN4) +#define GPIO_DCMI_D5_1 (GPIO_ALT|GPIO_AF4|GPIO_PORTD|GPIO_PIN3) +#define GPIO_DCMI_D5_2 (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN6) +#define GPIO_DCMI_D6_1 (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN8) +#define GPIO_DCMI_D6_2 (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN5) +#define GPIO_DCMI_D7_1 (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN9) +#define GPIO_DCMI_D7_2 (GPIO_ALT|GPIO_AF10|GPIO_PORTE|GPIO_PIN6) +#define GPIO_DCMI_D8_1 (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN10) +#define GPIO_DCMI_D8_2 (GPIO_ALT|GPIO_AF10|GPIO_PORTH|GPIO_PIN6) +#define GPIO_DCMI_D9_1 (GPIO_ALT|GPIO_AF10|GPIO_PORTC|GPIO_PIN12) +#define GPIO_DCMI_D9_2 (GPIO_ALT|GPIO_AF10|GPIO_PORTH|GPIO_PIN7) +#define GPIO_DCMI_D10_1 (GPIO_ALT|GPIO_AF4|GPIO_PORTD|GPIO_PIN6) +#define GPIO_DCMI_D10_2 (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN5) +#define GPIO_DCMI_D11_1 (GPIO_ALT|GPIO_AF10|GPIO_PORTD|GPIO_PIN2) +#define GPIO_DCMI_D11_2 (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN10) +#define GPIO_DCMI_D12_1 (GPIO_ALT|GPIO_AF10|GPIO_PORTB|GPIO_PIN4) +#define GPIO_DCMI_D12_2 (GPIO_ALT|GPIO_AF10|GPIO_PORTF|GPIO_PIN11) +#define GPIO_DCMI_D13_1 (GPIO_ALT|GPIO_AF10|GPIO_PORTG|GPIO_PIN15) +#define GPIO_DCMI_D13_2 (GPIO_ALT|GPIO_AF10|GPIO_PORTI|GPIO_PIN0) /* Digital Filter for Sigma-Delta Modulators (DFSDM) */ @@ -300,14 +329,15 @@ #define GPIO_I2C4_SDA_2 (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN11) #define GPIO_I2C4_SDA_3 (GPIO_ALT|GPIO_AF2 |GPIO_PORTC|GPIO_PIN1) #define GPIO_I2C4_SDA_4 (GPIO_ALT|GPIO_AF4 |GPIO_PORTD|GPIO_PIN13) +#define GPIO_I2C4_SDA_5 (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN15) #define GPIO_I2C4_SCL_1 (GPIO_ALT|GPIO_AF5 |GPIO_PORTB|GPIO_PIN6) #define GPIO_I2C4_SCL_2 (GPIO_ALT|GPIO_AF3 |GPIO_PORTB|GPIO_PIN10) #define GPIO_I2C4_SCL_3 (GPIO_ALT|GPIO_AF2 |GPIO_PORTC|GPIO_PIN0) #define GPIO_I2C4_SCL_4 (GPIO_ALT|GPIO_AF4 |GPIO_PORTD|GPIO_PIN12) +#define GPIO_I2C4_SCL_5 (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN14) #define GPIO_I2C4_SMBA_1 (GPIO_ALT|GPIO_AF5 |GPIO_PORTA|GPIO_PIN14) #define GPIO_I2C4_SMBA_2 (GPIO_ALT|GPIO_AF4 |GPIO_PORTD|GPIO_PIN11) -#define GPIO_I2C4_SMBA_3 (GPIO_ALT|GPIO_AF4 |GPIO_PORTD|GPIO_PIN11) -#define GPIO_I2C4_SMBA_4 (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN13) +#define GPIO_I2C4_SMBA_3 (GPIO_ALT|GPIO_AF4 |GPIO_PORTF|GPIO_PIN13) /* JTAG */ diff --git a/arch/arm/src/stm32l4/stm32l4_i2c.c b/arch/arm/src/stm32l4/stm32l4_i2c.c index 9be4419de44..58c2fa780f8 100644 --- a/arch/arm/src/stm32l4/stm32l4_i2c.c +++ b/arch/arm/src/stm32l4/stm32l4_i2c.c @@ -1535,7 +1535,7 @@ static int stm32l4_i2c_isr_process(struct stm32l4_i2c_priv_s *priv) #ifdef CONFIG_STM32L4_I2C2 static int stm32l4_i2c_isr(int irq, void *context, FAR void *arg) { - struct stm32l4_i2c_priv_s *priv = (struct stm32l4_i2c_priv_s *priv)arg; + struct stm32l4_i2c_priv_s *priv = (struct stm32l4_i2c_priv_s *)arg; DEBUGASSERT(priv != NULL); return stm32l4_i2c_isr_process(priv); From 6157653acaf0125944883eb0722fc0a90f867cf5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 2 May 2017 14:34:11 -0600 Subject: [PATCH 4/6] Update some comments --- net/pkt/pkt.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/pkt/pkt.h b/net/pkt/pkt.h index a1005f1d934..69a35296dd5 100644 --- a/net/pkt/pkt.h +++ b/net/pkt/pkt.h @@ -97,7 +97,6 @@ extern "C" struct net_driver_s; /* Forward reference */ struct eth_hdr_s; /* Forward reference */ -/* Defined in pkt_conn.c ****************************************************/ /**************************************************************************** * Name: pkt_initialize() * @@ -159,7 +158,6 @@ struct pkt_conn_s *pkt_active(FAR struct eth_hdr_s *buf); struct pkt_conn_s *pkt_nextconn(FAR struct pkt_conn_s *conn); -/* Defined in pkt_callback.c ************************************************/ /**************************************************************************** * Name: pkt_callback * @@ -177,7 +175,6 @@ struct pkt_conn_s *pkt_nextconn(FAR struct pkt_conn_s *conn); uint16_t pkt_callback(FAR struct net_driver_s *dev, FAR struct pkt_conn_s *conn, uint16_t flags); -/* Defined in pkt_input.c ***************************************************/ /**************************************************************************** * Name: pkt_input * From 9b5ac5640917a8a38d4ae2f6e8611e91e81edc06 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 3 May 2017 23:10:48 +0000 Subject: [PATCH 5/6] Fixed typo and backward ifdef --- arch/arm/src/stm32/stm32_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/stm32/stm32_i2c.c b/arch/arm/src/stm32/stm32_i2c.c index f754a6ad185..5f3e1c2c5c9 100644 --- a/arch/arm/src/stm32/stm32_i2c.c +++ b/arch/arm/src/stm32/stm32_i2c.c @@ -1454,8 +1454,8 @@ static int stm32_i2c_isr_process(struct stm32_i2c_priv_s *priv) * ************************************************************************************/ -#ifdef CONFIG_I2C_POLLED -static int stm32_i2c2_isr(int irq, void *context, FAR void *arg) +#ifndef CONFIG_I2C_POLLED +static int stm32_i2c_isr(int irq, void *context, FAR void *arg) { struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)arg; From 1e054a2d3b1e3fb7be4348d88e35db3773e836b9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 3 May 2017 17:33:35 -0600 Subject: [PATCH 6/6] STM32 I2C: More backward tests of CONFIG_I2C_POLLED. Needs to be reviewed. --- 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 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 }