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

Method restartTimer

src/IRReceive.hpp:400–412  ·  view source on GitHub ↗

* Restarts timer interrupts, adjusts TickCounterForISR for correct gap value after stopTimer(). Does not call resume()! */

Source from the content-addressed store, hash-verified

398 * Restarts timer interrupts, adjusts TickCounterForISR for correct gap value after stopTimer(). Does not call resume()!
399 */
400void IRrecv::restartTimer() {
401 // Setup for cyclic 50 us interrupt
402 timerConfigForReceive(); // no interrupts enabled here!
403 // Timer interrupt is enabled after state machine reset
404 if (sMicrosAtLastStopTimer != 0) {
405 irparams.TickCounterForISR += (micros() - sMicrosAtLastStopTimer) / MICROS_PER_TICK; // adjust TickCounterForISR for correct gap value, which is used for repeat detection
406 sMicrosAtLastStopTimer = 0;
407 }
408 timerEnableReceiveInterrupt(); // Enables the receive sample timer interrupt which consumes a small amount of CPU every 50 us.
409#ifdef _IR_MEASURE_TIMING
410 pinModeFast(_IR_TIMING_TEST_PIN, OUTPUT);
411#endif
412}
413/**
414 * Alias for start().
415 */

Callers

nothing calls this directly

Calls 2

timerConfigForReceiveFunction · 0.85

Tested by

no test coverage detected