From 6630958533d02d66dca8cc79897fda2cb744c076 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Fri, 20 Dec 2013 23:34:28 +0100 Subject: lcd-common/scroll_engine: Introduce lcd_putsxy_scroll_func(). This function supports installing a custom scroll callback. This will be called when the scrollengine redraws the line. It allows to draw extended styles (or anything your can possible imagine) along with the text. It is also strictly pixel-based, the first pixel-based function that supports scrolling. Change-Id: I57f81ac7b3d08b877aea4cb8afa882f175ebcdfc --- firmware/drivers/lcd-charcell.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'firmware/drivers/lcd-charcell.c') diff --git a/firmware/drivers/lcd-charcell.c b/firmware/drivers/lcd-charcell.c index db867cdb0a..54159519a3 100644 --- a/firmware/drivers/lcd-charcell.c +++ b/firmware/drivers/lcd-charcell.c @@ -563,6 +563,16 @@ void lcd_puts_scroll_worker(int x, int y, const unsigned char *string, lcd_scroll_info.lines++; } +void lcd_putsxy_scroll_func(int x, int y, const unsigned char *string, + void (*scroll_func)(struct scrollinfo *), + void *data, int x_offset) +{ + if (!scroll_func) + lcd_putsxyofs(x, y, x_offset, string); + else + lcd_puts_scroll_worker(x, y, string, x_offset, scroll_func, data); +} + void lcd_scroll_fn(struct scrollinfo* s) { lcd_putsxyofs(s->x, s->y, s->offset, s->line); -- cgit v1.2.3