* Restarts timer interrupts, adjusts TickCounterForISR for correct gap value after stopTimer(). Does not call resume()! */
| 398 | * Restarts timer interrupts, adjusts TickCounterForISR for correct gap value after stopTimer(). Does not call resume()! |
| 399 | */ |
| 400 | void 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 | */ |
nothing calls this directly
no test coverage detected