diff options
Diffstat (limited to 'firmware/drivers/lcd-player.c')
-rw-r--r-- | firmware/drivers/lcd-player.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/firmware/drivers/lcd-player.c b/firmware/drivers/lcd-player.c index 01d7cfdb6e..8dd97cac0a 100644 --- a/firmware/drivers/lcd-player.c +++ b/firmware/drivers/lcd-player.c | |||
@@ -88,7 +88,7 @@ struct cursorinfo { | |||
88 | static void scroll_thread(void); | 88 | static void scroll_thread(void); |
89 | static char scroll_stack[DEFAULT_STACK_SIZE]; | 89 | static char scroll_stack[DEFAULT_STACK_SIZE]; |
90 | static const char scroll_name[] = "scroll"; | 90 | static const char scroll_name[] = "scroll"; |
91 | static char scroll_speed = 8; /* updates per second */ | 91 | static char scroll_ticks = 12; /* # of ticks between updates */ |
92 | static int scroll_delay = HZ/2; /* delay before starting scroll */ | 92 | static int scroll_delay = HZ/2; /* delay before starting scroll */ |
93 | static int jump_scroll_delay = HZ/4; /* delay between jump scroll jumps */ | 93 | static int jump_scroll_delay = HZ/4; /* delay between jump scroll jumps */ |
94 | static char scroll_spacing = 3; /* spaces between end and start of text */ | 94 | static char scroll_spacing = 3; /* spaces between end and start of text */ |
@@ -547,7 +547,7 @@ void lcd_puts_scroll(int x, int y, const unsigned char* string ) | |||
547 | s->direction=+1; | 547 | s->direction=+1; |
548 | s->jump_scroll=0; | 548 | s->jump_scroll=0; |
549 | s->jump_scroll_steps=0; | 549 | s->jump_scroll_steps=0; |
550 | if (jump_scroll && jump_scroll_delay<(HZ/scroll_speed)*(s->textlen-11+x)) { | 550 | if (jump_scroll && jump_scroll_delay<scroll_ticks*(s->textlen-11+x)) { |
551 | s->jump_scroll_steps=11-x; | 551 | s->jump_scroll_steps=11-x; |
552 | s->jump_scroll=jump_scroll; | 552 | s->jump_scroll=jump_scroll; |
553 | } | 553 | } |
@@ -593,9 +593,15 @@ void lcd_allow_bidirectional_scrolling(bool on) | |||
593 | allow_bidirectional_scrolling=on; | 593 | allow_bidirectional_scrolling=on; |
594 | } | 594 | } |
595 | 595 | ||
596 | static const char scroll_tick_table[16] = { | ||
597 | /* Hz values: | ||
598 | 1, 1.25, 1.55, 2, 2.5, 3.12, 4, 5, 6.25, 8.33, 10, 12.5, 16.7, 20, 25, 33 */ | ||
599 | 100, 80, 64, 50, 40, 32, 25, 20, 16, 12, 10, 8, 6, 5, 4, 3 | ||
600 | }; | ||
601 | |||
596 | void lcd_scroll_speed(int speed) | 602 | void lcd_scroll_speed(int speed) |
597 | { | 603 | { |
598 | scroll_speed = speed; | 604 | scroll_ticks = scroll_tick_table[speed]; |
599 | } | 605 | } |
600 | 606 | ||
601 | void lcd_scroll_delay(int ms) | 607 | void lcd_scroll_delay(int ms) |
@@ -723,7 +729,7 @@ static void scroll_thread(void) | |||
723 | } | 729 | } |
724 | } | 730 | } |
725 | 731 | ||
726 | sleep(HZ/scroll_speed); | 732 | sleep(scroll_ticks); |
727 | } | 733 | } |
728 | } | 734 | } |
729 | 735 | ||