diff options
-rw-r--r-- | firmware/target/coldfire/mpio/hd300/button-hd300.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/firmware/target/coldfire/mpio/hd300/button-hd300.c b/firmware/target/coldfire/mpio/hd300/button-hd300.c index f59c046cdb..fda26dd0df 100644 --- a/firmware/target/coldfire/mpio/hd300/button-hd300.c +++ b/firmware/target/coldfire/mpio/hd300/button-hd300.c | |||
@@ -90,20 +90,20 @@ void scrollstrip_isr(void) | |||
90 | /* read GPIO6 and GPIO7 state*/ | 90 | /* read GPIO6 and GPIO7 state*/ |
91 | new_scroll_lines = (GPIO_READ >> 6) & 0x03; | 91 | new_scroll_lines = (GPIO_READ >> 6) & 0x03; |
92 | 92 | ||
93 | /* was it initialized? */ | ||
93 | if ( prev_scroll_lines == -1 ) | 94 | if ( prev_scroll_lines == -1 ) |
94 | { | 95 | { |
95 | prev_scroll_lines = new_scroll_lines; | 96 | prev_scroll_lines = new_scroll_lines; |
96 | ack_scrollstrip_interrupt(); | 97 | goto end; |
97 | enable_scrollstrip_interrupts(); | ||
98 | return; | ||
99 | } | 98 | } |
100 | 99 | ||
100 | /* calculate the direction according to the sequence order */ | ||
101 | scroll_dir = scroll_state[prev_scroll_lines][new_scroll_lines]; | 101 | scroll_dir = scroll_state[prev_scroll_lines][new_scroll_lines]; |
102 | prev_scroll_lines = new_scroll_lines; | 102 | prev_scroll_lines = new_scroll_lines; |
103 | 103 | ||
104 | /* catch sequence error */ | 104 | /* catch sequence error */ |
105 | if (scroll_dir == BUTTON_NONE) | 105 | if (scroll_dir == BUTTON_NONE) |
106 | return; | 106 | goto end; |
107 | 107 | ||
108 | /* direction reversal */ | 108 | /* direction reversal */ |
109 | if (direction != scroll_dir) | 109 | if (direction != scroll_dir) |
@@ -116,9 +116,7 @@ void scrollstrip_isr(void) | |||
116 | 116 | ||
117 | direction = scroll_dir; | 117 | direction = scroll_dir; |
118 | count = 0; | 118 | count = 0; |
119 | ack_scrollstrip_interrupt(); | 119 | goto end; |
120 | enable_scrollstrip_interrupts(); | ||
121 | return; | ||
122 | } | 120 | } |
123 | 121 | ||
124 | /* poke backlight */ | 122 | /* poke backlight */ |
@@ -129,12 +127,9 @@ void scrollstrip_isr(void) | |||
129 | next_backlight_on = current_tick + HZ/4; | 127 | next_backlight_on = current_tick + HZ/4; |
130 | } | 128 | } |
131 | 129 | ||
130 | /* apply sensitivity filter */ | ||
132 | if (++count < SLIDER_BASE_SENSITIVITY) | 131 | if (++count < SLIDER_BASE_SENSITIVITY) |
133 | { | 132 | goto end; |
134 | ack_scrollstrip_interrupt(); | ||
135 | enable_scrollstrip_interrupts(); | ||
136 | return; | ||
137 | } | ||
138 | 133 | ||
139 | count = 0; | 134 | count = 0; |
140 | 135 | ||
@@ -146,6 +141,10 @@ void scrollstrip_isr(void) | |||
146 | scroll.timeout = current_tick + SLIDER_REL_TIMEOUT; | 141 | scroll.timeout = current_tick + SLIDER_REL_TIMEOUT; |
147 | scroll.rel = false; | 142 | scroll.rel = false; |
148 | 143 | ||
144 | end: | ||
145 | /* acknowledge the interrupt | ||
146 | * and reenable scrollstrip interrupts | ||
147 | */ | ||
149 | ack_scrollstrip_interrupt(); | 148 | ack_scrollstrip_interrupt(); |
150 | enable_scrollstrip_interrupts(); | 149 | enable_scrollstrip_interrupts(); |
151 | } | 150 | } |