summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-scroll.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/lcd-scroll.c')
-rw-r--r--firmware/drivers/lcd-scroll.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/firmware/drivers/lcd-scroll.c b/firmware/drivers/lcd-scroll.c
index a1bde9fe12..5162f9a100 100644
--- a/firmware/drivers/lcd-scroll.c
+++ b/firmware/drivers/lcd-scroll.c
@@ -30,7 +30,7 @@
30#define MAIN_LCD 30#define MAIN_LCD
31#endif 31#endif
32 32
33static struct scrollinfo LCDFN(scroll)[LCD_SCROLLABLE_LINES]; 33static struct scrollinfo LCDFN(scroll)[LCDM(SCROLLABLE_LINES)];
34 34
35struct scroll_screen_info LCDFN(scroll_info) = 35struct scroll_screen_info LCDFN(scroll_info) =
36{ 36{
@@ -51,6 +51,13 @@ struct scroll_screen_info LCDFN(scroll_info) =
51 51
52void LCDFN(scroll_stop)(void) 52void LCDFN(scroll_stop)(void)
53{ 53{
54 for (int i = 0; i < LCDFN(scroll_info).lines; i++)
55 {
56 /* inform scroller about end of scrolling */
57 struct scrollinfo *s = &LCDFN(scroll_info).scroll[i];
58 s->line = NULL;
59 s->scroll_func(s);
60 }
54 LCDFN(scroll_info).lines = 0; 61 LCDFN(scroll_info).lines = 0;
55} 62}
56 63
@@ -66,6 +73,9 @@ void LCDFN(scroll_stop_viewport_rect)(const struct viewport *vp, int x, int y, i
66 && (x < (s->x+s->width) && (x+width) >= s->x) 73 && (x < (s->x+s->width) && (x+width) >= s->x)
67 && (y < (s->y+s->height) && (y+height) >= s->y)) 74 && (y < (s->y+s->height) && (y+height) >= s->y))
68 { 75 {
76 /* inform scroller about end of scrolling */
77 s->line = NULL;
78 s->scroll_func(s);
69 /* If i is not the last active line in the array, then move 79 /* If i is not the last active line in the array, then move
70 the last item to position i. This compacts 80 the last item to position i. This compacts
71 the scroll array at the same time of removing the line */ 81 the scroll array at the same time of removing the line */