From 6a6c3ce7a199f03de28315ead7ac834df70bd994 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Mon, 20 Nov 2023 20:20:07 -0600 Subject: [PATCH] AP_HAL: inline serial accessor function Saves a bit more flash. --- libraries/AP_HAL/HAL.cpp | 9 --------- libraries/AP_HAL/HAL.h | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libraries/AP_HAL/HAL.cpp b/libraries/AP_HAL/HAL.cpp index deef2581c3..6f796c3ab9 100644 --- a/libraries/AP_HAL/HAL.cpp +++ b/libraries/AP_HAL/HAL.cpp @@ -11,12 +11,3 @@ HAL::FunCallbacks::FunCallbacks(void (*setup_fun)(void), void (*loop_fun)(void)) } } - -// access serial ports using SERIALn numbering -AP_HAL::UARTDriver* AP_HAL::HAL::serial(uint8_t sernum) const -{ - if (sernum >= ARRAY_SIZE(serial_array)) { - return nullptr; - } - return serial_array[sernum]; -} diff --git a/libraries/AP_HAL/HAL.h b/libraries/AP_HAL/HAL.h index d56aeaa724..063871d064 100644 --- a/libraries/AP_HAL/HAL.h +++ b/libraries/AP_HAL/HAL.h @@ -155,3 +155,12 @@ public: #endif }; + +// access serial ports using SERIALn numbering +inline AP_HAL::UARTDriver* AP_HAL::HAL::serial(uint8_t sernum) const +{ + if (sernum >= ARRAY_SIZE(serial_array)) { + return nullptr; + } + return serial_array[sernum]; +}