* Function using an 16 byte microsecond timing array in FLASH for every purpose. * Raw data starts with a Mark. No leading space as in received timing data! */
| 491 | * Raw data starts with a Mark. No leading space as in received timing data! |
| 492 | */ |
| 493 | void IRsend::sendRaw_P(const uint16_t aPGMBufferWithMicroseconds[], uint_fast16_t aLengthOfBuffer, |
| 494 | uint_fast8_t aIRFrequencyKilohertz) { |
| 495 | #if !defined(__AVR__) |
| 496 | sendRaw(aPGMBufferWithMicroseconds, aLengthOfBuffer, aIRFrequencyKilohertz); // Let the function work for non AVR platforms |
| 497 | #else |
| 498 | // Set IR carrier frequency |
| 499 | enableIROut(aIRFrequencyKilohertz); |
| 500 | /* |
| 501 | * Raw data starts with a mark |
| 502 | */ |
| 503 | // If the PROGMEM array is defined in the function, the C-compiler uses a wrong address :-(. sizeof() works. |
| 504 | DEBUG_PRINT(F("aPGMBufferWithMicroseconds=0x")); |
| 505 | DEBUG_PRINTLN((uint16_t) aPGMBufferWithMicroseconds, HEX); |
| 506 | |
| 507 | for (uint_fast16_t i = 0; i < aLengthOfBuffer; i++) { |
| 508 | uint16_t duration = pgm_read_word(&aPGMBufferWithMicroseconds[i]); |
| 509 | // uint16_t duration = pgm_read_word(aPGMBufferWithMicroseconds); // is equivalent for the compiler |
| 510 | if (i & 1) { |
| 511 | // Odd |
| 512 | space(duration); |
| 513 | DEBUG_PRINT(F("S=")); |
| 514 | } else { |
| 515 | mark(duration); |
| 516 | DEBUG_PRINT(F("M=")); |
| 517 | } |
| 518 | DEBUG_PRINTLN(duration); |
| 519 | } |
| 520 | #endif |
| 521 | } |
| 522 | |
| 523 | void IRsend::sendRaw_P(const uint16_t aPGMBufferWithMicroseconds[], uint_fast16_t aLengthOfBuffer, |
| 524 | uint_fast8_t aIRFrequencyKilohertz, uint_fast16_t aRepeatPeriodMillis, int_fast8_t aNumberOfRepeats) { |
nothing calls this directly
no outgoing calls
no test coverage detected