Zajímavý projekt a hezky popsaný, díky.
Není cli() a sei() v obsluze přerušení zbytečné? Podle datasheetu Atmegy 328 se to děje automaticky:
"When an interrupt occurs, the Global Interrupt Enable I-bit is cleared and all interrupts are disabled. The user software can write logic one to the I-bit to enable nested interrupts. All enabled interrupts can then interrupt the current interrupt routine. The I-bit is automatically set when a Return from Interrupt instruction – RETI – is executed."