mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-05-04 07:10:16 +00:00
isSubOverflow
This commit is contained in:
parent
c2506fe1dc
commit
960b3064cb
@ -21,11 +21,11 @@ void IR_DecoderRaw::isr() {
|
|||||||
|
|
||||||
if (firstUnHandledFront == nullptr) {
|
if (firstUnHandledFront == nullptr) {
|
||||||
firstUnHandledFront = &subBuffer[currentSubBufferIndex]; // Если нет необработанных данных - добавляем их
|
firstUnHandledFront = &subBuffer[currentSubBufferIndex]; // Если нет необработанных данных - добавляем их
|
||||||
// isSubBufferOverflow = false;
|
isSubBufferOverflow = false;
|
||||||
} else {
|
} else {
|
||||||
if (firstUnHandledFront == &subBuffer[currentSubBufferIndex]) { // Если контроллер не успел обработать новый сигнал, принудительно пропускаем его
|
if (firstUnHandledFront == &subBuffer[currentSubBufferIndex]) { // Если контроллер не успел обработать новый сигнал, принудительно пропускаем его
|
||||||
firstUnHandledFront = firstUnHandledFront->next;
|
firstUnHandledFront = firstUnHandledFront->next;
|
||||||
// isSubBufferOverflow = true;
|
isSubBufferOverflow = true;
|
||||||
#ifdef IRDEBUG_INFO
|
#ifdef IRDEBUG_INFO
|
||||||
// Serial.println();
|
// Serial.println();
|
||||||
Serial.println(" ISR BUFFER OVERFLOW ");
|
Serial.println(" ISR BUFFER OVERFLOW ");
|
||||||
@ -82,7 +82,7 @@ void IR_DecoderRaw::tick() {
|
|||||||
FrontStorage currentFront;
|
FrontStorage currentFront;
|
||||||
noInterrupts();
|
noInterrupts();
|
||||||
listenStart();
|
listenStart();
|
||||||
if (firstUnHandledFront == nullptr) {/* isSubBufferOverflow = false; */ interrupts(); return; } //Если данных нет - ничего не делаем
|
if (firstUnHandledFront == nullptr) { isSubBufferOverflow = false; interrupts(); return; } //Если данных нет - ничего не делаем
|
||||||
currentFront = *((FrontStorage*)firstUnHandledFront); //найти следующий необработанный фронт/спад
|
currentFront = *((FrontStorage*)firstUnHandledFront); //найти следующий необработанный фронт/спад
|
||||||
interrupts();
|
interrupts();
|
||||||
if (currentFront.next == nullptr) { isRecive = false; return; }
|
if (currentFront.next == nullptr) { isRecive = false; return; }
|
||||||
|
@ -43,13 +43,13 @@ public:
|
|||||||
void tick(); // Обработка приёмника, необходима для работы
|
void tick(); // Обработка приёмника, необходима для работы
|
||||||
|
|
||||||
bool isOverflow() { return isBufferOverflow; }; // Буффер переполнился
|
bool isOverflow() { return isBufferOverflow; }; // Буффер переполнился
|
||||||
// bool isSubOverflow() { //TODO: При опросе volatile сваливается в постоянно true
|
bool isSubOverflow() {
|
||||||
// uint8_t oldSREG = SREG;
|
uint8_t oldSREG = SREG;
|
||||||
// cli();
|
cli();
|
||||||
// bool ret = isSubBufferOverflow;
|
bool ret = isSubBufferOverflow;
|
||||||
// SREG = oldSREG;
|
SREG = oldSREG;
|
||||||
// return ret;
|
return ret;
|
||||||
// };
|
};
|
||||||
bool isReciving() { return isBufferOverflow; }; // Возвращает true, если происходит приём пакета
|
bool isReciving() { return isBufferOverflow; }; // Возвращает true, если происходит приём пакета
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user