mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-10 13:45:10 -05:00
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
This commit is contained in:
parent
9dd6396aa2
commit
bbc8b1b8cb
1 changed files with 12 additions and 1 deletions
|
|
@ -20,6 +20,7 @@
|
||||||
* KIND, either express or implied.
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
#include "system.h"
|
||||||
#include "button-target.h"
|
#include "button-target.h"
|
||||||
#include "as3525.h"
|
#include "as3525.h"
|
||||||
#ifndef BOOTLOADER
|
#ifndef BOOTLOADER
|
||||||
|
|
@ -56,12 +57,22 @@ int button_read_device(void)
|
||||||
{
|
{
|
||||||
static int row = 0;
|
static int row = 0;
|
||||||
static int buttons = 0;
|
static int buttons = 0;
|
||||||
|
static unsigned power_counter = 0;
|
||||||
|
|
||||||
if(button_hold())
|
if(button_hold())
|
||||||
|
{
|
||||||
|
power_counter = HZ;
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* direct GPIO connections */
|
/* 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;
|
buttons |= BUTTON_POWER;
|
||||||
else
|
else
|
||||||
buttons &= ~BUTTON_POWER;
|
buttons &= ~BUTTON_POWER;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue