Make average calculation floating point.

This commit is contained in:
Mario Hüttel 2020-02-09 19:21:06 +01:00
parent 8bbc2e60f8
commit 48fea3d36e
1 changed files with 1 additions and 1 deletions

View File

@ -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 / (float)(ADC_PT1000_DMA_AVG_SAMPLES-2);
}
void ADC_IRQHandler(void)