From 55ecc64bf13cafaaeb71953d76a4f62474a22f5e Mon Sep 17 00:00:00 2001 From: silabs-ChatNguyen Date: Mon, 13 Nov 2023 11:57:16 +0700 Subject: [PATCH] Fix crash when pwmio deinit --- ports/silabs/common-hal/pwmio/PWMOut.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/silabs/common-hal/pwmio/PWMOut.c b/ports/silabs/common-hal/pwmio/PWMOut.c index 7382fade97..57d010f546 100644 --- a/ports/silabs/common-hal/pwmio/PWMOut.c +++ b/ports/silabs/common-hal/pwmio/PWMOut.c @@ -46,6 +46,8 @@ void pwmout_reset(void) { mcu_tim_pin_obj_t *l_tim = &mcu_tim_list[tim_index]; if (l_tim->pin != NULL) { sl_pwm_deinit(&pwm_handle[tim_index]); + common_hal_reset_pin(l_tim->pin); + l_tim->pin = NULL; } }