File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
ports/raspberrypi/common-hal/pulseio Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,8 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self,
85
85
common_hal_pwmio_pwmout_raise_error (result );
86
86
87
87
// Disable gpio output before we set the duty cycle.
88
+ gpio_put (pin -> number , false);
89
+ gpio_set_dir (pin -> number , GPIO_OUT );
88
90
gpio_set_function (pin -> number , GPIO_FUNC_SIO );
89
91
common_hal_pwmio_pwmout_set_duty_cycle (& self -> carrier , duty_cycle );
90
92
@@ -101,6 +103,7 @@ void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t *self) {
101
103
if (common_hal_pulseio_pulseout_deinited (self )) {
102
104
return ;
103
105
}
106
+ gpio_set_dir (self -> pin , GPIO_IN );
104
107
common_hal_pwmio_pwmout_deinit (& self -> carrier );
105
108
self -> pin = NO_PIN ;
106
109
}
You can’t perform that action at this time.
0 commit comments