[X7] fix #5911 and bmp loading (#6703)

* lcdDraw1bitBitmap now bit exact

* bmp rows are padded up to a multiple of 4 bytes
This commit is contained in:
Raphael Coeffic
2019-09-03 07:11:20 +02:00
committed by Bertrand Songis
parent 56127e5808
commit 27946ee92b
3 changed files with 24 additions and 4 deletions
+2 -1
View File
@@ -129,10 +129,11 @@ uint8_t * lcdLoadBitmap(uint8_t * bmp, const char * filename, uint8_t width, uin
memset(dest, 0, BITMAP_BUFFER_SIZE(w, h) - 2);
uint8_t rowSize = (w + 7) / 8;
uint8_t rowSize;
switch (depth) {
case 1:
rowSize = ((w + 31) / 32) * 4;
for (int8_t i=h-1; i>=0; i--) {
result = f_read(&bmpFile, buf, rowSize, &read);
if (result != FR_OK || read != rowSize) {