summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/arm/src')
-rw-r--r--nuttx/arch/arm/src/common/up_arch.h9
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_i2c.c9
-rwxr-xr-xnuttx/arch/arm/src/stm32/stm32_i2c_alt.c9
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_serial.c9
4 files changed, 21 insertions, 15 deletions
diff --git a/nuttx/arch/arm/src/common/up_arch.h b/nuttx/arch/arm/src/common/up_arch.h
index af29bbf65..fc6981efb 100644
--- a/nuttx/arch/arm/src/common/up_arch.h
+++ b/nuttx/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/nuttx/arch/arm/src/stm32/stm32_i2c.c b/nuttx/arch/arm/src/stm32/stm32_i2c.c
index f10460b35..cd4714fd4 100644
--- a/nuttx/arch/arm/src/stm32/stm32_i2c.c
+++ b/nuttx/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/nuttx/arch/arm/src/stm32/stm32_i2c_alt.c b/nuttx/arch/arm/src/stm32/stm32_i2c_alt.c
index 63c329691..9a6e90999 100755
--- a/nuttx/arch/arm/src/stm32/stm32_i2c_alt.c
+++ b/nuttx/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/nuttx/arch/arm/src/stm32/stm32_serial.c b/nuttx/arch/arm/src/stm32/stm32_serial.c
index de499ab08..f2de1642e 100644
--- a/nuttx/arch/arm/src/stm32/stm32_serial.c
+++ b/nuttx/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 */
/****************************************************************************