Add configurable application entry point

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5070 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo
2012-08-30 20:13:50 +00:00
parent 6ab6c46f2f
commit b121fbbb00
254 changed files with 777 additions and 613 deletions
-10
View File
@@ -169,16 +169,6 @@
#define TRACE_BITSET (TRACE_INIT_BITS|TRACE_ERROR_BITS|TRACE_CLASS_BITS|\
TRACE_TRANSFER_BITS|TRACE_CONTROLLER_BITS|TRACE_INTERRUPT_BITS)
/* Entry point **************************************************************/
#ifdef CONFIG_NSH_BUILTIN_APPS
# define MAIN_NAME conn_main
# define MAIN_NAME_STRING "conn"
#else
# define MAIN_NAME user_start
# define MAIN_NAME_STRING "user_start"
#endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
+10 -10
View File
@@ -662,7 +662,7 @@ void board_cdcuninitialize(FAR struct usbdevclass_driver_s *classdev)
}
/****************************************************************************
* user_start/conn_main
* conn_main
*
* Description:
* This is the main program that configures the USB mass storage device
@@ -672,7 +672,7 @@ void board_cdcuninitialize(FAR struct usbdevclass_driver_s *classdev)
*
****************************************************************************/
int MAIN_NAME(int argc, char *argv[])
int conn_main(int argc, char *argv[])
{
int ret;
@@ -688,7 +688,7 @@ int MAIN_NAME(int argc, char *argv[])
if (g_composite.cmphandle)
{
message(MAIN_NAME_STRING ": ERROR: Already connected\n");
message("conn_main: ERROR: Already connected\n");
return 1;
}
#endif
@@ -705,11 +705,11 @@ int MAIN_NAME(int argc, char *argv[])
/* Perform architecture-specific initialization */
message(MAIN_NAME_STRING ": Performing architecture-specific intialization\n");
message("conn_main: Performing architecture-specific intialization\n");
ret = composite_archinitialize();
if (ret < 0)
{
message(MAIN_NAME_STRING ": composite_archinitialize failed: %d\n", -ret);
message("conn_main: composite_archinitialize failed: %d\n", -ret);
return 1;
}
check_test_memory_usage("After composite_archinitialize()");
@@ -719,7 +719,7 @@ int MAIN_NAME(int argc, char *argv[])
g_composite.cmphandle = composite_initialize();
if (!g_composite.cmphandle)
{
message(MAIN_NAME_STRING ": composite_initialize failed\n");
message("conn_main: composite_initialize failed\n");
return 1;
}
check_test_memory_usage("After composite_initialize()");
@@ -774,7 +774,7 @@ int MAIN_NAME(int argc, char *argv[])
/* Dump trace data */
# ifdef CONFIG_USBDEV_TRACE
message("\n" MAIN_NAME_STRING ": USB TRACE DATA:\n");
message("\n" "conn_main: USB TRACE DATA:\n");
ret = dumptrace();
if (ret < 0)
{
@@ -782,18 +782,18 @@ int MAIN_NAME(int argc, char *argv[])
}
check_test_memory_usage("After usbtrace_enumerate()");
# else
message(MAIN_NAME_STRING ": Still alive\n");
message("conn_main: Still alive\n");
# endif
}
#else
message(MAIN_NAME_STRING ": Connected\n");
message("conn_main: Connected\n");
check_test_memory_usage("After composite device connection");
#endif
/* Dump debug memory usage */
message(MAIN_NAME_STRING ": Exiting\n");
message("conn_main: Exiting\n");
#if !defined(CONFIG_NSH_BUILTIN_APPS) && !defined(CONFIG_DISABLE_SIGNALS)
close(g_composite.infd);
close(g_composite.outfd);