File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
ports/raspberrypi/common-hal/pwmio Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self,
143
143
common_hal_pwmio_pwmout_set_frequency (self , frequency );
144
144
pwm_set_enabled (slice , true);
145
145
} else {
146
+ common_hal_pwmio_pwmout_set_frequency (self , frequency );
146
147
common_hal_pwmio_pwmout_set_duty_cycle (self , duty );
147
148
}
148
149
@@ -163,7 +164,7 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) {
163
164
uint32_t channel_mask = _mask (self -> slice , self -> channel );
164
165
channel_use &= ~channel_mask ;
165
166
never_reset_channel &= ~channel_mask ;
166
- uint32_t slice_mask = ((1 << CHANNELS_PER_SLICE ) - 1 ) << (self -> slice * CHANNELS_PER_SLICE + self -> channel );
167
+ uint32_t slice_mask = ((1 << CHANNELS_PER_SLICE ) - 1 ) << (self -> slice * CHANNELS_PER_SLICE );
167
168
if ((channel_use & slice_mask ) == 0 ) {
168
169
target_slice_frequencies [self -> slice ] = 0 ;
169
170
slice_variable_frequency &= ~(1 << self -> slice );
You can’t perform that action at this time.
0 commit comments