Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Fixed bitmap-printing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
PaintYourDragon committed Aug 30, 2012
1 parent b766e75 commit bca51e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Adafruit_Thermal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,14 @@ void Adafruit_Thermal::printBitmap(int w, int h, const uint8_t *bitmap) {
rowBytes = (w + 7) / 8; // Round up to next byte boundary
rowBytesClipped = (rowBytes >= 48) ? 48 : rowBytes; // 384 pixels max width

for(rowStart=0; rowStart < h; rowStart += 255) {
for(i=rowStart=0; rowStart < h; rowStart += 255) {
// Issue up to 255 rows at a time:
chunkHeight = h - rowStart;
if(chunkHeight > 255) chunkHeight = 255;

writeBytes(18, 42, chunkHeight, rowBytesClipped);

for(i=y=0; y < chunkHeight; y++) {
for(y=0; y < chunkHeight; y++) {
for(x=0; x < rowBytesClipped; x++, i++) {
PRINTER_PRINT(pgm_read_byte(bitmap + i));
}
Expand Down

0 comments on commit bca51e6

Please sign in to comment.