8000 Merge pull request #4165 from DavePutz/issue_4143 · alexbartlow/circuitpython@b19c700 · GitHub
[go: up one dir, main page]

Skip to content

Commit b19c700

Browse files
authored
Merge pull request adafruit#4165 from DavePutz/issue_4143
Issue 4143 - Fixed marking a PWM slice incorrectly as variable frequency
2 parents cd05aa5 + 9a28f0b commit b19c700

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)
0