diff options
| author | Rafaël Carré <rafael.carre@gmail.com> | 2010-04-03 22:33:47 +0000 |
|---|---|---|
| committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-04-03 22:33:47 +0000 |
| commit | 6cbbd1a756df6656d9cc498e317fc47fd252d904 (patch) | |
| tree | d1e444d53644bf097a6ffa5cc5370fef10dc92c8 | |
| parent | 2dbafc10863fda3d18745e3948d76b09a017dd65 (diff) | |
| download | rockbox-6cbbd1a756df6656d9cc498e317fc47fd252d904.zip rockbox-6cbbd1a756df6656d9cc498e317fc47fd252d904.tar.gz rockbox-6cbbd1a756df6656d9cc498e317fc47fd252d904.tar.bz2 rockbox-6cbbd1a756df6656d9cc498e317fc47fd252d904.tar.xz | |
Clipv2: read hold switch correctly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25462 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/target/arm/as3525/sansa-clipv2/button-clip.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/sansa-clipv2/button-clip.c b/firmware/target/arm/as3525/sansa-clipv2/button-clip.c index c14d67c..1356bfb 100644 --- a/firmware/target/arm/as3525/sansa-clipv2/button-clip.c +++ b/firmware/target/arm/as3525/sansa-clipv2/button-clip.c @@ -130,8 +130,19 @@ bool button_hold(void) #ifndef BOOTLOADER static bool hold_button_old = false; #endif + + GPIOA_DIR |= 1<<7; + GPIOA_PIN(7) = 1<<7; + + int delay = 50; + while(delay--) + asm("nop"); + bool hold_button = (GPIOA_PIN(3) != 0); + GPIOA_PIN(7) = 0; + GPIOA_DIR &= ~(1<<7); + #ifndef BOOTLOADER /* light handling */ if (hold_button != hold_button_old) |