Configuration
| 48 | // Configuration |
| 49 | //**************************** |
| 50 | void initialize(unsigned long microseconds=1000000) __attribute__((always_inline)) { |
| 51 | TCCR1 = _BV(CTC1); //clear timer1 when it matches the value in OCR1C |
| 52 | TIMSK |= _BV(OCIE1A); //enable interrupt when OCR1A matches the timer value |
| 53 | setPeriod(microseconds); |
| 54 | } |
| 55 | void setPeriod(unsigned long microseconds) __attribute__((always_inline)) { |
| 56 | const unsigned long cycles = microseconds * ratio; |
| 57 | if (cycles < TIMER1_RESOLUTION) { |
nothing calls this directly
no outgoing calls
no test coverage detected