mjs513
Senior Member+
On the Using Interrupts you can use the following code snippet to save and restore the interrupt state, for the T3.x's:
However, on the T4.x's SREG is not available. So question is how would you do this for the T4.x's.
Yes I know I can wrap it in noInterrputs()/interrupts() but if this might interfere with other things.
Code:
unsigned char sreg_backup;
sreg_backup = SREG; /* save interrupt enable/disable state */
cli();
overflow_count = 0;
SREG = sreg_backup /* restore interrupt state */
However, on the T4.x's SREG is not available. So question is how would you do this for the T4.x's.
Yes I know I can wrap it in noInterrputs()/interrupts() but if this might interfere with other things.