[v2] AVR C code for firmware