mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 13:12:37 -05:00
Button queue handling is split from main button driver
First half of https://gerrit.rockbox.org/r/c/rockbox/+/570 Change-Id: Icc64dfd8194c18f69564ed5f8bf7dd70a4330eb9
This commit is contained in:
parent
5954a2fd48
commit
da9d67a0fe
30 changed files with 266 additions and 221 deletions
|
|
@ -305,7 +305,7 @@ int button_read_device(void)
|
|||
{
|
||||
/* need to use queue_post() in order to do BUTTON_SCROLL_*,
|
||||
* Rockbox treats these buttons differently. */
|
||||
queue_post(&button_queue, BUTTON_SCROLL_FWD, 0);
|
||||
button_queue_post(BUTTON_SCROLL_FWD, 0);
|
||||
enc_position = 0;
|
||||
reset_poweroff_timer();
|
||||
backlight_on();
|
||||
|
|
@ -314,7 +314,7 @@ int button_read_device(void)
|
|||
{
|
||||
/* need to use queue_post() in order to do BUTTON_SCROLL_*,
|
||||
* Rockbox treats these buttons differently. */
|
||||
queue_post(&button_queue, BUTTON_SCROLL_BACK, 0);
|
||||
button_queue_post(BUTTON_SCROLL_BACK, 0);
|
||||
enc_position = 0;
|
||||
reset_poweroff_timer();
|
||||
backlight_on();
|
||||
|
|
|
|||
|
|
@ -296,9 +296,9 @@ static void ft_step_state(uint32_t t, int evt, int tx, int ty)
|
|||
* should not be necessary but better to be safe. */
|
||||
if(fsm.active) {
|
||||
if(dy < 0) {
|
||||
queue_post(&button_queue, BUTTON_SCROLL_BACK, 0);
|
||||
button_queue_post(BUTTON_SCROLL_BACK, 0);
|
||||
} else {
|
||||
queue_post(&button_queue, BUTTON_SCROLL_FWD, 0);
|
||||
button_queue_post(BUTTON_SCROLL_FWD, 0);
|
||||
}
|
||||
|
||||
/* Poke the backlight */
|
||||
|
|
|
|||
|
|
@ -136,8 +136,8 @@ int button_read_device(int* data)
|
|||
wheel_pos = 0;
|
||||
|
||||
/* Post the event (rapid motion is more reliable this way) */
|
||||
queue_post(&button_queue, wheel_btn, 0);
|
||||
queue_post(&button_queue, wheel_btn|BUTTON_REL, 0);
|
||||
button_queue_post(wheel_btn, 0);
|
||||
button_queue_post(wheel_btn|BUTTON_REL, 0);
|
||||
|
||||
/* Poke the backlight */
|
||||
backlight_on();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue