AP_HAL_SITL: Add uart specification and array

This commit is contained in:
murata 2021-04-27 05:47:21 +09:00 committed by Peter Barker
parent 29534a7e2d
commit b67f2e9307
3 changed files with 8 additions and 2 deletions

View File

@ -54,7 +54,7 @@ public:
uint16_t voltage2_pin_value; // pin 15 uint16_t voltage2_pin_value; // pin 15
uint16_t current2_pin_value; // pin 14 uint16_t current2_pin_value; // pin 14
// paths for UART devices // paths for UART devices
const char *_uart_path[7] { const char *_uart_path[9] {
"none:0", "none:0",
"fifo:gps", "fifo:gps",
"none:1", "none:1",
@ -62,6 +62,8 @@ public:
"none:3", "none:3",
"none:4", "none:4",
"none:5", "none:5",
"none:6",
"none:7",
}; };
uint8_t get_instance() const { return _instance; } uint8_t get_instance() const { return _instance; }

View File

@ -104,7 +104,7 @@ public:
uint16_t current2_pin_value; // pin 14 uint16_t current2_pin_value; // pin 14
// paths for UART devices // paths for UART devices
const char *_uart_path[7] { const char *_uart_path[9] {
"tcp:0:wait", "tcp:0:wait",
"GPS1", "GPS1",
"tcp:2", "tcp:2",
@ -112,6 +112,8 @@ public:
"GPS2", "GPS2",
"tcp:5", "tcp:5",
"tcp:6", "tcp:6",
"tcp:7",
"tcp:8",
}; };
std::vector<struct AP_Param::defaults_table_struct> cmdline_param; std::vector<struct AP_Param::defaults_table_struct> cmdline_param;

View File

@ -408,6 +408,7 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
case CMDLINE_UARTF: case CMDLINE_UARTF:
case CMDLINE_UARTG: case CMDLINE_UARTG:
case CMDLINE_UARTH: case CMDLINE_UARTH:
case CMDLINE_UARTI:
_uart_path[opt - CMDLINE_UARTA] = gopt.optarg; _uart_path[opt - CMDLINE_UARTA] = gopt.optarg;
break; break;
case CMDLINE_SERIAL0: case CMDLINE_SERIAL0:
@ -418,6 +419,7 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
case CMDLINE_SERIAL5: case CMDLINE_SERIAL5:
case CMDLINE_SERIAL6: case CMDLINE_SERIAL6:
case CMDLINE_SERIAL7: case CMDLINE_SERIAL7:
case CMDLINE_SERIAL8:
_uart_path[opt - CMDLINE_SERIAL0] = gopt.optarg; _uart_path[opt - CMDLINE_SERIAL0] = gopt.optarg;
break; break;
case CMDLINE_RTSCTS: case CMDLINE_RTSCTS: