summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <siehputz@gmail.com>2021-02-09 15:22:59 -0600
committerroot <siehputz@gmail.com>2021-02-09 15:22:59 -0600
commit9a28f0bf455f8a13522fd8454e05b7bcd67ecb99 (patch)
tree644dbad89ee054a5931bdd0535064c83f14fad80
parentcec921f3747beccff10c2d2dfbc237c305083f62 (diff)
Fix check for variable PWM frequency
-rw-r--r--ports/raspberrypi/common-hal/pwmio/PWMOut.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/raspberrypi/common-hal/pwmio/PWMOut.c b/ports/raspberrypi/common-hal/pwmio/PWMOut.c
index 567ec5ef5..3d8979a03 100644
--- a/ports/raspberrypi/common-hal/pwmio/PWMOut.c
+++ b/ports/raspberrypi/common-hal/pwmio/PWMOut.c
@@ -107,7 +107,7 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self,
if (variable_frequency) {
return PWMOUT_ALL_TIMERS_ON_PIN_IN_USE;
}
- // If the other user wants to change frequency then we can't share either.
+ // If the other user wants a variable frequency then we can't share either.
if ((slice_fixed_frequency & (1 << slice)) != 0) {
return PWMOUT_ALL_TIMERS_ON_PIN_IN_USE;
}
@@ -119,7 +119,7 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self,
self->slice = slice;
self->channel = channel;
channel_use |= channel_use_mask;
- if (!variable_frequency) {
+ if (variable_frequency) {
slice_fixed_frequency |= 1 << slice;
}