AP_HAL_SITL: support uartI, allowing a total of 9 uarts

this allows for OTG2 on the MatekH743 board, which makes SLCAN much
easier
This commit is contained in:
Andrew Tridgell 2020-11-26 17:49:00 +11:00
parent 78711e05b7
commit a7a5879c0c
3 changed files with 6 additions and 0 deletions

View File

@ -60,6 +60,7 @@ static UARTDriver sitlUart4Driver(4, &sitlState);
static UARTDriver sitlUart5Driver(5, &sitlState);
static UARTDriver sitlUart6Driver(6, &sitlState);
static UARTDriver sitlUart7Driver(7, &sitlState);
static UARTDriver sitlUart8Driver(8, &sitlState);
#if defined(HAL_BUILD_AP_PERIPH)
static Empty::I2CDeviceManager i2c_mgr_instance;
@ -83,6 +84,7 @@ HAL_SITL::HAL_SITL() :
&sitlUart5Driver, /* uartF */
&sitlUart6Driver, /* uartG */
&sitlUart7Driver, /* uartH */
&sitlUart8Driver, /* uartI */
&i2c_mgr_instance,
&emptySPI, /* spi */
&sitlAnalogIn, /* analogin */

View File

@ -90,6 +90,7 @@ void SITL_State::_usage(void)
"\t--uartF device set device string for UARTF\n"
"\t--uartG device set device string for UARTG\n"
"\t--uartH device set device string for UARTH\n"
"\t--uartI device set device string for UARTI\n"
"\t--rtscts enable rtscts on serial ports (default false)\n"
"\t--base-port PORT set port num for base port(default 5670) must be before -I option\n"
"\t--rc-in-port PORT set port num for rc in\n"
@ -224,6 +225,7 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
CMDLINE_UARTF,
CMDLINE_UARTG,
CMDLINE_UARTH,
CMDLINE_UARTI,
CMDLINE_RTSCTS,
CMDLINE_BASE_PORT,
CMDLINE_RCIN_PORT,
@ -261,6 +263,7 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
{"uartF", true, 0, CMDLINE_UARTF},
{"uartG", true, 0, CMDLINE_UARTG},
{"uartH", true, 0, CMDLINE_UARTH},
{"uartI", true, 0, CMDLINE_UARTI},
{"rtscts", false, 0, CMDLINE_RTSCTS},
{"base-port", true, 0, CMDLINE_BASE_PORT},
{"rc-in-port", true, 0, CMDLINE_RCIN_PORT},

View File

@ -243,6 +243,7 @@ void Scheduler::_run_io_procs()
hal.uartF->_timer_tick();
hal.uartG->_timer_tick();
hal.uartH->_timer_tick();
hal.uartI->_timer_tick();
hal.storage->_timer_tick();
#ifndef HAL_BUILD_AP_PERIPH