From b910724ea9950af14e9b9aac82e34a0586f35714 Mon Sep 17 00:00:00 2001 From: "Michael (XIAO Xufeng)" Date: Mon, 30 Aug 2021 22:59:36 +0800 Subject: [PATCH] example: fixed the issue that config struct is not properly initialized --- .../peripherals/gpio/generic_gpio/main/gpio_example_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/peripherals/gpio/generic_gpio/main/gpio_example_main.c b/examples/peripherals/gpio/generic_gpio/main/gpio_example_main.c index 425f8fa9e1..faf584b48e 100644 --- a/examples/peripherals/gpio/generic_gpio/main/gpio_example_main.c +++ b/examples/peripherals/gpio/generic_gpio/main/gpio_example_main.c @@ -59,7 +59,8 @@ static void gpio_task_example(void* arg) void app_main(void) { - gpio_config_t io_conf; + //zero-initialize the config structure. + gpio_config_t io_conf = {}; //disable interrupt io_conf.intr_type = GPIO_INTR_DISABLE; //set as output mode