Skip to content

Commit 9a28f0b

Browse files
committed
Fix check for variable PWM frequency
1 parent cec921f commit 9a28f0b

File tree

1 file changed

+2
-2
lines changed
  • ports/raspberrypi/common-hal/pwmio

1 file changed

+2
-2
lines changed

ports/raspberrypi/common-hal/pwmio/PWMOut.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self,
107107
if (variable_frequency) {
108108
return PWMOUT_ALL_TIMERS_ON_PIN_IN_USE;
109109
}
110-
// If the other user wants to change frequency then we can't share either.
110+
// If the other user wants a variable frequency then we can't share either.
111111
if ((slice_fixed_frequency & (1 << slice)) != 0) {
112112
return PWMOUT_ALL_TIMERS_ON_PIN_IN_USE;
113113
}
@@ -119,7 +119,7 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self,
119119
self->slice = slice;
120120
self->channel = channel;
121121
channel_use |= channel_use_mask;
122-
if (!variable_frequency) {
122+
if (variable_frequency) {
123123
slice_fixed_frequency |= 1 << slice;
124124
}
125125

0 commit comments

Comments
 (0)