Add custom bootlogo_template.h

This commit is contained in:
fvanroie 2021-06-15 23:17:01 +02:00
parent 63793a957b
commit 233cb53f8c
6 changed files with 43 additions and 7 deletions

1
.gitignore vendored
View File

@ -18,6 +18,7 @@ build_output/firmware/*.bin
build_output/firmware/*.exe
src/custom/*
!src/custom/README.md
!src/custom/bootlogo_template.h
## Test result files
*.xml

View File

@ -54,7 +54,7 @@ TFT_Class tft(io, controller, TFT_WIDTH, TFT_HEIGHT);
#include <GxCTRL/GxCTRL_ILI9341/GxCTRL_ILI9341.h> // 240x320
#include "GxReadRegisters.h"
#include "bootscreen.h" // Sketch tab header for xbm images
#include "custom/bootlogo_template.h" // Sketch tab header for xbm images
/*********************
* DEFINES

View File

@ -0,0 +1,38 @@
// Images can be converted to XBM format by using the online converter here:
// https://www.online-utility.org/image/convert/to/XBM
// The output must be pasted in a header file, renamed and adjusted to appear
// as as a const unsigned char array in PROGMEM (FLASH program memory).
// The xbm format adds padding to pixel rows so they are a whole number of bytes
// In this example 93 pixel width means 96 bits = 12 bytes
// the 16 height then means array uses 12 x 16 = 192 bytes of FLASH
// The library ignores the padding bits when drawing the image on the display.
// The openHASP logo uses the MaterialDesign icons font, released under the OFL license
// Usage:
// - Copy this file to src/custom/bootlogo.h
// - Add #define HASP_CUSTOMIZE_BOOTLOGO to include/user_config_override.h
// RGB array
#define logoBgColor {0,128,128}
#define logoFgColor {255,255,255}
#define logoWidth 93
#define logoHeight 16
// Image is stored in the array below, also update the width and height accordingly
PROGMEM const unsigned char logoImage[] = {
0x7C, 0xF0, 0x07, 0xFF, 0x71, 0x1C, 0xC7, 0xC1, 0x07, 0xFC, 0xF1, 0x07, 0xFE, 0xF0, 0x0F, 0xFF, 0xF1, 0x1C,
0xC7, 0xE1, 0x0F, 0xFE, 0xF1, 0x0F, 0xFF, 0xF1, 0x1F, 0xFF, 0xF1, 0x1C, 0xC7, 0xF1, 0x1F, 0xFF, 0xF1, 0x1F,
0xC7, 0x71, 0x1C, 0x07, 0xF0, 0x1C, 0xC7, 0x71, 0x1C, 0x07, 0x70, 0x1C, 0xC7, 0x71, 0x1C, 0x07, 0xF0, 0x1D,
0xC7, 0x71, 0x1C, 0x07, 0x70, 0x1C, 0xC7, 0x71, 0x1C, 0x07, 0xF0, 0x1D, 0xC7, 0x71, 0x1C, 0x07, 0x70, 0x1C,
0xC7, 0x71, 0x1C, 0x07, 0xF0, 0x1F, 0xC7, 0x71, 0x1C, 0x07, 0x70, 0x1C, 0xC7, 0xF1, 0x1F, 0xFF, 0xF1, 0x1F,
0xFF, 0xF1, 0x1F, 0xFF, 0xF0, 0x1F, 0xC7, 0xF1, 0x0F, 0xFF, 0xF1, 0x1F, 0xFF, 0xF1, 0x1F, 0xFE, 0xF1, 0x0F,
0xC7, 0xF1, 0x07, 0xFF, 0xF1, 0x1F, 0xFF, 0xF1, 0x1F, 0xFC, 0xF1, 0x07, 0xC7, 0x71, 0x00, 0x07, 0x70, 0x1F,
0xC7, 0x71, 0x1C, 0xC0, 0x71, 0x00, 0xC7, 0x71, 0x00, 0x07, 0x70, 0x1F, 0xC7, 0x71, 0x1C, 0xC0, 0x71, 0x00,
0xC7, 0x71, 0x00, 0x07, 0x70, 0x1E, 0xC7, 0x71, 0x1C, 0xC0, 0x71, 0x00, 0xFF, 0x71, 0x00, 0xFF, 0x71, 0x1E,
0xC7, 0x71, 0x1C, 0xFF, 0x71, 0x00, 0xFE, 0x70, 0x00, 0xFF, 0x71, 0x1E, 0xC7, 0x71, 0x1C, 0xFF, 0x71, 0x00,
0x7C, 0x70, 0x00, 0xFF, 0x71, 0x1C, 0xC7, 0x71, 0x1C, 0xFF, 0x70, 0x00,
};

View File

@ -19,7 +19,7 @@
#ifdef HASP_CUSTOMIZE_BOOTLOGO
#include "custom/bootlogo.h" // Sketch tab header for xbm images
#else
#include "bootscreen.h" // Sketch tab header for xbm images
#include "custom/bootlogo_template.h" // Sketch tab header for xbm images
#endif
namespace dev {

View File

@ -133,18 +133,15 @@ void IRAM_ATTR TftEspi::flush_pixels(lv_disp_drv_t* disp, const lv_area_t* area,
{
uint32_t w = (area->x2 - area->x1 + 1);
uint32_t h = (area->y2 - area->y1 + 1);
// size_t len = lv_area_get_size(area);
uint32_t len = w * h;
#ifdef USE_DMA_TO_TFT
tft.startWrite(); /* Start new TFT transaction */
// tft.setWindow(area->x1, area->y1, area->x2, area->y2);
tft.setAddrWindow(area->x1, area->y1, w, h); /* set the working window */
tft.pushPixelsDMA((uint16_t*)color_p, len); /* Write words at once */
tft.endWrite(); /* terminate TFT transaction */
#else
tft.startWrite(); /* Start new TFT transaction */
// tft.setWindow(area->x1, area->y1, area->x2, area->y2);
tft.setAddrWindow(area->x1, area->y1, w, h); /* set the working window */
tft.pushPixels((uint16_t*)color_p, len); /* Write words at once */
tft.endWrite(); /* terminate TFT transaction */

View File

@ -18,7 +18,7 @@
#ifdef HASP_CUSTOMIZE_BOOTLOGO
#include "custom/bootlogo.h" // Sketch tab header for xbm images
#else
#include "bootscreen.h" // Sketch tab header for xbm images
#include "custom/bootlogo_template.h" // Sketch tab header for xbm images
#endif
namespace dev {