From 10e0759372f1e04c8fcd182c382d31d7ca8534d4 Mon Sep 17 00:00:00 2001 From: jeromecoutant Date: Wed, 17 Mar 2021 08:35:04 +0100 Subject: [PATCH] STM32 PWM : correct GPIO free --- targets/TARGET_STM/pwmout_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/TARGET_STM/pwmout_api.c b/targets/TARGET_STM/pwmout_api.c index 27f140a530..38120f2772 100644 --- a/targets/TARGET_STM/pwmout_api.c +++ b/targets/TARGET_STM/pwmout_api.c @@ -219,8 +219,8 @@ void pwmout_init(pwmout_t *obj, PinName pin) void pwmout_free(pwmout_t *obj) { - // Configure GPIO - pin_function(obj->pin, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0)); + // Configure GPIO back to reset value + pin_function(obj->pin, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)); } void pwmout_write(pwmout_t *obj, float value)