Yes it’s the same variable, things can only go wrong if you don’t do your business in enough time for the next interrupt.
The interrupt gets called more often than your code expects, or something like that, then things can run away from you.
Essentially though, the interrupt code isn’t special, don’t think of that part of the program in interrupt land.
It’s just a part of the same program that gets called under certain event driven circumstances and that’s all.
If you want to share any variable between the ISR and main program you will probably have to declare it in the include file,
or in your main program before you inserted the include line. The only reason you have to save and restore w & status
(assembler interrupt) is because your main program doesn’t know when the interrupt will happen.. or you wouldn’t need one![]()
Bookmarks