RLE for greyscale lcd (gives more firmware space!) (#1142)

* use RLE encodes bitmaps on 212x64 pixel radios

* fix model image display
fix icon display

* implement RLE bitmaps in companion for splash image on 212x64 radios
reserve 3kB for RLE bitmaps in firmware

* fix size check

* use defines instead of magic numbers

* fix display of splash screens on 212x64 radios

* add warning message if compressed image is larger than the reserved space
This commit is contained in:
Malte Langermann
2021-12-04 15:06:23 +11:00
committed by GitHub
parent 995e41469e
commit ec01fa8df9
12 changed files with 317 additions and 33 deletions
+11 -6
View File
@@ -22,16 +22,21 @@
#include "opentx.h"
#if defined(SPLASH)
const unsigned char splashdata[] = {
'S','P','S',0,
#include "bitmaps/212x64/splash.lbm"
'S','P','E',0 };
const unsigned char * const splash_lbm = splashdata+4;
#define MAXIMUM_SPLASH_IMAGE_SIZE 3072
struct {
const uint8_t __magic_prefix[4] = { 'S','P','S',0 };
const uint8_t splashdata[MAXIMUM_SPLASH_IMAGE_SIZE] = {
#include "bitmaps/212x64/splash.lbm"
};
const uint8_t __magic_suffix[4] = { 'S','P','E',0 };
} splash_struct;
static_assert(sizeof(splash_struct.splashdata) <= MAXIMUM_SPLASH_IMAGE_SIZE, "");
const unsigned char * const splash_lbm = splash_struct.splashdata;
void drawSplash()
{
lcdClear();
lcdDrawBitmap(0, 0, splash_lbm);
lcdDrawRleBitmap(0, 0, splash_lbm);
#if MENUS_LOCK == 1
if (readonly == false) {