diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-11 17:37:47 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-11 17:37:47 +0000 |
commit | 6877a8efaf6edad7dcff6412c1eb03973d080247 (patch) | |
tree | 700904d10859106a5fe5d49650d3ff89d9e5ea94 /nuttx/examples/ostest | |
parent | 8404d53e7285cad8c64992658a84a3d6809cef27 (diff) | |
download | px4-nuttx-6877a8efaf6edad7dcff6412c1eb03973d080247.tar.gz px4-nuttx-6877a8efaf6edad7dcff6412c1eb03973d080247.tar.bz2 px4-nuttx-6877a8efaf6edad7dcff6412c1eb03973d080247.zip |
task_create now accepts variable number of arguments; 8051 bringup changes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@56 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/ostest')
-rw-r--r-- | nuttx/examples/ostest/main.c | 16 | ||||
-rw-r--r-- | nuttx/examples/ostest/sighand.c | 2 |
2 files changed, 8 insertions, 10 deletions
diff --git a/nuttx/examples/ostest/main.c b/nuttx/examples/ostest/main.c index 10f4ac2c6..c68aaee89 100644 --- a/nuttx/examples/ostest/main.c +++ b/nuttx/examples/ostest/main.c @@ -68,7 +68,7 @@ static FAR char arg4[] = "Arg4"; static char write_data1[] = "Standard I/O Check: write fd=1\n"; static char write_data2[] = "Standard I/O Check: write fd=2\n"; #endif -static char *args[NARGS] = { arg1, arg2, arg3, arg4 }; +static const char *g_argv[NARGS] = { arg1, arg2, arg3, arg4 }; /************************************************************ * Private Functions @@ -90,15 +90,15 @@ static int user_main(int argc, char *argv[]) for (i = 0; i <= NARGS; i++) { - printf("user_main: argv[%d]=\"%s\"\n", i, argv[i]); + printf("user_main: argv[%d]=\"%s\"\n", i, (FAR char*)argv[i]); } for (i = 1; i <= NARGS; i++) { - if (strcmp(argv[i], args[i-1]) != 0) + if (strcmp(argv[i], g_argv[i-1]) != 0) { printf("user_main: ERROR argv[%d]: Expected \"%s\" found \"%s\"\n", - i, argv[i], args[i-1]); + i, g_argv[i-1], argv[i]); } } @@ -171,7 +171,7 @@ void user_initialize(void) * user_start ************************************************************/ -int user_start(int parm1, int parm2, int parm3, int parm4) +int user_start(int argc, char *argv[]) { int result; @@ -192,11 +192,9 @@ int user_start(int parm1, int parm2, int parm3, int parm4) /* Verify that we can spawn a new task */ #ifndef CONFIG_CUSTOM_STACK - result = task_create("ostest", PRIORITY, STACKSIZE, user_main, - arg1, arg2, arg3, arg4); + result = task_create("ostest", PRIORITY, STACKSIZE, user_main, g_argv); #else - result = task_create("ostest", PRIORITY, user_main, - arg1, arg2, arg3, arg4); + result = task_create("ostest", PRIORITY, user_main, g_argv); #endif if (result == ERROR) { diff --git a/nuttx/examples/ostest/sighand.c b/nuttx/examples/ostest/sighand.c index b5b1ad806..4ea556612 100644 --- a/nuttx/examples/ostest/sighand.c +++ b/nuttx/examples/ostest/sighand.c @@ -209,7 +209,7 @@ void sighand_test(void) } waiterpid = task_create("waiter", param.sched_priority, - PTHREAD_STACK_DEFAULT, waiter_main, 0, 0, 0, 0); + PTHREAD_STACK_DEFAULT, waiter_main, NULL); if (waiterpid == ERROR) { printf("sighand_test: ERROR failed to start waiter_main\n" ); |