Skip to content

Commit 9904a6f

Browse files
committed
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
1 parent 59f7f98 commit 9904a6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hardware/arduino/cores/arduino/wiring_analog.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ void analogWrite(uint8_t pin, int val)
230230
break;
231231
#endif
232232

233-
#if defined(TCCR4C)
233+
#if defined(TCCR4C) && defined(COM4D1)
234234
case TIMER4D:
235235
// connect pwm to pin on timer 4, channel D
236236
sbi(TCCR4C, COM4D1);

0 commit comments

Comments
 (0)