sparkfun / SparkFun_SerLCD_Arduino_Library

A library to seamlessly control the SparkFun SerLCD over I2C, SPI, and Serial.
MIT License
23 stars 10 forks source link

Explicitly cast numeric literals to type byte to avoid ESP32 and ESP8266 compile errors #7

Closed fourstix closed 4 years ago

fourstix commented 4 years ago

This is the correct pull request to merge. It only changes one file with the fixed lines.

This is a fix for issue #6. The ESP32 and ESP8266 code uses templates to define the min/max function. This causes a compile error because the numerical literals are of implicit type (int) being compared to a byte parameter.

Even though the types are compatible, this type mismatch causes a compile error in the template used to define the min/max function in the ESP32 and ESP8266 code.

This fix explicitly casts the numeric literals in min() and max() to type (byte) and eliminate the compile error.

fourstix commented 4 years ago

Closing to fix comment and re-submit a new pull request.