MCPcopy Create free account
hub / github.com/Arduino-IRremote/Arduino-IRremote / initDecodedIRData

Method initDecodedIRData

src/IRReceive.hpp:505–527  ·  view source on GitHub ↗

* Is internally called by decode before calling decoders. * Must be used to setup data, if you call decoders manually. */

Source from the content-addressed store, hash-verified

503 * Must be used to setup data, if you call decoders manually.
504 */
505void IRrecv::initDecodedIRData() {
506
507 if (irparams.OverflowFlag) {
508 decodedIRData.flags = IRDATA_FLAGS_WAS_OVERFLOW;
509
510 DEBUG_PRINT(F("Overflow happened, try to increase the \"RAW_BUFFER_LENGTH\" value of "));
511 DEBUG_PRINT(RAW_BUFFER_LENGTH);
512 DEBUG_PRINTLN(F(" with #define RAW_BUFFER_LENGTH=<biggerValue>"));
513
514 } else {
515 decodedIRData.flags = IRDATA_FLAGS_EMPTY;
516 // save last protocol, command and address for repeat handling (where they are compared or copied back :-))
517 lastDecodedProtocol = decodedIRData.protocol; // repeat patterns can be equal between protocols (e.g. NEC, Samsung and LG), so we must keep the original one
518 lastDecodedCommand = decodedIRData.command;
519 lastDecodedAddress = decodedIRData.address;
520
521 }
522 decodedIRData.protocol = UNKNOWN;
523 decodedIRData.command = 0;
524 decodedIRData.address = 0;
525 decodedIRData.decodedRawData = 0;
526 decodedIRData.numberOfBits = 0;
527}
528
529/**
530 * @return true if available() is true or IR receiver has not received a mark/signal since last resume().

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected