mirror of https://github.com/ArduPilot/ardupilot
AP_HAL: inline serial accessor function
Saves a bit more flash.
This commit is contained in:
parent
8747ae539f
commit
6a6c3ce7a1
|
@ -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];
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue