How to use the for loop in a simple sequence with STM32H7 in a SPI transmission?
Hello everyone,
I am trying to replace a simple code in C inside a STM32H7 that goes like this:
function(0, &array[0]);
function(1, &array[1]);
function(2, &array[2]);
function(3, &array[3]);
function(4, &array[4]);with
enum_variable_t index ;
for(index = FIRST_ENUM ; index < LAST_ENUM; index ++)
{
function((uint16_t)index , &array[index]);
}However, some data is corrupted due to this simple change, I thought it might be an optimization problem but I can't solve it by including the (-O) flag. Any advice would be of great help.
Regards
Alan
