Skip to content

Commit 10e0759

Browse files
committed
STM32 PWM : correct GPIO free
1 parent c734138 commit 10e0759

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

targets/TARGET_STM/pwmout_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ void pwmout_init(pwmout_t *obj, PinName pin)
219219

220220
void pwmout_free(pwmout_t *obj)
221221
{
222-
// Configure GPIO
223-
pin_function(obj->pin, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0));
222+
// Configure GPIO back to reset value
223+
pin_function(obj->pin, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0));
224224
}
225225

226226
void pwmout_write(pwmout_t *obj, float value)

0 commit comments

Comments
 (0)