Replace millis() with esp_timer_get_time() (#423)

This commit is contained in:
iranl
2024-07-15 17:16:43 +02:00
committed by GitHub
parent 8e5e47b102
commit 77ddef76af
22 changed files with 171 additions and 145 deletions

View File

@@ -62,6 +62,7 @@ public:
void publishInt(const char* prefix, const char* topic, const int value, bool retain);
void publishUInt(const char* prefix, const char* topic, const unsigned int value, bool retain);
void publishULong(const char* prefix, const char* topic, const unsigned long value, bool retain);
void publishLongLong(const char* prefix, const char* topic, int64_t value, bool retain);
void publishBool(const char* prefix, const char* topic, const bool value, bool retain);
bool publishString(const char* prefix, const char* topic, const char* value, bool retain);
@@ -162,7 +163,7 @@ private:
bool _connectReplyReceived = false;
bool _firstDisconnected = true;
unsigned long _nextReconnect = 0;
int64_t _nextReconnect = 0;
char _mqttBrokerAddr[101] = {0};
char _mqttUser[31] = {0};
char _mqttPass[31] = {0};
@@ -176,17 +177,16 @@ private:
bool _logIp = true;
std::vector<String> _subscribedTopics;
std::map<String, String> _initTopics;
unsigned long _lastConnectedTs = 0;
unsigned long _lastMaintenanceTs = 0;
unsigned long _lastUpdateCheckTs = 0;
#if PRESENCE_DETECTION_ENABLED
unsigned long _lastPresenceTs = 0;
#endif
unsigned long _lastRssiTs = 0;
int64_t _lastConnectedTs = 0;
int64_t _lastMaintenanceTs = 0;
int64_t _lastUpdateCheckTs = 0;
#if PRESENCE_DETECTION_ENABLED
int64_t _lastPresenceTs = 0;
#endif
int64_t _lastRssiTs = 0;
bool _mqttEnabled = true;
long _rssiPublishInterval = 0;
std::map<uint8_t, unsigned long> _gpioTs;
int _rssiPublishInterval = 0;
std::map<uint8_t, int64_t> _gpioTs;
char* _buffer;
const size_t _bufferSize;