fix(bw212): SD card image viewer may show corrupted image (#7416)
This commit is contained in:
@@ -191,6 +191,15 @@ uint8_t * lcdLoadBitmap(uint8_t * bmp, const char * filename, uint16_t width, ui
|
||||
|
||||
uint8_t modelBitmap[MODEL_BITMAP_SIZE] __DMA;
|
||||
|
||||
void loadLogoBitmap(uint8_t* bitmap)
|
||||
{
|
||||
RleBitmap pic(logo_taranis, 0);
|
||||
*bitmap++ = pic.getWidth();
|
||||
*bitmap++ = pic.getRawRows();
|
||||
for(int i=0; i < MODEL_BITMAP_SIZE-2; i++)
|
||||
*bitmap++ = pic.getNext();
|
||||
}
|
||||
|
||||
bool loadModelBitmap(char * name, uint8_t * bitmap)
|
||||
{
|
||||
uint8_t len = zlen(name, LEN_BITMAP_NAME);
|
||||
@@ -204,10 +213,6 @@ bool loadModelBitmap(char * name, uint8_t * bitmap)
|
||||
}
|
||||
|
||||
// In all error cases, we set the default logo
|
||||
RleBitmap pic(logo_taranis, 0);
|
||||
*bitmap++ = pic.getWidth();
|
||||
*bitmap++ = pic.getRawRows();
|
||||
for(int i=0; i < MODEL_BITMAP_SIZE-2; i++)
|
||||
*bitmap++ = pic.getNext();
|
||||
loadLogoBitmap(bitmap);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
extern uint8_t modelBitmap[MODEL_BITMAP_SIZE];
|
||||
bool loadModelBitmap(char * name, uint8_t * bitmap);
|
||||
void loadLogoBitmap(uint8_t* bitmap);
|
||||
|
||||
void drawColumnHeader(const char * const * headers, uint8_t index);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user