fixes
This commit is contained in:
parent
859dcf5f24
commit
5a9ff398a4
@ -8,8 +8,8 @@
|
||||
#ifndef DEFINES_H_
|
||||
#define DEFINES_H_
|
||||
|
||||
#define DEBUG
|
||||
//#define SLEEP
|
||||
// #define DEBUG
|
||||
#define SLEEP
|
||||
|
||||
#define EEPROM_ADDR 0
|
||||
|
||||
|
@ -75,15 +75,20 @@ void read_thermometer() {
|
||||
}
|
||||
|
||||
void loopApplication() {
|
||||
static uint32_t lastMillis = 0;
|
||||
mqttLoop();
|
||||
|
||||
#ifndef SLEEP
|
||||
static uint32_t lastMillis = 0;
|
||||
uint32_t currentMillis = millis();
|
||||
if (currentMillis - lastMillis > 1000) {
|
||||
if (currentMillis - lastMillis > (configBlock.measurePeriod * 1000)) {
|
||||
lastMillis = currentMillis;
|
||||
#endif
|
||||
|
||||
read_thermometer();
|
||||
|
||||
#ifndef SLEEP
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SLEEP
|
||||
@ -93,7 +98,6 @@ void loopApplication() {
|
||||
mqttClient.disconnect();
|
||||
ESP.deepSleep(configBlock.measurePeriod * 1000000);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user