Skip to content

Commit

Permalink
Merge pull request #38 from sparkfun/release_candidate
Browse files Browse the repository at this point in the history
v1.3.3 - fix compiler warnings
  • Loading branch information
PaulZC authored May 8, 2021
2 parents 176c71f + acbf9a6 commit f3f475d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
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 <techsupport@sparkfun.com>
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

0 comments on commit f3f475d

Please sign in to comment.