From aacd7d84d96bcceef4c274eb36887fbb5181b314 Mon Sep 17 00:00:00 2001 From: morris Date: Fri, 4 Aug 2023 13:20:57 +0800 Subject: [PATCH] fix(i80_lcd): reset cs gpio on exit --- components/esp_lcd/src/esp_lcd_panel_io_i2s.c | 5 +++++ components/esp_lcd/src/esp_lcd_panel_io_i80.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/components/esp_lcd/src/esp_lcd_panel_io_i2s.c b/components/esp_lcd/src/esp_lcd_panel_io_i2s.c index 737f7fc5af6..a835f26558f 100644 --- a/components/esp_lcd/src/esp_lcd_panel_io_i2s.c +++ b/components/esp_lcd/src/esp_lcd_panel_io_i2s.c @@ -338,6 +338,11 @@ static esp_err_t panel_io_i80_del(esp_lcd_panel_io_t *io) LIST_REMOVE(i80_device, device_list_entry); portEXIT_CRITICAL(&bus->spinlock); + // reset CS GPIO + if (i80_device->cs_gpio_num >= 0) { + gpio_reset_pin(i80_device->cs_gpio_num); + } + ESP_LOGD(TAG, "del i80 lcd panel io @%p", i80_device); vQueueDelete(i80_device->trans_queue); vQueueDelete(i80_device->done_queue); diff --git a/components/esp_lcd/src/esp_lcd_panel_io_i80.c b/components/esp_lcd/src/esp_lcd_panel_io_i80.c index 36a8fd9e8a8..955f5853f81 100644 --- a/components/esp_lcd/src/esp_lcd_panel_io_i80.c +++ b/components/esp_lcd/src/esp_lcd_panel_io_i80.c @@ -330,6 +330,11 @@ static esp_err_t panel_io_i80_del(esp_lcd_panel_io_t *io) LIST_REMOVE(i80_device, device_list_entry); portEXIT_CRITICAL(&bus->spinlock); + // reset CS to normal GPIO + if (i80_device->cs_gpio_num >= 0) { + gpio_reset_pin(i80_device->cs_gpio_num); + } + ESP_LOGD(TAG, "del i80 lcd panel io @%p", i80_device); vQueueDelete(i80_device->trans_queue); vQueueDelete(i80_device->done_queue);