Added enterCritical/leaceCritical methods in SREG and fixed RotaryEncoder so correct bits are set for triggering