initialise 16-bit timers on the mega1280 correctly

This commit is contained in:
Michael Moon 2011-01-25 12:47:22 +11:00
parent a98886d236
commit 007d3c9736
1 changed files with 6 additions and 6 deletions

View File

@ -82,24 +82,24 @@ void io_init(void) {
OCR2B = 0; OCR2B = 0;
#ifdef TCCR3A #ifdef TCCR3A
TCCR3A = MASK(WGM31) | MASK(WGM30); TCCR3A = MASK(WGM30);
TCCR3B = MASK(CS30); TCCR3B = MASK(WGM32) | MASK(CS30);
TIMSK3 = 0; TIMSK3 = 0;
OCR3A = 0; OCR3A = 0;
OCR3B = 0; OCR3B = 0;
#endif #endif
#ifdef TCCR4A #ifdef TCCR4A
TCCR4A = MASK(WGM41) | MASK(WGM40); TCCR4A = MASK(WGM40);
TCCR4B = MASK(CS40); TCCR4B = MASK(WGM42) | MASK(CS40);
TIMSK4 = 0; TIMSK4 = 0;
OCR4A = 0; OCR4A = 0;
OCR4B = 0; OCR4B = 0;
#endif #endif
#ifdef TCCR5A #ifdef TCCR5A
TCCR5A = MASK(WGM51) | MASK(WGM50); TCCR5A = MASK(WGM50);
TCCR5B = MASK(CS50); TCCR5B = MASK(WGM52) | MASK(CS50);
TIMSK5 = 0; TIMSK5 = 0;
OCR5A = 0; OCR5A = 0;
OCR5B = 0; OCR5B = 0;