mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-05 07:28:29 -04:00
AP_HAL_Linux: 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:
parent
68fdf033ee
commit
78711e05b7
@ -69,6 +69,7 @@ static UARTDriver uartEDriver(false);
|
|||||||
static UARTDriver uartFDriver(false);
|
static UARTDriver uartFDriver(false);
|
||||||
static UARTDriver uartGDriver(false);
|
static UARTDriver uartGDriver(false);
|
||||||
static UARTDriver uartHDriver(false);
|
static UARTDriver uartHDriver(false);
|
||||||
|
static UARTDriver uartIDriver(false);
|
||||||
|
|
||||||
static I2CDeviceManager i2c_mgr_instance;
|
static I2CDeviceManager i2c_mgr_instance;
|
||||||
static SPIDeviceManager spi_mgr_instance;
|
static SPIDeviceManager spi_mgr_instance;
|
||||||
@ -233,6 +234,7 @@ HAL_Linux::HAL_Linux() :
|
|||||||
&uartFDriver,
|
&uartFDriver,
|
||||||
&uartGDriver,
|
&uartGDriver,
|
||||||
&uartHDriver,
|
&uartHDriver,
|
||||||
|
&uartIDriver,
|
||||||
&i2c_mgr_instance,
|
&i2c_mgr_instance,
|
||||||
&spi_mgr_instance,
|
&spi_mgr_instance,
|
||||||
&analogIn,
|
&analogIn,
|
||||||
@ -256,7 +258,7 @@ HAL_Linux::HAL_Linux() :
|
|||||||
|
|
||||||
void _usage(void)
|
void _usage(void)
|
||||||
{
|
{
|
||||||
printf("Usage: -A uartAPath -B uartBPath -C uartCPath -D uartDPath -E uartEPath -F uartFPath -G uartGpath -H uartHpath\n");
|
printf("Usage: -A uartAPath -B uartBPath -C uartCPath -D uartDPath -E uartEPath -F uartFPath -G uartGpath -H uartHpath -I uartIpath\n");
|
||||||
printf("Options:\n");
|
printf("Options:\n");
|
||||||
printf("\tserial:\n");
|
printf("\tserial:\n");
|
||||||
printf(" -A /dev/ttyO4\n");
|
printf(" -A /dev/ttyO4\n");
|
||||||
@ -302,6 +304,7 @@ void HAL_Linux::run(int argc, char* const argv[], Callbacks* callbacks) const
|
|||||||
{"uartF", true, 0, 'F'},
|
{"uartF", true, 0, 'F'},
|
||||||
{"uartG", true, 0, 'G'},
|
{"uartG", true, 0, 'G'},
|
||||||
{"uartH", true, 0, 'H'},
|
{"uartH", true, 0, 'H'},
|
||||||
|
{"uartI", true, 0, 'I'},
|
||||||
{"log-directory", true, 0, 'l'},
|
{"log-directory", true, 0, 'l'},
|
||||||
{"terrain-directory", true, 0, 't'},
|
{"terrain-directory", true, 0, 't'},
|
||||||
{"storage-directory", true, 0, 's'},
|
{"storage-directory", true, 0, 's'},
|
||||||
@ -342,6 +345,9 @@ void HAL_Linux::run(int argc, char* const argv[], Callbacks* callbacks) const
|
|||||||
case 'H':
|
case 'H':
|
||||||
uartHDriver.set_device_path(gopt.optarg);
|
uartHDriver.set_device_path(gopt.optarg);
|
||||||
break;
|
break;
|
||||||
|
case 'I':
|
||||||
|
uartIDriver.set_device_path(gopt.optarg);
|
||||||
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
utilInstance.set_custom_log_directory(gopt.optarg);
|
utilInstance.set_custom_log_directory(gopt.optarg);
|
||||||
break;
|
break;
|
||||||
@ -376,6 +382,7 @@ void HAL_Linux::run(int argc, char* const argv[], Callbacks* callbacks) const
|
|||||||
uartF->begin(115200);
|
uartF->begin(115200);
|
||||||
uartG->begin(115200);
|
uartG->begin(115200);
|
||||||
uartH->begin(115200);
|
uartH->begin(115200);
|
||||||
|
uartI->begin(115200);
|
||||||
analogin->init();
|
analogin->init();
|
||||||
utilInstance.init(argc+gopt.optind-1, &argv[gopt.optind-1]);
|
utilInstance.init(argc+gopt.optind-1, &argv[gopt.optind-1]);
|
||||||
|
|
||||||
|
@ -263,6 +263,7 @@ void Scheduler::_run_uarts()
|
|||||||
hal.uartF->_timer_tick();
|
hal.uartF->_timer_tick();
|
||||||
hal.uartG->_timer_tick();
|
hal.uartG->_timer_tick();
|
||||||
hal.uartH->_timer_tick();
|
hal.uartH->_timer_tick();
|
||||||
|
hal.uartI->_timer_tick();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scheduler::_rcin_task()
|
void Scheduler::_rcin_task()
|
||||||
|
Loading…
Reference in New Issue
Block a user