From 6a66737e2299b012ca33c699624853840a27f8be Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Sun, 11 Apr 2010 03:49:17 -0400 Subject: [PATCH] Avoid hard-coding the location of OC2B on the chip --- target/config.h | 2 ++ target/main.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/target/config.h b/target/config.h index 4b0dcf6..d2ac031 100644 --- a/target/config.h +++ b/target/config.h @@ -20,6 +20,8 @@ #undef TARGET_AUDIO_PORT_SHIFT #define TARGET_AUDIO_PWM_OC2B +#define TARGET_AUDIO_PWM_OC2B_DDR DDRD +#define TARGET_AUDIO_PWM_OC2B_PIN 3 #define TARGET_LIGHT_PORT PORTB #define TARGET_LIGHT_DDR DDRB diff --git a/target/main.c b/target/main.c index 1a74e8a..9d54c95 100644 --- a/target/main.c +++ b/target/main.c @@ -380,7 +380,7 @@ int main() { TCCR2A = (1 << COM2B1) | (1 << WGM21) | (1 << WGM20); TCCR2B = (1 << CS20); OCR2B = 0; - DDRD |= (1 << 3); + TARGET_AUDIO_PWM_OC2B_DDR |= (1 << TARGET_AUDIO_PWM_OC2B_PIN); #endif asm("sei"); -- 2.50.1