Skip to content

Commit ffc15aa

Browse files
authored
Merge pull request #68 from jomjol/rolling
Update to v4.1.1
2 parents 8f5200e + c9c02da commit ffc15aa

File tree

11 files changed

+1197
-31
lines changed

11 files changed

+1197
-31
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ A 3d-printable housing can be found here: https://www.thingiverse.com/thing:4571
2525

2626
**General remark:** Beside the `firmware.bin`, typically also the content of `/html` needs to be updated!
2727

28+
##### 4.1.1 Configuration editor - (2020-12-02)
2829

30+
* Bug fixing: internal improvement of file handling (reduce not responding)
2931

30-
##### 4.1.0 Configuration editor- (2020-11-30)
32+
33+
34+
##### 4.1.0 Configuration editor - (2020-11-30)
3135

3236
* Implementation of configuration editor (including basic and expert mode)
3337

code/components/jomjol_flowcontroll/ClassFlowMQTT.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ bool ClassFlowMQTT::doFlow(string zwtime)
126126
}
127127

128128
OldValue = result;
129-
130-
129+
131130
return true;
132131
}

code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "ClassFlowAnalog.h"
55
#include "ClassFlowDigit.h"
66
#include "ClassFlowMakeImage.h"
7+
#include "ClassLogFile.h"
78

89
#include <iomanip>
910
#include <sstream>
@@ -42,6 +43,7 @@ bool ClassFlowPostProcessing::LoadPreValue(void)
4243
zwtime = trim(std::string(zw));
4344

4445
fgets(zw, 1024, pFile);
46+
fclose(pFile);
4547
printf("%s", zw);
4648
zwvalue = trim(std::string(zw));
4749
PreValue = stof(zwvalue.c_str());
@@ -103,17 +105,15 @@ void ClassFlowPostProcessing::SavePreValue(float value, string zwtime)
103105
timeinfo = localtime(&rawtime);
104106

105107
strftime(buffer, 80, "%Y-%m-%d_%H-%M-%S", timeinfo);
106-
107108
zwtime = std::string(buffer);
108109
}
109110

110-
fputs(zwtime.c_str(), pFile);
111-
fputs("\n", pFile);
112-
113-
fputs(to_string(value).c_str(), pFile);
114-
fputs("\n", pFile);
111+
fputs(zwtime.c_str(), pFile);
112+
fputs("\n", pFile);
113+
fputs(to_string(value).c_str(), pFile);
114+
fputs("\n", pFile);
115115

116-
fclose(pFile);
116+
fclose(pFile);
117117
}
118118

119119

@@ -269,6 +269,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
269269

270270
ErrorMessageText = "";
271271

272+
272273
for (int i = 0; i < ListFlowControll->size(); ++i)
273274
{
274275
if (((*ListFlowControll)[i])->name().compare("ClassFlowMakeImage") == 0)
@@ -312,6 +313,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
312313

313314
ReturnRawValue = ShiftDecimal(ReturnRawValue, DecimalShift);
314315

316+
315317
if (!PreValueUse || !PreValueOkay)
316318
{
317319
ReturnValue = ReturnRawValue;
@@ -336,7 +338,6 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
336338

337339
zw = ErsetzteN(ReturnRawValue);
338340

339-
340341
Value = std::stof(zw);
341342
if (checkDigitIncreaseConsistency)
342343
{
@@ -367,10 +368,10 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
367368
if (ErrorMessageText.length() == 0)
368369
{
369370
PreValue = Value;
371+
370372
SavePreValue(Value, zwtime);
373+
371374
}
372-
373-
374375
return true;
375376
}
376377

code/components/jomjol_time_sntp/time_sntp.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,7 @@ std::string gettimestring(const char * frm)
4848
time_t now;
4949
struct tm timeinfo;
5050
time(&now);
51-
localtime_r(&now, &timeinfo);
52-
// Is time set? If not, tm_year will be (1970 - 1900).
53-
if (timeinfo.tm_year < (2016 - 1900)) {
54-
ESP_LOGI(TAG, "Reboot - Connecting to WiFi and getting time over NTP.");
55-
obtain_time();
56-
// update 'now' variable with current time
57-
time(&now);
58-
}
5951
char strftime_buf[64];
60-
61-
// setenv("TZ", "UTC-2", 1);
62-
// tzset();
6352
localtime_r(&now, &timeinfo);
6453
strftime(strftime_buf, sizeof(strftime_buf), frm, &timeinfo);
6554

@@ -119,6 +108,8 @@ static void obtain_time(void)
119108
struct tm timeinfo = {};
120109
int retry = 0;
121110
const int retry_count = 10;
111+
time(&now);
112+
localtime_r(&now, &timeinfo);
122113
while (sntp_get_sync_status() == SNTP_SYNC_STATUS_RESET && ++retry < retry_count) {
123114
ESP_LOGI(TAG, "Waiting for system time to be set... (%d/%d)", retry, retry_count);
124115
vTaskDelay(2000 / portTICK_PERIOD_MS);

code/sdkconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ CONFIG_FATFS_MAX_LFN=255
537537
CONFIG_FATFS_API_ENCODING_ANSI_OEM=y
538538
# CONFIG_FATFS_API_ENCODING_UTF_16 is not set
539539
# CONFIG_FATFS_API_ENCODING_UTF_8 is not set
540-
CONFIG_FATFS_FS_LOCK=0
540+
CONFIG_FATFS_FS_LOCK=5
541541
CONFIG_FATFS_TIMEOUT_MS=10000
542542
CONFIG_FATFS_PER_FILE_CACHE=y
543543
CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y

0 commit comments

Comments
 (0)