diff --git a/common/breathing_led.c b/common/breathing_led.c index 4e4822f8..11346e8f 100644 --- a/common/breathing_led.c +++ b/common/breathing_led.c @@ -10,6 +10,18 @@ static uint8_t breathing_led_duration = 0; void breathing_led_init(void) { +#ifdef BREATHING_LED_TIMER1 + /* Timer1 setup */ + /* CTC mode */ + TCCR1B |= (1<>8)&0xff; + OCR1AL = BREATHING_LED_TIMER_TOP&0xff; +#else /* Timer3 setup */ /* CTC mode */ TCCR3B |= (1<>8)&0xff; OCR3AL = BREATHING_LED_TIMER_TOP&0xff; +#endif SREG = sreg; } void breathing_led_enable(void) { /* Enable Compare Match Interrupt */ +#ifdef BREATHING_LED_TIMER1 + TIMSK1 |= (1<