Skip to content

Commit

Permalink
Merge branch 'bugfix/lcd_spi_acquire_bus_v4.4' into 'release/v4.4'
Browse files Browse the repository at this point in the history
spi_lcd: don't release bus if acquire failed (v4.4)

See merge request espressif/esp-idf!23038
  • Loading branch information
jack0c committed Apr 4, 2023
2 parents d337d9d + 1a61181 commit 6852aaa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/esp_lcd/src/esp_lcd_panel_io_spi.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -144,7 +144,7 @@ static esp_err_t panel_io_spi_register_event_callbacks(esp_lcd_panel_io_handle_t
esp_lcd_panel_io_spi_t *spi_panel_io = __containerof(io, esp_lcd_panel_io_spi_t, base);

if (spi_panel_io->on_color_trans_done != NULL) {
ESP_LOGW(TAG, "Callback on_color_trans_done was already set and now it was owerwritten!");
ESP_LOGW(TAG, "Callback on_color_trans_done was already set and now it was overwritten!");
}

spi_panel_io->on_color_trans_done = cbs->on_color_trans_done;
Expand Down Expand Up @@ -189,7 +189,7 @@ static esp_err_t panel_io_spi_tx_param(esp_lcd_panel_io_t *io, int lcd_cmd, cons
esp_lcd_panel_io_spi_t *spi_panel_io = __containerof(io, esp_lcd_panel_io_spi_t, base);
bool send_cmd = (lcd_cmd >= 0);

spi_device_acquire_bus(spi_panel_io->spi_dev, portMAX_DELAY);
ESP_RETURN_ON_ERROR(spi_device_acquire_bus(spi_panel_io->spi_dev, portMAX_DELAY), TAG, "acquire spi bus failed");

// before issue a polling transaction, need to wait queued transactions finished
size_t num_trans_inflight = spi_panel_io->num_trans_inflight;
Expand Down Expand Up @@ -249,7 +249,7 @@ static esp_err_t panel_io_spi_rx_param(esp_lcd_panel_io_t *io, int lcd_cmd, void
esp_lcd_panel_io_spi_t *spi_panel_io = __containerof(io, esp_lcd_panel_io_spi_t, base);
bool send_cmd = (lcd_cmd >= 0);

spi_device_acquire_bus(spi_panel_io->spi_dev, portMAX_DELAY);
ESP_RETURN_ON_ERROR(spi_device_acquire_bus(spi_panel_io->spi_dev, portMAX_DELAY), TAG, "acquire spi bus failed");

// before issue a polling transaction, need to wait queued transactions finished
size_t num_trans_inflight = spi_panel_io->num_trans_inflight;
Expand Down

0 comments on commit 6852aaa

Please sign in to comment.