From 019f441b2f947dcc77428a94b1ca466e708e04bf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 12 Jul 2019 14:58:31 +1000 Subject: [PATCH] HAL_Linux: added uartH --- libraries/AP_HAL_Linux/HAL_Linux_Class.cpp | 9 ++++++++- libraries/AP_HAL_Linux/Scheduler.cpp | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL_Linux/HAL_Linux_Class.cpp b/libraries/AP_HAL_Linux/HAL_Linux_Class.cpp index 6a69d5c4e5..17fe8576bd 100644 --- a/libraries/AP_HAL_Linux/HAL_Linux_Class.cpp +++ b/libraries/AP_HAL_Linux/HAL_Linux_Class.cpp @@ -66,6 +66,7 @@ static UARTDriver uartDDriver(false); static UARTDriver uartEDriver(false); static UARTDriver uartFDriver(false); static UARTDriver uartGDriver(false); +static UARTDriver uartHDriver(false); static I2CDeviceManager i2c_mgr_instance; static SPIDeviceManager spi_mgr_instance; @@ -220,6 +221,7 @@ HAL_Linux::HAL_Linux() : &uartEDriver, &uartFDriver, &uartGDriver, + &uartHDriver, &i2c_mgr_instance, &spi_mgr_instance, &analogIn, @@ -237,7 +239,7 @@ HAL_Linux::HAL_Linux() : void _usage(void) { - printf("Usage: -A uartAPath -B uartBPath -C uartCPath -D uartDPath -E uartEPath -F uartFPath -G uartGpath\n"); + printf("Usage: -A uartAPath -B uartBPath -C uartCPath -D uartDPath -E uartEPath -F uartFPath -G uartGpath -H uartHpath\n"); printf("Options:\n"); printf("\tserial:\n"); printf(" -A /dev/ttyO4\n"); @@ -279,6 +281,7 @@ void HAL_Linux::run(int argc, char* const argv[], Callbacks* callbacks) const {"uartE", true, 0, 'E'}, {"uartF", true, 0, 'F'}, {"uartG", true, 0, 'G'}, + {"uartH", true, 0, 'H'}, {"log-directory", true, 0, 'l'}, {"terrain-directory", true, 0, 't'}, {"storage-directory", true, 0, 's'}, @@ -316,6 +319,9 @@ void HAL_Linux::run(int argc, char* const argv[], Callbacks* callbacks) const case 'G': uartGDriver.set_device_path(gopt.optarg); break; + case 'H': + uartHDriver.set_device_path(gopt.optarg); + break; case 'l': utilInstance.set_custom_log_directory(gopt.optarg); break; @@ -349,6 +355,7 @@ void HAL_Linux::run(int argc, char* const argv[], Callbacks* callbacks) const uartE->begin(115200); uartF->begin(115200); uartG->begin(115200); + uartH->begin(115200); analogin->init(); utilInstance.init(argc+gopt.optind-1, &argv[gopt.optind-1]); diff --git a/libraries/AP_HAL_Linux/Scheduler.cpp b/libraries/AP_HAL_Linux/Scheduler.cpp index 3b73076179..1cc012b27e 100644 --- a/libraries/AP_HAL_Linux/Scheduler.cpp +++ b/libraries/AP_HAL_Linux/Scheduler.cpp @@ -264,6 +264,7 @@ void Scheduler::_run_uarts() hal.uartE->_timer_tick(); hal.uartF->_timer_tick(); hal.uartG->_timer_tick(); + hal.uartH->_timer_tick(); } void Scheduler::_rcin_task()