diff --git a/libraries/AP_HAL_ESP32/system.cpp b/libraries/AP_HAL_ESP32/system.cpp index 20f07a0147..4ee607c561 100644 --- a/libraries/AP_HAL_ESP32/system.cpp +++ b/libraries/AP_HAL_ESP32/system.cpp @@ -56,8 +56,14 @@ uint64_t millis64() } // namespace AP_HAL +static HAL_ESP32 hal_esp32; + const AP_HAL::HAL& AP_HAL::get_HAL() { - static const HAL_ESP32 hal; - return hal; + return hal_esp32; +} + +AP_HAL::HAL& AP_HAL::get_HAL_mutable() +{ + return hal_esp32; }