mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
fix hold-button handling for m200v4.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19314 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4317ff90a9
commit
0d0cc039f8
1 changed files with 4 additions and 2 deletions
|
|
@ -36,6 +36,8 @@ static inline void btn_delay(void) { int i = 5; while(i--) ; }
|
||||||
int button_read_device(void)
|
int button_read_device(void)
|
||||||
{
|
{
|
||||||
int result = BUTTON_NONE;
|
int result = BUTTON_NONE;
|
||||||
|
if(button_hold())
|
||||||
|
return result;
|
||||||
|
|
||||||
/* direct GPIO connections */
|
/* direct GPIO connections */
|
||||||
if (GPIOA_PIN(3))
|
if (GPIOA_PIN(3))
|
||||||
|
|
@ -44,6 +46,7 @@ int button_read_device(void)
|
||||||
/* This is a keypad using A4-A6 as columns and A0-A2 as rows */
|
/* This is a keypad using A4-A6 as columns and A0-A2 as rows */
|
||||||
GPIOA_PIN(4) = (1<<4);
|
GPIOA_PIN(4) = (1<<4);
|
||||||
btn_delay();
|
btn_delay();
|
||||||
|
|
||||||
/* A4A0 is unused */
|
/* A4A0 is unused */
|
||||||
|
|
||||||
if (GPIOA_PIN(1))
|
if (GPIOA_PIN(1))
|
||||||
|
|
@ -78,8 +81,7 @@ int button_read_device(void)
|
||||||
if (GPIOA_PIN(1))
|
if (GPIOA_PIN(1))
|
||||||
result |= BUTTON_VOLUP;
|
result |= BUTTON_VOLUP;
|
||||||
|
|
||||||
if (GPIOA_PIN(2))
|
/* hold button is read in button_hold() */
|
||||||
result |= BUTTON_HOLD;
|
|
||||||
|
|
||||||
GPIOA_PIN(6) = 0x00;
|
GPIOA_PIN(6) = 0x00;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue