Skip to content

Commit 59b03f1

Browse files
Roy, Elizabethfacchinm
authored andcommitted
Added compile time check for allowed timers
1 parent dae0c6a commit 59b03f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cores/arduino/Tone.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
#define USE_TIMERB2 // interferes with PWM on pin 11
5050
#define USE_TIMERB0 // interferes with PWM on pin 6
5151
*/
52+
#if !defined(USE_TIMERB1) && !defined(USE_TIMERB2) && !defined(USE_TIMERB0)
53+
# error "No timers allowed for tone()"
54+
/* Please uncomment a timer above and rebuild */
55+
#endif
5256

5357
// Can't use TIMERB3 -- used for application time tracking
5458
// Using TIMERA0 NOT RECOMMENDED -- all other timers use its clock!

0 commit comments

Comments
 (0)