AP_HAL: 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:54:35 -06:00 committed by Peter Barker
parent c48feefe23
commit dc76e03890
1 changed files with 2 additions and 1 deletions

View File

@ -67,6 +67,7 @@ namespace AP_HAL {
class SIMState;
// Must be implemented by the concrete HALs.
// Must be implemented by the concrete HALs and return the same reference.
const HAL& get_HAL();
HAL& get_HAL_mutable();
}