diff options
Diffstat (limited to 'firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c')
-rw-r--r-- | firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c index 021110c7c6..bc92995094 100644 --- a/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c +++ b/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c | |||
@@ -55,7 +55,7 @@ static void scrollwheel(short dbop_din) | |||
55 | unsigned btn = BUTTON_NONE; | 55 | unsigned btn = BUTTON_NONE; |
56 | /* old wheel values */ | 56 | /* old wheel values */ |
57 | static unsigned old_wheel_value = 0; | 57 | static unsigned old_wheel_value = 0; |
58 | static unsigned wheel_repeat = BUTTON_NONE; | 58 | static unsigned old_btn = BUTTON_NONE; |
59 | 59 | ||
60 | /* getting BUTTON_REPEAT works like this: Remember when the btn value was | 60 | /* getting BUTTON_REPEAT works like this: Remember when the btn value was |
61 | * posted to the button_queue last, and if it was recent enough, generate | 61 | * posted to the button_queue last, and if it was recent enough, generate |
@@ -77,7 +77,13 @@ static void scrollwheel(short dbop_din) | |||
77 | { 2, 0, 3, 1 }, /* Clockwise rotation */ | 77 | { 2, 0, 3, 1 }, /* Clockwise rotation */ |
78 | { 1, 3, 0, 2 }, /* Counter-clockwise */ | 78 | { 1, 3, 0, 2 }, /* Counter-clockwise */ |
79 | }; | 79 | }; |
80 | 80 | ||
81 | if(hold_button) | ||
82 | { | ||
83 | repeat = counter = 0; | ||
84 | return; | ||
85 | } | ||
86 | |||
81 | wheel_value = dbop_din & (1<<13|1<<14); | 87 | wheel_value = dbop_din & (1<<13|1<<14); |
82 | wheel_value >>= 13; | 88 | wheel_value >>= 13; |
83 | 89 | ||
@@ -88,10 +94,10 @@ static void scrollwheel(short dbop_din) | |||
88 | 94 | ||
89 | if (btn != BUTTON_NONE) | 95 | if (btn != BUTTON_NONE) |
90 | { | 96 | { |
91 | if (btn != wheel_repeat) | 97 | if (btn != old_btn) |
92 | { | 98 | { |
93 | /* direction reversals nullify repeats */ | 99 | /* direction reversals nullify repeats */ |
94 | wheel_repeat = btn; | 100 | old_btn = btn; |
95 | repeat = counter = 0; | 101 | repeat = counter = 0; |
96 | } | 102 | } |
97 | if (btn != BUTTON_NONE) | 103 | if (btn != BUTTON_NONE) |