summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-10-09 23:27:38 +0000
committerThomas Martitz <kugel@rockbox.org>2009-10-09 23:27:38 +0000
commitfaddb574824b4181aa02c0e385b177487a75e1e5 (patch)
tree0d8db0e8d13b1234a78f3fc6bbc59928e6d9f222
parenta931acd3abff29fb93d3824cefff7b44614b8f45 (diff)
downloadrockbox-faddb574824b4181aa02c0e385b177487a75e1e5.tar.gz
rockbox-faddb574824b4181aa02c0e385b177487a75e1e5.zip
Fuze/e200v2: Fix inaccuracy when moving the wheel slowly (fixes FS#10667).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23059 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/button-e200v2-fuze.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/firmware/target/arm/as3525/button-e200v2-fuze.c b/firmware/target/arm/as3525/button-e200v2-fuze.c
index edb2aa4a47..ef343b5514 100644
--- a/firmware/target/arm/as3525/button-e200v2-fuze.c
+++ b/firmware/target/arm/as3525/button-e200v2-fuze.c
@@ -93,7 +93,7 @@ static void scrollwheel(unsigned short dbop_din)
93 * clicks of the wheel */ 93 * clicks of the wheel */
94 static int counter = 0; 94 static int counter = 0;
95 /* Read wheel 95 /* Read wheel
96 * Bits 13 and 14 of DBOP_DIN change as follows: 96 * Bits 13 and 14 of DBOP_DIN change as follows (Gray Code):
97 * Clockwise rotation 00 -> 01 -> 11 -> 10 -> 00 97 * Clockwise rotation 00 -> 01 -> 11 -> 10 -> 00
98 * Counter-clockwise 00 -> 10 -> 11 -> 01 -> 00 98 * Counter-clockwise 00 -> 10 -> 11 -> 01 -> 00
99 * 99 *
@@ -118,18 +118,16 @@ static void scrollwheel(unsigned short dbop_din)
118 btn = BUTTON_SCROLL_FWD; 118 btn = BUTTON_SCROLL_FWD;
119 else if (old_wheel_value == wheel_tbl[1][wheel_value]) 119 else if (old_wheel_value == wheel_tbl[1][wheel_value])
120 btn = BUTTON_SCROLL_BACK; 120 btn = BUTTON_SCROLL_BACK;
121 else if (old_btn != BUTTON_NONE) 121 else if (old_wheel_value != wheel_value && accel > ACCEL_INCREMENT)
122 { /* if no button is read, assume old_btn, but only once to not have 122 { /* if no button is read and wheel_value changed, assume old_btn */
123 * wrong readings */
124 btn = old_btn; 123 btn = old_btn;
125 old_btn = BUTTON_NONE;
126 } 124 }
127 /* else btn = BUTTON_NONE */ 125 /* else btn = BUTTON_NONE */
128 126
129 if (btn != BUTTON_NONE) 127 if (btn != BUTTON_NONE)
130 { 128 {
131 if (btn != old_btn && old_btn != BUTTON_NONE) 129 if (btn != old_btn)
132 { /* don't do this if we assumned old_btn */ 130 {
133 /* direction reversals nullify acceleration and counters */ 131 /* direction reversals nullify acceleration and counters */
134 old_btn = btn; 132 old_btn = btn;
135 accel = counter = 0; 133 accel = counter = 0;