asked by

Please log in or register to answer this question.

1 Answer

0 votes
answered by
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.

Related questions

1 answer 4 views
1 answer 7 views
asked May 24, 2018 by Q&A
1 answer 8 views
asked Mar 18, 2018 by Q&A
1 answer 17 views

Welcome to Q&A site for electrical and electronics engineering discussion for diploma, B.E./B.Tech, M.E./M.Tech, & PhD study.
If you have a new question please ask in English.
If you want to help this community answer these questions.