summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/drivers/lcd-player.c12
-rw-r--r--firmware/drivers/lcd.h1
2 files changed, 11 insertions, 2 deletions
diff --git a/firmware/drivers/lcd-player.c b/firmware/drivers/lcd-player.c
index c6385a222c..3917692df9 100644
--- a/firmware/drivers/lcd-player.c
+++ b/firmware/drivers/lcd-player.c
@@ -78,6 +78,7 @@ static char scroll_name[] = "scroll";
78static char scroll_speed = 8; /* updates per second */ 78static char scroll_speed = 8; /* updates per second */
79static int scroll_delay = HZ/2; /* delay before starting scroll */ 79static int scroll_delay = HZ/2; /* delay before starting scroll */
80static char scroll_spacing = 3; /* spaces between end and start of text */ 80static char scroll_spacing = 3; /* spaces between end and start of text */
81static bool allow_bidirectictional_scrolling = true;
81 82
82static struct scrollinfo scroll[SCROLLABLE_LINES]; 83static struct scrollinfo scroll[SCROLLABLE_LINES];
83 84
@@ -462,8 +463,10 @@ void lcd_puts_scroll(int x, int y, unsigned char* string )
462 s->direction=+1; 463 s->direction=+1;
463 strncpy(s->text,string,sizeof s->text); 464 strncpy(s->text,string,sizeof s->text);
464 s->turn_offset=-1; 465 s->turn_offset=-1;
465 if ( s->textlen + x > 11+4) 466 if (allow_bidirectictional_scrolling) {
466 s->turn_offset=s->textlen-x-11+4; 467 if ( s->textlen + x > 11+4)
468 s->turn_offset=s->textlen-x-11+4;
469 }
467 470
468 for (i=0; i<scroll_spacing && s->textlen<(int)sizeof(s->text); i++) { 471 for (i=0; i<scroll_spacing && s->textlen<(int)sizeof(s->text); i++) {
469 s->text[s->textlen++]=' '; 472 s->text[s->textlen++]=' ';
@@ -554,6 +557,11 @@ void lcd_scroll_resume_line(int line)
554 } 557 }
555} 558}
556 559
560void lcd_allow_bidirectictional_scrolling(bool on)
561{
562 allow_bidirectictional_scrolling=on;
563}
564
557void lcd_scroll_speed(int speed) 565void lcd_scroll_speed(int speed)
558{ 566{
559 scroll_speed = speed; 567 scroll_speed = speed;
diff --git a/firmware/drivers/lcd.h b/firmware/drivers/lcd.h
index bd993387b6..1a5cd0851c 100644
--- a/firmware/drivers/lcd.h
+++ b/firmware/drivers/lcd.h
@@ -87,6 +87,7 @@ extern void lcd_define_pattern (int which,char *pattern);
87extern void lcd_double_height (bool on); 87extern void lcd_double_height (bool on);
88unsigned char lcd_get_locked_pattern(void); 88unsigned char lcd_get_locked_pattern(void);
89void lcd_unlock_pattern(unsigned char pat); 89void lcd_unlock_pattern(unsigned char pat);
90void lcd_allow_bidirectictional_scrolling(bool on);
90 91
91#endif 92#endif
92 93