mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-05-04 07:10:16 +00:00
fix nullptr
This commit is contained in:
parent
af6041c5ae
commit
5547bec263
@ -81,11 +81,12 @@ void IR_DecoderRaw::listenStart() {
|
||||
|
||||
void IR_DecoderRaw::tick() {
|
||||
FrontStorage currentFront;
|
||||
noInterrupts();
|
||||
uint8_t oldSREG = SREG;
|
||||
cli();
|
||||
listenStart();
|
||||
if (firstUnHandledFront == nullptr) { isSubBufferOverflow = false; interrupts(); return; } //Если данных нет - ничего не делаем
|
||||
if (firstUnHandledFront == nullptr) { isSubBufferOverflow = false; SREG = oldSREG; return; } //Если данных нет - ничего не делаем
|
||||
currentFront = *((FrontStorage*)firstUnHandledFront); //найти следующий необработанный фронт/спад
|
||||
interrupts();
|
||||
SREG = oldSREG;
|
||||
if (currentFront.next == nullptr) { isRecive = false; return; }
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -272,7 +273,12 @@ void IR_DecoderRaw::tick() {
|
||||
digitalWrite(writeOp, isPreamb);
|
||||
#endif
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
oldSREG = SREG;
|
||||
cli();
|
||||
if (firstUnHandledFront != nullptr) {
|
||||
firstUnHandledFront = firstUnHandledFront->next; //переместить флаг на следующий элемент для обработки (next or nullptr)
|
||||
}
|
||||
SREG = oldSREG;
|
||||
}
|
||||
|
||||
void IR_DecoderRaw::writeToBuffer(bool bit) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user