Skip to content

Commit 2b5ee0c

Browse files
falojmmahadevan108
authored andcommitted
drivers: display: ssd1322: fix only part of the image being diplayed
Only the first chunk of the desired image is displayed repeatedly over the screen height (at least on an NHD-2.7-12864WDW3 display). Fix it by computing the internal mono01 to 4bit grayscale conversion buffer size correctly so it can fit the entire image. Signed-off-by: Johan Lafon <[email protected]>
1 parent a140dd3 commit 2b5ee0c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/display/ssd1322.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,9 @@ static struct display_driver_api ssd1322_driver_api = {
358358
};
359359

360360
#define SSD1322_CONV_BUFFER_SIZE(node_id) \
361-
(DT_PROP(node_id, width) * DT_PROP(node_id, segments_per_pixel) * 4)
361+
DIV_ROUND_UP(DT_PROP(node_id, width) * DT_PROP(node_id, height) * \
362+
DT_PROP(node_id, segments_per_pixel), \
363+
SEGMENTS_PER_BYTE)
362364

363365
#define SSD1322_DEFINE(node_id) \
364366
static uint8_t conversion_buf##node_id[SSD1322_CONV_BUFFER_SIZE(node_id)]; \

0 commit comments

Comments
 (0)