@@ -40,7 +40,7 @@ typedef struct
4040 uint8_t color_mode ;
4141 size_t buffer_size ;
4242 uint8_t * color_buffer ;
43- bool landscape ;
43+ uint8_t screen_orientation ;
4444} ili9488_panel_t ;
4545
4646enum ili9488_constants
@@ -120,7 +120,6 @@ static esp_err_t panel_ili9488_init(esp_lcd_panel_t *panel)
120120{
121121 ili9488_panel_t * ili9488 = __containerof (panel , ili9488_panel_t , base );
122122 esp_lcd_panel_io_handle_t io = ili9488 -> io ;
123-
124123 lcd_init_cmd_t ili9488_init [] =
125124 {
126125 { ILI9488_POSITIVE_GAMMA_CTL ,
@@ -146,6 +145,7 @@ static esp_err_t panel_ili9488_init(esp_lcd_panel_t *panel)
146145 { ILI9488_FUNCTION_CTL , { 0x02 , 0x02 , 0x3B }, 3 },
147146 { ILI9488_ENTRY_MODE_CTL , { 0xC6 }, 1 },
148147 { ILI9488_ADJUST_CTL_THREE , { 0xA9 , 0x51 , 0x2C , 0x02 }, 4 },
148+ { ILI9488_SET_ADDRESS_MODE , { ili9488 -> screen_orientation }, 1 },
149149 { LCD_CMD_NOP , { 0 }, ILI9488_INIT_DONE_FLAG },
150150 };
151151
@@ -160,9 +160,6 @@ static esp_err_t panel_ili9488_init(esp_lcd_panel_t *panel)
160160 ili9488_init [cmd ].data_bytes & ILI9488_INIT_LENGTH_MASK );
161161 cmd ++ ;
162162 }
163- // Set address mode orientation
164- uint8_t cmdOrientation = ili9488 -> landscape ? ILI9488_ORIENTATION_LANDSCAPE : ILI9488_ORIENTATION_PORTRAIT ;
165- esp_lcd_panel_io_tx_param (io , ILI9488_SET_ADDRESS_MODE , & cmdOrientation , 1 );
166163
167164 // Take the display out of sleep mode.
168165 esp_lcd_panel_io_tx_param (io , LCD_CMD_SLPOUT , NULL , 0 );
@@ -351,8 +348,12 @@ esp_err_t esp_lcd_new_panel_ili9488(
351348 ESP_GOTO_ON_ERROR (gpio_config (& cfg ), err , TAG ,
352349 "configure GPIO for RESET line failed" );
353350 }
354- ili9488 -> landscape = landscape ;
355351
352+ ili9488 -> screen_orientation = ILI9488_ORIENTATION_PORTRAIT ;
353+ if (landscape )
354+ {
355+ ili9488 -> screen_orientation = ILI9488_ORIENTATION_LANDSCAPE ;
356+ }
356357
357358 if (panel_dev_config -> bits_per_pixel == 16 )
358359 {
0 commit comments