You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/06/05 04:21:59 UTC
[incubator-nuttx] 05/05: Fix PR 1188 nxstyle issues
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 871d5c6b728be4a281eb44c4176980189ee9af17
Author: Ouss4 <ab...@gmail.com>
AuthorDate: Wed Jun 3 20:57:01 2020 +0100
Fix PR 1188 nxstyle issues
---
arch/arm/src/stm32/stm32.h | 4 ---
.../arm/stm32/stm32f4discovery/src/stm32_cs43l22.c | 37 ++++++++++++++--------
2 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/arch/arm/src/stm32/stm32.h b/arch/arm/src/stm32/stm32.h
index 8fceece..a0975e9 100644
--- a/arch/arm/src/stm32/stm32.h
+++ b/arch/arm/src/stm32/stm32.h
@@ -49,10 +49,6 @@
#include "arm_internal.h"
-/************************************************************************************
- * Pre-processor Definitions
- ************************************************************************************/
-
/* Peripherals **********************************************************************/
#include "chip.h"
diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_cs43l22.c b/boards/arm/stm32/stm32f4discovery/src/stm32_cs43l22.c
index 40e9c44..9ce4220 100644
--- a/boards/arm/stm32/stm32f4discovery/src/stm32_cs43l22.c
+++ b/boards/arm/stm32/stm32f4discovery/src/stm32_cs43l22.c
@@ -153,7 +153,8 @@ static int cs43l22_attach(FAR const struct cs43l22_lower_s *lower,
if (isr)
{
/* Just save the address of the handler and its argument for now. The
- * new handler will called via cs43l22_interrupt() when the interrupt occurs.
+ * new handler will called via cs43l22_interrupt() when the interrupt
+ * occurs.
*/
audinfo("Attaching %p\n", isr);
@@ -171,7 +172,8 @@ static int cs43l22_attach(FAR const struct cs43l22_lower_s *lower,
return OK;
}
-static bool cs43l22_enable(FAR const struct cs43l22_lower_s *lower, bool enable)
+static bool cs43l22_enable(FAR const struct cs43l22_lower_s *lower,
+ bool enable)
{
static bool enabled;
irqstate_t flags;
@@ -187,14 +189,17 @@ static bool cs43l22_enable(FAR const struct cs43l22_lower_s *lower, bool enable)
if (enable && g_cs43l22info.handler)
{
audinfo("Enabling\n");
+
/* TODO: stm32_pioirqenable(IRQ_INT_CS43L22); */
+
enabled = true;
}
else
{
-
audinfo("Disabling\n");
+
/* TODO: stm32_pioirqdisable(IRQ_INT_CS43L22); */
+
enabled = false;
}
}
@@ -207,7 +212,7 @@ static bool cs43l22_enable(FAR const struct cs43l22_lower_s *lower, bool enable)
#if 0
static int cs43l22_interrupt(int irq, FAR void *context)
{
- Just forward the interrupt to the CS43L22 driver
+ /* Just forward the interrupt to the CS43L22 driver */
audinfo("handler %p\n", g_cs43l22info.handler);
if (g_cs43l22info.handler)
@@ -215,10 +220,12 @@ static int cs43l22_interrupt(int irq, FAR void *context)
return g_cs43l22info.handler(&g_cs43l22info.lower, g_cs43l22info.arg);
}
- We got an interrupt with no handler. This should not
- happen.
+ /* We got an interrupt with no handler. This should not
+ * happen.
+ */
+
+ /* TODO: stm32_pioirqdisable(IRQ_INT_CS43L22); */
- TODO: stm32_pioirqdisable(IRQ_INT_CS43L22);
return OK;
}
#endif
@@ -272,10 +279,11 @@ int stm32_cs43l22_initialize(int minor)
audinfo("minor %d\n", minor);
DEBUGASSERT(minor >= 0 && minor <= 25);
- /* Have we already initialized? Since we never uninitialize we must prevent
- * multiple initializations. This is necessary, for example, when the
- * touchscreen example is used as a built-in application in NSH and can be
- * called numerous time. It will attempt to initialize each time.
+ /* Have we already initialized? Since we never uninitialize we must
+ * prevent multiple initializations. This is necessary, for example,
+ * when the touchscreen example is used as a built-in application in
+ * NSH and can be called numerous time. It will attempt to initialize
+ * each time.
*/
if (!initialized)
@@ -295,6 +303,7 @@ int stm32_cs43l22_initialize(int minor)
ret = -ENODEV;
goto errout;
}
+
/* Get an instance of the I2S interface for the CS43L22 data channel */
i2s = stm32_i2sbus_initialize(CS43L22_I2S_BUS);
@@ -305,8 +314,8 @@ int stm32_cs43l22_initialize(int minor)
goto errout_with_i2c;
}
- /* Configure the DAC master clock. This clock is provided by PCK2 (PB10)
- * that is connected to the CS43L22 MCLK.
+ /* Configure the DAC master clock. This clock is provided by
+ * PCK2 (PB10) that is connected to the CS43L22 MCLK.
*/
/* Configure CS43L22 interrupts */
@@ -332,6 +341,7 @@ int stm32_cs43l22_initialize(int minor)
ret = -ENODEV;
goto errout_with_irq;
}
+
/* No we can embed the CS43L22/I2C/I2S conglomerate into a PCM decoder
* instance so that we will have a PCM front end for the the CS43L22
* driver.
@@ -344,6 +354,7 @@ int stm32_cs43l22_initialize(int minor)
ret = -ENODEV;
goto errout_with_cs43l22;
}
+
/* Create a device name */
snprintf(devname, 12, "pcm%d", minor);