# HG changeset patch # User Laurent Bessard # Date 1364165690 -3600 # Node ID 2f7721dae9a0e1241ab52c2ef2bda4322171ebba # Parent 17d9c81b5ed845a6c4cee0f979bcd2b1a1c059ae# Parent d6da2ccafca4cca055d41b776d14141c186e1da0 Merged diff -r d6da2ccafca4 -r 2f7721dae9a0 targets/plc_main_tail.c --- a/targets/plc_main_tail.c Fri Mar 22 16:09:16 2013 +0100 +++ b/targets/plc_main_tail.c Sun Mar 24 23:54:50 2013 +0100 @@ -26,7 +26,7 @@ if(buffpos + size < LOG_BUFFER_SIZE){ memcpy(&LogBuff[level][buffpos], buf, size); }else{ - uint32_t remaining = LOG_BUFFER_SIZE - buffpos - 1; + uint32_t remaining = LOG_BUFFER_SIZE - buffpos; memcpy(&LogBuff[level][buffpos], buf, remaining); memcpy(LogBuff[level], (char*)buf + remaining, size - remaining); } @@ -58,7 +58,7 @@ |63 ... 32|31 ... 0| | Message | Buffer | | counter | Index | */ -static uint64_t LogCursor[LOG_LEVELS] = {0x0,0x0,0x0,0x0}; +static uint64_t LogCursor[LOG_LEVELS] LOG_BUFFER_ATTRS = {0x0,0x0,0x0,0x0}; /* Store one log message of give size */ int LogMessage(uint8_t level, uint8_t* buf, uint32_t size){