summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-05 23:21:13 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-05 23:21:13 +0000
commitc0d8ad0f16f6e77ddb4dfd1791f6c93b1aa0ce62 (patch)
treec760d74a8cf34a03ebc19ecc05f248e1944ec296 /nuttx
parent559f6b32a41c0f2a8f90cb1a70d4f94c5aabb42b (diff)
downloadpx4-nuttx-c0d8ad0f16f6e77ddb4dfd1791f6c93b1aa0ce62.tar.gz
px4-nuttx-c0d8ad0f16f6e77ddb4dfd1791f6c93b1aa0ce62.tar.bz2
px4-nuttx-c0d8ad0f16f6e77ddb4dfd1791f6c93b1aa0ce62.zip
Fix compilation errors with floating point is enabled and field widths are disabled (I don't know why you would do that, but the code was wrong)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4562 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rwxr-xr-xnuttx/arch/arm/src/stm32/stm32_otgfsdev.c35
-rw-r--r--[-rwxr-xr-x]nuttx/lib/misc/lib_crc32.c0
-rw-r--r--[-rwxr-xr-x]nuttx/lib/stdio/lib_dtoa.c0
-rw-r--r--[-rwxr-xr-x]nuttx/lib/stdio/lib_libdtoa.c0
-rw-r--r--nuttx/lib/stdio/lib_libvsprintf.c42
-rw-r--r--[-rwxr-xr-x]nuttx/lib/string/lib_strtod.c0
6 files changed, 55 insertions, 22 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c b/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c
index 3e7fcbd15..a34dafe04 100755
--- a/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c
+++ b/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c
@@ -2763,6 +2763,8 @@ static void stm32_ep0configure(FAR struct stm32_usbdev_s *priv)
static int stm32_epdisable(FAR struct usbdev_ep_s *ep)
{
FAR struct stm32_ep_s *privep = (FAR struct stm32_ep_s *)ep;
+ uint32_t regaddr;
+ uint32_t regval;
irqstate_t flags;
#ifdef CONFIG_DEBUG
@@ -2774,20 +2776,39 @@ static int stm32_epdisable(FAR struct usbdev_ep_s *ep)
#endif
usbtrace(TRACE_EPDISABLE, privep->epphy);
- flags = irqsave();
-
- /* Disable Endpoint */
+ /* Is this an IN or an OUT endpoint */
+ flags = irqsave();
if (privep->isin)
{
-#warning "Missing logic"
+ /* Deactivate the endpoint */
+
+ regaddr = STM32_OTGFS_DIEPCTL(privep->epphy);
+ regval = stm32_getreg(regaddr);
+ regval &= ~OTGFS_DIEPCTL0_USBAEP;
+ stm32_putreg(regval, regaddr);
+
+ /* Disable endpoint interrupts */
+
+ regval = stm32_getreg(STM32_OTGFS_DAINTMSK);
+ regval &= ~OTGFS_DAINT_IEP(privep->epphy);
+ stm32_putreg(regval, STM32_OTGFS_DAINTMSK);
}
else
{
-#warning "Missing logic"
- }
+ /* Deactivate the endpoint */
- privep->stalled = true;
+ regaddr = priv, STM32_OTGFS_DOEPCTL(privep->epphy);
+ regval = stm32_getreg(regaddr);
+ regval &= ~OTGFS_DOEPCTL_USBAEP;
+ stm32_putreg(regval, regaddr);
+
+ /* Disable endpoint interrupts */
+
+ regval = stm32_getreg(STM32_OTGFS_DAINTMSK);
+ regval &= ~OTGFS_DAINT_OEP(privep->epphy);
+ stm32_putreg(regval, STM32_OTGFS_DAINTMSK);
+ }
/* Cancel any ongoing activity */
diff --git a/nuttx/lib/misc/lib_crc32.c b/nuttx/lib/misc/lib_crc32.c
index f851598e0..f851598e0 100755..100644
--- a/nuttx/lib/misc/lib_crc32.c
+++ b/nuttx/lib/misc/lib_crc32.c
diff --git a/nuttx/lib/stdio/lib_dtoa.c b/nuttx/lib/stdio/lib_dtoa.c
index 894af4f42..894af4f42 100755..100644
--- a/nuttx/lib/stdio/lib_dtoa.c
+++ b/nuttx/lib/stdio/lib_dtoa.c
diff --git a/nuttx/lib/stdio/lib_libdtoa.c b/nuttx/lib/stdio/lib_libdtoa.c
index 3bfe70aea..3bfe70aea 100755..100644
--- a/nuttx/lib/stdio/lib_libdtoa.c
+++ b/nuttx/lib/stdio/lib_libdtoa.c
diff --git a/nuttx/lib/stdio/lib_libvsprintf.c b/nuttx/lib/stdio/lib_libvsprintf.c
index 341c055c6..dd2c5f83f 100644
--- a/nuttx/lib/stdio/lib_libvsprintf.c
+++ b/nuttx/lib/stdio/lib_libvsprintf.c
@@ -1,8 +1,8 @@
/****************************************************************************
* lib/stdio/lib_libvsprintf.c
*
- * Copyright (C) 2007-2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2007-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -49,16 +49,17 @@
#include "lib_internal.h"
/****************************************************************************
- * Pre-processor oDefinitions
+ * Pre-processor Definitions
****************************************************************************/
+/* If you have floating point but no fieldwidth, then use a fixed (but
+ * configurable) floating point precision.
+ */
-enum
-{
- FMT_RJUST = 0, /* Default */
- FMT_LJUST,
- FMT_RJUST0,
- FMT_CENTER
-};
+#if defined(CONFIG_LIBC_FLOATINGPOINT) && \
+ defined(CONFIG_NOPRINTF_FIELDWIDTH) && \
+ !defined(CONFIG_LIBC_FIXEDPRECISION)
+# define CONFIG_LIBC_FIXEDPRECISION 3
+#endif
#define FLAG_SHOWPLUS 0x01
#define FLAG_ALTFORM 0x02
@@ -129,6 +130,14 @@ enum
* Private Type Declarations
****************************************************************************/
+enum
+{
+ FMT_RJUST = 0, /* Default */
+ FMT_LJUST,
+ FMT_RJUST0,
+ FMT_CENTER
+};
+
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
@@ -1549,9 +1558,8 @@ int lib_vsprintf(FAR struct lib_outstream_s *obj, FAR const char *src, va_list a
#ifdef CONFIG_LIBC_FLOATINGPOINT
else if (strchr("eEfgG", FMT_CHAR))
{
+#ifdef CONFIG_NOPRINTF_FIELDWIDTH
double dblval = va_arg(ap, double);
-
-#ifndef CONFIG_NOPRINTF_FIELDWIDTH
int dblsize;
/* Get the width of the output */
@@ -1561,21 +1569,25 @@ int lib_vsprintf(FAR struct lib_outstream_s *obj, FAR const char *src, va_list a
/* Perform left field justification actions */
prejustify(obj, fmt, flags, width, dblsize);
-#endif
/* Output the number */
lib_dtoa(obj, FMT_CHAR, trunc, flags, dblval);
-#ifndef CONFIG_NOPRINTF_FIELDWIDTH
/* Perform right field justification actions */
postjustify(obj, fmt, flags, width, dblsize);
- }
+#else
+ /* Output the number with a fixed precision */
+
+ double dblval = va_arg(ap, double);
+ lib_dtoa(obj, FMT_CHAR, CONFIG_LIBC_FIXEDPRECISION, flags, dblval);
#endif
+ }
#endif /* CONFIG_LIBC_FLOATINGPOINT */
}
return obj->nput;
}
+
diff --git a/nuttx/lib/string/lib_strtod.c b/nuttx/lib/string/lib_strtod.c
index 86719c510..86719c510 100755..100644
--- a/nuttx/lib/string/lib_strtod.c
+++ b/nuttx/lib/string/lib_strtod.c