From c2506fe1dccfe814497f58f2286c7ed4faca459f Mon Sep 17 00:00:00 2001 From: DashyFox Date: Thu, 29 Feb 2024 15:35:49 +0300 Subject: [PATCH] no isSubOverflow, todo --- IR_DecoderRaw.cpp | 6 +++--- IR_DecoderRaw.h | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/IR_DecoderRaw.cpp b/IR_DecoderRaw.cpp index af800b1..5c6e484 100644 --- a/IR_DecoderRaw.cpp +++ b/IR_DecoderRaw.cpp @@ -21,11 +21,11 @@ void IR_DecoderRaw::isr() { if (firstUnHandledFront == nullptr) { firstUnHandledFront = &subBuffer[currentSubBufferIndex]; // Если нет необработанных данных - добавляем их - isSubBufferOverflow = false; + // isSubBufferOverflow = false; } else { if (firstUnHandledFront == &subBuffer[currentSubBufferIndex]) { // Если контроллер не успел обработать новый сигнал, принудительно пропускаем его firstUnHandledFront = firstUnHandledFront->next; - isSubBufferOverflow = true; + // isSubBufferOverflow = true; #ifdef IRDEBUG_INFO // Serial.println(); Serial.println(" ISR BUFFER OVERFLOW "); @@ -82,7 +82,7 @@ void IR_DecoderRaw::tick() { FrontStorage currentFront; noInterrupts(); listenStart(); - if (firstUnHandledFront == nullptr) { isSubBufferOverflow = false; interrupts(); return; } //Если данных нет - ничего не делаем + if (firstUnHandledFront == nullptr) {/* isSubBufferOverflow = false; */ interrupts(); return; } //Если данных нет - ничего не делаем currentFront = *((FrontStorage*)firstUnHandledFront); //найти следующий необработанный фронт/спад interrupts(); if (currentFront.next == nullptr) { isRecive = false; return; } diff --git a/IR_DecoderRaw.h b/IR_DecoderRaw.h index 27cdc56..b6f6efe 100644 --- a/IR_DecoderRaw.h +++ b/IR_DecoderRaw.h @@ -43,13 +43,13 @@ public: void tick(); // Обработка приёмника, необходима для работы bool isOverflow() { return isBufferOverflow; }; // Буффер переполнился - bool isSubOverflow() { - uint8_t oldSREG = SREG; - cli(); - bool ret = isSubBufferOverflow; - SREG = oldSREG; - return ret; - }; + // bool isSubOverflow() { //TODO: При опросе volatile сваливается в постоянно true + // uint8_t oldSREG = SREG; + // cli(); + // bool ret = isSubBufferOverflow; + // SREG = oldSREG; + // return ret; + // }; bool isReciving() { return isBufferOverflow; }; // Возвращает true, если происходит приём пакета //////////////////////////////////////////////////////////////////////////