Some changes to make it compile for both ESP8266 and ESP32

This commit is contained in:
Gunnar Skjold
2020-01-28 18:17:20 +01:00
parent 50faaca559
commit 3312f88804
3 changed files with 7 additions and 4 deletions

3
.gitignore vendored
View File

@@ -6,4 +6,5 @@
*.sw[op]
.vscode
.pio
platformio-user.ini
platformio-user.ini
src/version.h

View File

@@ -107,7 +107,7 @@ void HanConfigAp::handleRoot() {
configuration *config = new configuration();
config->load();
String html = CONFIG_HTML;
String html = String((const __FlashStringHelper*) CONFIG_HTML);
if(config->hasConfig()) {
bool access = !config->isAuth();
@@ -201,10 +201,12 @@ void HanConfigAp::handleRoot() {
void HanConfigAp::handleStyle() {
println("Serving /style.css over http...");
String css = String((const __FlashStringHelper*) STYLE_CSS);
server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
server.sendHeader("Pragma", "no-cache");
server.sendHeader("Expires", "-1");
server.send(200, "text/html", STYLE_CSS, sizeof(STYLE_CSS));
server.send(200, "text/css", css);
}
void HanConfigAp::handleSave() {

View File

@@ -3,7 +3,7 @@ extra_configs = platformio-user.ini
[common]
framework = arduino
lib_deps = HanConfigAp@1.0.0, HanReader@1.0.0, HanToJson@1.0.0, ArduinoJson@^6.0.0, MQTT@^2.4.0, DallasTemperature@^3.8.0, Base64@0.0.1
lib_deps = HanConfigAp@1.0.0, HanReader@1.0.0, HanToJson@1.0.0, ArduinoJson@^6.0.0, MQTT@^2.4.0, DallasTemperature@^3.8.0
[env:esp12e]
platform = espressif8266