diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index a1836e0c4..e5ad559ef 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -8,7 +8,7 @@ option(FLIGHT_MODES "Flight Modes" ON) option(CURVES "Curves" ON) option(GVARS "Global variables" OFF) option(GUI "GUI enabled" ON) -option(SPLASH "Splash enabled" ON) +set(SPLASH "DEFAULT" CACHE STRING "Splash (DEFAULT/OFF/FRSKY)") set(PPM_UNIT "PERCENT_PREC1" CACHE STRING "PPM display unit (US/PERCENT_PREC1/PERCENT_PREC0)") option(PPM_CENTER_ADJUSTABLE "PPM center adjustable" ON) option(PPM_LIMITS_SYMETRICAL "PPM limits symetrical" OFF) @@ -275,7 +275,9 @@ if(DANGEROUS_MODULE_FUNCTIONS) add_definitions(-DDANGEROUS_MODULE_FUNCTIONS) endif() -if(SPLASH) +if(SPLASH STREQUAL FRSKY) + add_definitions(-DSPLASH -DSPLASH_FRSKY) +elseif(NOT SPLASH STREQUAL OFF) add_definitions(-DSPLASH) endif() diff --git a/radio/src/bitmaps/128x64/splash_frsky.png b/radio/src/bitmaps/128x64/splash_frsky.png new file mode 100644 index 000000000..84b3cf5e4 Binary files /dev/null and b/radio/src/bitmaps/128x64/splash_frsky.png differ diff --git a/radio/src/bitmaps/212x64/splash_frsky.png b/radio/src/bitmaps/212x64/splash_frsky.png new file mode 100644 index 000000000..37c410f47 Binary files /dev/null and b/radio/src/bitmaps/212x64/splash_frsky.png differ diff --git a/radio/src/gui/128x64/gui.h b/radio/src/gui/128x64/gui.h index e7e2eb2b4..d15422ce9 100644 --- a/radio/src/gui/128x64/gui.h +++ b/radio/src/gui/128x64/gui.h @@ -441,6 +441,7 @@ void drawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr); extern const pm_uchar sticks[] PROGMEM; void drawSplash(); +void drawSecondSplash(); void drawScreenIndex(uint8_t index, uint8_t count, uint8_t attr); void drawStick(coord_t centrex, int16_t xval, int16_t yval); void drawPotsBars(); diff --git a/radio/src/gui/128x64/splash.cpp b/radio/src/gui/128x64/splash.cpp index 25123da70..8cf1f02dc 100644 --- a/radio/src/gui/128x64/splash.cpp +++ b/radio/src/gui/128x64/splash.cpp @@ -67,3 +67,19 @@ void drawSplash() lcdRefresh(); } #endif + +#if defined(SPLASH_FRSKY) +const pm_uchar splashdata2[] PROGMEM = { + 'S','F','S',0, + #include "bitmaps/128x64/splash_frsky.lbm" + 'S','F','E',0 }; + +const pm_uchar * const splash2_lbm = splashdata2+4; + +void drawSecondSplash() +{ + lcdClear(); + lcd_img(0, 0, splash2_lbm, 0, 0); + lcdRefresh(); +} +#endif diff --git a/radio/src/gui/212x64/gui.h b/radio/src/gui/212x64/gui.h index 4df3756bc..faaa52ecf 100644 --- a/radio/src/gui/212x64/gui.h +++ b/radio/src/gui/212x64/gui.h @@ -69,6 +69,7 @@ extern uint8_t noHighlightCounter; void drawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr); void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr); void drawSplash(); +void drawSecondSplash(); void drawScreenIndex(uint8_t index, uint8_t count, uint8_t attr); void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible); void displayMenuBar(const MenuItem * menu, int index); diff --git a/radio/src/gui/212x64/splash.cpp b/radio/src/gui/212x64/splash.cpp index 8fbdea114..61889ad7e 100644 --- a/radio/src/gui/212x64/splash.cpp +++ b/radio/src/gui/212x64/splash.cpp @@ -42,3 +42,18 @@ void drawSplash() lcdRefresh(); } #endif + +#if defined(SPLASH_FRSKY) +const pm_uchar splashdata2[] PROGMEM = { + 'S','F','S',0, + #include "bitmaps/212x64/splash_frsky.lbm" + 'S','F','E',0 }; +const pm_uchar * const splash2_lbm = splashdata2+4; + +void drawSecondSplash() +{ + lcdClear(); + lcdDrawBitmap(0, 0, splash2_lbm); + lcdRefresh(); +} +#endif \ No newline at end of file diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index dae12cc31..fe445b9cb 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -964,6 +964,14 @@ void doSplash() } #endif +#if defined(SPLASH_FRSKY) + static uint8_t secondSplash = false; + if (!secondSplash && get_tmr10ms() >= tgtime-200) { + secondSplash = true; + drawSecondSplash(); + } +#endif + #if defined(PCBSKY9X) if (curTime < get_tmr10ms()) { curTime += 10;