summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-04-16 07:24:48 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-04-16 09:11:47 -0600
commita28bca05c6968885b43d440d9bb9e3cf1806cde0 (patch)
tree1182801e80659baccf56b0321014b689dd1c1e4d
parente656626b3d8e017309042fb73afe36013fcd843d (diff)
downloadpx4-nuttx-a28bca05c6968885b43d440d9bb9e3cf1806cde0.tar.gz
px4-nuttx-a28bca05c6968885b43d440d9bb9e3cf1806cde0.tar.bz2
px4-nuttx-a28bca05c6968885b43d440d9bb9e3cf1806cde0.zip
When boardctl() fails, need to print errno not the returned value which will always be -1.
-rw-r--r--apps/examples/adc/adc_main.c4
-rw-r--r--apps/examples/pwm/pwm_main.c2
-rw-r--r--apps/examples/touchscreen/tc_main.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/apps/examples/adc/adc_main.c b/apps/examples/adc/adc_main.c
index 16f180696..c64281385 100644
--- a/apps/examples/adc/adc_main.c
+++ b/apps/examples/adc/adc_main.c
@@ -252,9 +252,9 @@ int adc_main(int argc, char *argv[])
printf("adc_main: Initializing external ADC device\n");
ret = boardctl(BOARDIOC_ADCTEST_SETUP, 0);
- if (ret != OK)
+ if (ret < 0)
{
- printf("adc_main: boardctl failed: %d\n", ret);
+ printf("adc_main: boardctl failed: %d\n", errno);
errval = 1;
goto errout;
}
diff --git a/apps/examples/pwm/pwm_main.c b/apps/examples/pwm/pwm_main.c
index 844551550..84c78c329 100644
--- a/apps/examples/pwm/pwm_main.c
+++ b/apps/examples/pwm/pwm_main.c
@@ -317,7 +317,7 @@ int pwm_main(int argc, char *argv[])
ret = boardctl(BOARDIOC_PWMTEST_SETUP, 0);
if (ret != OK)
{
- printf("pwm_main: boardctl failed: %d\n", ret);
+ printf("pwm_main: boardctl failed: %d\n", errno);
goto errout;
}
diff --git a/apps/examples/touchscreen/tc_main.c b/apps/examples/touchscreen/tc_main.c
index 8e35630d2..74d08e790 100644
--- a/apps/examples/touchscreen/tc_main.c
+++ b/apps/examples/touchscreen/tc_main.c
@@ -1,7 +1,7 @@
/****************************************************************************
* examples/touchscreen/tc_main.c
*
- * Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011, 2014-2025 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -134,7 +134,7 @@ int tc_main(int argc, char *argv[])
ret = boardctl(BOARDIOC_TSCTEST_SETUP, CONFIG_EXAMPLES_TOUCHSCREEN_MINOR);
if (ret != OK)
{
- printf("tc_main: board_tsc_setup failed: %d\n", ret);
+ printf("tc_main: board_tsc_setup failed: %d\n", errno);
errval = 1;
goto errout;
}