add atmega644p support for borg16 (untested)

This commit is contained in:
kju 2010-01-29 03:05:49 +00:00
parent d4119775d4
commit c9437891b7
1 changed files with 22 additions and 1 deletions

View File

@ -32,6 +32,13 @@
#define COLDDR2 DDR(COLPORT2)
#define ROWDDR DDR(ROWPORT)
#ifdef __AVR_ATmega644P__
/* more ifdef magic :-( */
#define OCR0 OCR0A
#define SIG_OUTPUT_COMPARE0 SIG_OUTPUT_COMPARE0A
#endif
//Der Puffer, in dem das aktuelle Bild gespeichert wird
unsigned char pixmap[NUMPLANE][NUM_ROWS][LINEBYTES];
@ -161,7 +168,13 @@ void timer0_off(){
COLPORT2 = 0;
ROWPORT = 0;
#ifdef __AVR_ATmega644P__
TCCR0A = 0x00;
TCCR0B = 0x00;
#else
TCCR0 = 0x00;
#endif
sei();
}
@ -178,10 +191,18 @@ void timer0_on(){
1 0 1 clk/1024
*/
TCCR0 = 0x0C; // CTC Mode, clk/64
#ifdef __AVR_ATmega644P__
TCCR0A = 0x02; // CTC Mode
TCCR0B = 0x04; // clk/256
TCNT0 = 0; // reset timer
OCR0 = 20; // Compare with this value
TIMSK0 = 0x02; // Compare match Interrupt on
#else
TCCR0 = 0x0C; // CTC Mode, clk/256
TCNT0 = 0; // reset timer
OCR0 = 20; // Compare with this value
TIMSK = 0x02; // Compare match Interrupt on
#endif
}
void borg_hw_init(){