From 08e576051374001f6e4a13014cd62ce090e4dc50 Mon Sep 17 00:00:00 2001 From: TragicPancake <74947314+TragicPancake@users.noreply.github.com> Date: Wed, 2 Jun 2021 23:57:12 -0600 Subject: [PATCH] Fix compiler warning from setCursor I've been working on a project that uses this library and figured I could give back to the community by fixing this compiler warning. On line 347 the max function is used to set a lower limit, but the input data is of type byte. In the arduino environment byte equates to uint8_t and so can never be less than 0 and thus causes a compiler warning. --- src/SerLCD.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/SerLCD.cpp b/src/SerLCD.cpp index a84301c..83c901c 100644 --- a/src/SerLCD.cpp +++ b/src/SerLCD.cpp @@ -343,8 +343,6 @@ void SerLCD::setCursor(byte col, byte row) int row_offsets[] = {0x00, 0x40, 0x14, 0x54}; //kepp variables in bounds - //Explicitly cast numeric literals to type byte to avoid ESP32 and ESP8266 compile errors - row = max((byte) 0, row); //row cannot be less than 0 row = min(row, (byte)(MAX_ROWS - 1)); //row cannot be greater than max rows //send the command @@ -775,4 +773,4 @@ void SerLCD::setAddress(byte new_addr) byte SerLCD::getAddress() { return _i2cAddr; -} //getAddress \ No newline at end of file +} //getAddress