From 1f5a535076229b006597b0aaa45708a6c2a8debb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Sat, 8 Feb 2020 19:18:47 +0100 Subject: [PATCH] Make average filtering of HF meas path an integer calculation --- stm-firmware/adc-meas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stm-firmware/adc-meas.c b/stm-firmware/adc-meas.c index fe7dcd3..ba0b8c0 100644 --- a/stm-firmware/adc-meas.c +++ b/stm-firmware/adc-meas.c @@ -263,7 +263,7 @@ static inline __attribute__((optimize("O3"))) float adc_pt1000_dma_avg_pre_filte sum = sum - (uint32_t)max_val - (uint32_t)min_val; /* Divide to get average and return */ - return (float)sum / (ADC_PT1000_DMA_AVG_SAMPLES-2); + return (float)(sum / (ADC_PT1000_DMA_AVG_SAMPLES-2)); } void ADC_IRQHandler(void)