diff --git a/firmware/development/wave_analyzer.cpp b/firmware/development/wave_analyzer.cpp index 04926fe3a6..1db6514db2 100644 --- a/firmware/development/wave_analyzer.cpp +++ b/firmware/development/wave_analyzer.cpp @@ -60,6 +60,7 @@ static void waAnaWidthCallback(WaveReader *reader) { efitick_t nowUs = getTimeNowUs(); reader->riseEventCounter++; reader->lastActivityTimeUs = nowUs; + assertIsrContext(CUSTOM_ERR_6670); addEngineSniffferEvent(reader->name, WC_UP); uint32_t width = nowUs - reader->periodEventTimeUs; @@ -73,6 +74,7 @@ void WaveReader::onFallEvent() { efitick_t nowUs = getTimeNowUs(); fallEventCounter++; lastActivityTimeUs = nowUs; + assertIsrContext(CUSTOM_ERR_6670); addEngineSniffferEvent(name, WC_DOWN); efitick_t width = nowUs - widthEventTimeUs; diff --git a/firmware/util/rfiutil.h b/firmware/util/rfiutil.h index 34950d3db0..4060ea8db8 100644 --- a/firmware/util/rfiutil.h +++ b/firmware/util/rfiutil.h @@ -22,6 +22,8 @@ #define isLocked() (ch.dbg.lock_cnt > 0) #define isIsrContext() (ch.dbg.isr_cnt > 0) +#define assertIsrContext(code) efiAssertVoid(code, isIsrContext(), "NOT_ISR") + #ifdef __cplusplus extern "C" {