forked from len0rd/rockbox
Unify kernel list management for ticks, registered queues and timeout objects by using NULL-terminated lists of pointers. Redo timeout API a bit to simplify it and integrate it. Should give some small binsize reduction accross the board but more if timeout objects are being included.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19808 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a7ec73cddd
commit
580d91f097
5 changed files with 122 additions and 120 deletions
|
|
@ -85,13 +85,13 @@ static int button_read(void);
|
|||
static struct timeout hp_detect_timeout; /* Debouncer for headphone plug/unplug */
|
||||
/* This callback can be used for many different functions if needed -
|
||||
just check to which object tmo points */
|
||||
static bool btn_detect_callback(struct timeout *tmo)
|
||||
static int btn_detect_callback(struct timeout *tmo)
|
||||
{
|
||||
/* Try to post only transistions */
|
||||
const long id = tmo->data ? SYS_PHONE_PLUGGED : SYS_PHONE_UNPLUGGED;
|
||||
queue_remove_from_head(&button_queue, id);
|
||||
queue_post(&button_queue, id, 0);
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue