Merge pull request #107 from jerryneedell/patch-1

Update Adafruit_MQTT_Client.cpp to remove use of min()
This commit is contained in:
Limor "Ladyada" Fried 2018-01-06 19:46:31 -05:00 committed by GitHub
commit a3f09cfa4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ bool Adafruit_MQTT_Client::sendPacket(uint8_t *buffer, uint16_t len) {
if (client->connected()) {
// send 250 bytes at most at a time, can adjust this later based on Client
uint16_t sendlen = min(len, (uint16_t)250);
uint16_t sendlen = len > 250 ? 250 : len;
//Serial.print("Sending: "); Serial.println(sendlen);
ret = client->write(buffer, sendlen);
DEBUG_PRINT(F("Client sendPacket returned: ")); DEBUG_PRINTLN(ret);