fix(nshterm): went out of stack

fix(mavlink_shell): no echo of commands
This commit is contained in:
Marin Doetterer authored and Ramon Roche committed 2026-09-03 12:31:07 -07:00
1 parent da60109091
commit 66f197b6ea
2 files changed
+10 -2

No files matched your search

+9 -2
View File
@@ -70,6 +70,10 @@ MavlinkShell::~MavlinkShell()
if (_from_shell_fd >= 0) {
close(_from_shell_fd);
}
if (_shell_fds[1] >= 0) {
close(_shell_fds[1]);
}
}
int MavlinkShell::start()
@@ -170,9 +174,8 @@ int MavlinkShell::start()
#endif
//close unused pipe fd's
//close unused pipe fd's; _shell_fds[1] is kept open, write() reuses it to echo input
close(_shell_fds[0]);
close(_shell_fds[1]);
#ifdef __PX4_NUTTX
sched_unlock();
@@ -214,6 +217,10 @@ int MavlinkShell::shell_start_thread(int argc, char *argv[])
size_t MavlinkShell::write(uint8_t *buffer, size_t len)
{
if (::write(_shell_fds[1], buffer, len) < 0) {
PX4_WARN("echo failed");
}
return ::write(_to_shell_fd, buffer, len);
}
+1
View File
@@ -34,6 +34,7 @@ px4_add_module(
MODULE systemcmds__nshterm
MAIN nshterm
PRIORITY "SCHED_PRIORITY_DEFAULT-30"
STACK_MAIN 4096
COMPILE_FLAGS
SRCS
nshterm.cpp