esp32 compiling version

This commit is contained in:
Dmitry Borisenko
2020-08-30 00:12:11 +03:00
parent 01248f41da
commit 86ee523182
12 changed files with 49 additions and 28 deletions

View File

@@ -1,5 +1,5 @@
#ifdef FSEditor
#include "FSEditor.h"
#ifdef ESP32
#include "LITTLEFS.h"
#define LittleFS LITTLEFS
@@ -324,3 +324,4 @@ void FSEditor::handleUpload(AsyncWebServerRequest *request, const String &filena
}
}
}
#endif

View File

@@ -1,3 +1,4 @@
#ifdef SSDP
#ifdef ESP8266
#include <ESP8266SSDP.h>
#endif
@@ -52,4 +53,5 @@ String decToHex(uint32_t decValue, byte desiredStringLength) {
String hexString = String(decValue, HEX);
while (hexString.length() < desiredStringLength) hexString = "0" + hexString;
return hexString;
}
}
#endif

View File

@@ -1,5 +1,5 @@
#ifdef SERVO_ENABLED
#include "Servo/Servos.h"
Servos myServo;
Servos::Servos(){};
@@ -38,3 +38,4 @@ Servo *Servos::get(uint8_t num) {
size_t Servos::count() {
return _items.size();
}
#endif

View File

@@ -59,7 +59,7 @@ void upgrade_firmware() {
t_httpUpdate_return ret = ESPhttpUpdate.updateSpiffs(wifiClient, "http://91.204.228.124:1100/update/esp8266/esp32-esp8266_iot-manager_modules_firmware.spiffs.bin");
#else
httpUpdate.rebootOnUpdate(false);
t_httpUpdate_return ret = httpUpdate.updateSpiffs(client_for_upgrade, "http://91.204.228.124:1100/update/esp32/esp32-esp8266_iot-manager_modules_firmware.spiffs.bin");
t_httpUpdate_return ret = httpUpdate.updateSpiffs(wifiClient, "http://91.204.228.124:1100/update/esp32/esp32-esp8266_iot-manager_modules_firmware.spiffs.bin");
#endif
if (ret == HTTP_UPDATE_OK) {
writeFile(String(DEVICE_SCENARIO_FILE), scanerioBackup);
@@ -78,7 +78,7 @@ void upgrade_firmware() {
#ifdef ESP8266
ret = ESPhttpUpdate.update(wifiClient, "http://91.204.228.124:1100/update/esp8266/esp32-esp8266_iot-manager_modules_firmware.ino.bin");
#else
ret = httpUpdate.update(client_for_upgrade, "http://91.204.228.124:1100/update/esp32/esp32-esp8266_iot-manager_modules_firmware.ino.bin");
ret = httpUpdate.update(wifiClient, "http://91.204.228.124:1100/update/esp32/esp32-esp8266_iot-manager_modules_firmware.ino.bin");
#endif
if (ret == HTTP_UPDATE_OK) {
pm.info("done! restart...");

View File

@@ -20,7 +20,7 @@ void startSTAMode() {
bool keepConnecting = true;
uint8_t tries = 20;
sint8_t connRes;
int8_t connRes;
do {
#ifdef ESP8266
connRes = WiFi.waitForConnectResult(1000);

View File

@@ -15,10 +15,12 @@ void initWS();
void init() {
String login = jsonReadStr(configSetupJson, "weblogin");
String pass = jsonReadStr(configSetupJson, "webpass");
#ifdef FSEditor
#ifdef ESP32
server.addHandler(new FSEditor(LittleFS, login, pass));
#else
server.addHandler(new FSEditor(login, pass));
#endif
#endif
server.serveStatic("/css/", LittleFS, "/css/").setCacheControl("max-age=600");

View File

@@ -1,5 +1,6 @@
#include <SSDP.h>
#include "Class/CallBackTest.h"
#include "Class/NotAsinc.h"
#include "Class/ScenarioClass.h"
@@ -72,9 +73,10 @@ void setup() {
pm.info("Broadcast UDP");
udpInit();
#endif
#ifdef SSDP
pm.info("Ssdp Init");
SsdpInit();
#endif
ts.add(
TEST, 1000 * 60, [&](void*) {