mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 21:54:33 +02:00
refactor(esp_lcd): reformat code with astyle_py
This commit is contained in:
@@ -44,7 +44,6 @@ typedef struct {
|
|||||||
esp_lcd_panel_io_color_trans_done_cb_t on_color_trans_done; /*!< Callback invoked when color data transfer has finished */
|
esp_lcd_panel_io_color_trans_done_cb_t on_color_trans_done; /*!< Callback invoked when color data transfer has finished */
|
||||||
} esp_lcd_panel_io_callbacks_t;
|
} esp_lcd_panel_io_callbacks_t;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Transmit LCD command and receive corresponding parameters
|
* @brief Transmit LCD command and receive corresponding parameters
|
||||||
*
|
*
|
||||||
|
@@ -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
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -94,7 +94,7 @@ static esp_err_t panel_io_i2c_register_event_callbacks(esp_lcd_panel_io_handle_t
|
|||||||
{
|
{
|
||||||
lcd_panel_io_i2c_t *i2c_panel_io = __containerof(io, lcd_panel_io_i2c_t, base);
|
lcd_panel_io_i2c_t *i2c_panel_io = __containerof(io, lcd_panel_io_i2c_t, base);
|
||||||
|
|
||||||
if(i2c_panel_io->on_color_trans_done != NULL) {
|
if (i2c_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 owerwritten!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,8 +161,7 @@ static esp_err_t panel_io_i2c_tx_buffer(esp_lcd_panel_io_t *io, int lcd_cmd, con
|
|||||||
}
|
}
|
||||||
|
|
||||||
// some displays don't want any additional commands on data transfers
|
// some displays don't want any additional commands on data transfers
|
||||||
if (send_param)
|
if (send_param) {
|
||||||
{
|
|
||||||
uint8_t cmds[4] = {BYTESHIFT(lcd_cmd, 3), BYTESHIFT(lcd_cmd, 2), BYTESHIFT(lcd_cmd, 1), BYTESHIFT(lcd_cmd, 0)};
|
uint8_t cmds[4] = {BYTESHIFT(lcd_cmd, 3), BYTESHIFT(lcd_cmd, 2), BYTESHIFT(lcd_cmd, 1), BYTESHIFT(lcd_cmd, 0)};
|
||||||
size_t cmds_size = i2c_panel_io->lcd_cmd_bits / 8;
|
size_t cmds_size = i2c_panel_io->lcd_cmd_bits / 8;
|
||||||
if (cmds_size > 0 && cmds_size <= sizeof(cmds)) {
|
if (cmds_size > 0 && cmds_size <= sizeof(cmds)) {
|
||||||
|
@@ -105,7 +105,7 @@ static esp_err_t panel_io_i2c_register_event_callbacks(esp_lcd_panel_io_handle_t
|
|||||||
{
|
{
|
||||||
lcd_panel_io_i2c_t *i2c_panel_io = __containerof(io, lcd_panel_io_i2c_t, base);
|
lcd_panel_io_i2c_t *i2c_panel_io = __containerof(io, lcd_panel_io_i2c_t, base);
|
||||||
|
|
||||||
if(i2c_panel_io->on_color_trans_done != NULL) {
|
if (i2c_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 owerwritten!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,8 +159,7 @@ static esp_err_t panel_io_i2c_tx_buffer(esp_lcd_panel_io_t *io, int lcd_cmd, con
|
|||||||
}
|
}
|
||||||
|
|
||||||
// some displays don't want any additional commands on data transfers
|
// some displays don't want any additional commands on data transfers
|
||||||
if (send_param)
|
if (send_param) {
|
||||||
{
|
|
||||||
uint8_t cmds[4] = {BYTESHIFT(lcd_cmd, 3), BYTESHIFT(lcd_cmd, 2), BYTESHIFT(lcd_cmd, 1), BYTESHIFT(lcd_cmd, 0)};
|
uint8_t cmds[4] = {BYTESHIFT(lcd_cmd, 3), BYTESHIFT(lcd_cmd, 2), BYTESHIFT(lcd_cmd, 1), BYTESHIFT(lcd_cmd, 0)};
|
||||||
size_t cmds_size = i2c_panel_io->lcd_cmd_bits / 8;
|
size_t cmds_size = i2c_panel_io->lcd_cmd_bits / 8;
|
||||||
if (cmds_size > 0 && cmds_size <= sizeof(cmds)) {
|
if (cmds_size > 0 && cmds_size <= sizeof(cmds)) {
|
||||||
|
@@ -425,7 +425,7 @@ static esp_err_t panel_io_i80_tx_param(esp_lcd_panel_io_t *io, int lcd_cmd, cons
|
|||||||
// wait all pending transaction in the queue to finish
|
// wait all pending transaction in the queue to finish
|
||||||
size_t num_trans_inflight = next_device->num_trans_inflight;
|
size_t num_trans_inflight = next_device->num_trans_inflight;
|
||||||
for (size_t i = 0; i < num_trans_inflight; i++) {
|
for (size_t i = 0; i < num_trans_inflight; i++) {
|
||||||
ESP_RETURN_ON_FALSE( xQueueReceive(next_device->done_queue, &trans_desc, portMAX_DELAY) == pdTRUE,
|
ESP_RETURN_ON_FALSE(xQueueReceive(next_device->done_queue, &trans_desc, portMAX_DELAY) == pdTRUE,
|
||||||
ESP_FAIL, TAG, "recycle inflight transactions failed");
|
ESP_FAIL, TAG, "recycle inflight transactions failed");
|
||||||
next_device->num_trans_inflight--;
|
next_device->num_trans_inflight--;
|
||||||
}
|
}
|
||||||
|
@@ -330,7 +330,7 @@ static esp_err_t panel_io_spi_tx_color(esp_lcd_panel_io_t *io, int lcd_cmd, cons
|
|||||||
lcd_trans->flags.dc_gpio_level = !spi_panel_io->flags.dc_data_level; // set D/C line to command mode
|
lcd_trans->flags.dc_gpio_level = !spi_panel_io->flags.dc_data_level; // set D/C line to command mode
|
||||||
lcd_trans->base.length = spi_panel_io->lcd_cmd_bits;
|
lcd_trans->base.length = spi_panel_io->lcd_cmd_bits;
|
||||||
lcd_trans->base.tx_buffer = &lcd_cmd;
|
lcd_trans->base.tx_buffer = &lcd_cmd;
|
||||||
if(color && color_size) {
|
if (color && color_size) {
|
||||||
lcd_trans->base.flags |= SPI_TRANS_CS_KEEP_ACTIVE;
|
lcd_trans->base.flags |= SPI_TRANS_CS_KEEP_ACTIVE;
|
||||||
}
|
}
|
||||||
if (spi_panel_io->flags.octal_mode) {
|
if (spi_panel_io->flags.octal_mode) {
|
||||||
|
@@ -106,7 +106,7 @@ esp_lcd_new_panel_st7789(const esp_lcd_panel_io_handle_t io, const esp_lcd_panel
|
|||||||
|
|
||||||
st7789->ramctl_val_1 = 0x00;
|
st7789->ramctl_val_1 = 0x00;
|
||||||
st7789->ramctl_val_2 = 0xf0; // Use big endian by default
|
st7789->ramctl_val_2 = 0xf0; // Use big endian by default
|
||||||
if((panel_dev_config->data_endian) == LCD_RGB_DATA_ENDIAN_LITTLE) {
|
if ((panel_dev_config->data_endian) == LCD_RGB_DATA_ENDIAN_LITTLE) {
|
||||||
// Use little endian
|
// Use little endian
|
||||||
st7789->ramctl_val_2 |= ST7789_DATA_LITTLE_ENDIAN_BIT;
|
st7789->ramctl_val_2 |= ST7789_DATA_LITTLE_ENDIAN_BIT;
|
||||||
}
|
}
|
||||||
|
@@ -43,7 +43,6 @@ TEST_CASE("i80_and_i2s_driver_co-existence", "[lcd][i2s]")
|
|||||||
};
|
};
|
||||||
TEST_ESP_OK(esp_lcd_new_i80_bus(&bus_config, &i80_bus));
|
TEST_ESP_OK(esp_lcd_new_i80_bus(&bus_config, &i80_bus));
|
||||||
|
|
||||||
|
|
||||||
i2s_chan_handle_t tx_handle = NULL;
|
i2s_chan_handle_t tx_handle = NULL;
|
||||||
i2s_chan_config_t chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(I2S_NUM_0, I2S_ROLE_MASTER);
|
i2s_chan_config_t chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(I2S_NUM_0, I2S_ROLE_MASTER);
|
||||||
// I2S driver won't be installed as the same I2S port has been used by LCD
|
// I2S driver won't be installed as the same I2S port has been used by LCD
|
||||||
|
@@ -66,7 +66,6 @@ components_not_formatted_temporary:
|
|||||||
- "/components/esp_https_ota/"
|
- "/components/esp_https_ota/"
|
||||||
- "/components/esp_https_server/"
|
- "/components/esp_https_server/"
|
||||||
- "/components/esp_hw_support/"
|
- "/components/esp_hw_support/"
|
||||||
- "/components/esp_lcd/"
|
|
||||||
- "/components/esp_local_ctrl/"
|
- "/components/esp_local_ctrl/"
|
||||||
- "/components/esp_mm/"
|
- "/components/esp_mm/"
|
||||||
- "/components/esp_netif/"
|
- "/components/esp_netif/"
|
||||||
|
Reference in New Issue
Block a user