/* 2015, Ralf Ramsauer * ralf@binary-kitchen.de */ #include #include #include #include #include "io.h" #include "uart.h" #include "../doorcmds.h" static volatile enum {LOCKED, UNLOCKED} state = LOCKED; static volatile bool schnapper = false; static inline void timer_init(void) { // Config the timer // The 16bit Timer1 is used for resetting the lock state, // if the UART stops receiving the unlock command TIMSK |= (1<