Merge pull request #4165 from DavePutz/issue_4143

Issue 4143 - Fixed marking a PWM slice incorrectly as variable frequency
This commit is contained in:
Scott Shawcroft 2021-02-09 14:30:39 -08:00 committed by GitHub
commit b19c700d4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}