1 Answer

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.
Like 0 like

Related

Description : Describe the following terms: (i) Keyword (ii) Identifier (iii) Variable (iv) Constant

Description : Which of the following is not a keyword? a) eval b) assert c) nonlocal d) pass

Description : Which of the following is used to make an Abstract class ? (A) Making atleast one member function as pure virtual function (B) Making atleast one member function as virtual function (C) Declaring as Abstract class using virtual keyword (D) Declaring as Abstract class using static keyword

Description : A keyword can be used as an identifier by using the  A) prefix # B) prefix @ C) prefix $ D) prefix x

Ask a QuestionQuestions ← Prev Page Next Page →