Skip to content

Commit af9470b

Browse files
poeschelojeda
authored andcommitted
auxdisplay: charlcd: Do not print chars at end of line
Skip printing characters at the end of a display line. This fits to the behaviour we already had, that the cursor is nailed to the last position of a line. This might slightly change behaviour. On hd44780 displays with one or two lines the previous implementation did still write characters to the buffer of the display even if they are currently not visible. The shift_display command could be used to set the "viewing window" to a new position in the buffer and then you could see the characters previously written. This described behaviour does not work for hd44780 displays with more than two display lines. There simply is not enough buffer. So the behaviour was a bit inconsistent across different displays. The new behaviour is to stop writing characters at the end of a visible line, even if there would be room in the buffer. This allows us to have an easy implementation, that should behave equal on all supported displays. This is not hd44780 hardware dependent anymore. Reviewed-by: Willy Tarreau <[email protected]> Signed-off-by: Lars Poeschel <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 40c2b72 commit af9470b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/auxdisplay/charlcd.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ static void charlcd_home(struct charlcd *lcd)
111111

112112
static void charlcd_print(struct charlcd *lcd, char c)
113113
{
114+
if (lcd->addr.x >= lcd->width)
115+
return;
116+
114117
if (lcd->char_conv)
115118
c = lcd->char_conv[(unsigned char)c];
116119

0 commit comments

Comments
 (0)