| 227 | IRAM_ATTR |
| 228 | #endif |
| 229 | void handleReceivedIRData() |
| 230 | { |
| 231 | irmp_get_data(&irmp_data); |
| 232 | |
| 233 | IRDispatcher.IRReceivedData.address = irmp_data.address; |
| 234 | IRDispatcher.IRReceivedData.command = irmp_data.command; |
| 235 | IRDispatcher.IRReceivedData.isRepeat = irmp_data.flags & IRMP_FLAG_REPETITION; |
| 236 | IRDispatcher.IRReceivedData.MillisOfLastCode = millis(); |
| 237 | |
| 238 | #if !defined(ARDUINO_ARCH_MBED) && !defined(ESP32) // no Serial etc. possible in callback for RTOS based cores like ESP, even when interrupts are enabled |
| 239 | interrupts(); // To enable tone(), delay() etc. for commands. Be careful with non-blocking and repeatable commands which lasts longer than the IR repeat duration. |
| 240 | # endif |
| 241 | |
| 242 | # if defined(LOCAL_INFO) |
| 243 | irmp_result_print(&Serial, &irmp_data); |
| 244 | # endif |
| 245 | |
| 246 | # if defined(IR_ADDRESS) |
| 247 | // if available, compare address |
| 248 | if (IRDispatcher.IRReceivedData.address != IR_ADDRESS) { |
| 249 | INFO_PRINT(F("Wrong address. Expected 0x")); |
| 250 | INFO_PRINTLN(IR_ADDRESS, HEX); |
| 251 | } else |
| 252 | # endif |
| 253 | { |
| 254 | IRDispatcher.IRReceivedData.isAvailable = true; |
| 255 | // check if dispatcher enabled |
| 256 | if (!IRDispatcher.doNotUseDispatcher) |
| 257 | { |
| 258 | /* |
| 259 | * Only short (non blocking) commands are executed directly in ISR (Interrupt Service Routine) context, |
| 260 | * others are stored for main loop which calls checkAndRunSuspendedBlockingCommands() |
| 261 | */ |
| 262 | IRDispatcher.checkAndCallCommand(false); |
| 263 | } |
| 264 | } |
| 265 | } |
| 266 | #endif // elif defined(USE_IRMP_LIBRARY) |
| 267 | |
| 268 | /******************************************* |
nothing calls this directly
no test coverage detected