From 5cdcb0f0e6f1d1f5e4b7aeb486d8bfa42ee50009 Mon Sep 17 00:00:00 2001 From: Dmitry Borisenko <67171972+IoTManagerProject@users.noreply.github.com> Date: Mon, 14 Feb 2022 10:48:14 +0100 Subject: [PATCH] =?UTF-8?q?=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D1=8F=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20esp32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 5 ----- include/DeviceList.h | 4 ++++ include/PeriodicTasks.h | 9 ++++++++- include/utils/FileUtils.h | 2 +- platformio.ini | 5 ++--- 5 files changed, 15 insertions(+), 10 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index d183cdca..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "files.associations": { - "ratio": "cpp" - } -} \ No newline at end of file diff --git a/include/DeviceList.h b/include/DeviceList.h index afd15b9d..d04ff8bf 100644 --- a/include/DeviceList.h +++ b/include/DeviceList.h @@ -1,6 +1,10 @@ #pragma once #include "Global.h" +#ifdef ESP8266 #include "ESPAsyncUDP.h" +#else +#include "AsyncUDP.h" +#endif extern AsyncUDP asyncUdp; extern const String getThisDevice(); diff --git a/include/PeriodicTasks.h b/include/PeriodicTasks.h index ea091e15..d7c187c7 100644 --- a/include/PeriodicTasks.h +++ b/include/PeriodicTasks.h @@ -3,8 +3,15 @@ #include "WsServer.h" #include "Utils/TimeUtils.h" +#ifdef ESP32 +#include +#endif + extern void periodicTasksInit(); extern void printGlobalVarSize(); extern void handleError(String errorId, String errorValue); -extern void handleError(String errorId, int errorValue); \ No newline at end of file +extern void handleError(String errorId, int errorValue); + +extern String ESP_getResetReason(void); +extern String ESP32GetResetReason(uint32_t cpu_no); \ No newline at end of file diff --git a/include/utils/FileUtils.h b/include/utils/FileUtils.h index 78185e66..76492b9a 100644 --- a/include/utils/FileUtils.h +++ b/include/utils/FileUtils.h @@ -1,6 +1,6 @@ #pragma once -#include "EspFileSystem.h" #include "Global.h" +#include "EspFileSystem.h" extern void writeFileUint8tByFrames(const String& filename, uint8_t*& big_buf, size_t length, size_t headerLenth, size_t frameSize); extern void writeFileUint8tByByte(const String& filename, uint8_t*& payload, size_t length, size_t headerLenth); diff --git a/platformio.ini b/platformio.ini index d11174e8..d3bc3223 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,17 +9,15 @@ ; https://docs.platformio.org/page/projectconf.html [platformio] -default_envs = esp8266_4mb +default_envs = esp32_4mb data_dir = data_svelte [common_env_data] lib_deps_external = bblanchon/ArduinoJson @6.18.0 me-no-dev/ESP Async WebServer - me-no-dev/ESPAsyncUDP Links2004/WebSockets knolleary/PubSubClient - [env:esp8266_4mb] build_flags = -Desp8266_4mb="esp8266_4mb" framework = arduino @@ -33,6 +31,7 @@ lib_deps = beegee-tokyo/DHT sensor library for ESPx adafruit/Adafruit BMP280 Library adafruit/Adafruit BME280 Library + me-no-dev/ESPAsyncUDP ;для esp32 данная библиотека встроена в ядро monitor_filters = esp8266_exception_decoder upload_speed = 921600 monitor_speed = 115200