]> www.fi.muni.cz Git - bike-lights.git/blobdiff - firmware/logging.c
Disable WDT as early as possible
[bike-lights.git] / firmware / logging.c
index 2b8d242e7156215af1284c1708e609e37d19ff98..31329f889ba6f860ad44e954480f959cf73c7a23 100644 (file)
@@ -21,7 +21,7 @@ void log_set_state(unsigned char val)
                eeprom_write_byte(&log_state, val);
 }
 
-void init_log()
+void init_log(unsigned char mcusr)
 {
        unsigned char r_count;
 
@@ -31,8 +31,7 @@ void init_log()
        if (r_count < 5) {
                r_count++;
                eeprom_write_byte(&reboot_count,
-                       (r_count << 4) | (MCUSR & 0xF));
-               MCUSR = 0;
+                       (r_count << 4) | (mcusr & 0xF));
                can_write_eeprom = 1;
        } else {
                //eeprom_write_byte(&log_state, 0xFF);