summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-01-11 16:53:33 -0500
committerJack Humbert <jack.humb@gmail.com>2016-01-11 16:53:33 -0500
commit29de37d5c0ea9fc6b5539ce4493c7b10a2a7f33f (patch)
treececb16f2969a1d250b45d828df1e700bce1d8c40 /tmk_core
parent11ce694557389bdde2b5ae15af38fdad3fe77a27 (diff)
pwm audio
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common/avr/timer.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/tmk_core/common/avr/timer.c b/tmk_core/common/avr/timer.c
index 292b41c3a6..1a695a9aae 100644
--- a/tmk_core/common/avr/timer.c
+++ b/tmk_core/common/avr/timer.c
@@ -29,24 +29,24 @@ volatile uint32_t timer_count = 0;
void timer_init(void)
{
// Timer0 CTC mode
- TCCR0A = 0x02;
+ TCCR1A = 0x02;
#if TIMER_PRESCALER == 1
- TCCR0B = 0x01;
+ TCCR1B = 0x01;
#elif TIMER_PRESCALER == 8
- TCCR0B = 0x02;
+ TCCR1B = 0x02;
#elif TIMER_PRESCALER == 64
- TCCR0B = 0x03;
+ TCCR1B = 0x03;
#elif TIMER_PRESCALER == 256
- TCCR0B = 0x04;
+ TCCR1B = 0x04;
#elif TIMER_PRESCALER == 1024
- TCCR0B = 0x05;
+ TCCR1B = 0x05;
#else
# error "Timer prescaler value is NOT vaild."
#endif
- OCR0A = TIMER_RAW_TOP;
- TIMSK0 = (1<<OCIE0A);
+ OCR1A = TIMER_RAW_TOP;
+ TIMSK1 = (1<<OCIE1A);
}
inline
@@ -111,7 +111,7 @@ uint32_t timer_elapsed32(uint32_t last)
}
// excecuted once per 1ms.(excess for just timer count?)
-ISR(TIMER0_COMPA_vect)
+ISR(TIMER1_COMPA_vect)
{
timer_count++;
}