refactor(esp_lcd): reformat code with astyle_py

pull/12368/head
morris 2023-09-27 22:39:34 +08:00
rodzic 180d455528
commit 1b2484214c
10 zmienionych plików z 14 dodań i 19 usunięć

Wyświetl plik

@ -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_callbacks_t;
/**
* @brief Transmit LCD command and receive corresponding parameters
*

Wyświetl plik

@ -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
*/
@ -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);
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!");
}
@ -117,7 +117,7 @@ static esp_err_t panel_io_i2c_rx_buffer(esp_lcd_panel_io_t *io, int lcd_cmd, voi
if (send_param) {
if (i2c_panel_io->control_phase_enabled) {
ESP_GOTO_ON_ERROR(i2c_master_write_byte(cmd_link, i2c_panel_io->control_phase_cmd, true),
err, TAG, "write control phase failed"); // control phase
err, TAG, "write control phase failed"); // control phase
}
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;
@ -157,12 +157,11 @@ static esp_err_t panel_io_i2c_tx_buffer(esp_lcd_panel_io_t *io, int lcd_cmd, con
ESP_GOTO_ON_ERROR(i2c_master_write_byte(cmd_link, (i2c_panel_io->dev_addr << 1) | I2C_MASTER_WRITE, true), err, TAG, "write address failed"); // address phase
if (i2c_panel_io->control_phase_enabled) {
ESP_GOTO_ON_ERROR(i2c_master_write_byte(cmd_link, is_param ? i2c_panel_io->control_phase_cmd : i2c_panel_io->control_phase_data, true),
err, TAG, "write control phase failed"); // control phase
err, TAG, "write control phase failed"); // control phase
}
// 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)};
size_t cmds_size = i2c_panel_io->lcd_cmd_bits / 8;
if (cmds_size > 0 && cmds_size <= sizeof(cmds)) {

Wyświetl plik

@ -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);
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!");
}
@ -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
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)};
size_t cmds_size = i2c_panel_io->lcd_cmd_bits / 8;
if (cmds_size > 0 && cmds_size <= sizeof(cmds)) {

Wyświetl plik

@ -425,8 +425,8 @@ 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
size_t num_trans_inflight = next_device->num_trans_inflight;
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_FAIL, TAG, "recycle inflight transactions failed");
ESP_RETURN_ON_FALSE(xQueueReceive(next_device->done_queue, &trans_desc, portMAX_DELAY) == pdTRUE,
ESP_FAIL, TAG, "recycle inflight transactions failed");
next_device->num_trans_inflight--;
}

Wyświetl plik

@ -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->base.length = spi_panel_io->lcd_cmd_bits;
lcd_trans->base.tx_buffer = &lcd_cmd;
if(color && color_size) {
if (color && color_size) {
lcd_trans->base.flags |= SPI_TRANS_CS_KEEP_ACTIVE;
}
if (spi_panel_io->flags.octal_mode) {

Wyświetl plik

@ -141,10 +141,10 @@ static esp_err_t panel_ssd1306_init(esp_lcd_panel_t *panel)
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, SSD1306_CMD_DISP_OFF, NULL, 0), TAG,
"io tx param SSD1306_CMD_DISP_OFF failed");
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, SSD1306_CMD_SET_MEMORY_ADDR_MODE, (uint8_t[]) {
0x00 // horizontal addressing mode
0x00 // horizontal addressing mode
}, 1), TAG, "io tx param SSD1306_CMD_SET_MEMORY_ADDR_MODE failed");
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, SSD1306_CMD_SET_CHARGE_PUMP, (uint8_t[]) {
0x14 // enable charge pump
0x14 // enable charge pump
}, 1), TAG, "io tx param SSD1306_CMD_SET_CHARGE_PUMP failed");
ESP_RETURN_ON_ERROR(esp_lcd_panel_io_tx_param(io, SSD1306_CMD_MIRROR_X_OFF, NULL, 0), TAG,
"io tx param SSD1306_CMD_MIRROR_X_OFF failed");

Wyświetl plik

@ -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_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
st7789->ramctl_val_2 |= ST7789_DATA_LITTLE_ENDIAN_BIT;
}

Wyświetl plik

@ -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));
i2s_chan_handle_t tx_handle = NULL;
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

Wyświetl plik

@ -26,7 +26,7 @@
#define TEST_IMG_SIZE (100 * 100 * sizeof(uint16_t))
static esp_lcd_panel_handle_t test_rgb_panel_initialization(size_t data_width, size_t bpp, size_t bb_pixels, bool refresh_on_demand,
esp_lcd_rgb_panel_vsync_cb_t vsync_cb, void *user_data)
esp_lcd_rgb_panel_vsync_cb_t vsync_cb, void *user_data)
{
esp_lcd_panel_handle_t panel_handle = NULL;
esp_lcd_rgb_panel_config_t panel_config = {

Wyświetl plik

@ -66,7 +66,6 @@ components_not_formatted_temporary:
- "/components/esp_https_ota/"
- "/components/esp_https_server/"
- "/components/esp_hw_support/"
- "/components/esp_lcd/"
- "/components/esp_local_ctrl/"
- "/components/esp_mm/"
- "/components/esp_netif/"