aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/wiring_analog.c
diff options
context:
space:
mode:
authorCristian Maglie <c.maglie@bug.st>2014-07-01 18:29:07 +0200
committerCristian Maglie <c.maglie@bug.st>2014-07-01 18:29:07 +0200
commit08f101023053f7bceb226b17942432ad0acd14b1 (patch)
tree55c3d7d67f88e6dbaab22e811a757abe0922f8ab /cores/arduino/wiring_analog.c
parent84bf36a96e6c8d1567ab6e091b9a4b500b5152e9 (diff)
parent4fdf87c0e8a801093d5f0513e4aab122e20bfc2e (diff)
Merge branch 'ide-1.5.x-timer-variant' of github.com:matthijskooijman/Arduino into matthijskooijman-ide-1.5.x-timer-variant
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 8feead9..48a9ef5 100644
--- a/cores/arduino/wiring_analog.c
+++ b/cores/arduino/wiring_analog.c
@@ -160,6 +160,14 @@ void analogWrite(uint8_t pin, int val)
break;
#endif
+ #if defined(TCCR1A) && defined(COM1C1)
+ case TIMER1C:
+ // connect pwm to pin on timer 1, channel B
+ sbi(TCCR1A, COM1C1);
+ OCR1C = val; // set pwm duty
+ break;
+ #endif
+
#if defined(TCCR2) && defined(COM21)
case TIMER2:
// connect pwm to pin on timer 2