diff --git a/drivers/CoreDAC/source/CoreSTM32HalBasicTimer.cpp b/drivers/CoreDAC/source/CoreSTM32HalBasicTimer.cpp index bb54da1113..d8512ababb 100644 --- a/drivers/CoreDAC/source/CoreSTM32HalBasicTimer.cpp +++ b/drivers/CoreDAC/source/CoreSTM32HalBasicTimer.cpp @@ -39,7 +39,7 @@ void CoreSTM32HalBasicTimer::initialize(float frequency) timerMasterConfig.MasterOutputTrigger = TIM_TRGO_UPDATE; _hal.HAL_TIMEx_MasterConfigSynchronization(&_htim, &timerMasterConfig); - static const auto &self = *this; + static auto &self = (*this); _hal.HAL_TIM_RegisterCallback(&_htim, HAL_TIM_PERIOD_ELAPSED_CB_ID, []([[maybe_unused]] TIM_HandleTypeDef *htim) { if (self._callback != nullptr) { self._callback(); @@ -49,7 +49,7 @@ void CoreSTM32HalBasicTimer::initialize(float frequency) void CoreSTM32HalBasicTimer::_registerMspCallbacks() { - static const auto &self = *this; + static auto &self = (*this); _hal.HAL_TIM_RegisterCallback(&_htim, HAL_TIM_BASE_MSPINIT_CB_ID, []([[maybe_unused]] TIM_HandleTypeDef *htim) { self._hal.HAL_RCC_TIM6_CLK_ENABLE();