Skip to content

Commit

Permalink
Merge pull request #226 from patfreeman/overflow
Browse files Browse the repository at this point in the history
millis() overflow fix to mqtt connection
  • Loading branch information
gysmo38 authored Aug 3, 2023
2 parents 29d7174 + c4580b0 commit 1e49de5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mitsubishi2mqtt/mitsubishi2mqtt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1844,7 +1844,7 @@ void loop() {
//MQTT failed retry to connect
if (mqtt_client.state() < MQTT_CONNECTED)
{
if ((millis() > (lastMqttRetry + MQTT_RETRY_INTERVAL_MS)) or lastMqttRetry == 0) {
if ((millis() - lastMqttRetry > MQTT_RETRY_INTERVAL_MS) or lastMqttRetry == 0) {
mqttConnect();
}
}
Expand Down

0 comments on commit 1e49de5

Please sign in to comment.