mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 10:23:33 +08:00
Added startup scripts useful when running USB consoles, made MAVLink aware that /dev/console is a hint for running on USB (magic strings, magic strings)
This commit is contained in:
@@ -442,7 +442,8 @@ int mavlink_open_uart(int baud, const char *uart_name, struct termios *uart_conf
|
||||
int termios_state;
|
||||
*is_usb = false;
|
||||
|
||||
if (strcmp(uart_name, "/dev/ttyACM0") != OK) {
|
||||
/* make some wild guesses including that USB serial is indicated by either /dev/ttyACM0 or /dev/console */
|
||||
if (strcmp(uart_name, "/dev/ttyACM0") != OK && strcmp(uart_name, "/dev/console") != OK) {
|
||||
/* Back up the original uart configuration to restore it after exit */
|
||||
if ((termios_state = tcgetattr(uart, uart_config_original)) < 0) {
|
||||
fprintf(stderr, "[mavlink] ERROR getting baudrate / termios config for %s: %d\n", uart_name, termios_state);
|
||||
|
||||
Reference in New Issue
Block a user