Skip to content

Commit c8a7c4b

Browse files
committed
Fix check for connected pins
1 parent 2a28ae7 commit c8a7c4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/nRF5/HardwarePWM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ uint8_t HardwarePWM::usedChannelCount(void)
244244
uint8_t usedChannels = 0;
245245
for(int i=0; i<MAX_CHANNELS; i++)
246246
{
247-
if ( _pwm->PSEL.OUT[i] & PWM_PSEL_OUT_CONNECT_Msk )
247+
if ( (_pwm->PSEL.OUT[i] & PWM_PSEL_OUT_CONNECT_Msk) != (PWM_PSEL_OUT_CONNECT_Disconnected << PWM_PSEL_OUT_CONNECT_Pos) )
248248
{
249249
usedChannels++;
250250
}

0 commit comments

Comments
 (0)