X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?p=bike-lights.git;a=blobdiff_plain;f=firmware%2Flogging.c;h=05716bf1050cdc6d4aa907e7bc3a8d90e181dc47;hp=2b8d242e7156215af1284c1708e609e37d19ff98;hb=HEAD;hpb=5160421f0d1725356e74a24b334e68eaaa9b398c diff --git a/firmware/logging.c b/firmware/logging.c index 2b8d242..44e2c39 100644 --- a/firmware/logging.c +++ b/firmware/logging.c @@ -5,7 +5,7 @@ #include "lights.h" -#define LOG_BUFFER 128 +#define LOG_BUFFER 64 static unsigned char log_buffer_ee[LOG_BUFFER] EEMEM; static unsigned char log_buffer_count; static unsigned char log_buffer[LOG_BUFFER]; @@ -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);