mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
1мб 4мб переключение версий
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
22
src/Web.cpp
22
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("<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #ffc7c7; padding: 10px;'>Присеты не доступны, модуль на 1mb</p></font></div>"));
|
||||
#else
|
||||
|
||||
jsonWriteStr(configSetupJson, F("warning1"), F("<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #ffc7c7; padding: 10px;'>Требуется перезагрузка</p></font></div>"));
|
||||
#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", "<button class=\"close\" onclick=\"toggle('my-block')\">×</button>" + msg);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
#include <SSDP.h>
|
||||
|
||||
#include "BufferExecute.h"
|
||||
#include "Bus.h"
|
||||
#include "Class/CallBackTest.h"
|
||||
|
||||
Reference in New Issue
Block a user