diff --git a/firmware/development/engine_sniffer.cpp b/firmware/development/engine_sniffer.cpp index 7b850d1ab5..0abebaf0fc 100644 --- a/firmware/development/engine_sniffer.cpp +++ b/firmware/development/engine_sniffer.cpp @@ -160,8 +160,9 @@ void WaveChart::publish() { */ void WaveChart::addEvent3(const char *name, const char * msg) { ScopePerf perf(PE::EngineSniffer); + efitick_t nowNt = getTimeNowNt(); - if (getTimeNowNt() < pauseEngineSnifferUntilNt) { + if (nowNt < pauseEngineSnifferUntilNt) { return; } #if EFI_TEXT_LOGGING @@ -191,9 +192,6 @@ void WaveChart::addEvent3(const char *name, const char * msg) { return; } - - efitick_t nowNt = getTimeNowNt(); - bool alreadyLocked = lockOutputBuffer(); // we have multiple threads writing to the same output buffer if (counter == 0) { diff --git a/firmware/development/engine_sniffer.h b/firmware/development/engine_sniffer.h index f53b6486cf..64ac3d633f 100644 --- a/firmware/development/engine_sniffer.h +++ b/firmware/development/engine_sniffer.h @@ -27,6 +27,7 @@ public: void publish(); bool isFull() const; bool isStartedTooLongAgo() const; + // looks like this is only used by functional tests on real hardware efitick_t pauseEngineSnifferUntilNt = 0; private: