From 19c3e83dbfd54b1d63356ece9dad80bb2882a77f Mon Sep 17 00:00:00 2001 From: Mike Lowe Date: Tue, 12 Mar 2024 13:00:15 -0300 Subject: [PATCH] Left-shift additional bytes by 'neededBits - remainingBits' instead of 'kByteNBits - remainingBits' --- src/qwiic_grssd1306.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qwiic_grssd1306.cpp b/src/qwiic_grssd1306.cpp index d298dd7..12d68da 100644 --- a/src/qwiic_grssd1306.cpp +++ b/src/qwiic_grssd1306.cpp @@ -880,7 +880,7 @@ void QwGrSSD1306::drawBitmap(uint8_t x0, uint8_t y0, uint8_t dst_width, if (remainingBits) // more data to add from the next byte in this column bmp_data |= (pBitmap[bmp_width * (bmpPage + 1) + bmp_x] & bmp_mask[1]) - << (kByteNBits - remainingBits); + << (neededBits - remainingBits); // Write the bmp data to the graphics buffer - using current write op. // Note, if the location in the buffer didn't start at bit 0, we shift