IRMP-org / IRMP

Infrared Multi Protocol Decoder
GNU General Public License v3.0
267 stars 43 forks source link

Detect if IRMP is currently receiving #21

Closed Roxolasu closed 3 years ago

Roxolasu commented 3 years ago

Question / Feature request

Arduino Platform

IDE

IR-Protocol

Example to reproduce the issue

Pin(s) used for IR-receive, if not default

Version

Additional context

I'm trying to use IRMP (using interrupts / callback) in conjunction with code which disables interrupts (NeoPixel). For this, I want to skip the code which disables interrupts if IRMP is currently receiving something.

Is there a way to check if IRMP is currently expecting more data? (I tried some flags like irmp_ir_detected, but they didn't seem to have the expected effect)

ArminJo commented 3 years ago

Please test the new function bool irmp_IsBusy() and give feedback if it is not sufficient for you.

Roxolasu commented 3 years ago

Thanks!

Unfortunately, this doesn't seem to work: Given the interrupt example, with the following loop function

if(irmp_IsBusy()){
    Serial.println("Busy");
} else{
    Serial.println("Not Busy");
}
delay(100);

This always prints busy.

ArminJo commented 3 years ago

Congratulation. 🥇 You tested the case I missed. I updated the code with a version which also gives reliable results for interrupt mode 😀 .