Skip to content

Commit d3769f8

Browse files
committed
RGB driver work.
1 parent 8ec4bf5 commit d3769f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext_mod/lcd_bus/esp32_src/rgb_bus_rotation.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@
344344
y_end = MIN(y_end, d_height);
345345
}
346346

347-
uint16_t src_bytes_per_line = (x_end - x_start + 1) * (uint16_t)bytes_per_pixel;
347+
uint16_t src_bytes_per_line = (x_end - x_start) * (uint16_t)bytes_per_pixel;
348348
uint32_t dst_bytes_per_line = bytes_per_pixel * d_width;
349349
size_t offset = y_start * src_bytes_per_line + x_start * bytes_per_pixel;
350350

@@ -361,6 +361,8 @@
361361
if (x_start == 0 && x_end == (d_width - 1)) {
362362
memcpy(fb, src, d_width * (y_end - y_start + 1) * bytes_per_pixel);
363363
} else {
364+
src_bytes_per_line = (x_end - x_start + 1) * (uint16_t)bytes_per_pixel;
365+
364366
for (int y = y_start; y < y_end; y++) {
365367
memcpy(fb, src, src_bytes_per_line);
366368
fb += dst_bytes_per_line;

0 commit comments

Comments
 (0)