Skip to content

Commit

Permalink
Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
rzeldent committed Mar 7, 2024
1 parent 6701245 commit a852e9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/esp_lcd_panel_gc9a01.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ esp_err_t gc9a01_draw_bitmap(esp_lcd_panel_t *panel, int x_start, int y_start, i
y_end += ph->y_gap;

esp_err_t res;
const uint8_t caset[4] = {x_start >> 8, x_start & 0xff, (x_end - 1) >> 8, (x_end - 1) & 0xff};
const uint8_t raset[4] = {y_start >> 8, y_start & 0xff, (y_end - 1) >> 8, (y_end - 1) & 0xff};
const uint8_t caset[4] = {x_start >> 8, x_start, (x_end - 1) >> 8, x_end - 1};
const uint8_t raset[4] = {y_start >> 8, y_start, (y_end - 1) >> 8, y_end - 1};
if ((res = esp_lcd_panel_io_tx_param(ph->io, LCD_CMD_CASET, caset, sizeof(caset))) != ESP_OK ||
(res = esp_lcd_panel_io_tx_param(ph->io, LCD_CMD_RASET, raset, sizeof(raset))) != ESP_OK)
{
Expand All @@ -197,7 +197,7 @@ esp_err_t gc9a01_draw_bitmap(esp_lcd_panel_t *panel, int x_start, int y_start, i

uint8_t bytes_per_pixel = (ph->config.bits_per_pixel + 0x7) >> 3;
size_t len = (x_end - x_start) * (y_end - y_start) * bytes_per_pixel;
if ((res = esp_lcd_panel_io_tx_param(ph->io, LCD_CMD_RAMWR, color_data, len)) != ESP_OK)
if ((res = esp_lcd_panel_io_tx_color(ph->io, LCD_CMD_RAMWR, color_data, len)) != ESP_OK)
{
log_e("Sending RAMWR failed");
return res;
Expand Down
2 changes: 1 addition & 1 deletion src/esp_lcd_panel_st7796.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ esp_err_t st7796_draw_bitmap(esp_lcd_panel_t *panel, int x_start, int y_start, i

uint8_t bytes_per_pixel = (ph->config.bits_per_pixel + 0x7) >> 3;
size_t len = (x_end - x_start) * (y_end - y_start) * bytes_per_pixel;
if ((res = esp_lcd_panel_io_tx_param(ph->io, LCD_CMD_RAMWR, color_data, len)) != ESP_OK)
if ((res = esp_lcd_panel_io_tx_color(ph->io, LCD_CMD_RAMWR, color_data, len)) != ESP_OK)
{
log_e("Sending RAMWR failed");
return res;
Expand Down

0 comments on commit a852e9d

Please sign in to comment.