summaryrefslogtreecommitdiff
path: root/avr/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'avr/main.c')
-rw-r--r--avr/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/avr/main.c b/avr/main.c
index 2199454..0a1cab6 100644
--- a/avr/main.c
+++ b/avr/main.c
@@ -115,10 +115,10 @@ void setup_avr(void)
CLKPR = 0;
/* Timer */
- PRR1 &= ~_BV(PRTIM3);
- OCR3A = F_CPU / 1000 - 1; /* Timer3: 1000Hz interval (OC3A) */
- TCCR3B = (0b01<<WGM32)|(0b001<<CS30); /* CTC Mode, Prescaler 1 */
- TIMSK3 = _BV(OCIE3A); /* Enable TC2.oca interrupt */
+ PRR1 &= ~_BV(PRTIM4);
+ OCR4A = F_CPU / 1000 - 1; /* Timer4: 1000Hz interval */
+ TCCR4B = (0b00<<WGM42)|(0b001<<CS40); /* Normal Mode, Prescaler 1 */
+ TIMSK4 = _BV(OCIE4A); /* Enable Output Compare A interrupt */
/* INT5, INT6: falling edge */
EICRB = (EICRB & ~((0b11 << ISC50) | (0b11 << ISC60))) |