summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-recorder.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2004-10-15 20:30:29 +0000
committerJens Arnold <amiconn@rockbox.org>2004-10-15 20:30:29 +0000
commit566eae2e119f3c57b1df0782ddcc29fccedbf816 (patch)
treefc8cced8cd199734b2185a20efdfd2ebbcce41bb /firmware/drivers/lcd-recorder.c
parent672305f0a1fe8e423904f95d5cb22aea68ff4c62 (diff)
downloadrockbox-566eae2e119f3c57b1df0782ddcc29fccedbf816.tar.gz
rockbox-566eae2e119f3c57b1df0782ddcc29fccedbf816.zip
Logarithmic scroll speed setting: speed doubles every 3 steps.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5288 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd-recorder.c')
-rw-r--r--firmware/drivers/lcd-recorder.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index a711a8fa6d..8f8e9f9332 100644
--- a/firmware/drivers/lcd-recorder.c
+++ b/firmware/drivers/lcd-recorder.c
@@ -94,7 +94,7 @@ static volatile int scrolling_lines=0; /* Bitpattern of which lines are scrollin
94static void scroll_thread(void); 94static void scroll_thread(void);
95static char scroll_stack[DEFAULT_STACK_SIZE]; 95static char scroll_stack[DEFAULT_STACK_SIZE];
96static const char scroll_name[] = "scroll"; 96static const char scroll_name[] = "scroll";
97static char scroll_speed = 8; /* updates per second */ 97static char scroll_ticks = 12; /* # of ticks between updates*/
98static int scroll_delay = HZ/2; /* ticks delay before start */ 98static int scroll_delay = HZ/2; /* ticks delay before start */
99static char scroll_step = 6; /* pixels per scroll step */ 99static char scroll_step = 6; /* pixels per scroll step */
100static int bidir_limit = 50; /* percent */ 100static int bidir_limit = 50; /* percent */
@@ -856,9 +856,15 @@ void lcd_stop_scroll(void)
856 scrolling_lines=0; 856 scrolling_lines=0;
857} 857}
858 858
859static const char scroll_tick_table[16] = {
860 /* Hz values:
861 1, 1.25, 1.55, 2, 2.5, 3.12, 4, 5, 6.25, 8.33, 10, 12.5, 16.7, 20, 25, 33 */
862 100, 80, 64, 50, 40, 32, 25, 20, 16, 12, 10, 8, 6, 5, 4, 3
863};
864
859void lcd_scroll_speed(int speed) 865void lcd_scroll_speed(int speed)
860{ 866{
861 scroll_speed = speed; 867 scroll_ticks = scroll_tick_table[speed];
862} 868}
863 869
864void lcd_scroll_step(int step) 870void lcd_scroll_step(int step)
@@ -933,7 +939,7 @@ static void scroll_thread(void)
933 lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height); 939 lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
934 } 940 }
935 941
936 sleep(HZ/scroll_speed); 942 sleep(scroll_ticks);
937 } 943 }
938} 944}
939 945