1

SREG is the processor status register. One of the bits in there is the interrupt flag, which is cleared with the cli() command and reset at the end of the function. Why the original poster used the register instead of just using cli/sei is unclear. (Note: Instead of cli() and sei() the arduino documentation uses the much clearer equivalents noInterrupts() ...


Only top voted, non community-wiki answers of a minimum length are eligible