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

Function compensateAndDumpSequence

src/ir_Pronto.hpp:234–248  ·  view source on GitHub ↗

* Compensate received values by MARK_EXCESS_MICROS, like it is done for decoding! */

Source from the content-addressed store, hash-verified

232 * Compensate received values by MARK_EXCESS_MICROS, like it is done for decoding!
233 */
234static void compensateAndDumpSequence(Print *aSerial, const volatile IRRawbufType *data, size_t length, uint16_t timebase) {
235 for (size_t i = 0; i < length; i++) {
236 uint32_t tDuration = data[i] * MICROS_PER_TICK;
237 if (i & 1) {
238 // Mark
239 tDuration -= getMarkExcessMicros();
240 } else {
241 tDuration += getMarkExcessMicros();
242 }
243 dumpDurationHex(aSerial, tDuration, timebase);
244 }
245
246 // append a gap
247 dumpDurationHex(aSerial, PRONTO_DEFAULT_GAP, timebase);
248}
249
250/**
251 * Print the result (second argument) as Pronto Hex on the Print supplied as argument.

Calls 2

getMarkExcessMicrosFunction · 0.85
dumpDurationHexFunction · 0.85

Tested by

no test coverage detected