Ask now - it's free
in Embedded System Design by

Know someone who can answer this question ? Share this on Facebook, Twitter, Whatsapp

← Prev Question Next Question →

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.

Related questions

1 answer 38 views
1 answer 39 views
0 answers 44 views
1 answer 2,294 views
1 answer 96 views
2 answers 241 views
1 answer 256 views
1 answer 88 views
1 answer 51 views
1 answer 58 views
1 answer 86 views
2 answers 252 views
1 answer 44 views
1 answer 55 views
1 answer 92 views
1 answer 40 views
2 answers 145 views
1 answer 349 views

Want to ask a new question ? :-> Ask Question

Want to help the community by giving answer? :-> Unanswered Questions

Here anyone can ask and answer any question. Get help and can help to any engineering problem including Electrical, Electronics, Mechanical, Telecommunication, Instrumentation, Computer, Mathematics, Physics etc. Get answers to questions. Help is always 100% free!