diff options
Diffstat (limited to 'firmware/target/arm/as3525/sansa-fuze')
-rw-r--r-- | firmware/target/arm/as3525/sansa-fuze/button-fuze.c | 13 | ||||
-rw-r--r-- | firmware/target/arm/as3525/sansa-fuze/button-target.h | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/firmware/target/arm/as3525/sansa-fuze/button-fuze.c b/firmware/target/arm/as3525/sansa-fuze/button-fuze.c index f532a96431..afbba78074 100644 --- a/firmware/target/arm/as3525/sansa-fuze/button-fuze.c +++ b/firmware/target/arm/as3525/sansa-fuze/button-fuze.c | |||
@@ -56,7 +56,7 @@ static void scrollwheel(short dbop_din) | |||
56 | unsigned btn = BUTTON_NONE; | 56 | unsigned btn = BUTTON_NONE; |
57 | /* old wheel values */ | 57 | /* old wheel values */ |
58 | static unsigned old_wheel_value = 0; | 58 | static unsigned old_wheel_value = 0; |
59 | static unsigned wheel_repeat = BUTTON_NONE; | 59 | static unsigned old_btn = BUTTON_NONE; |
60 | 60 | ||
61 | /* getting BUTTON_REPEAT works like this: We increment repeat by 2 if the | 61 | /* getting BUTTON_REPEAT works like this: We increment repeat by 2 if the |
62 | * wheel was turned, and decrement it by 1 each tick, | 62 | * wheel was turned, and decrement it by 1 each tick, |
@@ -76,6 +76,13 @@ static void scrollwheel(short dbop_din) | |||
76 | { 2, 0, 3, 1 }, /* Clockwise rotation */ | 76 | { 2, 0, 3, 1 }, /* Clockwise rotation */ |
77 | { 1, 3, 0, 2 }, /* Counter-clockwise */ | 77 | { 1, 3, 0, 2 }, /* Counter-clockwise */ |
78 | }; | 78 | }; |
79 | |||
80 | if(hold_button) | ||
81 | { | ||
82 | repeat = counter = 0; | ||
83 | return; | ||
84 | } | ||
85 | |||
79 | wheel_value = dbop_din & (1<<13|1<<14); | 86 | wheel_value = dbop_din & (1<<13|1<<14); |
80 | wheel_value >>= 13; | 87 | wheel_value >>= 13; |
81 | 88 | ||
@@ -86,10 +93,10 @@ static void scrollwheel(short dbop_din) | |||
86 | 93 | ||
87 | if (btn != BUTTON_NONE) | 94 | if (btn != BUTTON_NONE) |
88 | { | 95 | { |
89 | if (btn != wheel_repeat) | 96 | if (btn != old_btn) |
90 | { | 97 | { |
91 | /* direction reversals nullify repeats */ | 98 | /* direction reversals nullify repeats */ |
92 | wheel_repeat = btn; | 99 | old_btn = btn; |
93 | repeat = counter = 0; | 100 | repeat = counter = 0; |
94 | } | 101 | } |
95 | if (btn != BUTTON_NONE) | 102 | if (btn != BUTTON_NONE) |
diff --git a/firmware/target/arm/as3525/sansa-fuze/button-target.h b/firmware/target/arm/as3525/sansa-fuze/button-target.h index 75ce3d060e..5b5b1e097f 100644 --- a/firmware/target/arm/as3525/sansa-fuze/button-target.h +++ b/firmware/target/arm/as3525/sansa-fuze/button-target.h | |||
@@ -30,7 +30,7 @@ | |||
30 | void button_init_device(void); | 30 | void button_init_device(void); |
31 | bool button_hold(void); | 31 | bool button_hold(void); |
32 | int button_read_device(void); | 32 | int button_read_device(void); |
33 | 33 | short button_read_dbop(void); | |
34 | /* Sandisk Sansa Fuze button codes */ | 34 | /* Sandisk Sansa Fuze button codes */ |
35 | 35 | ||
36 | /* Main unit's buttons */ | 36 | /* Main unit's buttons */ |