From 1ca6adadfa363064d10872a09740f18c88290231 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 20 Sep 2014 15:53:28 -0600 Subject: [PATCH] More naming changes to get the stm3240g-eval/nxterm configuration building again --- arch/arm/src/common/up_arch.h | 9 +++++---- arch/arm/src/stm32/stm32_i2c.c | 9 ++++++--- arch/arm/src/stm32/stm32_i2c_alt.c | 9 ++++++--- arch/arm/src/stm32/stm32_serial.c | 9 ++++----- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/arch/arm/src/common/up_arch.h b/arch/arm/src/common/up_arch.h index af29bbf6528..fc6981efb6f 100644 --- a/arch/arm/src/common/up_arch.h +++ b/arch/arm/src/common/up_arch.h @@ -85,16 +85,17 @@ static inline void putreg16(uint16_t val, unsigned int addr) #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif /* Atomic modification of registers */ -EXTERN void modifyreg8(unsigned int addr, uint8_t clearbits, uint8_t setbits); -EXTERN void modifyreg16(unsigned int addr, uint16_t clearbits, uint16_t setbits); -EXTERN void modifyreg32(unsigned int addr, uint32_t clearbits, uint32_t setbits); +void modifyreg8(unsigned int addr, uint8_t clearbits, uint8_t setbits); +void modifyreg16(unsigned int addr, uint16_t clearbits, uint16_t setbits); +void modifyreg32(unsigned int addr, uint32_t clearbits, uint32_t setbits); #undef EXTERN #if defined(__cplusplus) diff --git a/arch/arm/src/stm32/stm32_i2c.c b/arch/arm/src/stm32/stm32_i2c.c index f10460b35f2..cd4714fd452 100644 --- a/arch/arm/src/stm32/stm32_i2c.c +++ b/arch/arm/src/stm32/stm32_i2c.c @@ -1601,21 +1601,24 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms struct stm32_i2c_inst_s *inst = (struct stm32_i2c_inst_s *)dev; FAR struct stm32_i2c_priv_s *priv = inst->priv; uint32_t status = 0; +#ifdef I2C1_FSMC_CONFLICT uint32_t ahbenr; +#endif int errval = 0; ASSERT(count); +#ifdef I2C1_FSMC_CONFLICT /* Disable FSMC that shares a pin with I2C1 (LBAR) */ ahbenr = stm32_i2c_disablefsmc(priv); +#else /* Wait for any STOP in progress. NOTE: If we have to disable the FSMC * then we cannot do this at the top of the loop, unfortunately. The STOP * will not complete normally if the FSMC is enabled. */ -#ifndef I2C1_FSMC_CONFLICT stm32_i2c_sem_waitstop(priv); #endif @@ -1755,18 +1758,18 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms stm32_i2c_tracedump(priv); +#ifdef I2C1_FSMC_CONFLICT /* Wait for any STOP in progress. NOTE: If we have to disable the FSMC * then we cannot do this at the top of the loop, unfortunately. The STOP * will not complete normally if the FSMC is enabled. */ -#ifdef I2C1_FSMC_CONFLICT stm32_i2c_sem_waitstop(priv); -#endif /* Re-enable the FSMC */ stm32_i2c_enablefsmc(ahbenr); +#endif stm32_i2c_sem_post(dev); return -errval; diff --git a/arch/arm/src/stm32/stm32_i2c_alt.c b/arch/arm/src/stm32/stm32_i2c_alt.c index 63c329691fd..9a6e90999a3 100755 --- a/arch/arm/src/stm32/stm32_i2c_alt.c +++ b/arch/arm/src/stm32/stm32_i2c_alt.c @@ -2103,21 +2103,24 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms struct stm32_i2c_inst_s *inst = (struct stm32_i2c_inst_s *)dev; FAR struct stm32_i2c_priv_s *priv = inst->priv; uint32_t status = 0; +#ifdef I2C1_FSMC_CONFLICT uint32_t ahbenr; +#endif int errval = 0; ASSERT(count); +#ifdef I2C1_FSMC_CONFLICT /* Disable FSMC that shares a pin with I2C1 (LBAR) */ ahbenr = stm32_i2c_disablefsmc(priv); +#else /* Wait for any STOP in progress. NOTE: If we have to disable the FSMC * then we cannot do this at the top of the loop, unfortunately. The STOP * will not complete normally if the FSMC is enabled. */ -#ifndef I2C1_FSMC_CONFLICT stm32_i2c_sem_waitstop(priv); #endif @@ -2283,18 +2286,18 @@ static int stm32_i2c_process(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *ms stm32_i2c_tracedump(priv); +#ifdef I2C1_FSMC_CONFLICT /* Wait for any STOP in progress. NOTE: If we have to disable the FSMC * then we cannot do this at the top of the loop, unfortunately. The STOP * will not complete normally if the FSMC is enabled. */ -#ifdef I2C1_FSMC_CONFLICT stm32_i2c_sem_waitstop(priv); -#endif /* Re-enable the FSMC */ stm32_i2c_enablefsmc(ahbenr); +#endif stm32_i2c_sem_post(dev); return -errval; diff --git a/arch/arm/src/stm32/stm32_serial.c b/arch/arm/src/stm32/stm32_serial.c index de499ab086f..f2de1642ebe 100644 --- a/arch/arm/src/stm32/stm32_serial.c +++ b/arch/arm/src/stm32/stm32_serial.c @@ -68,7 +68,7 @@ #include "up_internal.h" /**************************************************************************** - * Definitions + * Preprocessor Definitions ****************************************************************************/ /* Some sanity checks *******************************************************/ /* DMA configuration */ @@ -1308,8 +1308,6 @@ static void up_set_format(struct uart_dev_s *dev) #endif up_serialout(priv, STM32_USART_CR3_OFFSET, regval); - -#endif } #endif /* CONFIG_SUPPRESS_UART_CONFIG */ @@ -1327,7 +1325,7 @@ static void up_set_format(struct uart_dev_s *dev) static void up_set_apb_clock(struct uart_dev_s *dev, bool on) { - struct up_dev_s *priv = (struct up_dev_s*)dev->priv; + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; uint32_t rcc_en; uint32_t regaddr; @@ -2331,7 +2329,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable) * Name: up_txready * * Description: - * Return true if the tranmsit data register is empty + * Return true if the transmit data register is empty * ****************************************************************************/ @@ -2530,6 +2528,7 @@ static int up_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate) return OK; } #endif +#endif /* HAVE_UART */ #endif /* USE_SERIALDRIVER */ /****************************************************************************