Skip to content

Commit f9da18c

Browse files
Merge pull request #30 from softwarecrash/setp-page-rework
Setp page rework
2 parents 8860b98 + 42ba79c commit f9da18c

16 files changed

+709
-737
lines changed

platformio.ini

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
[env:esp32dev]
1212
custom_project_name = BLLEDController
1313
custom_project_codename = Balder
14-
custom_version = 1.0.0.nightly.220525.2 ; for github release name the release VX.Y.Z X=(Incerase when Modifications oder new functions Break the API/webUI) Y=(Incerase for add oder modify changes that not breake the API/webUI until X incearase) Z=(Incerase for bugfix releases until minor is incerase)
14+
custom_version = 1.0.0.nightly.240525.1 ; for github release name the release VX.Y.Z X=(Incerase when Modifications oder new functions Break the API/webUI) Y=(Incerase for add oder modify changes that not breake the API/webUI until X incearase) Z=(Incerase for bugfix releases until minor is incerase)
1515
platform = espressif32
1616
board = esp32dev
1717
framework = arduino
@@ -21,6 +21,9 @@ board_build.filesystem = littlefs
2121
build_flags =
2222
-DVERSION=${this.custom_version}
2323
-DSTRVERSION=\""${this.custom_version}"\"
24+
-D CONFIG_ASYNC_TCP_QUEUE_SIZE=64
25+
-D CONFIG_ASYNC_TCP_RUNNING_CORE=1
26+
-D WS_MAX_QUEUED_MESSAGES=128
2427
extra_scripts =
2528
pre:pre_build.py
2629
merge_firmware.py

src/blled/filesystem.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ char *generateRandomString(int length)
2828

2929
void saveFileSystem()
3030
{
31-
Serial.println(F("Saving config"));
31+
LogSerial.println(F("Saving config"));
3232

3333
JsonDocument json;
3434
json["ssid"] = globalVariables.SSID;
@@ -124,17 +124,17 @@ void saveFileSystem()
124124
File configFile = LittleFS.open(configPath, "w");
125125
if (!configFile)
126126
{
127-
Serial.println(F("Failed to save config"));
127+
LogSerial.println(F("Failed to save config"));
128128
return;
129129
}
130130
serializeJson(json, configFile);
131131
configFile.close();
132-
Serial.println(F("Config Saved"));
132+
LogSerial.println(F("Config Saved"));
133133
}
134134

135135
void loadFileSystem()
136136
{
137-
Serial.println(F("Loading config"));
137+
LogSerial.println(F("Loading config"));
138138

139139
File configFile;
140140
int attempts = 0;
@@ -146,16 +146,16 @@ void loadFileSystem()
146146
break;
147147
}
148148
attempts++;
149-
Serial.println(F("Failed to open config file, retrying.."));
149+
LogSerial.println(F("Failed to open config file, retrying.."));
150150
delay(2000);
151151
}
152152
if (!configFile)
153153
{
154-
Serial.print(F("Failed to open config file after "));
155-
Serial.print(attempts);
156-
Serial.println(F(" retries"));
154+
LogSerial.print(F("Failed to open config file after "));
155+
LogSerial.print(attempts);
156+
LogSerial.println(F(" retries"));
157157

158-
Serial.println(F("Clearing config"));
158+
LogSerial.println(F("Clearing config"));
159159
// LittleFS.remove(configPath);
160160
saveFileSystem();
161161
return;
@@ -222,15 +222,15 @@ void loadFileSystem()
222222
printerConfig.frontCoverRGB = hex2rgb(json["frontCoverRGB"], json["frontCoverWW"], json["frontCoverCW"]);
223223
printerConfig.nozzleTempRGB = hex2rgb(json["nozzleTempRGB"], json["nozzleTempWW"], json["nozzleTempCW"]);
224224
printerConfig.bedTempRGB = hex2rgb(json["bedTempRGB"], json["bedTempWW"], json["bedTempCW"]);
225-
Serial.println(F("Loaded config"));
225+
LogSerial.println(F("Loaded config"));
226226
}
227227
else
228228
{
229-
Serial.println(F("Failed loading config"));
230-
Serial.println(F("Clearing config"));
229+
LogSerial.println(F("Failed loading config"));
230+
LogSerial.println(F("Clearing config"));
231231
LittleFS.remove(configPath);
232232

233-
// Serial.println(F("Generating new password"));
233+
// LogSerial.println(F("Generating new password"));
234234
// char* pw = generateRandomString(8);
235235
// strcpy(printerConfig.webpagePassword, pw);
236236
}
@@ -240,7 +240,7 @@ void loadFileSystem()
240240

241241
void deleteFileSystem()
242242
{
243-
Serial.println(F("Deleting LittleFS"));
243+
LogSerial.println(F("Deleting LittleFS"));
244244
LittleFS.remove(configPath);
245245
}
246246

@@ -251,17 +251,17 @@ bool hasFileSystem()
251251

252252
void setupFileSystem()
253253
{
254-
Serial.println(F("Mounting LittleFS"));
254+
LogSerial.println(F("Mounting LittleFS"));
255255
if (!LittleFS.begin())
256256
{
257-
Serial.println(F("Failed to mount LittleFS"));
257+
LogSerial.println(F("Failed to mount LittleFS"));
258258
LittleFS.format();
259-
Serial.println(F("Formatting LittleFS"));
260-
Serial.println(F("Restarting Device"));
259+
LogSerial.println(F("Formatting LittleFS"));
260+
LogSerial.println(F("Restarting Device"));
261261
delay(1000);
262262
ESP.restart();
263263
}
264-
Serial.println(F("Mounted LittleFS"));
264+
LogSerial.println(F("Mounted LittleFS"));
265265
};
266266

267267
#endif

0 commit comments

Comments
 (0)