File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,10 @@ static void turnOffPWM(uint8_t pin)
103
103
104
104
/* TCA0 */
105
105
case TIMERA0 :
106
+ // check, if TCA is set to Port B (default megaavr-PWM ports)
107
+ // see variants/nona4809/variant.c line 13
108
+ if (!(PORTMUX_TCAROUTEA == PORTMUX_TCA0_PORTB_gc ))
109
+ return ;
106
110
/* Bit position will give output channel */
107
111
bit_pos = digitalPinToBitPosition (pin );
108
112
@@ -113,7 +117,15 @@ static void turnOffPWM(uint8_t pin)
113
117
114
118
/* TCB - only one output */
115
119
case TIMERB0 :
120
+ // check, if TCB0 is set to alternate mode PF4 (Pin D6) (default megaavr-PWM)
121
+ // see variants/nona4809/variant.c line 31
122
+ if ((pin == 6 ) && ((PORTMUX_TCBROUTEA & PORTMUX_TCB0_bm ) != PORTMUX_TCB0_bm ))
123
+ return ;
116
124
case TIMERB1 :
125
+ // check, if TCB1 is set to alternate mode PF5 (Pin D3) (default megaavr-PWM)
126
+ // see variants/nona4809/variant.c line 36
127
+ if ((pin == 3 ) && ((PORTMUX_TCBROUTEA & PORTMUX_TCB1_bm ) != PORTMUX_TCB1_bm ))
128
+ return ;
117
129
case TIMERB2 :
118
130
case TIMERB3 :
119
131
You can’t perform that action at this time.
0 commit comments