Merge pull request #93 from sidwarkd/patch-1

Fix orientation config define on Kconfig and ssd1306
This commit is contained in:
Carlos Diaz 2021-08-25 12:46:29 -05:00 committed by GitHub
commit dd09b4d01a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 16 deletions

View file

@ -195,24 +195,24 @@ menu "LVGL TFT Display controller"
# Used in display init function to send display orientation commands
choice DISPLAY_ORIENTATION
prompt "Display orientation"
default DISPLAY_ORIENTATION_PORTRAIT if !LV_TFT_DISPLAY_CONTROLLER_SSD1306
default DISPLAY_ORIENTATION_LANDSCAPE if LV_TFT_DISPLAY_CONTROLLER_SSD1306
config DISPLAY_ORIENTATION_PORTRAIT
default LV_DISPLAY_ORIENTATION_PORTRAIT if !LV_TFT_DISPLAY_CONTROLLER_SSD1306
default LV_DISPLAY_ORIENTATION_LANDSCAPE if LV_TFT_DISPLAY_CONTROLLER_SSD1306
config LV_DISPLAY_ORIENTATION_PORTRAIT
bool "Portrait" if !LV_TFT_DISPLAY_CONTROLLER_SSD1306
config DISPLAY_ORIENTATION_PORTRAIT_INVERTED
config LV_DISPLAY_ORIENTATION_PORTRAIT_INVERTED
bool "Portrait inverted" if !LV_TFT_DISPLAY_CONTROLLER_SSD1306
config DISPLAY_ORIENTATION_LANDSCAPE
config LV_DISPLAY_ORIENTATION_LANDSCAPE
bool "Landscape"
config DISPLAY_ORIENTATION_LANDSCAPE_INVERTED
config LV_DISPLAY_ORIENTATION_LANDSCAPE_INVERTED
bool "Landscape inverted"
endchoice
config LV_DISPLAY_ORIENTATION
int
default 0 if DISPLAY_ORIENTATION_PORTRAIT
default 1 if DISPLAY_ORIENTATION_PORTRAIT_INVERTED
default 2 if DISPLAY_ORIENTATION_LANDSCAPE
default 3 if DISPLAY_ORIENTATION_LANDSCAPE_INVERTED
default 0 if LV_DISPLAY_ORIENTATION_PORTRAIT
default 1 if LV_DISPLAY_ORIENTATION_PORTRAIT_INVERTED
default 2 if LV_DISPLAY_ORIENTATION_LANDSCAPE
default 3 if LV_DISPLAY_ORIENTATION_LANDSCAPE_INVERTED
config LV_TFT_DISPLAY_OFFSETS
bool
@ -222,15 +222,15 @@ menu "LVGL TFT Display controller"
config LV_TFT_DISPLAY_X_OFFSET
depends on LV_TFT_DISPLAY_OFFSETS
int "X offset"
default 40 if LV_PREDEFINED_DISPLAY_TTGO && (DISPLAY_ORIENTATION_LANDSCAPE || DISPLAY_ORIENTATION_LANDSCAPE_INVERTED)
default 53 if LV_PREDEFINED_DISPLAY_TTGO && (DISPLAY_ORIENTATION_PORTRAIT || DISPLAY_ORIENTATION_PORTRAIT_INVERTED)
default 40 if LV_PREDEFINED_DISPLAY_TTGO && (LV_DISPLAY_ORIENTATION_LANDSCAPE || LV_DISPLAY_ORIENTATION_LANDSCAPE_INVERTED)
default 53 if LV_PREDEFINED_DISPLAY_TTGO && (LV_DISPLAY_ORIENTATION_PORTRAIT || LV_DISPLAY_ORIENTATION_PORTRAIT_INVERTED)
default 0
config LV_TFT_DISPLAY_Y_OFFSET
depends on LV_TFT_DISPLAY_OFFSETS
int "Y offset"
default 53 if LV_PREDEFINED_DISPLAY_TTGO && (DISPLAY_ORIENTATION_LANDSCAPE || DISPLAY_ORIENTATION_LANDSCAPE_INVERTED)
default 40 if LV_PREDEFINED_DISPLAY_TTGO && (DISPLAY_ORIENTATION_PORTRAIT || DISPLAY_ORIENTATION_PORTRAIT_INVERTED)
default 53 if LV_PREDEFINED_DISPLAY_TTGO && (LV_DISPLAY_ORIENTATION_LANDSCAPE || LV_DISPLAY_ORIENTATION_LANDSCAPE_INVERTED)
default 40 if LV_PREDEFINED_DISPLAY_TTGO && (LV_DISPLAY_ORIENTATION_PORTRAIT || LV_DISPLAY_ORIENTATION_PORTRAIT_INVERTED)
default 0

View file

@ -99,10 +99,10 @@ void ssd1306_init(void)
uint8_t orientation_1 = 0;
uint8_t orientation_2 = 0;
#if defined (CONFIG_DISPLAY_ORIENTATION_LANDSCAPE)
#if defined (CONFIG_LV_DISPLAY_ORIENTATION_LANDSCAPE)
orientation_1 = OLED_CMD_SET_SEGMENT_REMAP;
orientation_2 = OLED_CMD_SET_COM_SCAN_MODE_REMAP;
#elif defined (CONFIG_DISPLAY_ORIENTATION_LANDSCAPE_INVERTED)
#elif defined (CONFIG_LV_DISPLAY_ORIENTATION_LANDSCAPE_INVERTED)
orientation_1 = 0xA0;
orientation_2 = OLED_CMD_SET_COM_SCAN_MODE_NORMAL;
#else