File tree Expand file tree Collapse file tree 3 files changed +26
-14
lines changed
hardware/arduino/avr/cores/arduino Expand file tree Collapse file tree 3 files changed +26
-14
lines changed Original file line number Diff line number Diff line change @@ -194,20 +194,21 @@ extern const uint8_t PROGMEM digital_pin_to_timer_PGM[];
194194#define TIMER0B 2
195195#define TIMER1A 3
196196#define TIMER1B 4
197- #define TIMER2 5
198- #define TIMER2A 6
199- #define TIMER2B 7
200-
201- #define TIMER3A 8
202- #define TIMER3B 9
203- #define TIMER3C 10
204- #define TIMER4A 11
205- #define TIMER4B 12
206- #define TIMER4C 13
207- #define TIMER4D 14
208- #define TIMER5A 15
209- #define TIMER5B 16
210- #define TIMER5C 17
197+ #define TIMER1C 5
198+ #define TIMER2 6
199+ #define TIMER2A 7
200+ #define TIMER2B 8
201+
202+ #define TIMER3A 9
203+ #define TIMER3B 10
204+ #define TIMER3C 11
205+ #define TIMER4A 12
206+ #define TIMER4B 13
207+ #define TIMER4C 14
208+ #define TIMER4D 15
209+ #define TIMER5A 16
210+ #define TIMER5B 17
211+ #define TIMER5C 18
211212
212213#ifdef __cplusplus
213214} // extern "C"
Original file line number Diff line number Diff line change @@ -160,6 +160,14 @@ void analogWrite(uint8_t pin, int val)
160160 break ;
161161 #endif
162162
163+ #if defined(TCCR1A ) && defined(COM1C1 )
164+ case TIMER1C :
165+ // connect pwm to pin on timer 1, channel B
166+ sbi (TCCR1A , COM1C1 );
167+ OCR1C = val ; // set pwm duty
168+ break ;
169+ #endif
170+
163171 #if defined(TCCR2 ) && defined(COM21 )
164172 case TIMER2 :
165173 // connect pwm to pin on timer 2
Original file line number Diff line number Diff line change @@ -84,6 +84,9 @@ static void turnOffPWM(uint8_t timer)
8484 #if defined(TCCR1A ) && defined(COM1B1 )
8585 case TIMER1B : cbi (TCCR1A , COM1B1 ); break ;
8686 #endif
87+ #if defined(TCCR1A ) && defined(COM1C1 )
88+ case TIMER1C : cbi (TCCR1A , COM1C1 ); break ;
89+ #endif
8790
8891 #if defined(TCCR2 ) && defined(COM21 )
8992 case TIMER2 : cbi (TCCR2 , COM21 ); break ;
You can’t perform that action at this time.
0 commit comments