Skip to content

Commit c9d4f0b

Browse files
authored
From ChatGPT, doesn't compile
1 parent 8090ca3 commit c9d4f0b

File tree

2 files changed

+28
-19
lines changed

2 files changed

+28
-19
lines changed

nshtask.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
return 0;
28+
}

nshtask_main.c

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)