File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed
Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change 1- // From ChatGPT, doesn't compile
1+ // How to create a NuttX Task for NSH Shell
22#include <nuttx/sched.h>
3- #include <nuttx/nsh.h>
4-
5- int nsh_main (int argc , char * argv []);
6-
7- int nsh_task (int argc , char * argv [])
8- {
9- nsh_main (argc , argv );
10- return 0 ;
11- }
3+ #include <stdio.h>
4+ #include "nshlib/nshlib.h"
125
136int main (int argc , char * argv [])
147{
158 pid_t pid = task_create (
169 "nsh" , // Task Name
1710 100 , // Task Priority
18- 2048 , // Task Stack Size
19- nsh_task , // Task Function
20- ( FAR char * const * ) argv // Task Arguments
11+ CONFIG_DEFAULT_TASK_STACKSIZE , // Task Stack Size
12+ nsh_consolemain , // Task Function
13+ NULL // Task Arguments
2114 );
2215 if (pid < 0 ) {
2316 printf ("Error creating task\n" );
24- } else {
25- task_start (pid );
2617 }
2718 return 0 ;
2819}
You can’t perform that action at this time.
0 commit comments