From 8e0ed1482f74bd11821bd2cda081e1977a6b06cc Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Sat, 15 May 2021 11:22:33 +0200 Subject: [PATCH] Load calibration bitmaps from flash memory --- radio/src/bitmaps/480x272/CMakeLists.txt | 2 +- .../default_theme/alpha_stick_background.png} | Bin .../480x272/default_theme/alpha_stick_pointer.png} | Bin .../default_theme/alpha_trackp_background.png} | Bin radio/src/gui/colorlcd/themes/480_bitmaps.h | 9 +++++++++ radio/src/gui/colorlcd/themes/480_default.cpp | 10 ++++++---- 6 files changed, 16 insertions(+), 5 deletions(-) rename radio/{sdcard/horus/THEMES/EdgeTX/stick_background.png => src/bitmaps/480x272/default_theme/alpha_stick_background.png} (100%) rename radio/{sdcard/horus/THEMES/EdgeTX/stick_pointer.png => src/bitmaps/480x272/default_theme/alpha_stick_pointer.png} (100%) rename radio/{sdcard/horus/THEMES/EdgeTX/trackp_background.png => src/bitmaps/480x272/default_theme/alpha_trackp_background.png} (100%) diff --git a/radio/src/bitmaps/480x272/CMakeLists.txt b/radio/src/bitmaps/480x272/CMakeLists.txt index 4b413dcdc..b24d5528e 100644 --- a/radio/src/bitmaps/480x272/CMakeLists.txt +++ b/radio/src/bitmaps/480x272/CMakeLists.txt @@ -31,7 +31,7 @@ add_bitmaps_target(${BITMAP_TARGET_PREFIX}_fonts ${RADIO_SRC_DIR}/fonts/truetype add_bitmaps_target(${BITMAP_TARGET_PREFIX}_volume_masks ${RADIO_SRC_DIR}/bitmaps/480x272/volume/*.png 8bits "${MASK_ARGS}") add_bitmaps_target(${BITMAP_TARGET_PREFIX}_themes_masks "${RADIO_SRC_DIR}/bitmaps/480x272/default_theme/mask_*.png" 8bits "${BITMAPS_ARGS}") -add_bitmaps_target(${BITMAP_TARGET_PREFIX}_themes_alpha "${RADIO_SRC_DIR}/bitmaps/480x272/default_theme/alpha_*.png" "4/4/4/4" "${BITMAPS_ARGS}") +add_png_target(${BITMAP_TARGET_PREFIX}_themes_alpha "${RADIO_SRC_DIR}/bitmaps/480x272/default_theme/alpha_*.png") add_bitmaps_target(${BITMAP_TARGET_PREFIX}_bootloader_bitmaps ${RADIO_SRC_DIR}/bitmaps/480x272/bootloader/bmp_*.png "4/4/4/4" "${BITMAP_RLE_ARGS}") add_bitmaps_target(${BITMAP_TARGET_PREFIX}_bootloader_icons ${RADIO_SRC_DIR}/bitmaps/480x272/bootloader/icon_*.png 8bits "${MASK_ARGS}") diff --git a/radio/sdcard/horus/THEMES/EdgeTX/stick_background.png b/radio/src/bitmaps/480x272/default_theme/alpha_stick_background.png similarity index 100% rename from radio/sdcard/horus/THEMES/EdgeTX/stick_background.png rename to radio/src/bitmaps/480x272/default_theme/alpha_stick_background.png diff --git a/radio/sdcard/horus/THEMES/EdgeTX/stick_pointer.png b/radio/src/bitmaps/480x272/default_theme/alpha_stick_pointer.png similarity index 100% rename from radio/sdcard/horus/THEMES/EdgeTX/stick_pointer.png rename to radio/src/bitmaps/480x272/default_theme/alpha_stick_pointer.png diff --git a/radio/sdcard/horus/THEMES/EdgeTX/trackp_background.png b/radio/src/bitmaps/480x272/default_theme/alpha_trackp_background.png similarity index 100% rename from radio/sdcard/horus/THEMES/EdgeTX/trackp_background.png rename to radio/src/bitmaps/480x272/default_theme/alpha_trackp_background.png diff --git a/radio/src/gui/colorlcd/themes/480_bitmaps.h b/radio/src/gui/colorlcd/themes/480_bitmaps.h index 06cd21f5f..4fc6e5494 100644 --- a/radio/src/gui/colorlcd/themes/480_bitmaps.h +++ b/radio/src/gui/colorlcd/themes/480_bitmaps.h @@ -217,3 +217,12 @@ const uint8_t mask_theme_view7[] = { const uint8_t mask_theme_view8[] = { #include "mask_theme_view8.lbm" }; +const uint8_t stick_pointer[] = { +#include "alpha_stick_pointer.lbm" +}; +const uint8_t stick_background[] = { +#include "alpha_stick_background.lbm" +}; +const uint8_t trackp_background[] = { +#include "alpha_trackp_background.lbm" +}; diff --git a/radio/src/gui/colorlcd/themes/480_default.cpp b/radio/src/gui/colorlcd/themes/480_default.cpp index 2f7866cf3..97b6ebe79 100644 --- a/radio/src/gui/colorlcd/themes/480_default.cpp +++ b/radio/src/gui/colorlcd/themes/480_default.cpp @@ -201,14 +201,16 @@ class Theme480: public OpenTxTheme { // Calibration screen delete calibStick; - calibStick = BitmapBuffer::loadBitmap(getFilePath("stick_pointer.png")); + calibStick = + BitmapBuffer::loadRamBitmap(stick_pointer, sizeof(stick_pointer)); delete calibStickBackground; - calibStickBackground = BitmapBuffer::loadBitmap(getFilePath("stick_background.png")); + calibStickBackground = BitmapBuffer::loadRamBitmap( + stick_background, sizeof(stick_background)); delete calibTrackpBackground; - calibTrackpBackground = BitmapBuffer::loadBitmap(getFilePath("trackp_background.png")); - + calibTrackpBackground = BitmapBuffer::loadRamBitmap( + trackp_background, sizeof(trackp_background)); // Model Selection screen delete modelselIconBitmap;