From af6041c5aea55fb67adbc557aa32b6083183d747 Mon Sep 17 00:00:00 2001 From: DashyFox Date: Thu, 29 Feb 2024 16:24:35 +0300 Subject: [PATCH] isSubOverflow fix --- IR_DecoderRaw.cpp | 1 + IR_DecoderRaw.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/IR_DecoderRaw.cpp b/IR_DecoderRaw.cpp index af800b1..ae69bb9 100644 --- a/IR_DecoderRaw.cpp +++ b/IR_DecoderRaw.cpp @@ -26,6 +26,7 @@ void IR_DecoderRaw::isr() { if (firstUnHandledFront == &subBuffer[currentSubBufferIndex]) { // Если контроллер не успел обработать новый сигнал, принудительно пропускаем его firstUnHandledFront = firstUnHandledFront->next; isSubBufferOverflow = true; + #ifdef IRDEBUG_INFO // Serial.println(); Serial.println(" ISR BUFFER OVERFLOW "); diff --git a/IR_DecoderRaw.h b/IR_DecoderRaw.h index 27cdc56..bf1b7cc 100644 --- a/IR_DecoderRaw.h +++ b/IR_DecoderRaw.h @@ -46,7 +46,7 @@ public: bool isSubOverflow() { uint8_t oldSREG = SREG; cli(); - bool ret = isSubBufferOverflow; + volatile bool ret = isSubBufferOverflow; SREG = oldSREG; return ret; };