MCPcopy Create free account
hub / github.com/PaulStoffregen/TimerOne / initialize

Method initialize

TimerOne.h:50–54  ·  view source on GitHub ↗

Configuration

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected