AP_HAL_Linux: introduce get_HAL_mutable() to complement get_HAL()

Returns a mutable reference to the same HAL for certain purposes where
the HAL needs to be mutated to avoid UB problems with casting away const
and to make the fact that mutation is happening obvious.
This commit is contained in:
Thomas Watson 2023-11-23 19:56:36 -06:00 committed by Peter Barker
parent db12f428c5
commit 8fe95dca81
1 changed files with 5 additions and 0 deletions

View File

@ -491,3 +491,8 @@ const AP_HAL::HAL &AP_HAL::get_HAL()
{
return hal_linux;
}
AP_HAL::HAL &AP_HAL::get_HAL_mutable()
{
return hal_linux;
}