aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/wiring_analog.c
diff options
context:
space:
mode:
authorZach Eveland <zeveland@blacklabel-development.com>2011-09-16 16:36:42 -0400
committerZach Eveland <zeveland@blacklabel-development.com>2011-09-16 16:36:42 -0400
commit5bbe2a63e48ec3057322167a3a6745a66f0c8941 (patch)
tree89b3476bd48922f7c727ed4de4121bbb0c8160ad /cores/arduino/wiring_analog.c
parentd3a8346007edfce585b8daf146a319e6a0d2bbee (diff)
added support for TIMER4D used for PWM on Leonardo and Micro D6
Diffstat (limited to 'cores/arduino/wiring_analog.c')
-rw-r--r--cores/arduino/wiring_analog.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cores/arduino/wiring_analog.c b/cores/arduino/wiring_analog.c
index 62b91cf..2b1f3a0 100644
--- a/cores/arduino/wiring_analog.c
+++ b/cores/arduino/wiring_analog.c
@@ -225,6 +225,14 @@ void analogWrite(uint8_t pin, int val)
OCR4C = val; // set pwm duty
break;
#endif
+
+ #if defined(TCCR4A) && defined(COM4D1)
+ case TIMER4D:
+ // connect pwm to pin on timer 4, channel D
+ sbi(TCCR4A, COM4D1);
+ OCR4D = val; // set pwm duty
+ break;
+ #endif
#if defined(TCCR5A) && defined(COM5A1)
case TIMER5A: