فهرست منبع

partial web server fix

added String content(reinterpret_cast<const __FlashStringHelper *>(page)
to each web server progmem call
network configuration still crashes

cf
http://www.esp8266.com/viewtopic.php?f=29&t=4060&sid=228fe4ca7a42e37448566bf60eed6fb8&start=40
Etienne Landon 9 سال پیش
والد
کامیت
87e1fe2226
2فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 5 5
      web.h
  2. 1 1
      web_NetworkConfiguration.h

+ 5 - 5
web.h

@@ -112,14 +112,14 @@ void Second_Tick()
 
 
 void setupWebserver(){
-  server.on ( "/", []() {server.send ( 200, "text/html", web_AdminMainPage ); } );
-  server.on ( "/admin.html", []() {Serial.println("admin.html"); server.send ( 200, "text/html", web_AdminMainPage ); }  );
+  server.on ( "/", []() {server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(web_AdminMainPage) ); } );
+  server.on ( "/admin.html", []() {Serial.println("admin.html"); server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(web_AdminMainPage) ); }  );
   server.on ( "/config.html", send_network_configuration_html );
-  server.on ( "/info.html", []() { Serial.println("info.html"); server.send ( 200, "text/html", web_Information ); }  );
+  server.on ( "/info.html", []() { Serial.println("info.html"); server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(web_Information) ); }  );
   server.on ( "/ntp.html", send_NTP_configuration_html  );
   server.on ( "/general.html",  send_general_html );
-  server.on ( "/style.css", []() { Serial.println("style.css"); server.send ( 200, "text/plain", web_Style_css );} );
-  server.on ( "/microajax.js", []() { Serial.println("microajax.js"); server.send ( 200, "text/plain", web_microajax_js ); } );
+  server.on ( "/style.css", []() { Serial.println("style.css"); server.send ( 200, "text/plain", reinterpret_cast<const __FlashStringHelper *>(web_Style_css ));} );
+  server.on ( "/microajax.js", []() { Serial.println("microajax.js"); server.send ( 200, "text/plain", reinterpret_cast<const __FlashStringHelper *>(web_microajax_js )); } );
   server.on ( "/admin/values", send_network_configuration_values_html );
   server.on ( "/admin/connectionstate", send_connection_state_values_html );
   server.on ( "/admin/infovalues", send_information_values_html );

+ 1 - 1
web_NetworkConfiguration.h

@@ -97,7 +97,7 @@ void send_network_configuration_html()
 			if (server.argName(i) == "gw_3") if (checkRange(server.arg(i))) 	config.Gateway[3] =  server.arg(i).toInt();
 			if (server.argName(i) == "dhcp") config.dhcp = true;
 		}
-		 server.send ( 200, "text/html", web_WaitAndReload );
+		 server.send ( 200, "text/html", reinterpret_cast<const __FlashStringHelper *>(web_WaitAndReload) );
 		WriteConfig();
 		ConfigureWifi();
 		AdminTimeOutCounter=0;