From d8c81ecca1c41ce0db9f5357405b00b16e2e4bb4 Mon Sep 17 00:00:00 2001 From: tablatronix Date: Thu, 24 Feb 2022 11:43:42 -0600 Subject: [PATCH] macro test --- WiFiManager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/WiFiManager.cpp b/WiFiManager.cpp index cd58a17..9fa330c 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -588,8 +588,12 @@ void WiFiManager::setupHTTPServer(){ server.reset(new WM_WebServer(_httpPort)); + #define G(string_literal) (String(FPSTR(string_literal)).c_str()) + + // workaround for Uri() bug https://github.com/esp8266/Arduino/issues/7102 + /* Setup httpd callbacks, web pages: root, wifi config pages, SO captive portal detectors and not found. */ - server->on(String(FPSTR(R_root)).c_str(), std::bind(&WiFiManager::handleRoot, this)); + server->on(G(R_root), std::bind(&WiFiManager::handleRoot, this)); server->on(String(FPSTR(R_wifi)).c_str(), std::bind(&WiFiManager::handleWifi, this, true)); server->on(String(FPSTR(R_wifinoscan)).c_str(), std::bind(&WiFiManager::handleWifi, this, false)); server->on(String(FPSTR(R_wifisave)).c_str(), std::bind(&WiFiManager::handleWifiSave, this));