waveshare: fix RGB for some screensizes

This commit is contained in:
Philippe Teuwen 2020-09-14 09:48:33 +02:00
parent 9247613c0b
commit 3146305de1

View file

@ -216,8 +216,8 @@ static int read_bmp_rgb(const uint8_t *bmp, const size_t bmpsize, uint8_t **blac
Black_data = Black_data << 1;
Red_data = Red_data << 1;
}
// Skip BMP line padding
offset+=(((pbmpheader->BMP_Width*3/4)+1)*4)-pbmpheader->BMP_Width*3;
// Skip BMP line padding: we accumulate 3* %4 per line and need one more %4 as padding
offset += pbmpheader->BMP_Width % 4;
}
return PM3_SUCCESS;
}