From 517860ab338a6ae829b228c94036f1b775f2c44d Mon Sep 17 00:00:00 2001 From: Hieromon Ikasamo Date: Wed, 12 Feb 2020 13:30:23 +0900 Subject: [PATCH] Fixed the compiler warning with experimental WiFi enum. --- src/AutoConnectPage.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/AutoConnectPage.cpp b/src/AutoConnectPage.cpp index ebf4d11..c2f033e 100644 --- a/src/AutoConnectPage.cpp +++ b/src/AutoConnectPage.cpp @@ -1004,27 +1004,29 @@ String AutoConnect::_token_ESTAB_SSID(PageArgument& args) { String AutoConnect::_token_WIFI_MODE(PageArgument& args) { AC_UNUSED(args); - const char* wifiMode = ""; + PGM_P wifiMode; switch (WiFi.getMode()) { case WIFI_OFF: - wifiMode = "OFF"; + wifiMode = PSTR("OFF"); break; case WIFI_STA: - wifiMode = "STA"; + wifiMode = PSTR("STA"); break; case WIFI_AP: - wifiMode = "AP"; + wifiMode = PSTR("AP"); break; case WIFI_AP_STA: - wifiMode = "AP_STA"; + wifiMode = PSTR("AP_STA"); break; #ifdef ARDUINO_ARCH_ESP32 case WIFI_MODE_MAX: - wifiMode = "MAX"; + wifiMode = PSTR("MAX";) break; #endif + default: + wifiMode = PSTR("experiment"); } - return String(wifiMode); + return String(FPSTR(wifiMode)); } String AutoConnect::_token_WIFI_STATUS(PageArgument& args) {