diff --git a/src/trace.cpp b/src/trace.cpp index 34239a4..5e25c4f 100644 --- a/src/trace.cpp +++ b/src/trace.cpp @@ -24,7 +24,7 @@ struct TraceLine static TraceLine _lines[MAX_TRACE_LINES]; static uint16_t _lines_index = 0; static uint16_t _lines_count = 0; -static int _modified = 0; +static volatile int _modified = 0; static AsyncWebSocket *_wss = NULL; // webovy soket pro trasovani static Interval _tint; // interval pro casovani stopare @@ -276,6 +276,7 @@ void trace_poll() { // .. a vyprsel timeout pro obcerstvovani String log; + _modified = 0; // rusime pozadavek na odeslani novych dat if (log.reserve((MAX_TRACE_LINES * MAX_LINE_LEN) + (MAX_TRACE_LINES * 50))) { log = F("{\"type\":\"trace\",\"data\":["); @@ -285,7 +286,6 @@ void trace_poll() } else _wss->textAll(F("{\"type\":\"trace\",\"text\":\"Memory error\"}")); - _modified = 0; // rusime pozadavek na odeslani novych dat _tint.set(TRACE_CHECK_INTERVAL); } }