diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-08-30 20:13:50 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-08-30 20:13:50 +0000 |
commit | 79c7065433ae27932ad8b781d38b8f7832b01581 (patch) | |
tree | f770414832eeecb35adb70404b31d147afad7235 /apps/examples/nxlines/nxlines_main.c | |
parent | f9d19788072090be80b71ab0d0de14507a6e739b (diff) | |
download | px4-nuttx-79c7065433ae27932ad8b781d38b8f7832b01581.tar.gz px4-nuttx-79c7065433ae27932ad8b781d38b8f7832b01581.tar.bz2 px4-nuttx-79c7065433ae27932ad8b781d38b8f7832b01581.zip |
Add configurable application entry point
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5070 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples/nxlines/nxlines_main.c')
-rw-r--r-- | apps/examples/nxlines/nxlines_main.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/apps/examples/nxlines/nxlines_main.c b/apps/examples/nxlines/nxlines_main.c index df946b868..331fab631 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; |