Skip to content

Commit b5cc55e

Browse files
committed
Update Tone.cpp
Tone.cpp stops compile when TCCR0A/TCCR0B defined and WGM01 not defined arduino#2923
1 parent 818dc19 commit b5cc55e

File tree

1 file changed

+2
-1
lines changed
  • hardware/arduino/avr/cores/arduino

1 file changed

+2
-1
lines changed

hardware/arduino/avr/cores/arduino/Tone.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Version Modified By Date Comments
3030
0006 D Mellis 09/12/29 Replaced objects with functions
3131
0007 M Sproul 10/08/29 Changed #ifdefs from cpu to register
3232
0008 S Kanemoto 12/06/22 Fixed for Leonardo by @maris_HY
33+
0009 jipp 15/04/13 added additional define check #2923
3334
*************************************************/
3435

3536
#include <avr/interrupt.h>
@@ -151,7 +152,7 @@ static int8_t toneBegin(uint8_t _pin)
151152
// whereas 16 bit timers are set to either ck/1 or ck/64 prescalar
152153
switch (_timer)
153154
{
154-
#if defined(TCCR0A) && defined(TCCR0B)
155+
#if defined(TCCR0A) && defined(TCCR0B) && defined(WGM01)
155156
case 0:
156157
// 8 bit timer
157158
TCCR0A = 0;

0 commit comments

Comments
 (0)