by

1 Answer

0 like 0 dislike
The volatile keyword is a part of C standard, and this warns the compiler that ISR might change the value of a variable so that the compiler will not optimize the code in a way that will make it fall.

Here, need to declare:

static volatile long int iSecondsToday;

With the volatile keyword in the declaration, the compiler will know that the variable is volatile and each reference is read from memory.

If the keyword is not supported, you can still get the similar result by turning off the compiler optimizations.
by

Related questions

1 answer
1 answer
asked May 23, 2018 by anonymous1 | 18 views
1 answer
asked Mar 17, 2018 by anonymous1 | 19 views
1 answer
1 answer
asked Dec 16, 2017 by Quiz | 44 views
1 answer
asked Dec 16, 2017 by Quiz | 32 views
1 answer
asked Oct 19, 2017 by Quiz | 29 views
0 answers
0 answers
asked Apr 1, 2018 by Quiz | 26 views
1 answer
asked Mar 28, 2018 by Quiz | 26 views
0 answers
1 answer
asked Mar 17, 2018 by Quiz | 18 views
1 answer
asked Mar 17, 2018 by Quiz | 43 views
1 answer
asked Jan 27, 2018 by anonymous1 | 2,247 views
1 answer
asked Jan 25, 2018 by anonymous1 | 55 views
2 answers
asked Jan 24, 2018 by anonymous1 | 151 views
1 answer
1 answer
asked Jan 24, 2018 by anonymous1 | 210 views
1 answer
asked Jan 24, 2018 by anonymous1 | 50 views
1 answer
1 answer
asked Jan 23, 2018 by anonymous1 | 29 views
1 answer
asked Jan 23, 2018 by anonymous1 | 42 views
1 answer
asked Jan 23, 2018 by anonymous1 | 64 views
1 answer
2 answers
asked Jan 21, 2018 by Quiz | 213 views
1 answer
asked Jan 20, 2018 by Quiz | 24 views
1 answer
asked Jan 20, 2018 by Quiz | 33 views
1 answer
asked Jan 20, 2018 by Quiz | 44 views
1 answer
asked Dec 16, 2017 by Quiz | 31 views
1 answer
asked Dec 16, 2017 by Quiz | 19 views
2 answers
asked Aug 25, 2017 by Zeeshan | 84 views
1 answer
asked Aug 9, 2017 by Zeeshan | 334 views