Skip to content

Commit 39c2112

Browse files
committed
Add fallback if MILLIS_USE_TIMERBx is not defined
1 parent 13b3eb3 commit 39c2112

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: cores/arduino/wiring.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ static volatile TCB_t* _timer =
6565
&TCB1;
6666
#elif defined(MILLIS_USE_TIMERB2)
6767
&TCB2;
68-
#else
68+
#elif defined(MILLIS_USE_TIMERB3)
6969
&TCB3;
70+
#else
71+
// fallback to TCB0 (every platform has it)
72+
&TCB0;
7073
#endif
7174

7275
#if defined(MILLIS_USE_TIMERB0)
@@ -75,8 +78,11 @@ ISR(TCB0_INT_vect)
7578
ISR(TCB1_INT_vect)
7679
#elif defined(MILLIS_USE_TIMERB2)
7780
ISR(TCB2_INT_vect)
78-
#else
81+
#elif defined(MILLIS_USE_TIMERB3)
7982
ISR(TCB3_INT_vect)
83+
#else
84+
// fallback to TCB0 (every platform has it)
85+
ISR(TCB0_INT_vect)
8086
#endif
8187
{
8288
// copy these to local variables so they can be stored in registers

0 commit comments

Comments
 (0)