We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
The application note suggests to wrap a timer tick variable in a function which disables all interrupts, reads and copies the variable into a temp, re-enables interrupts, then returns the temp. Can the variable be accessed directly outside of the ISR without disabling interrupts if the timer tick variable is declared as "volatile?"
From K&R: "The purpose of volatile is to force an implementation to suppress optimisation that could otherwise occur" So there you are: its sole purpose is to control optimisation - not to guarantee atomic accesses, nor anything else.