diff --git a/include/Consts.h b/include/Consts.h index 1805957a..f6a7fc80 100644 --- a/include/Consts.h +++ b/include/Consts.h @@ -2,9 +2,9 @@ //===========Firmware============================================================================================================================================= #define FIRMWARE_VERSION 273 -#define FLASH_SIZE_1MB true +#define ESP8266_FLASH_SIZE_1MB false //===========FileSystem============================================================================================================================================== -#define USE_LITTLEFS false +#define USE_LITTLEFS true //================================================================================================================================================================== #define NUM_BUTTONS 6 #define LED_PIN LED_BUILTIN @@ -28,14 +28,12 @@ #define SensorDhtEnabled #define PwmOutEnable //=========Features================================================================================================================================= -#ifndef FLASH_SIZE_1MB #define telegramEnable -#endif #define uartEnable #ifdef ESP8266 -#ifdef FLASH_SIZE_1MB +#ifdef ESP8266_FLASH_SIZE_1MB #define FIRMWARE_NAME "esp8266-1mb" #else #define FIRMWARE_NAME "esp8266" diff --git a/platformio.ini b/platformio.ini index 3d8bb9ec..5ce94223 100644 --- a/platformio.ini +++ b/platformio.ini @@ -45,7 +45,7 @@ extra_scripts = ./tools/littlefsbuilder.py [env:esp8266_01_1m] framework = arduino board = nodemcuv2 -board_build.ldscript = eagle.flash.1m512.ld +board_build.ldscript = eagle.flash.1m256.ld platform = https://github.com/platformio/platform-espressif8266.git lib_deps = ${common_env_data.lib_deps_external} @@ -57,7 +57,6 @@ lib_deps = monitor_filters = esp8266_exception_decoder upload_speed = 921600 monitor_speed = 115200 -board_build.filesystem = littlefs [env:esp8266] framework = arduino diff --git a/src/Web.cpp b/src/Web.cpp index 0d4c5875..a6cf2b84 100644 --- a/src/Web.cpp +++ b/src/Web.cpp @@ -26,11 +26,9 @@ void web_init() { if (request->hasArg(F("addPreset"))) { addPreset2(request->getParam(F("addPreset"))->value().toInt()); -#ifdef FLASH_SIZE_1MB - jsonWriteStr(configSetupJson, F("warning1"), F("

Присеты не доступны, модуль на 1mb

")); -#else + jsonWriteStr(configSetupJson, F("warning1"), F("

Требуется перезагрузка

")); -#endif + request->redirect(F("/?set.device")); } @@ -335,13 +333,11 @@ void web_init() { SerialPrint("I", "Update", "firmware version: " + String(lastVersion)); String msg = ""; -#ifdef FLASH_SIZE_1MB - if (FLASH_SIZE_1MB) { + + if (ESP8266_FLASH_SIZE_1MB) { msg = F("Обновление невозможно, память устройства 1 мб"); } else { -#endif - if (lastVersion == FIRMWARE_VERSION) { msg = F("Актуальная версия прошивки уже установлена."); } @@ -357,17 +353,7 @@ void web_init() { else if (lastVersion < FIRMWARE_VERSION) { msg = F("Ошибка версии. Попробуйте повторить позже..."); } -#ifdef FLASH_SIZE_1MB } -#endif - - // else if (lastVersion == "") { - //msg = F("Нажмите на кнопку \"обновить прошивку\" повторно..."); - //} else if (lastVersion == "less") { - //msg = F("Обновление \"по воздуху\" не поддерживается!"); - //} else if (lastVersion == "notsupported") { - // msg = F("Обновление возможно только через usb!"); - //} String tmp = "{}"; jsonWriteStr(tmp, "title", "" + msg); diff --git a/src/main.cpp b/src/main.cpp index 3bd8fb0a..aeabdbd2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,5 @@ #include - #include "BufferExecute.h" #include "Bus.h" #include "Class/CallBackTest.h"