mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-22 17:10:28 +00:00
lcd: don't turn on disp in init
Closes https://github.com/espressif/esp-idf/issues/8516
This commit is contained in:
@@ -33,7 +33,7 @@ static esp_err_t panel_st7789_invert_color(esp_lcd_panel_t *panel, bool invert_c
|
||||
static esp_err_t panel_st7789_mirror(esp_lcd_panel_t *panel, bool mirror_x, bool mirror_y);
|
||||
static esp_err_t panel_st7789_swap_xy(esp_lcd_panel_t *panel, bool swap_axes);
|
||||
static esp_err_t panel_st7789_set_gap(esp_lcd_panel_t *panel, int x_gap, int y_gap);
|
||||
static esp_err_t panel_st7789_disp_off(esp_lcd_panel_t *panel, bool off);
|
||||
static esp_err_t panel_st7789_disp_on_off(esp_lcd_panel_t *panel, bool off);
|
||||
|
||||
typedef struct {
|
||||
esp_lcd_panel_t base;
|
||||
@@ -102,7 +102,7 @@ esp_err_t esp_lcd_new_panel_st7789(const esp_lcd_panel_io_handle_t io, const esp
|
||||
st7789->base.set_gap = panel_st7789_set_gap;
|
||||
st7789->base.mirror = panel_st7789_mirror;
|
||||
st7789->base.swap_xy = panel_st7789_swap_xy;
|
||||
st7789->base.disp_off = panel_st7789_disp_off;
|
||||
st7789->base.disp_on_off = panel_st7789_disp_on_off;
|
||||
*ret_panel = &(st7789->base);
|
||||
ESP_LOGD(TAG, "new st7789 panel @%p", st7789);
|
||||
|
||||
@@ -162,8 +162,6 @@ static esp_err_t panel_st7789_init(esp_lcd_panel_t *panel)
|
||||
esp_lcd_panel_io_tx_param(io, LCD_CMD_COLMOD, (uint8_t[]) {
|
||||
st7789->colmod_cal,
|
||||
}, 1);
|
||||
// turn on display
|
||||
esp_lcd_panel_io_tx_param(io, LCD_CMD_DISPON, NULL, 0);
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
@@ -256,15 +254,15 @@ static esp_err_t panel_st7789_set_gap(esp_lcd_panel_t *panel, int x_gap, int y_g
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t panel_st7789_disp_off(esp_lcd_panel_t *panel, bool off)
|
||||
static esp_err_t panel_st7789_disp_on_off(esp_lcd_panel_t *panel, bool on_off)
|
||||
{
|
||||
st7789_panel_t *st7789 = __containerof(panel, st7789_panel_t, base);
|
||||
esp_lcd_panel_io_handle_t io = st7789->io;
|
||||
int command = 0;
|
||||
if (off) {
|
||||
command = LCD_CMD_DISPOFF;
|
||||
} else {
|
||||
if (on_off) {
|
||||
command = LCD_CMD_DISPON;
|
||||
} else {
|
||||
command = LCD_CMD_DISPOFF;
|
||||
}
|
||||
esp_lcd_panel_io_tx_param(io, command, NULL, 0);
|
||||
return ESP_OK;
|
||||
|
Reference in New Issue
Block a user