forked from len0rd/rockbox
D2: Implement HAS_BUTTON_HOLD.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16748 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b659c0c14c
commit
f061ba4ebb
2 changed files with 11 additions and 7 deletions
|
@ -27,6 +27,11 @@ void button_init_device(void)
|
|||
/* Nothing to do */
|
||||
}
|
||||
|
||||
bool button_hold(void)
|
||||
{
|
||||
return (GPIOA & 0x8) ? false : true;
|
||||
}
|
||||
|
||||
int button_read_device(void)
|
||||
{
|
||||
int btn = BUTTON_NONE;
|
||||
|
@ -57,9 +62,6 @@ int button_read_device(void)
|
|||
/* TODO: Read 'fake' buttons based on touchscreen quadrants.
|
||||
Question: How can I read from the PCF chip (I2C) in a tick task? */
|
||||
|
||||
if (!(GPIOA & 0x8))
|
||||
btn |= BUTTON_HOLD;
|
||||
|
||||
if (!(GPIOA & 0x4))
|
||||
btn |= BUTTON_POWER;
|
||||
|
||||
|
|
|
@ -23,15 +23,17 @@
|
|||
#include <stdbool.h>
|
||||
#include "config.h"
|
||||
|
||||
#define HAS_BUTTON_HOLD
|
||||
|
||||
bool button_hold(void);
|
||||
void button_init_device(void);
|
||||
int button_read_device(void);
|
||||
|
||||
/* Main unit's buttons */
|
||||
#define BUTTON_POWER 0x00000001
|
||||
#define BUTTON_HOLD 0x00000002
|
||||
#define BUTTON_PLUS 0x00000004
|
||||
#define BUTTON_MINUS 0x00000008
|
||||
#define BUTTON_MENU 0x00000010
|
||||
#define BUTTON_PLUS 0x00000002
|
||||
#define BUTTON_MINUS 0x00000004
|
||||
#define BUTTON_MENU 0x00000008
|
||||
|
||||
/* Faked buttons based on touchscreen quadrants (not yet read) */
|
||||
#define BUTTON_UP 0x00000020
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue