Skip to content

Commit e60d6af

Browse files
committed
Fix compilation for ESP32/8266.
1 parent aa34d3d commit e60d6af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ArduinoIoTCloudTCP.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker()
358358
}
359359

360360
_last_connection_attempt_cnt++;
361-
unsigned long const reconnection_retry_delay = min(AIOT_CONFIG_MAX_RECONNECTION_RETRY_DELAY_ms, pow(2, _last_connection_attempt_cnt) * AIOT_CONFIG_RECONNECTION_RETRY_DELAY_ms);
361+
unsigned long const reconnection_retry_delay = min(static_cast<unsigned long>(AIOT_CONFIG_MAX_RECONNECTION_RETRY_DELAY_ms), static_cast<unsigned long>(pow(2, _last_connection_attempt_cnt) * AIOT_CONFIG_RECONNECTION_RETRY_DELAY_ms));
362362
_next_connection_attempt_tick = millis() + reconnection_retry_delay;
363363

364364
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not connect to %s:%d", __FUNCTION__, _brokerAddress.c_str(), _brokerPort);

0 commit comments

Comments
 (0)