summaryrefslogtreecommitdiffstats
path: root/apps/examples/nxlines/nxlines_main.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-08-30 20:13:50 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-08-30 20:13:50 +0000
commit2848bbca144ff4b01906c7f6290c653800904b42 (patch)
treef770414832eeecb35adb70404b31d147afad7235 /apps/examples/nxlines/nxlines_main.c
parent98d0ef6c36fb33301c697552a73e8f3d400a0c20 (diff)
Add configurable application entry point
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5070 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'apps/examples/nxlines/nxlines_main.c')
-rw-r--r--apps/examples/nxlines/nxlines_main.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/apps/examples/nxlines/nxlines_main.c b/apps/examples/nxlines/nxlines_main.c
index df946b8685..331fab6317 100644
--- a/apps/examples/nxlines/nxlines_main.c
+++ b/apps/examples/nxlines/nxlines_main.c
@@ -199,18 +199,10 @@ static inline int nxlines_initialize(void)
****************************************************************************/
/****************************************************************************
- * Name: user_start/nxlines_main
+ * Name: nxlines_main
****************************************************************************/
-#ifdef CONFIG_EXAMPLES_NXLINES_BUILTIN
-# define MAIN_NAME nxlines_main
-# define MAIN_NAME_STRING "nxlines_main"
-#else
-# define MAIN_NAME user_start
-# define MAIN_NAME_STRING "user_start"
-#endif
-
-int MAIN_NAME(int argc, char *argv[])
+int nxlines_main(int argc, char *argv[])
{
nxgl_mxpixel_t color;
int ret;
@@ -218,24 +210,24 @@ int MAIN_NAME(int argc, char *argv[])
/* Initialize NX */
ret = nxlines_initialize();
- message(MAIN_NAME_STRING ": NX handle=%p\n", g_nxlines.hnx);
+ message("nxlines_main: NX handle=%p\n", g_nxlines.hnx);
if (!g_nxlines.hnx || ret < 0)
{
- message(MAIN_NAME_STRING ": Failed to get NX handle: %d\n", errno);
+ message("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(MAIN_NAME_STRING ": Set background color=%d\n",
+ message("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(MAIN_NAME_STRING ": nx_setbgcolor failed: %d\n", errno);
+ message("nxlines_main: nx_setbgcolor failed: %d\n", errno);
g_nxlines.code = NXEXIT_NXSETBGCOLOR;
goto errout_with_nx;
}
@@ -245,7 +237,7 @@ int MAIN_NAME(int argc, char *argv[])
ret = nx_requestbkgd(g_nxlines.hnx, &g_nxlinescb, NULL);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": nx_setbgcolor failed: %d\n", errno);
+ message("nxlines_main: nx_setbgcolor failed: %d\n", errno);
g_nxlines.code = NXEXIT_NXREQUESTBKGD;
goto errout_with_nx;
}
@@ -258,7 +250,7 @@ int MAIN_NAME(int argc, char *argv[])
{
(void)sem_wait(&g_nxlines.sem);
}
- message(MAIN_NAME_STRING ": Screen resolution (%d,%d)\n", g_nxlines.xres, g_nxlines.yres);
+ message("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).
@@ -273,7 +265,7 @@ int MAIN_NAME(int argc, char *argv[])
/* Close NX */
errout_with_nx:
- message(MAIN_NAME_STRING ": Close NX\n");
+ message("nxlines_main: Close NX\n");
nx_close(g_nxlines.hnx);
errout:
return g_nxlines.code;