dangerous relocation: l32r: literal placed after use
Posted: Tue Jan 21, 2025 11:14 am
Hello,
The following 3 lines in my code generate the following error (esp-idf esp32-C3 in visual studio code)
"dangerous relocation: l32r: literal placed after use"
These lines are in the same function, but at different locations....
I think that I have a clue as to what might be happening for the 2 bottom ones, but the first one is less obvious.
Even less obvious is how to fix it!
Can anyone help me?
Thanks,
Cyrille
The following 3 lines in my code generate the following error (esp-idf esp32-C3 in visual studio code)
"dangerous relocation: l32r: literal placed after use"
These lines are in the same function, but at different locations....
I think that I have a clue as to what might be happening for the 2 bottom ones, but the first one is less obvious.
Even less obvious is how to fix it!
Can anyone help me?
Thanks,
Cyrille
Code: Select all
uint32_t newDeltaBetweenSteps= 1000000 / (Abs(currentSpd));
*((uint32_t*)GPIO_OUT_W1TS_REG)=1<<stp; stpVal= 1;
*((uint32_t*)GPIO_OUT_W1TC_REG)=1<<stp; stpVal= 0;