Skip to content

Commit fd91150

Browse files
committed
temp saving
1 parent 90f74d9 commit fd91150

16 files changed

+10376
-18
lines changed

platformio.ini

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
; http://docs.platformio.org/page/projectconf.html
1010

1111
[platformio]
12-
env_default = nodemcuv2-newui-spanish
12+
env_default = nodemcuv2-newui
1313
;env_default = nodemcuv2, nodemcuv2-ptc, oled, thorrax, sonoff, sonoffota, ioexpander
1414

1515
[common_env_data]
@@ -26,7 +26,7 @@ board = nodemcuv2
2626
framework = arduino
2727
lib_extra_dirs = ./lib_async.legacy
2828
build_flags = -Wl,-Tesp8266.flash.4m.ld -DLegacyEspAsyncLibraries=true
29-
; -DSerialDebug=true
29+
-DSerialDebug=true
3030
; -DOLED_LCD=true
3131
; -DFORCE_KEEPALIVE=true
3232
; -DEanbleParasiteTempControl=true
@@ -46,18 +46,20 @@ build_flags = -Wl,-Tesp8266.flash.4m.ld -DLegacyEspAsyncLibraries=true
4646
monitor_speed = 115200
4747
lib_deps = ${common_env_data.lib_deps_external}
4848

49-
[env:nodemcuv2-newui]
50-
platform = espressif8266@~1.8
51-
board = nodemcuv2
49+
[env:nodemcuv2-newui]
50+
;not yet working
51+
platform = espressif8266@~1.8.0
52+
board = d1_mini
5253
framework = arduino
5354
lib_extra_dirs = ./lib_async
54-
build_flags = -Wl,-Tesp8266.flash.4m2m.ld
55+
build_flags = -Wl,-Tesp8266.flash.4m.ld
5556
-DUseNewFrontEnd=true
5657

5758
monitor_speed = 115200
5859
lib_deps = ${common_env_data.lib_deps_external}
5960

6061
[env:nodemcuv2-newui-spanish]
62+
;not yet working
6163
platform = espressif8266@~1.8
6264
board = nodemcuv2
6365
framework = arduino

src/BrewKeeper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ bool BrewProfile::checkCondition(unsigned long time,Gravity gravity){
174174
return false;
175175
}
176176

177-
float BrewProfile::tempByTimeGravity(unsigned long time,Gravity gravity)
177+
float BrewProfile::tempByTimeGravity(time_t time,Gravity gravity)
178178
{
179179
if(time < _schedule->startDay) return INVALID_CONTROL_TEMP;
180180

src/BrewKeeper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class BrewProfile
3232
}
3333
void setUnit(char unit);
3434
void setOriginalGravityPoint(uint16_t gravity);
35-
float tempByTimeGravity(unsigned long time,Gravity gravity);
35+
float tempByTimeGravity(time_t time,Gravity gravity);
3636
void setStableThreshold(uint8_t threshold){ _stableThreshold=threshold; }
3737
void profileUpdated();
3838
};

src/BrewLogger.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ BrewLogger::BrewLogger(void){
121121
*/
122122
int dataRead;
123123
size_t offset=0;
124-
int processIndex;
124+
int processIndex=0;
125125
uint8_t tag, mask;
126126

127127

@@ -166,7 +166,7 @@ BrewLogger::BrewLogger(void){
166166
if(mask & bitmask)
167167
recordSize +=2;
168168

169-
if (dataRead-processIndex < recordSize ){
169+
if (dataRead-processIndex < (int) recordSize ){
170170
processIndex -= 2;
171171
break;
172172
}
@@ -497,7 +497,7 @@ BrewLogger::BrewLogger(void){
497497
size_t BrewLogger::volatileDataAvailable(size_t start,size_t offset)
498498
{
499499
// get size;
500-
size_t dataAvail=(_logHead <= _logIndex)? (_logIndex-_logHead):(LogBufferSize + _logIndex - _logHead);
500+
size_t dataAvail=(_logHead <= (int)_logIndex)? (_logIndex-_logHead):(LogBufferSize + _logIndex - _logHead);
501501
dataAvail += VolatileHeaderSize; // for make-up header
502502
//DBG_PRINTF("volatileDataAvailable,start:%d, offset:%d, _logHead %d _logIndex %d, _startOffset:%d, dataAvail:%d\n",start, offset,_logHead,_logIndex,_startOffset, dataAvail);
503503
if( ((start + offset) == 0)
@@ -723,7 +723,7 @@ BrewLogger::BrewLogger(void){
723723
int BrewLogger::freeBufferSpace(void)
724724
{
725725
//DBG_PRINTF("_logHead:%d, _logIndex: %d\n",_logHead,_logIndex);
726-
if(_logIndex >= _logHead){
726+
if(_logIndex >= (size_t)_logHead){
727727
return LogBufferSize - _logIndex -1 + _logHead;
728728
}else {
729729
// _logIndex < _logHead

src/BrewPiLess.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ void greeting(std::function<void(const char*)> sendFunc)
689689
sprintf(buf,"A:{\"nn\":\"%s\",\"ver\":\"%s\",\"rssi\":%d,\
690690
\"tm\":%lu,\"off\":%ld, \"log\":\"%s\",\"cap\":{%s}}"
691691
,syscfg->titlelabel,BPL_VERSION,WiFi.RSSI(),
692-
TimeKeeper.getTimeSeconds(),TimeKeeper.getTimezoneOffset(),
692+
TimeKeeper.getTimeSeconds(),(long int)TimeKeeper.getTimezoneOffset(),
693693
logname, capstate.c_str());
694694

695695
#else

src/DataLogger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ int DataLogger::dataSprintf(char *buffer,const char *format)
3737

3838
int i=0;
3939
int d=0;
40-
for(i=0;i< strlen(format);i++){
40+
for(i=0;i< (int) strlen(format);i++){
4141
char ch=format[i];
4242
if( ch == '%'){
4343
i++;

src/DisplayLcd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static const char STR_empty_string[] PROGMEM = "";
5656

5757
void LcdDisplay::init(void){
5858
#ifdef BREWPI_IIC_LCD
59-
Wire.begin(PIN_SDA,PIN_SCL);
59+
// Wire.begin(PIN_SDA,PIN_SCL);
6060
#endif
6161
stateOnDisplay = 0xFF; // set to unknown state to force update
6262
flags = LCD_FLAG_ALTERNATE_ROOM;

src/ESPUpdateServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static bool handleFileRead(String path){
153153
if(SPIFFS.exists(pathWithGz))
154154
path += ".gz";
155155
File file = SPIFFS.open(path, "r");
156-
size_t sent = server.streamFile(file, contentType);
156+
/*size_t sent = */ server.streamFile(file, contentType);
157157
file.close();
158158
return true;
159159
}

src/IicLcd.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ void IIClcd::init(){
9393

9494
void IIClcd::init_priv()
9595
{
96-
#ifdef ESP8266
97-
Wire.begin();
96+
#ifdef ESP8266
97+
98+
Wire.begin(PIN_SDA,PIN_SCL);
9899
#if LCD_AUTO_ADDRESSING == true
99100
scanForAddress();
100101
#endif

0 commit comments

Comments
 (0)