Эх сурвалжийг харах

Merge branch 'bugfix/gpio_example_config_struct_zero_init' into 'master'

example: fixed the issue that config struct is not properly initialized

See merge request espressif/esp-idf!15007
Michael (XIAO Xufeng) 4 жил өмнө
parent
commit
db33e957b8

+ 2 - 1
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