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:
William Wilgus 2024-11-27 17:11:03 -05:00
parent 5954a2fd48
commit da9d67a0fe
30 changed files with 266 additions and 221 deletions

View file

@ -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();

View file

@ -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 */

View file

@ -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();