mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 09:33:34 +08:00
systemcmds: convert c -> c++
This commit is contained in:
@@ -36,7 +36,7 @@ px4_add_module(
|
||||
PRIORITY "SCHED_PRIORITY_DEFAULT-30"
|
||||
COMPILE_FLAGS
|
||||
SRCS
|
||||
nshterm.c
|
||||
nshterm.cpp
|
||||
DEPENDS
|
||||
)
|
||||
|
||||
|
||||
@@ -50,9 +50,7 @@
|
||||
#include <systemlib/err.h>
|
||||
#include <drivers/drv_hrt.h>
|
||||
|
||||
__EXPORT int nshterm_main(int argc, char *argv[]);
|
||||
|
||||
static void print_usage(void)
|
||||
static void print_usage()
|
||||
{
|
||||
PRINT_MODULE_DESCRIPTION("Start an NSH shell on a given port.\n"
|
||||
"\n"
|
||||
@@ -64,7 +62,7 @@ static void print_usage(void)
|
||||
PRINT_MODULE_USAGE_ARG("<file:dev>", "Device on which to start the shell (eg. /dev/ttyACM0)", false);
|
||||
}
|
||||
|
||||
int nshterm_main(int argc, char *argv[])
|
||||
extern "C" __EXPORT int nshterm_main(int argc, char *argv[])
|
||||
{
|
||||
if (argc < 2) {
|
||||
print_usage();
|
||||
@@ -102,7 +100,7 @@ int nshterm_main(int argc, char *argv[])
|
||||
dup2(fd, 1);
|
||||
dup2(fd, 2);
|
||||
|
||||
nsh_consolemain(0, NULL);
|
||||
nsh_consolemain(0, nullptr);
|
||||
|
||||
close(fd);
|
||||
|
||||
Reference in New Issue
Block a user