summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-04-12 09:58:23 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-04-12 09:58:23 -0600
commit17e994f544c2e4f5a4ed832231c46a1d9814bcc0 (patch)
tree38e2d4a593dc15915efdb65a1284173f140fe0f9
parentb3b87cc272d39ed9cc28e97f264cd91462a1fd3b (diff)
downloadnuttx-17e994f544c2e4f5a4ed832231c46a1d9814bcc0.tar.gz
nuttx-17e994f544c2e4f5a4ed832231c46a1d9814bcc0.tar.bz2
nuttx-17e994f544c2e4f5a4ed832231c46a1d9814bcc0.zip
STM32 OTG FS Hose and others: Remove some warnings
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_otgfshost.c16
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_spi.c2
-rw-r--r--nuttx/configs/stm32f4discovery/src/stm32_usb.c22
3 files changed, 19 insertions, 21 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_otgfshost.c b/nuttx/arch/arm/src/stm32/stm32_otgfshost.c
index 3614a7b02..4c53bb2ba 100644
--- a/nuttx/arch/arm/src/stm32/stm32_otgfshost.c
+++ b/nuttx/arch/arm/src/stm32/stm32_otgfshost.c
@@ -135,7 +135,7 @@
# undef CONFIG_STM32_USBHOST_PKTDUMP
#endif
-#undef HAVE_USB_TRACE 1
+#undef HAVE_USB_TRACE
#if defined(CONFIG_USBHOST_TRACE) || (defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_USB))
# define HAVE_USB_TRACE 1
#endif
@@ -2427,7 +2427,6 @@ static inline void stm32_gint_nptxfeisr(FAR struct stm32_usbhost_s *priv)
FAR struct stm32_chan_s *chan;
uint32_t regval;
unsigned int wrsize;
- unsigned int minsize;
unsigned int avail;
unsigned int chidx;
@@ -2467,12 +2466,12 @@ static inline void stm32_gint_nptxfeisr(FAR struct stm32_usbhost_s *priv)
avail = ((regval & OTGFS_HNPTXSTS_NPTXFSAV_MASK) >> OTGFS_HNPTXSTS_NPTXFSAV_SHIFT) << 2;
- /* Get minimal size packet that can be sent. Something is serioulsy
+ /* Get minimal size packet that can be sent. Something is seriously
* configured wrong if one packet will not fit into the empty Tx FIFO.
*/
- minsize = MIN(chan->buflen, chan->maxpacket);
- DEBUGASSERT(chan->buflen > 0 && avail >= minsize);
+ DEBUGASSERT(chan->buflen > 0 &&
+ avail >= MIN(chan->buflen, chan->maxpacket));
/* Get the size to put in the Tx FIFO now */
@@ -2517,7 +2516,6 @@ static inline void stm32_gint_ptxfeisr(FAR struct stm32_usbhost_s *priv)
FAR struct stm32_chan_s *chan;
uint32_t regval;
unsigned int wrsize;
- unsigned int minsize;
unsigned int avail;
unsigned int chidx;
@@ -2557,12 +2555,12 @@ static inline void stm32_gint_ptxfeisr(FAR struct stm32_usbhost_s *priv)
avail = ((regval & OTGFS_HPTXSTS_PTXFSAVL_MASK) >> OTGFS_HPTXSTS_PTXFSAVL_SHIFT) << 2;
- /* Get minimal size packet that can be sent. Something is serioulsy
+ /* Get minimal size packet that can be sent. Something is seriously
* configured wrong if one packet will not fit into the empty Tx FIFO.
*/
- minsize = MIN(chan->buflen, chan->maxpacket);
- DEBUGASSERT(chan->buflen > 0 && avail >= minsize);
+ DEBUGASSERT(chan->buflen > 0 &&
+ avail >= MIN(chan->buflen, chan->maxpacket));
/* Get the size to put in the Tx FIFO now */
diff --git a/nuttx/arch/arm/src/stm32/stm32_spi.c b/nuttx/arch/arm/src/stm32/stm32_spi.c
index e66a580a6..6dd69147c 100644
--- a/nuttx/arch/arm/src/stm32/stm32_spi.c
+++ b/nuttx/arch/arm/src/stm32/stm32_spi.c
@@ -1221,7 +1221,9 @@ static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd)
/* Check and clear any error flags (Reading from the SR clears the error flags) */
regval = spi_getreg(priv, STM32_SPI_SR_OFFSET);
+
spivdbg("Sent: %04x Return: %04x Status: %02x\n", wd, ret, regval);
+ UNUSED(regval);
return ret;
}
diff --git a/nuttx/configs/stm32f4discovery/src/stm32_usb.c b/nuttx/configs/stm32f4discovery/src/stm32_usb.c
index e0b693be3..071d096e6 100644
--- a/nuttx/configs/stm32f4discovery/src/stm32_usb.c
+++ b/nuttx/configs/stm32f4discovery/src/stm32_usb.c
@@ -109,6 +109,7 @@ static int usbhost_waiter(int argc, char *argv[])
ret = CONN_WAIT(g_usbconn, &connected);
DEBUGASSERT(ret == OK);
+ UNUSED(ret);
connected = !connected;
uvdbg("%s\n", connected ? "connected" : "disconnected");
@@ -209,14 +210,14 @@ int stm32_usbhost_initialize(void)
* Enable/disable driving of VBUS 5V output. This function must be provided be
* each platform that implements the STM32 OTG FS host interface
*
- * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump
- * or, if 5 V are available on the application board, a basic power switch, must
- * be added externally to drive the 5 V VBUS line. The external charge pump can
- * be driven by any GPIO output. When the application decides to power on VBUS
- * using the chosen GPIO, it must also set the port power bit in the host port
+ * "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump
+ * or, if 5 V are available on the application board, a basic power switch, must
+ * be added externally to drive the 5 V VBUS line. The external charge pump can
+ * be driven by any GPIO output. When the application decides to power on VBUS
+ * using the chosen GPIO, it must also set the port power bit in the host port
* control and status register (PPWR bit in OTG_FS_HPRT).
*
- * "The application uses this field to control power to this port, and the core
+ * "The application uses this field to control power to this port, and the core
* clears this bit on an overcurrent condition."
*
* Input Parameters:
@@ -232,7 +233,7 @@ int stm32_usbhost_initialize(void)
void stm32_usbhost_vbusdrive(int iface, bool enable)
{
DEBUGASSERT(iface == 0);
-
+
if (enable)
{
/* Enable the Power Switch by driving the enable pin low */
@@ -240,9 +241,9 @@ void stm32_usbhost_vbusdrive(int iface, bool enable)
stm32_gpiowrite(GPIO_OTGFS_PWRON, false);
}
else
- {
+ {
/* Disable the Power Switch by driving the enable pin high */
-
+
stm32_gpiowrite(GPIO_OTGFS_PWRON, true);
}
}
@@ -289,6 +290,3 @@ void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume)
#endif
#endif /* CONFIG_STM32_OTGFS */
-
-
-