From 56ddc4637de1b8b0e21840519ed0b94966395ff5 Mon Sep 17 00:00:00 2001 From: Zach Eveland Date: Thu, 19 Apr 2012 15:46:32 -0400 Subject: [PATCH] bugfix for boards with a timer 4 but no channel D compilation failed for Mega because the COM4D1 and OCR4D registers are defined for 32U4 but not for Mega --- cores/arduino/wiring_analog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/arduino/wiring_analog.c b/cores/arduino/wiring_analog.c index 40a3363..c06cad4 100644 --- a/cores/arduino/wiring_analog.c +++ b/cores/arduino/wiring_analog.c @@ -230,7 +230,7 @@ void analogWrite(uint8_t pin, int val) break; #endif - #if defined(TCCR4C) + #if defined(TCCR4C) && defined(COM4D1) case TIMER4D: // connect pwm to pin on timer 4, channel D sbi(TCCR4C, COM4D1);