summaryrefslogtreecommitdiff
path: root/apps/examples/nxlines
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-10-08 08:33:00 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-10-08 08:33:00 -0600
commitfdb1d0a4df496e7a3232a950d5c72231363cf67a (patch)
tree5d18c1b4f9241f17396ec663ff4425bf21e6b57a /apps/examples/nxlines
parent1753a0251a941fa4d1a5b95aec631209e9957670 (diff)
downloadpx4-nuttx-fdb1d0a4df496e7a3232a950d5c72231363cf67a.tar.gz
px4-nuttx-fdb1d0a4df496e7a3232a950d5c72231363cf67a.tar.bz2
px4-nuttx-fdb1d0a4df496e7a3232a950d5c72231363cf67a.zip
Remove non-portable references to syslog from apps/examples
Diffstat (limited to 'apps/examples/nxlines')
-rw-r--r--apps/examples/nxlines/nxlines.h20
-rw-r--r--apps/examples/nxlines/nxlines_bkgd.c20
-rw-r--r--apps/examples/nxlines/nxlines_main.c38
3 files changed, 29 insertions, 49 deletions
diff --git a/apps/examples/nxlines/nxlines.h b/apps/examples/nxlines/nxlines.h
index 19e809c8b..6a54e8f09 100644
--- a/apps/examples/nxlines/nxlines.h
+++ b/apps/examples/nxlines/nxlines.h
@@ -116,26 +116,6 @@
# endif
#endif
-/* Debug ********************************************************************/
-
-#ifdef CONFIG_CPP_HAVE_VARARGS
-# ifdef CONFIG_DEBUG
-# define message(...) lowsyslog(__VA_ARGS__)
-# define msgflush()
-# else
-# define message(...) printf(__VA_ARGS__)
-# define msgflush() fflush(stdout)
-# endif
-#else
-# ifdef CONFIG_DEBUG
-# define message lowsyslog
-# define msgflush()
-# else
-# define message printf
-# define msgflush() fflush(stdout)
-# endif
-#endif
-
/****************************************************************************
* Public Types
****************************************************************************/
diff --git a/apps/examples/nxlines/nxlines_bkgd.c b/apps/examples/nxlines/nxlines_bkgd.c
index b9383fd1d..dcf2a10bd 100644
--- a/apps/examples/nxlines/nxlines_bkgd.c
+++ b/apps/examples/nxlines/nxlines_bkgd.c
@@ -164,9 +164,9 @@ static void nxlines_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
static void nxlines_mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
uint8_t buttons, FAR void *arg)
{
- message("nxlines_mousein: hwnd=%p pos=(%d,%d) button=%02x\n",
- hwnd, pos->x, pos->y, buttons);
-}
+ printf("nxlines_mousein: hwnd=%p pos=(%d,%d) button=%02x\n",
+ hwnd, pos->x, pos->y, buttons);
+
#endif
/****************************************************************************
@@ -183,7 +183,7 @@ static void nxlines_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch,
* expected.
*/
- message("nxlines_kbdin: Unexpected keyboard callback\n");
+ printf("nxlines_kbdin: Unexpected keyboard callback\n");
}
#endif
@@ -225,7 +225,7 @@ void nxlines_test(NXWINDOW hwnd)
ret = nx_fillcircle((NXWINDOW)hwnd, &center, radius, color);
if (ret < 0)
{
- message("nxlines_test: nx_fillcircle failed: %d\n", ret);
+ printf("nxlines_test: nx_fillcircle failed: %d\n", ret);
}
/* Draw the circular border */
@@ -235,7 +235,7 @@ void nxlines_test(NXWINDOW hwnd)
CONFIG_EXAMPLES_NXLINES_BORDERWIDTH, color);
if (ret < 0)
{
- message("nxlines_test: nx_fillcircle failed: %d\n", ret);
+ printf("nxlines_test: nx_fillcircle failed: %d\n", ret);
}
/* Back off the radius to account for the thickness of border line
@@ -287,8 +287,8 @@ void nxlines_test(NXWINDOW hwnd)
vector.pt2.x = center.x - halfx;
vector.pt2.y = center.y - halfy;
- message("Angle: %08x vector: (%d,%d)->(%d,%d)\n",
- angle, vector.pt1.x, vector.pt1.y, vector.pt2.x, vector.pt2.y);
+ printf("Angle: %08x vector: (%d,%d)->(%d,%d)\n",
+ angle, vector.pt1.x, vector.pt1.y, vector.pt2.x, vector.pt2.y);
/* Clear the previous line by overwriting it with the circle color */
@@ -296,7 +296,7 @@ void nxlines_test(NXWINDOW hwnd)
ret = nx_drawline((NXWINDOW)hwnd, &previous, CONFIG_EXAMPLES_NXLINES_LINEWIDTH, color);
if (ret < 0)
{
- message("nxlines_test: nx_drawline failed clearing: %d\n", ret);
+ printf("nxlines_test: nx_drawline failed clearing: %d\n", ret);
}
/* Draw the new line */
@@ -305,7 +305,7 @@ void nxlines_test(NXWINDOW hwnd)
ret = nx_drawline((NXWINDOW)hwnd, &vector, CONFIG_EXAMPLES_NXLINES_LINEWIDTH, color);
if (ret < 0)
{
- message("nxlines_test: nx_drawline failed clearing: %d\n", ret);
+ printf("nxlines_test: nx_drawline failed clearing: %d\n", ret);
}
/* Set up for the next time through the loop then sleep for a bit. */
diff --git a/apps/examples/nxlines/nxlines_main.c b/apps/examples/nxlines/nxlines_main.c
index 78f3439c4..21798b7d1 100644
--- a/apps/examples/nxlines/nxlines_main.c
+++ b/apps/examples/nxlines/nxlines_main.c
@@ -121,12 +121,12 @@ static inline int nxlines_initialize(void)
#if defined(CONFIG_EXAMPLES_NXLINES_EXTERNINIT)
/* Use external graphics driver initialization */
- message("nxlines_initialize: Initializing external graphics device\n");
+ printf("nxlines_initialize: Initializing external graphics device\n");
dev = up_nxdrvinit(CONFIG_EXAMPLES_NXLINES_DEVNO);
if (!dev)
{
- message("nxlines_initialize: up_nxdrvinit failed, devno=%d\n",
- CONFIG_EXAMPLES_NXLINES_DEVNO);
+ printf("nxlines_initialize: up_nxdrvinit failed, devno=%d\n",
+ CONFIG_EXAMPLES_NXLINES_DEVNO);
g_nxlines.code = NXEXIT_EXTINITIALIZE;
return ERROR;
}
@@ -136,11 +136,11 @@ static inline int nxlines_initialize(void)
/* Initialize the LCD device */
- message("nxlines_initialize: Initializing LCD\n");
+ printf("nxlines_initialize: Initializing LCD\n");
ret = up_lcdinitialize();
if (ret < 0)
{
- message("nxlines_initialize: up_lcdinitialize failed: %d\n", -ret);
+ printf("nxlines_initialize: up_lcdinitialize failed: %d\n", -ret);
g_nxlines.code = NXEXIT_LCDINITIALIZE;
return ERROR;
}
@@ -150,7 +150,7 @@ static inline int nxlines_initialize(void)
dev = up_lcdgetdev(CONFIG_EXAMPLES_NXLINES_DEVNO);
if (!dev)
{
- message("nxlines_initialize: up_lcdgetdev failed, devno=%d\n", CONFIG_EXAMPLES_NXLINES_DEVNO);
+ printf("nxlines_initialize: up_lcdgetdev failed, devno=%d\n", CONFIG_EXAMPLES_NXLINES_DEVNO);
g_nxlines.code = NXEXIT_LCDGETDEV;
return ERROR;
}
@@ -163,11 +163,11 @@ static inline int nxlines_initialize(void)
/* Initialize the frame buffer device */
- message("nxlines_initialize: Initializing framebuffer\n");
+ printf("nxlines_initialize: Initializing framebuffer\n");
ret = up_fbinitialize();
if (ret < 0)
{
- message("nxlines_initialize: up_fbinitialize failed: %d\n", -ret);
+ printf("nxlines_initialize: up_fbinitialize failed: %d\n", -ret);
g_nxlines.code = NXEXIT_FBINITIALIZE;
return ERROR;
}
@@ -175,7 +175,7 @@ static inline int nxlines_initialize(void)
dev = up_fbgetvplane(CONFIG_EXAMPLES_NXLINES_VPLANE);
if (!dev)
{
- message("nxlines_initialize: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NXLINES_VPLANE);
+ printf("nxlines_initialize: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NXLINES_VPLANE);
g_nxlines.code = NXEXIT_FBGETVPLANE;
return ERROR;
}
@@ -183,11 +183,11 @@ static inline int nxlines_initialize(void)
/* Then open NX */
- message("nxlines_initialize: Open NX\n");
+ printf("nxlines_initialize: Open NX\n");
g_nxlines.hnx = nx_open(dev);
if (!g_nxlines.hnx)
{
- message("nxlines_initialize: nx_open failed: %d\n", errno);
+ printf("nxlines_initialize: nx_open failed: %d\n", errno);
g_nxlines.code = NXEXIT_NXOPEN;
return ERROR;
}
@@ -215,24 +215,24 @@ int nxlines_main(int argc, char *argv[])
/* Initialize NX */
ret = nxlines_initialize();
- message("nxlines_main: NX handle=%p\n", g_nxlines.hnx);
+ printf("nxlines_main: NX handle=%p\n", g_nxlines.hnx);
if (!g_nxlines.hnx || ret < 0)
{
- message("nxlines_main: Failed to get NX handle: %d\n", errno);
+ printf("nxlines_main: Failed to get NX handle: %d\n", errno);
g_nxlines.code = NXEXIT_NXOPEN;
goto errout;
}
/* Set the background to the configured background color */
- message("nxlines_main: Set background color=%d\n",
- CONFIG_EXAMPLES_NXLINES_BGCOLOR);
+ printf("nxlines_main: Set background color=%d\n",
+ CONFIG_EXAMPLES_NXLINES_BGCOLOR);
color = CONFIG_EXAMPLES_NXLINES_BGCOLOR;
ret = nx_setbgcolor(g_nxlines.hnx, &color);
if (ret < 0)
{
- message("nxlines_main: nx_setbgcolor failed: %d\n", errno);
+ printf("nxlines_main: nx_setbgcolor failed: %d\n", errno);
g_nxlines.code = NXEXIT_NXSETBGCOLOR;
goto errout_with_nx;
}
@@ -242,7 +242,7 @@ int nxlines_main(int argc, char *argv[])
ret = nx_requestbkgd(g_nxlines.hnx, &g_nxlinescb, NULL);
if (ret < 0)
{
- message("nxlines_main: nx_setbgcolor failed: %d\n", errno);
+ printf("nxlines_main: nx_setbgcolor failed: %d\n", errno);
g_nxlines.code = NXEXIT_NXREQUESTBKGD;
goto errout_with_nx;
}
@@ -255,7 +255,7 @@ int nxlines_main(int argc, char *argv[])
{
(void)sem_wait(&g_nxlines.sem);
}
- message("nxlines_main: Screen resolution (%d,%d)\n", g_nxlines.xres, g_nxlines.yres);
+ printf("nxlines_main: Screen resolution (%d,%d)\n", g_nxlines.xres, g_nxlines.yres);
/* Now, say perform the lines (these test does not return so the remaining
* logic is cosmetic).
@@ -270,7 +270,7 @@ int nxlines_main(int argc, char *argv[])
/* Close NX */
errout_with_nx:
- message("nxlines_main: Close NX\n");
+ printf("nxlines_main: Close NX\n");
nx_close(g_nxlines.hnx);
errout:
return g_nxlines.code;