From d616088f6905482bb081ee2caf3233f0504f8686 Mon Sep 17 00:00:00 2001 From: Pablo2048 Date: Sat, 19 Jan 2019 10:05:46 +0100 Subject: [PATCH] Modifikace kvuli multitaskingu v ESP32 --- src/trace.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } }