Add invert_display runtime option

This commit is contained in:
fvanroie 2021-01-13 00:10:22 +01:00
parent 724317c6ca
commit 755b3ea825
2 changed files with 62 additions and 62 deletions

View File

@ -86,11 +86,11 @@ TFT_Class tft(io, controller, TFT_WIDTH, TFT_HEIGHT);
/** /**
* Initialize the ILI9341 display controller * Initialize the ILI9341 display controller
*/ */
void fsmc_ili9341_init(uint8_t rotation) void fsmc_ili9341_init(uint8_t rotation, bool invert_display)
{ {
tft.init(); tft.init();
tft.setRotation(rotation); tft.setRotation(rotation);
tft.setRotation(rotation); tft.invertDisplay(invert_display);
tft.fillScreen(TFT_DARKCYAN); tft.fillScreen(TFT_DARKCYAN);
int x = (tft.width() - logoWidth) / 2; int x = (tft.width() - logoWidth) / 2;
int y = (tft.height() - logoHeight) / 2; int y = (tft.height() - logoHeight) / 2;

View File

@ -40,7 +40,7 @@ extern "C" {
/********************** /**********************
* GLOBAL PROTOTYPES * GLOBAL PROTOTYPES
**********************/ **********************/
void fsmc_ili9341_init(uint8_t rotation); void fsmc_ili9341_init(uint8_t rotation, bool invert_display);
void fsmc_ili9341_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p); void fsmc_ili9341_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p);
// void fsmc_ili9341_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t * color_p); // void fsmc_ili9341_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t * color_p);
// void fsmc_ili9341_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color); // void fsmc_ili9341_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color);