mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 13:16:45 +00:00
Add invert_display runtime option
This commit is contained in:
parent
ea8ac442ab
commit
9bbc4741af
@ -38,7 +38,7 @@ void m5stack_init()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void drv_display_init(uint8_t rotation)
|
void drv_display_init(lv_disp_drv_t * disp_drv, uint8_t rotation, bool invert_display)
|
||||||
{
|
{
|
||||||
#if defined(M5STACK)
|
#if defined(M5STACK)
|
||||||
m5stack_init(); // Set LCD power first
|
m5stack_init(); // Set LCD power first
|
||||||
@ -46,9 +46,23 @@ void drv_display_init(uint8_t rotation)
|
|||||||
|
|
||||||
/* TFT init */
|
/* TFT init */
|
||||||
#if defined(USE_FSMC)
|
#if defined(USE_FSMC)
|
||||||
fsmc_ili9341_init(rotation);
|
fsmc_ili9341_init(rotation, invert_display);
|
||||||
|
disp_drv->flush_cb = fsmc_ili9341_flush; // Normal callback when flushing
|
||||||
// xpt2046_init(rotation);
|
// xpt2046_init(rotation);
|
||||||
#else
|
#else
|
||||||
tft_espi_init(rotation);
|
tft_espi_init(rotation, invert_display);
|
||||||
|
disp_drv->flush_cb = tft_espi_flush; // Normal callback when flushing
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Callback used for screenshots only: */
|
||||||
|
|
||||||
|
/* indirect callback to flush screenshot data to the screen */
|
||||||
|
void drv_display_flush_cb(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p)
|
||||||
|
{
|
||||||
|
#if defined(USE_FSMC)
|
||||||
|
fsmc_ili9341_flush(disp, area, color_p);
|
||||||
|
#else
|
||||||
|
tft_espi_flush(disp, area, color_p);
|
||||||
|
#endif
|
||||||
|
}
|
@ -11,6 +11,7 @@
|
|||||||
#include "tft_espi_drv.h"
|
#include "tft_espi_drv.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void drv_display_init(uint8_t rotation);
|
void drv_display_init(lv_disp_drv_t * disp_drv, uint8_t rotation, bool invert_display);
|
||||||
|
void drv_display_flush_cb(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p);
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
x
Reference in New Issue
Block a user