Welcome to electrical and electronics engineering discussion website, Please login or register to continue.

Buy Product With :- https://amzn.to/2YK7F9b

27 views
in Embedded System Design by

Buy Product With :- https://amzn.to/2YK7F9b

Your answer

Thanks for your contribution. Feel free to answer this question. Please avoid short answer. Your answer is most welcome. Be genuine.

Upload image or document:

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
Are you a robot ? (Y = Yes / N = No)
To avoid this verification in future, please log in or register.

1 Answer

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

Buy Product With :- https://amzn.to/2YK7F9b

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.

Categories

...