Hi,
I just happened to see that the frame variable in the hello_world was defined as a volatile int.
Is there any specific reason?
I mean, would the optimizations pose problems on this specific variable? If yes why?
Thanks
volatile int for frame count
Re: volatile int for frame count
since this variable is updated in an irq handler it needs to be read from memory each time in the main loop. without the volatile declaration it would most likely be read once into a register and the updates would be never be seen.
Who is online
Users browsing this forum: No registered users and 0 guests