From 7d0963e3f5e8267c7c4b9b825ea5fad2c022ce36 Mon Sep 17 00:00:00 2001 From: Morgan Allen Date: Sun, 2 Sep 2018 17:27:51 -0700 Subject: [PATCH] use spi_flash_read to load stored config --- main/esp32-wifi-manager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/esp32-wifi-manager.c b/main/esp32-wifi-manager.c index 8f4d900..45cc857 100644 --- a/main/esp32-wifi-manager.c +++ b/main/esp32-wifi-manager.c @@ -5,6 +5,7 @@ #include "esp_log.h" #include "esp_heap_caps.h" +#include "esp_spi_flash.h" #include "driver/gpio.h" #include "driver/spi_common.h" @@ -21,7 +22,7 @@ static struct wifi_man_ap_store { } wifi_man_ap_store; void wifi_man_init_config() { - memset(&wifi_man_ap_store, 0, sizeof(struct wifi_man_ap_store)); + spi_flash_read(CONFIG_WIFI_MANAGER_MEM_ADDR, &wifi_man_ap_store, sizeof(struct wifi_man_ap_store)); } int wifi_man_load_config() {