|
@ -33,7 +33,7 @@ |
|
|
#define COLDDR2 DDR(COLPORT2) |
|
|
#define COLDDR2 DDR(COLPORT2) |
|
|
#define ROWDDR DDR(ROWPORT) |
|
|
#define ROWDDR DDR(ROWPORT) |
|
|
|
|
|
|
|
|
#ifdef __AVR_ATmega644P__ |
|
|
#if defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644__) |
|
|
/* more ifdef magic :-( */ |
|
|
/* more ifdef magic :-( */ |
|
|
#define OCR0 OCR0A |
|
|
#define OCR0 OCR0A |
|
|
#define SIG_OUTPUT_COMPARE0 SIG_OUTPUT_COMPARE0A |
|
|
#define SIG_OUTPUT_COMPARE0 SIG_OUTPUT_COMPARE0A |
|
@ -155,7 +155,7 @@ void timer0_off() { |
|
|
COLPORT2 = 0; |
|
|
COLPORT2 = 0; |
|
|
ROWPORT = 0; |
|
|
ROWPORT = 0; |
|
|
|
|
|
|
|
|
#ifdef __AVR_ATmega644P__ |
|
|
#if defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644__) |
|
|
TCCR0A = 0x00; |
|
|
TCCR0A = 0x00; |
|
|
TCCR0B = 0x00; |
|
|
TCCR0B = 0x00; |
|
|
#else |
|
|
#else |
|
@ -177,7 +177,7 @@ static void timer0_on() { |
|
|
1 0 1 clk/1024 |
|
|
1 0 1 clk/1024 |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
#ifdef __AVR_ATmega644P__ |
|
|
#if defined (__AVR_ATmega644P__) || defined (__AVR_ATmega644__) |
|
|
TCCR0A = 0x02; // CTC Mode
|
|
|
TCCR0A = 0x02; // CTC Mode
|
|
|
TCCR0B = 0x04; // clk/256
|
|
|
TCCR0B = 0x04; // clk/256
|
|
|
TCNT0 = 0; // reset timer
|
|
|
TCNT0 = 0; // reset timer
|
|
|