diff options
| author | Michael Chicoine <mc2739@gmail.com> | 2009-11-21 21:16:08 +0000 |
|---|---|---|
| committer | Michael Chicoine <mc2739@gmail.com> | 2009-11-21 21:16:08 +0000 |
| commit | bbc8b1b8cb9b732e68fa5ae65199d8b33fb2911a (patch) | |
| tree | 24ef4b0929ecb1b4478d87ee9eb11105fa988116 /firmware | |
| parent | 9dd6396aa2700697d2ff952079903fd230a1a0db (diff) | |
| download | rockbox-bbc8b1b8cb9b732e68fa5ae65199d8b33fb2911a.zip rockbox-bbc8b1b8cb9b732e68fa5ae65199d8b33fb2911a.tar.gz rockbox-bbc8b1b8cb9b732e68fa5ae65199d8b33fb2911a.tar.bz2 rockbox-bbc8b1b8cb9b732e68fa5ae65199d8b33fb2911a.tar.xz | |
FS#10796 - Clip - prevent power switch activation when coming out of hold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23686 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
| -rw-r--r-- | firmware/target/arm/as3525/sansa-clip/button-clip.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/firmware/target/arm/as3525/sansa-clip/button-clip.c b/firmware/target/arm/as3525/sansa-clip/button-clip.c index 99a68a5..53ebfa1 100644 --- a/firmware/target/arm/as3525/sansa-clip/button-clip.c +++ b/firmware/target/arm/as3525/sansa-clip/button-clip.c @@ -20,6 +20,7 @@ * KIND, either express or implied. * ****************************************************************************/ +#include "system.h" #include "button-target.h" #include "as3525.h" #ifndef BOOTLOADER @@ -56,12 +57,22 @@ int button_read_device(void) { static int row = 0; static int buttons = 0; + static unsigned power_counter = 0; if(button_hold()) + { + power_counter = HZ; return 0; + } /* direct GPIO connections */ - if (GPIOA_PIN(7)) + /* read power, but not if hold button was just released, since + * you basically always hit power due to the slider mechanism after + * releasing hold (wait 1 sec) */ + if (power_counter) + power_counter--; + + if (GPIOA_PIN(7) && !power_counter) buttons |= BUTTON_POWER; else buttons &= ~BUTTON_POWER; |