There is an easy way to take control: read the volatile variable only once.
volatile int x = 5;
...
int y=x;
printf("%d in hex is 0x%x.\n", y, y); volatile int x = 5;
...
int y=x;
printf("%d in hex is 0x%x.\n", y, y);No comments yet.