diff --git a/avr-code/main.c b/avr-code/main.c index d566e05..203554b 100644 --- a/avr-code/main.c +++ b/avr-code/main.c @@ -56,13 +56,14 @@ void uart_handler(const unsigned char c) uart_putc(retval); } -// Alle 1.137 Sekunden +// Timeroverflow interrupts occurs each 1.137 seconds +// UART receive interrupts is used to prevent timer overflows ISR(TIMER1_OVF_vect) { state = LOCKED; } -// Notzu +// Button Lock ISR(INT0_vect) { cli(); @@ -79,7 +80,7 @@ out: sei(); } -// Notauf +// Button Unlock ISR(INT1_vect) { cli(); @@ -112,15 +113,18 @@ int main(void) uart_init(); uart_set_recv_handler(uart_handler); - // Timer config + // Config the timer + // The 16bit Timer1 is used for resetting the lock state, + // if the UART stops receiving the unlock command TIMSK |= (1<