summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-09-27 03:13:50 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-09-27 03:13:50 +0000
commit71edd43b4ed83fbb8b5d6cf84e6ce1bd3ea289ad (patch)
treea6e2ac51a93bff32a1c810c633bf078401719281
parent2ee480b59e7f6d641dde0ec63254aaa8a87401c2 (diff)
downloadpx4-nuttx-71edd43b4ed83fbb8b5d6cf84e6ce1bd3ea289ad.tar.gz
px4-nuttx-71edd43b4ed83fbb8b5d6cf84e6ce1bd3ea289ad.tar.bz2
px4-nuttx-71edd43b4ed83fbb8b5d6cf84e6ce1bd3ea289ad.zip
Correct some bad parameter checking
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5197 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/ChangeLog2
-rw-r--r--nuttx/Kconfig6
-rw-r--r--nuttx/drivers/input/ads7843e.c3
-rw-r--r--nuttx/graphics/nxmu/nx_block.c4
-rw-r--r--nuttx/graphics/nxmu/nxmu_sendclient.c4
-rw-r--r--nuttx/graphics/nxmu/nxmu_sendserver.c4
6 files changed, 14 insertions, 9 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 80d889b3b..adb52afce 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -3417,4 +3417,6 @@
not an ILI93xx.
* configs/shenzhou/src/up_ssd1289.c: The LCD is basically functional
on the Shenzhou board.
+ * graphics/nxmu: Correct some bad parameter checking that caused
+ failures when DEBUG was enabled.
diff --git a/nuttx/Kconfig b/nuttx/Kconfig
index f4f6abe7e..0fe6eb0f7 100644
--- a/nuttx/Kconfig
+++ b/nuttx/Kconfig
@@ -230,7 +230,11 @@ config DEBUG_VERBOSE
bool "Enable Debug Verbose Output"
default n
---help---
- Enables verbose debug output (assuming debug output is enabled)
+ Enables verbose debug output (assuming debug output is enabled). As a
+ general rule, when DEBUG is enabled only errors will be reported in the debug
+ output. But if you also enable DEBUG_VERBOSE, then very chatty (and
+ often annoying) output will be generated. This means there are two levels
+ of debug output: errors-only and everything.
config DEBUG_ENABLE
bool "Enable Debug Controls"
diff --git a/nuttx/drivers/input/ads7843e.c b/nuttx/drivers/input/ads7843e.c
index 555ce3480..07e5e515d 100644
--- a/nuttx/drivers/input/ads7843e.c
+++ b/nuttx/drivers/input/ads7843e.c
@@ -572,7 +572,7 @@ static void ads7843e_worker(FAR void *arg)
/* Check for pen up or down by reading the PENIRQ GPIO. */
pendown = config->pendown(config);
-dbg("pendown: %d\n", pendown); // REMOVE ME
+
/* Handle the change from pen down to pen up */
if (!pendown)
@@ -643,7 +643,6 @@ dbg("pendown: %d\n", pendown); // REMOVE ME
/* Exit, re-enabling ADS7843E interrupts */
errout:
-dbg("Exiting\n"); // REMOVE ME
(void)ads7843e_sendcmd(priv, ADS7843_CMD_ENABPINIRQ);
config->enable(config, true);
}
diff --git a/nuttx/graphics/nxmu/nx_block.c b/nuttx/graphics/nxmu/nx_block.c
index 2f069f096..3a051f9d7 100644
--- a/nuttx/graphics/nxmu/nx_block.c
+++ b/nuttx/graphics/nxmu/nx_block.c
@@ -111,8 +111,8 @@ int nx_block(NXWINDOW hwnd, FAR void *arg)
#ifdef CONFIG_DEBUG
if (!hwnd)
{
- errno = EINVAL;
- return NULL;
+ set_errno(EINVAL);
+ return ERROR;
}
#endif
diff --git a/nuttx/graphics/nxmu/nxmu_sendclient.c b/nuttx/graphics/nxmu/nxmu_sendclient.c
index 8b7f12104..a59fa2363 100644
--- a/nuttx/graphics/nxmu/nxmu_sendclient.c
+++ b/nuttx/graphics/nxmu/nxmu_sendclient.c
@@ -93,9 +93,9 @@ int nxmu_sendclient(FAR struct nxfe_conn_s *conn, FAR const void *msg,
/* Sanity checking */
#ifdef CONFIG_DEBUG
- if (!conn || conn->swrmq)
+ if (!conn || !conn->swrmq)
{
- errno = EINVAL;
+ set_errno(EINVAL);
return ERROR;
}
#endif
diff --git a/nuttx/graphics/nxmu/nxmu_sendserver.c b/nuttx/graphics/nxmu/nxmu_sendserver.c
index 7007b81da..03ece4e7f 100644
--- a/nuttx/graphics/nxmu/nxmu_sendserver.c
+++ b/nuttx/graphics/nxmu/nxmu_sendserver.c
@@ -93,9 +93,9 @@ int nxmu_sendserver(FAR struct nxfe_conn_s *conn, FAR const void *msg,
/* Sanity checking */
#ifdef CONFIG_DEBUG
- if (!conn || conn->cwrmq)
+ if (!conn || !conn->cwrmq)
{
- errno = EINVAL;
+ set_errno(EINVAL);
return ERROR;
}
#endif