STM32H723: How to optimize summation of an array?
Hi folks.
I am trying to optimize (by time) the following piece of code.
for (uint32_t i = 6 + adc_data_index; i < 35 + adc_data_index; i++)
{
raw[0] += (adc_data[i]);
raw[1] += (adc_data[i + 35]);
raw[2] += (adc_data[i + 70]);
raw[3] += (adc_data[i + 115]);
}For now it takes 3.5 micro-second at 250 MHz clock
I want to make it less by at least factor of 2.
Do you have any ideas?
What I tried:
1. Change the optimization to be -Ofast
2. Using pointer
3. Also, thought about FMAC and DFSDM
How can I achieve that?
Thanks
Yonatan
