diff --git a/hal_st/stm32fxxx/AdcDmaMultiChannelStm.cpp b/hal_st/stm32fxxx/AdcDmaMultiChannelStm.cpp index bea8b762..707004f7 100644 --- a/hal_st/stm32fxxx/AdcDmaMultiChannelStm.cpp +++ b/hal_st/stm32fxxx/AdcDmaMultiChannelStm.cpp @@ -31,14 +31,14 @@ namespace hal auto result = HAL_ADCEx_Calibration_Start(&adc.Handle(), ADC_SINGLE_ENDED); assert(result == HAL_OK); #elif defined(IS_ADC_CALFACT) - auto result = HAL_ADCEx_Calibration_Start(&adc.Handle()); + auto result = HAL_ADCEx_Calibration_Start(&adc.Handle()); assert(result == HAL_OK); #endif LL_ADC_REG_SetDMATransfer(adc.Handle().Instance, LL_ADC_REG_DMA_TRANSFER_LIMITED); } - void AdcDmaMultiChannelStmBase::Measure(const infra::Function)>& onDone) + void AdcDmaMultiChannelStmBase::Measure(const infra::Function& onDone) { this->onDone = onDone; diff --git a/hal_st/stm32fxxx/AdcDmaMultiChannelStm.hpp b/hal_st/stm32fxxx/AdcDmaMultiChannelStm.hpp index 70975b43..7e9cb336 100644 --- a/hal_st/stm32fxxx/AdcDmaMultiChannelStm.hpp +++ b/hal_st/stm32fxxx/AdcDmaMultiChannelStm.hpp @@ -1,23 +1,27 @@ #ifndef HAL_ST_ADC_DMA_MULTI_CHANNEL_HPP #define HAL_ST_ADC_DMA_MULTI_CHANNEL_HPP +#include "hal/interfaces/AdcMultiChannel.hpp" #include "hal_st/stm32fxxx/AnalogToDigitalPinStm.hpp" #include "hal_st/stm32fxxx/DmaStm.hpp" #include "hal_st/stm32fxxx/GpioStm.hpp" #include "infra/util/AutoResetFunction.hpp" +#include +#include /// @brief This ADC implementation supports multiple channels with DMA transfer and software trigger. /// DMA transfer is one shot mode. namespace hal { class AdcDmaMultiChannelStmBase + : public AdcMultiChannel { public: AdcDmaMultiChannelStmBase( infra::MemoryRange buffer, infra::MemoryRange analogPins, AdcStm& adc, DmaStm::ReceiveStream& receiveStream); - void Measure(const infra::Function)>& onDone); + void Measure(const infra::Function& onDone) override; constexpr static std::size_t MaxChannels{ 16 }; @@ -29,7 +33,7 @@ namespace hal infra::MemoryRange analogPins; AdcStm& adc; ReceiveDmaChannel dmaStream; - infra::AutoResetFunction)> onDone; + infra::AutoResetFunction onDone; void TransferDone(); };