Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: target/dartuinoP0/memory_lcd.c

Issue 1777653003: [display] Fix corruption in color lcd update. (Closed) Base URL: https://github.com/littlekernel/lk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: target/dartuinoP0/memory_lcd.c
diff --git a/target/dartuinoP0/memory_lcd.c b/target/dartuinoP0/memory_lcd.c
index 1f792f3349d08538ffcc82c6f59d7bc403048284..0249211e3ef4a7e614c236489e7b50e0ae84da7c 100644
--- a/target/dartuinoP0/memory_lcd.c
+++ b/target/dartuinoP0/memory_lcd.c
@@ -122,6 +122,7 @@ static void mlcd_flush(uint starty, uint endy)
static uint8_t localbuf[MLCD_BUF_SIZE];
uint8_t *bufptr = localbuf;
+ uint8_t trailer = 0;
// The first line is preceeded with a write command.
*bufptr++ = MLCD_WR | vcom_state;
@@ -134,21 +135,20 @@ static void mlcd_flush(uint starty, uint endy)
bufptr += lcd_get_line(framebuffer, j, bufptr);
+ // 8 bit trailer per line
+ *bufptr++ = trailer;
+ if (j == endy) {
+ // 16 bit trailer on the last line
+ *bufptr++ = trailer;
+ }
+
if (HAL_SPI_Transmit(&SpiHandle, localbuf, bufptr - localbuf, HAL_MAX_DELAY) != HAL_OK) {
goto finish;
}
bufptr = localbuf;
-
- *bufptr++ = (j + 1);
}
- uint8_t trailer = 0;
- if (HAL_SPI_Transmit(&SpiHandle, &trailer, 1, HAL_MAX_DELAY) != HAL_OK) {
- goto finish;
- }
-
-
finish:
chip_select(false);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698