Skip to content

Commit 3d0beea

Browse files
committed
Fix web update available size
1 parent 32b07c6 commit 3d0beea

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

esp3d/config.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,22 +1371,23 @@ void CONFIG::print_config(tpipe output, bool plaintext)
13711371
BRIDGE::print(formatBytes(ESP.getFlashChipSize()).c_str(), output);
13721372
if (!plaintext)BRIDGE::print(F("\","), output);
13731373
else BRIDGE::print(F("\n"), output);
1374-
#ifdef ARDUINO_ARCH_ESP8266
1374+
#ifdef ARDUINO_ARCH_ESP8266
1375+
fs::FSInfo info;
1376+
SPIFFS.info(info);
13751377
if (!plaintext)BRIDGE::print(F("\"update_size\":\""), output);
13761378
else BRIDGE::print(F("Available Size for update: "), output);
13771379
uint32_t flashsize = ESP.getFlashChipSize();
13781380
if (flashsize > 1024 * 1024) flashsize = 1024 * 1024;
1379-
BRIDGE::print(formatBytes(flashsize - ESP.getSketchSize()).c_str(), output);
1381+
BRIDGE::print(formatBytes(flashsize - ESP.getSketchSize()-info.totalBytes).c_str(), output);
13801382
if (!plaintext)BRIDGE::print(F("\","), output);
13811383
else {
1382-
if ((flashsize - ESP.getSketchSize()) > (flashsize / 2)) BRIDGE::println(F("(Ok)"), output);
1383-
else BRIDGE::print(F("(Not enough)"), output);
1384+
if ((flashsize - ESP.getSketchSize()-info.totalBytes) > (flashsize / 2)) BRIDGE::println(F("(Ok)"), output);
1385+
else BRIDGE::println(F("(Not enough)"), output);
13841386
}
13851387

13861388
if (!plaintext)BRIDGE::print(F("\"spiffs_size\":\""), output);
13871389
else BRIDGE::print(F("Available Size for SPIFFS: "), output);
1388-
fs::FSInfo info;
1389-
SPIFFS.info(info);
1390+
13901391
BRIDGE::print(formatBytes(info.totalBytes).c_str(), output);
13911392
if (!plaintext)BRIDGE::print(F("\","), output);
13921393
else BRIDGE::print(F("\n"), output);

esp3d/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ extern "C" {
186186
#endif
187187
#include "wificonf.h"
188188
//version and sources location
189-
#define FW_VERSION "0.9.101"
189+
#define FW_VERSION "0.9.102"
190190
#define REPOSITORY "https://github.com/luc-github/ESP3D"
191191

192192
typedef enum {

0 commit comments

Comments
 (0)