Patrick_M:
scusa brunello22 una domanda... ma se era gia dichiarata global non deve dichiararla volatile o no?
Le variabili usate dentro una ISR ed anche fuori vanno SEMPRE dichiarate "volatile" ...
Variables shared between ISR functions and normal functions should be declared "volatile". This tells the compiler that such variables might change at any time, and thus the compiler must reload the variable whenever you reference it, rather than relying upon a copy it might have in a processor register.
... altrimenti rischi di NON vedere i valori aggiornati.
Guglielmo