Answered Questions

  • Can a variable be both const and volatile?

    Yes. The const modifier means that this code cannot change the value of the variable, but that does not mean that the value cannot be changed by means outside this code. For instance, in the example in  FAQ 8, the timer structure was accessed through a volatile const pointer. The function itself did not change the value of the timer, so it was declared const. However, the value was changed by...

    Ajay

    • Apr 17th, 2017

    Interrupt status register should be changed by the program. For example, if status register is updated by the hardware for some kind of interrupt. In our program we read the status register to service...