We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8090ca3 commit c9d4f0bCopy full SHA for c9d4f0b
nshtask.c
@@ -0,0 +1,28 @@
1
+// From ChatGPT, doesn't compile
2
+#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
+}
12
13
+int main(int argc, char *argv[])
14
15
+ pid_t pid = task_create(
16
+ "nsh", // Task Name
17
+ 100, // Task Priority
18
+ 2048, // Task Stack Size
19
+ nsh_task, // Task Function
20
+ (FAR char * const *)argv // Task Arguments
21
+ );
22
+ if (pid < 0) {
23
+ printf("Error creating task\n");
24
+ } else {
25
+ task_start(pid);
26
+ }
27
28
nshtask_main.c
0 commit comments