Use correct option for color inversion
This commit is contained in:
parent
4e0667a065
commit
849afed80d
|
@ -585,7 +585,7 @@ menu "LVGL TFT Display controller"
|
||||||
If text is backwards on your display, try enabling this.
|
If text is backwards on your display, try enabling this.
|
||||||
|
|
||||||
config LV_INVERT_COLORS
|
config LV_INVERT_COLORS
|
||||||
bool "Invert colors in display" if LV_TFT_DISPLAY_CONTROLLER_ILI9341 || LV_TFT_DISPLAY_CONTROLLER_ST7735S || LV_TFT_DISPLAY_CONTROLLER_ILI9481 || LV_TFT_DISPLAY_CONTROLLER_ST7789
|
bool "Invert colors in display" if LV_TFT_DISPLAY_CONTROLLER_ILI9341 || LV_TFT_DISPLAY_CONTROLLER_ST7735S || LV_TFT_DISPLAY_CONTROLLER_ILI9481 || LV_TFT_DISPLAY_CONTROLLER_ST7789 || LV_TFT_DISPLAY_CONTROLLER_SSD1306 || LV_TFT_DISPLAY_CONTROLLER_SH1107 || LV_TFT_DISPLAY_CONTROLLER_HX8357
|
||||||
default y if LV_PREDEFINED_DISPLAY_M5STACK || LV_PREDEFINED_DISPLAY_M5STICKC
|
default y if LV_PREDEFINED_DISPLAY_M5STACK || LV_PREDEFINED_DISPLAY_M5STICKC
|
||||||
help
|
help
|
||||||
If the colors look inverted on your display, try enabling this.
|
If the colors look inverted on your display, try enabling this.
|
||||||
|
|
|
@ -200,8 +200,10 @@ void hx8357_init(void)
|
||||||
|
|
||||||
hx8357_set_rotation(1);
|
hx8357_set_rotation(1);
|
||||||
|
|
||||||
#if HX8357_INVERT_DISPLAY
|
#if HX8357_INVERT_COLORS
|
||||||
hx8357_send_cmd(HX8357_INVON);;
|
hx8357_send_cmd(HX8357_INVON);
|
||||||
|
#else
|
||||||
|
hx8357_send_cmd(HX8357_INVOFF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
hx8357_enable_backlight(true);
|
hx8357_enable_backlight(true);
|
||||||
|
|
|
@ -40,6 +40,7 @@ extern "C" {
|
||||||
#define HX8357_BCKL CONFIG_LV_DISP_PIN_BCKL
|
#define HX8357_BCKL CONFIG_LV_DISP_PIN_BCKL
|
||||||
|
|
||||||
#define HX8357_ENABLE_BACKLIGHT_CONTROL CONFIG_LV_ENABLE_BACKLIGHT_CONTROL
|
#define HX8357_ENABLE_BACKLIGHT_CONTROL CONFIG_LV_ENABLE_BACKLIGHT_CONTROL
|
||||||
|
#define HX8357_INVERT_COLORS CONFIG_LV_INVERT_COLORS
|
||||||
|
|
||||||
#if CONFIG_LV_BACKLIGHT_ACTIVE_LVL
|
#if CONFIG_LV_BACKLIGHT_ACTIVE_LVL
|
||||||
#define HX8357_BCKL_ACTIVE_LVL 1
|
#define HX8357_BCKL_ACTIVE_LVL 1
|
||||||
|
@ -47,9 +48,6 @@ extern "C" {
|
||||||
#define HX8357_BCKL_ACTIVE_LVL 0
|
#define HX8357_BCKL_ACTIVE_LVL 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// if text/images are backwards, try setting this to 1
|
|
||||||
#define HX8357_INVERT_DISPLAY CONFIG_LV_INVERT_DISPLAY
|
|
||||||
|
|
||||||
|
|
||||||
/*******************
|
/*******************
|
||||||
* HX8357B/D REGS
|
* HX8357B/D REGS
|
||||||
|
|
|
@ -82,7 +82,7 @@ void sh1107_init(void)
|
||||||
{0xDA, {0}, 0}, // Set com pins
|
{0xDA, {0}, 0}, // Set com pins
|
||||||
{0x12, {0}, 0}, // ...value
|
{0x12, {0}, 0}, // ...value
|
||||||
{0xA4, {0}, 0}, // output ram to display
|
{0xA4, {0}, 0}, // output ram to display
|
||||||
#if defined CONFIG_LV_INVERT_DISPLAY
|
#if defined CONFIG_LV_INVERT_COLORS
|
||||||
{0xA7, {0}, 0}, // inverted display
|
{0xA7, {0}, 0}, // inverted display
|
||||||
#else
|
#else
|
||||||
{0xA6, {0}, 0}, // Non-inverted display
|
{0xA6, {0}, 0}, // Non-inverted display
|
||||||
|
|
|
@ -113,7 +113,7 @@ void ssd1306_init(void)
|
||||||
|
|
||||||
uint8_t display_mode = 0;
|
uint8_t display_mode = 0;
|
||||||
|
|
||||||
#if defined CONFIG_LV_INVERT_DISPLAY
|
#if defined CONFIG_LV_INVERT_COLORS
|
||||||
display_mode = OLED_CMD_DISPLAY_INVERTED;
|
display_mode = OLED_CMD_DISPLAY_INVERTED;
|
||||||
#else
|
#else
|
||||||
display_mode = OLED_CMD_DISPLAY_NORMAL;
|
display_mode = OLED_CMD_DISPLAY_NORMAL;
|
||||||
|
|
Loading…
Reference in a new issue