mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
Clipv2: read hold switch correctly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25462 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2dbafc1086
commit
6cbbd1a756
1 changed files with 11 additions and 0 deletions
|
|
@ -130,8 +130,19 @@ bool button_hold(void)
|
||||||
#ifndef BOOTLOADER
|
#ifndef BOOTLOADER
|
||||||
static bool hold_button_old = false;
|
static bool hold_button_old = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
GPIOA_DIR |= 1<<7;
|
||||||
|
GPIOA_PIN(7) = 1<<7;
|
||||||
|
|
||||||
|
int delay = 50;
|
||||||
|
while(delay--)
|
||||||
|
asm("nop");
|
||||||
|
|
||||||
bool hold_button = (GPIOA_PIN(3) != 0);
|
bool hold_button = (GPIOA_PIN(3) != 0);
|
||||||
|
|
||||||
|
GPIOA_PIN(7) = 0;
|
||||||
|
GPIOA_DIR &= ~(1<<7);
|
||||||
|
|
||||||
#ifndef BOOTLOADER
|
#ifndef BOOTLOADER
|
||||||
/* light handling */
|
/* light handling */
|
||||||
if (hold_button != hold_button_old)
|
if (hold_button != hold_button_old)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue