Skip to content

Commit a7d092c

Browse files
Provide the ability to choose a timer for megaavr
Signed-off-by: Vladyslav Arzhanov <[email protected]>
1 parent a6af182 commit a7d092c

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/megaavr/ServoTimers.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,18 @@
2626

2727
#include <avr/io.h>
2828

29-
//#define USE_TIMERB1 // interferes with PWM on pin 3
30-
#define USE_TIMERB2 // interferes with PWM on pin 11
31-
//#define USE_TIMERB0 // interferes with PWM on pin 6
32-
3329
#if !defined(USE_TIMERB1) && !defined(USE_TIMERB2) && !defined(USE_TIMERB0)
34-
# error "No timers allowed for Servo"
35-
/* Please uncomment a timer above and rebuild */
30+
#define USE_TIMERB2 // default timer
3631
#endif
3732

3833
static volatile TCB_t* _timer =
39-
#if defined(USE_TIMERB0)
34+
#if defined(USE_TIMERB0) // interferes with PWM on pin 6
4035
&TCB0;
4136
#endif
42-
#if defined(USE_TIMERB1)
37+
#if defined(USE_TIMERB1) // interferes with PWM on pin 3
4338
&TCB1;
4439
#endif
45-
#if defined(USE_TIMERB2)
40+
#if defined(USE_TIMERB2) // interferes with PWM on pin 11
4641
&TCB2;
4742
#endif
4843

0 commit comments

Comments
 (0)