Skip to content

v1.3.3 - fix compiler warnings #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SparkFun Micro OLED Breakout",
"version": "1.3.2",
"version": "1.3.3",
"keywords": "display oled",
"description": "Library for the SparkFun Micro OLED Breakout",
"repository":
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SparkFun Micro OLED Breakout
version=1.3.2
version=1.3.3
author=SparkFun Electronics <[email protected]>
maintainer=SparkFun Electronics <sparkfun.com>
sentence=Library for the <a href="https://www.sparkfun.com/products/13003">SparkFun Micro OLED Breakout</a>.
Expand Down
8 changes: 6 additions & 2 deletions src/SFE_MicroOLED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ Draw color pixel in the screen buffer's x,y position with NORM or XOR draw mode.
*/
void MicroOLED::pixel(uint8_t x, uint8_t y, uint8_t color, uint8_t mode)
{
if ((x < 0) || (x >= LCDWIDTH) || (y < 0) || (y >= LCDHEIGHT))
if ((x >= LCDWIDTH) || (y >= LCDHEIGHT))
return;

if (mode == XOR)
Expand Down Expand Up @@ -1059,7 +1059,9 @@ uint8_t MicroOLED::getFontType(void)
*/
uint8_t MicroOLED::setFontType(uint8_t type)
{
if ((type >= MAXFONTS) || (fontsPointer[type] == NULL))
if (type >= MAXFONTS)
return false;
if (fontsPointer[type] == NULL)
return false;

fontType = type;
Expand Down Expand Up @@ -1313,6 +1315,8 @@ void MicroOLED::drawBitmap(uint8_t *bitArray)
//Use http://en.radzio.dxp.pl/bitmap_converter/ to generate output
//Make sure the bitmap is n*8 pixels tall (pad white pixels to lower area as needed)
//Otherwise the bitmap bitmap_converter will compress some of the bytes together
//TO DO: fix compiler warning re. iconHeight being unused. Maybe use it to check if
// the icon will fit on the screen?
void MicroOLED::drawIcon(uint8_t offsetX, uint8_t offsetY, uint8_t iconWidth, uint8_t iconHeight, uint8_t *bitArray, uint8_t arraySizeInBytes, bool overwrite)
{
uint8_t columnNumber = offsetX;
Expand Down
2 changes: 1 addition & 1 deletion src/hardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ boolean MicroOLED::i2cWriteMultiple(uint8_t address, uint8_t *dataBytes, size_t
while (bytesLeftToWrite > 0)
{
size_t bytesToWrite; // Limit bytesToWrite to i2cTransactionSize
if (bytesLeftToWrite > (i2cTransactionSize - 1))
if (bytesLeftToWrite > ((size_t)i2cTransactionSize - 1))
bytesToWrite = i2cTransactionSize - 1;
else
bytesToWrite = bytesLeftToWrite;
Expand Down