From: Nathaniel Wesley Filardo Date: Sun, 11 Apr 2010 07:49:17 +0000 (-0400) Subject: Avoid hard-coding the location of OC2B on the chip X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=6a66737e2299b012ca33c699624853840a27f8be;p=acmetensortoys-chiptunes Avoid hard-coding the location of OC2B on the chip --- 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");