summaryrefslogtreecommitdiff
path: root/apps/examples/nximage
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/nximage
parent1753a0251a941fa4d1a5b95aec631209e9957670 (diff)
downloadnuttx-fdb1d0a4df496e7a3232a950d5c72231363cf67a.tar.gz
nuttx-fdb1d0a4df496e7a3232a950d5c72231363cf67a.tar.bz2
nuttx-fdb1d0a4df496e7a3232a950d5c72231363cf67a.zip
Remove non-portable references to syslog from apps/examples
Diffstat (limited to 'apps/examples/nximage')
-rw-r--r--apps/examples/nximage/nximage.h20
-rw-r--r--apps/examples/nximage/nximage_bkgd.c12
-rw-r--r--apps/examples/nximage/nximage_main.c36
3 files changed, 24 insertions, 44 deletions
diff --git a/apps/examples/nximage/nximage.h b/apps/examples/nximage/nximage.h
index ef475ca29..fc4fdcefd 100644
--- a/apps/examples/nximage/nximage.h
+++ b/apps/examples/nximage/nximage.h
@@ -107,26 +107,6 @@
# define CONFIG_EXAMPLES_NXIMAGE_YSCALE1p0 1
#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
-
/* Image Information ********************************************************/
#define IMAGE_HEIGHT 160 /* Number of rows in the raw image */
diff --git a/apps/examples/nximage/nximage_bkgd.c b/apps/examples/nximage/nximage_bkgd.c
index b20f777c1..c90e7c559 100644
--- a/apps/examples/nximage/nximage_bkgd.c
+++ b/apps/examples/nximage/nximage_bkgd.c
@@ -235,8 +235,8 @@ static void nximage_position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
static void nximage_mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
uint8_t buttons, FAR void *arg)
{
- message("nximage_mousein: hwnd=%p pos=(%d,%d) button=%02x\n",
- hwnd, pos->x, pos->y, buttons);
+ printf("nximage_mousein: hwnd=%p pos=(%d,%d) button=%02x\n",
+ hwnd, pos->x, pos->y, buttons);
}
#endif
@@ -258,7 +258,7 @@ static void nximage_kbdin(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch,
* expected.
*/
- message("nximage_kbdin: Unexpected keyboard callback\n");
+ printf("nximage_kbdin: Unexpected keyboard callback\n");
}
#endif
@@ -323,7 +323,7 @@ void nximage_image(NXWINDOW hwnd)
ret = nx_bitmap((NXWINDOW)hwnd, &dest, src, &pos, SCALED_WIDTH*sizeof(nxgl_mxpixel_t));
if (ret < 0)
{
- message("nximage_image: nx_bitmapwindow failed: %d\n", errno);
+ printf("nximage_image: nx_bitmapwindow failed: %d\n", errno);
}
/* Increment the vertical position */
@@ -365,7 +365,7 @@ void nximage_image(NXWINDOW hwnd)
ret = nx_bitmap((NXWINDOW)hwnd, &dest, src, &pos, SCALED_WIDTH*sizeof(nxgl_mxpixel_t));
if (ret < 0)
{
- message("nximage_image: nx_bitmapwindow failed: %d\n", errno);
+ printf("nximage_image: nx_bitmapwindow failed: %d\n", errno);
}
/* Increment the vertical position */
@@ -386,7 +386,7 @@ void nximage_image(NXWINDOW hwnd)
ret = nx_bitmap((NXWINDOW)hwnd, &dest, src, &pos, SCALED_WIDTH*sizeof(nxgl_mxpixel_t));
if (ret < 0)
{
- message("nximage_image: nx_bitmapwindow failed: %d\n", errno);
+ printf("nximage_image: nx_bitmapwindow failed: %d\n", errno);
}
/* Increment the vertical position */
diff --git a/apps/examples/nximage/nximage_main.c b/apps/examples/nximage/nximage_main.c
index 359e51023..0c3340a46 100644
--- a/apps/examples/nximage/nximage_main.c
+++ b/apps/examples/nximage/nximage_main.c
@@ -129,12 +129,12 @@ static inline int nximage_initialize(void)
#if defined(CONFIG_EXAMPLES_NXIMAGE_EXTERNINIT)
/* Use external graphics driver initialization */
- message("nximage_initialize: Initializing external graphics device\n");
+ printf("nximage_initialize: Initializing external graphics device\n");
dev = up_nxdrvinit(CONFIG_EXAMPLES_NXIMAGE_DEVNO);
if (!dev)
{
- message("nximage_initialize: up_nxdrvinit failed, devno=%d\n",
- CONFIG_EXAMPLES_NXIMAGE_DEVNO);
+ printf("nximage_initialize: up_nxdrvinit failed, devno=%d\n",
+ CONFIG_EXAMPLES_NXIMAGE_DEVNO);
g_nximage.code = NXEXIT_EXTINITIALIZE;
return ERROR;
}
@@ -144,11 +144,11 @@ static inline int nximage_initialize(void)
/* Initialize the LCD device */
- message("nximage_initialize: Initializing LCD\n");
+ printf("nximage_initialize: Initializing LCD\n");
ret = up_lcdinitialize();
if (ret < 0)
{
- message("nximage_initialize: up_lcdinitialize failed: %d\n", -ret);
+ printf("nximage_initialize: up_lcdinitialize failed: %d\n", -ret);
g_nximage.code = NXEXIT_LCDINITIALIZE;
return ERROR;
}
@@ -158,7 +158,7 @@ static inline int nximage_initialize(void)
dev = up_lcdgetdev(CONFIG_EXAMPLES_NXIMAGE_DEVNO);
if (!dev)
{
- message("nximage_initialize: up_lcdgetdev failed, devno=%d\n", CONFIG_EXAMPLES_NXIMAGE_DEVNO);
+ printf("nximage_initialize: up_lcdgetdev failed, devno=%d\n", CONFIG_EXAMPLES_NXIMAGE_DEVNO);
g_nximage.code = NXEXIT_LCDGETDEV;
return ERROR;
}
@@ -171,11 +171,11 @@ static inline int nximage_initialize(void)
/* Initialize the frame buffer device */
- message("nximage_initialize: Initializing framebuffer\n");
+ printf("nximage_initialize: Initializing framebuffer\n");
ret = up_fbinitialize();
if (ret < 0)
{
- message("nximage_initialize: up_fbinitialize failed: %d\n", -ret);
+ printf("nximage_initialize: up_fbinitialize failed: %d\n", -ret);
g_nximage.code = NXEXIT_FBINITIALIZE;
return ERROR;
}
@@ -183,7 +183,7 @@ static inline int nximage_initialize(void)
dev = up_fbgetvplane(CONFIG_EXAMPLES_NXIMAGE_VPLANE);
if (!dev)
{
- message("nximage_initialize: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NXIMAGE_VPLANE);
+ printf("nximage_initialize: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NXIMAGE_VPLANE);
g_nximage.code = NXEXIT_FBGETVPLANE;
return ERROR;
}
@@ -191,11 +191,11 @@ static inline int nximage_initialize(void)
/* Then open NX */
- message("nximage_initialize: Open NX\n");
+ printf("nximage_initialize: Open NX\n");
g_nximage.hnx = nx_open(dev);
if (!g_nximage.hnx)
{
- message("nximage_initialize: nx_open failed: %d\n", errno);
+ printf("nximage_initialize: nx_open failed: %d\n", errno);
g_nximage.code = NXEXIT_NXOPEN;
return ERROR;
}
@@ -226,10 +226,10 @@ int nximage_main(int argc, char *argv[])
/* Initialize NX */
ret = nximage_initialize();
- message("nximage_main: NX handle=%p\n", g_nximage.hnx);
+ printf("nximage_main: NX handle=%p\n", g_nximage.hnx);
if (!g_nximage.hnx || ret < 0)
{
- message("nximage_main: Failed to get NX handle: %d\n", errno);
+ printf("nximage_main: Failed to get NX handle: %d\n", errno);
g_nximage.code = NXEXIT_NXOPEN;
goto errout;
}
@@ -237,12 +237,12 @@ int nximage_main(int argc, char *argv[])
/* Set the background to the configured background color */
color = nximage_bgcolor();
- message("nximage_main: Set background color=%d\n", color);
+ printf("nximage_main: Set background color=%d\n", color);
ret = nx_setbgcolor(g_nximage.hnx, &color);
if (ret < 0)
{
- message("nximage_main: nx_setbgcolor failed: %d\n", errno);
+ printf("nximage_main: nx_setbgcolor failed: %d\n", errno);
g_nximage.code = NXEXIT_NXSETBGCOLOR;
goto errout_with_nx;
}
@@ -252,7 +252,7 @@ int nximage_main(int argc, char *argv[])
ret = nx_requestbkgd(g_nximage.hnx, &g_nximagecb, NULL);
if (ret < 0)
{
- message("nximage_main: nx_setbgcolor failed: %d\n", errno);
+ printf("nximage_main: nx_setbgcolor failed: %d\n", errno);
g_nximage.code = NXEXIT_NXREQUESTBKGD;
goto errout_with_nx;
}
@@ -265,7 +265,7 @@ int nximage_main(int argc, char *argv[])
{
(void)sem_wait(&g_nximage.sem);
}
- message("nximage_main: Screen resolution (%d,%d)\n", g_nximage.xres, g_nximage.yres);
+ printf("nximage_main: Screen resolution (%d,%d)\n", g_nximage.xres, g_nximage.yres);
/* Now, put up the NuttX logo and wait a bit so that it visible. */
@@ -279,7 +279,7 @@ int nximage_main(int argc, char *argv[])
/* Close NX */
errout_with_nx:
- message("nximage_main: Close NX\n");
+ printf("nximage_main: Close NX\n");
nx_close(g_nximage.hnx);
errout:
return g_nximage.code;