diff --git a/libraries/AP_HAL/HAL.cpp b/libraries/AP_HAL/HAL.cpp index 280f1ab2ca..a2d1216d2b 100644 --- a/libraries/AP_HAL/HAL.cpp +++ b/libraries/AP_HAL/HAL.cpp @@ -17,7 +17,7 @@ AP_HAL::UARTDriver* AP_HAL::HAL::serial(uint8_t sernum) const { UARTDriver **uart_array = const_cast(&uartA); // this mapping captures the historical use of uartB as SERIAL3 - const uint8_t mapping[] = { 0, 2, 3, 1, 4, 5, 6, 7, 8 }; + const uint8_t mapping[] = { 0, 2, 3, 1, 4, 5, 6, 7, 8, 9 }; static_assert(sizeof(mapping) == num_serial, "num_serial must match mapping"); if (sernum >= num_serial) { return nullptr; diff --git a/libraries/AP_HAL/HAL.h b/libraries/AP_HAL/HAL.h index 9d14ec3563..ae9a0861b7 100644 --- a/libraries/AP_HAL/HAL.h +++ b/libraries/AP_HAL/HAL.h @@ -29,6 +29,7 @@ public: AP_HAL::UARTDriver* _uartG, // extra2 AP_HAL::UARTDriver* _uartH, // extra3 AP_HAL::UARTDriver* _uartI, // extra4 + AP_HAL::UARTDriver* _uartJ, // extra5 AP_HAL::I2CDeviceManager* _i2c_mgr, AP_HAL::SPIDeviceManager* _spi, AP_HAL::QSPIDeviceManager* _qspi, @@ -58,6 +59,7 @@ public: uartG(_uartG), uartH(_uartH), uartI(_uartI), + uartJ(_uartJ), i2c_mgr(_i2c_mgr), spi(_spi), qspi(_qspi), @@ -115,6 +117,7 @@ private: AP_HAL::UARTDriver* uartG; AP_HAL::UARTDriver* uartH; AP_HAL::UARTDriver* uartI; + AP_HAL::UARTDriver* uartJ; public: AP_HAL::I2CDeviceManager* i2c_mgr; @@ -140,5 +143,5 @@ public: // access to serial ports using SERIALn_ numbering UARTDriver* serial(uint8_t sernum) const; - static constexpr uint8_t num_serial = 9; + static constexpr uint8_t num_serial = 10; };