summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2008-12-03 18:41:02 +0000
committerDominik Wenger <domonoky@googlemail.com>2008-12-03 18:41:02 +0000
commit0d0cc039f88ced4f6db5c4468b19913f52cd08c8 (patch)
treec5b3e0bb912781a8393565e6b596f14e8ccfa9eb
parent4317ff90a92ffa91b4aa457410d40da338182436 (diff)
downloadrockbox-0d0cc039f88ced4f6db5c4468b19913f52cd08c8.tar.gz
rockbox-0d0cc039f88ced4f6db5c4468b19913f52cd08c8.zip
fix hold-button handling for m200v4.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19314 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/sansa-m200v4/button-m200v4.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/firmware/target/arm/as3525/sansa-m200v4/button-m200v4.c b/firmware/target/arm/as3525/sansa-m200v4/button-m200v4.c
index f8d64e2785..a10956657f 100644
--- a/firmware/target/arm/as3525/sansa-m200v4/button-m200v4.c
+++ b/firmware/target/arm/as3525/sansa-m200v4/button-m200v4.c
@@ -36,6 +36,8 @@ static inline void btn_delay(void) { int i = 5; while(i--) ; }
36int button_read_device(void) 36int button_read_device(void)
37{ 37{
38 int result = BUTTON_NONE; 38 int result = BUTTON_NONE;
39 if(button_hold())
40 return result;
39 41
40 /* direct GPIO connections */ 42 /* direct GPIO connections */
41 if (GPIOA_PIN(3)) 43 if (GPIOA_PIN(3))
@@ -44,6 +46,7 @@ int button_read_device(void)
44 /* This is a keypad using A4-A6 as columns and A0-A2 as rows */ 46 /* This is a keypad using A4-A6 as columns and A0-A2 as rows */
45 GPIOA_PIN(4) = (1<<4); 47 GPIOA_PIN(4) = (1<<4);
46 btn_delay(); 48 btn_delay();
49
47 /* A4A0 is unused */ 50 /* A4A0 is unused */
48 51
49 if (GPIOA_PIN(1)) 52 if (GPIOA_PIN(1))
@@ -78,8 +81,7 @@ int button_read_device(void)
78 if (GPIOA_PIN(1)) 81 if (GPIOA_PIN(1))
79 result |= BUTTON_VOLUP; 82 result |= BUTTON_VOLUP;
80 83
81 if (GPIOA_PIN(2)) 84 /* hold button is read in button_hold() */
82 result |= BUTTON_HOLD;
83 85
84 GPIOA_PIN(6) = 0x00; 86 GPIOA_PIN(6) = 0x00;
85 87