mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 06:33:35 +08:00
NuttX: fixes for NuttX build
In the upstream tree ringbuffer.h includes the method implementations in the header file which causes multiple definitions in the link for other targets. Changed so ringbuffer.cpp is build separately for other platforms and is included by ringbuffer.h on NuttX. uORB changes do not link without uORBTest_UnitTest.cpp enabled for the NuttX build. px4_getopt was not exported and wasn't visible in NuttX build. The makefiles were restored to be as close as possible to upstream so the NuttX build builtin's work again. The code will have to be refactored after the merge. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -121,7 +121,7 @@ static int reorder(int argc, char **argv, const char *options)
|
||||
// Argv is changed to put all options and option args at the beginning,
|
||||
// followed by non-options.
|
||||
//
|
||||
int px4_getopt(int argc, char *argv[], const char *options, int *myoptind, const char **myoptarg)
|
||||
__EXPORT int px4_getopt(int argc, char *argv[], const char *options, int *myoptind, const char **myoptarg)
|
||||
{
|
||||
char *p;
|
||||
char c;
|
||||
@@ -149,4 +149,3 @@ int px4_getopt(int argc, char *argv[], const char *options, int *myoptind, const
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,21 +72,6 @@ px4_systemreset(bool to_bootloader)
|
||||
while(true);
|
||||
}
|
||||
|
||||
static void kill_task(FAR struct tcb_s *tcb, FAR void *arg);
|
||||
|
||||
void px4_killall()
|
||||
{
|
||||
// printf("Sending SIGUSR1 to all processes now\n");
|
||||
|
||||
/* iterate through all tasks and send kill signal */
|
||||
sched_foreach(kill_task, NULL);
|
||||
}
|
||||
|
||||
static void kill_task(FAR struct tcb_s *tcb, FAR void *arg)
|
||||
{
|
||||
kill(tcb->pid, SIGUSR1);
|
||||
}
|
||||
|
||||
int px4_task_spawn_cmd(const char *name, int scheduler, int priority, int stack_size, main_t entry, char * const argv[])
|
||||
{
|
||||
int pid;
|
||||
|
||||
Reference in New Issue
Block a user